ProxyKV: Cross-Model Proxy Pruning for Efficient Long-Context LLM Inference
ProxyKV is a cross-model framework that utilizes a lightweight asynchronous small-model proxy and a novel HybridAxialMapper to efficiently prune KV caches for long-context LLM inference, achieving high accuracy comparable to state-of-the-art methods while significantly reducing prefilling overhead.
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
The Problem: The "Memory Wall"
Imagine a Large Language Model (LLM) like a brilliant detective trying to solve a mystery based on a 100,000-page dossier. To do their job, the detective keeps a "scratchpad" (called the KV Cache) where they write down the most important clues from every page they've read so far.
As the dossier gets longer, this scratchpad gets huge. Eventually, it becomes so big that it doesn't fit on the detective's desk (the computer's memory). This causes the detective to trip over their own feet, slowing down the investigation significantly.
To fix this, we need to prune the scratchpad—throwing away the boring, unimportant pages and keeping only the vital clues. But here is the catch:
- Method A (The Fast Guess): A junior assistant quickly glances at the last few pages and guesses what to keep. It's fast, but they often throw away crucial clues hidden deep in the middle of the book.
- Method B (The Perfect Re-read): The detective re-reads the entire book a second time to figure out exactly what to keep. This is perfect, but it takes forever, defeating the purpose of speeding things up.
The Solution: ProxyKV (The "Shadow Detective")
The authors propose ProxyKV, a clever new system that gets the best of both worlds.
Imagine the main detective (the Large Model) is busy solving the case. Instead of re-reading the book themselves, they hire a Shadow Detective (a Small Model Proxy).
- The Shadow Detective: This is a smaller, faster version of the main detective. They are in the same "family" (trained on similar data) but are much lighter and quicker.
- The Parallel Job: While the main detective is reading the first page, the Shadow Detective is already reading the whole book in the background, on a separate desk.
- The Translator: The Shadow Detective doesn't speak the exact same language as the main detective (they have different numbers of "heads" or attention mechanisms). So, a special Translator (called the HybridAxialMapper) converts the Shadow's notes into a format the main detective understands.
- The Result: By the time the main detective finishes the first page, the Translator hands them a "Top 10 Clues" list. The main detective can now throw away the junk pages immediately and continue solving the case at lightning speed, without ever having to re-read the whole book.
How the Translator Works (The HybridAxialMapper)
The paper introduces a special tool called the HybridAxialMapper. Think of it as a smart sorting machine.
- Time vs. Heads: The Shadow Detective sees the story in a different way than the main detective. The Mapper separates the "story timeline" (what happened when) from the "perspective" (which part of the brain noticed it).
- The Ranking Game: Instead of trying to guess the exact score of every page (which is hard and prone to error), the Mapper learns to rank them. It asks: "Is Page 50 more important than Page 51?" This is much easier and more accurate for deciding what to throw away.
The Results: Fast and Accurate
The researchers tested this on several famous AI models (like Llama and Qwen) with different sizes (from 7 billion to 32 billion parameters).
- Speed: On an 8-billion parameter model, ProxyKV made the "start-up" phase of reading 3.2 times faster than the perfect-but-slow method. Even on a single computer, it was 1.5 times faster.
- Accuracy: It kept 98.7% of the accuracy of the perfect method. In other words, the detective solved the mystery just as well as if they had re-read the whole book, but they did it in a fraction of the time.
- Long Contexts: This speed boost held true even when the "dossier" was massive (up to 170,000 words).
The Trade-off
There is one small cost: To run the Shadow Detective and the Translator, you need a little extra memory space temporarily while the book is being read. However, once the reading is done and the "Top 10 Clues" are selected, the Shadow Detective packs up and leaves, freeing up that space for the rest of the work.
Summary
ProxyKV is like hiring a fast, smaller assistant to do the heavy lifting of sorting through a massive library while the main expert focuses on the final decision. It uses a smart translator to make sure the assistant's notes are understood perfectly, allowing AI to handle huge amounts of text quickly without losing its intelligence.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.