← Latest papers
💬 NLP

MiniPIC: Flexible Position-Independent Caching in <100LOC

MiniPIC is a minimal, flexible vLLM design that enables efficient position-independent caching for recurring structured inputs by storing unrotated K vectors and applying per-request positional encodings during attention, thereby achieving significant throughput and latency improvements with fewer than 100 lines of core-engine changes.

Original authors: Nathan Ordonez (IBM Research), Thomas Parnell (IBM Research)

Published 2026-06-12
📖 5 min read🧠 Deep dive

Original authors: Nathan Ordonez (IBM Research), Thomas Parnell (IBM Research)

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are running a massive, high-speed library where a librarian (the AI) has to read thousands of books to answer a single question. In modern AI, this "reading" phase is called prefill.

Usually, if two people ask similar questions, the librarian can reuse parts of the books they've already read. However, current library systems (like vLLM) are very rigid: they can only reuse a page if it appears in the exact same spot in the book. If you move a paragraph from page 10 to page 100, the librarian treats it as a brand-new page and has to read it all over again, even though they just read it a second ago.

MiniPIC is a clever, tiny upgrade to this library system that solves this problem without rebuilding the whole building. Here is how it works, using simple analogies:

1. The Problem: The "Sticky Note" Dilemma

In current AI systems, the "memory" of what was read (called the KV cache) has a sticky note attached to every page saying, "I am on page 10."

  • The Conflict: If you want to use that same page of text for a new request where it belongs on page 100, the library system gets confused. It can't have the same physical page be both "Page 10" and "Page 100" at the same time for different people.
  • The Old Fix: Previous solutions tried to make photocopies of the page, move them around, and re-label them. This is slow, wastes space, and creates traffic jams in the library.

2. The MiniPIC Solution: The "Blank Page" Strategy

MiniPIC changes the rules of the library in two simple ways:

A. The "Unlabeled" Shelf (Position-Free Cache)
Instead of writing "Page 10" on the physical page, MiniPIC keeps the pages blank regarding their location. The page just contains the words.

  • How it works: When the librarian reads the page, they only decide where it is at that exact moment. If they are reading for Person A, the page is "Page 10." If they are reading for Person B, the same physical page instantly becomes "Page 100."
  • The Benefit: You don't need to photocopy or move pages. The same physical memory block can serve multiple people at different positions simultaneously.

B. The "Magic Tokens" (User-Controlled Primitives)
Since the librarian no longer knows where a page belongs just by looking at it, the user (or a manager) gives the librarian three special "magic tokens" (special words) to tell the system how to handle the books:

  1. Padding: "Fill the empty space so this book ends neatly on a shelf boundary."
  2. SSEP (Span Separator): "This section is independent. You can reuse this chunk of text even if it's in a different book or a different spot." (This breaks the rigid "must match the start" rule).
  3. PDEP (Prompt Depend): "This part depends on everything that came before it. Do not reuse this; read it fresh."

By using these three tokens, the user can tell the system exactly which parts of the text are reusable "chunks" (like documents or code files) and which parts are unique.

3. The "Conveyor Belt" Scheduling

The paper also introduces a smarter way to organize the work.

  • Old Way: The library would finish reading all the reusable chunks for everyone, put a "STOP" sign on the line, and then start answering the actual questions. This leaves the librarian sitting idle.
  • MiniPIC Way (Interleaved Scheduling): The librarian starts reading the reusable chunks for the next person while still answering the current person's question. It's like a chef chopping vegetables for the next dish while the current dish is still simmering. This keeps the kitchen (the GPU) busy 100% of the time.

The Results: Fast, Small, and Flexible

The paper claims that by making these changes, they achieved:

  • Speed: A 49% increase in how fast the system can read and prepare data (prefill throughput) compared to the standard system.
  • Instant Access: For cached documents, the time to get the first answer dropped by up to 100 times (two orders of magnitude).
  • Tiny Footprint: The entire system required changing only 78 lines of code in the core engine (plus a custom "attention" tool). It's like fixing a car engine by swapping out two tiny spark plugs rather than rebuilding the whole engine.
  • No Penalty: When the system doesn't use these tricks, it only slows down by about 5.7%, which is barely noticeable.

Summary

MiniPIC is a lightweight, flexible upgrade that lets AI systems reuse text chunks regardless of where they appear in a prompt. It does this by removing "location labels" from the memory and letting users mark which parts are reusable with simple special words. This eliminates the need for complex, slow copying operations and allows the AI to work much faster, especially when dealing with long documents or repeated information.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →