# MiniPIC: Flexible Position-Independent Caching in <100LOC

*Nathan Ordonez, Thomas Parnell*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/151329) · [OpenReview](https://openreview.net/forum?id=bLPv1lSYrI) · [alphaXiv](https://www.alphaxiv.org/abs/2606.13126) · [Open on the map](../papers.html#p151329)

Category: [Efficient LLM Inference & Training](../pcat/14.md) › [KV Cache Optimization](../pgroup/283.md) · Type: new method · Keywords: position-independent caching, vLLM, KV cache, retrieval-augmented generation, efficient inference

Areas: [Memory](../areas/memory.md) › Model Memory Optimization › KV Cache Optimization

## Summary
MiniPIC introduces a minimal, flexible vLLM design with a positional-encoding-free KV cache and user-controlled primitives to enable position-independent caching across multiple methods.

## Explained to a 5-year-old
Computers sometimes read the same kind of information over and over, like a story or a piece of code. Right now, they can only save a memory of that information if the very beginning matches exactly another time. This makes it slow when many people ask questions or use helpers. The new idea lets the computer save parts of the information without caring about where they start, using a few simple tricks. It helps the computer work faster for tasks like answering questions or using helpful assistants.

## Explained to a 5-year-old, longer
Computers sometimes read the same kind of information over and over, like a story or a piece of code. Right now, they can only save a memory of that information if the very beginning matches exactly another time. This makes it slow when many people ask questions or use helpers. The new idea lets the computer save parts of the information without caring about where they start, using a few simple tricks. It works by storing the important pieces in a special place and then using a small set of rules to find them later. This way, the computer can reuse old memories even if the words are a little different. It also works with other ways of making the computer faster, like moving memory to the CPU. The result is that the computer can answer questions much quicker and use less energy. It also helps when many people use the same system at the same time. The changes are tiny, needing less than a hundred lines of code, so it's easy to add to existing systems. Overall, it makes the computer smarter at remembering and faster at helping.

## For a technical reader
The paper addresses the inefficiency of prefix caching in large language model inference, where KV cache entries are only reusable when request prefixes match exactly. Existing position-independent caching solutions either require extensive server modifications or incur host-device transfer overhead. The proposed design introduces a positional-encoding-free KV cache and three token-level primitives that allow flexible control over caching behavior, enabling multiple PIC methods within a single vLLM instance while integrating with CPU offload. Evaluations on 2WikiMultihopQA show significant speedups and low overhead.

## Problem
Retrieval-augmented and agentic workloads repeatedly process predictable structured inputs, but current prefix caching only reuses KV entries when prefixes are identical, and existing position-independent caching either demands large code changes or adds host-to-device transfer overhead.

## Method
The approach uses a positional-encoding-free KV cache that stores unrotated key vectors, applies rotary positional embeddings per request inside attention, and provides three token-level primitives (block-aligned padding, ssep, and pdep) to control caching behavior, enabling multiple PIC methods within a single vLLM instance.

## Results
The approach improves prefill throughput by 49% over baseline vLLM, reduces cached-span time-to-first-token by up to two orders of magnitude, and adds only 5.7% worst-case overhead.

## Contributions
It provides a minimal, flexible design for position-independent caching that requires fewer than 100 lines of engine changes, integrates with KV cache CPU offload, and supports multiple PIC methods within a single vLLM instance.

## Practical relevance
It enables faster and more efficient inference for retrieval-augmented and agentic applications by allowing flexible position-independent caching without extensive code changes.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/151329)
