How Query Visibility Changes KV-Cache Compression Rankings: A Matched-Budget Audit
This paper reveals that evaluating KV-cache compression methods under a realistic, query-agnostic protocol—where compression occurs before seeing the question—significantly alters performance rankings compared to standard query-aware evaluations, often causing advanced methods like SnapKV to underperform simple baselines while highlighting KeyDiff as the most robust solution.
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 have a massive library of books (the "context") and you want to build a super-smart assistant that can answer questions about them. But here's the catch: your assistant's brain (the "KV cache") is tiny. It can't hold every single page of every book at once. So, you need a librarian to throw away the boring pages and keep only the important ones before the assistant starts reading.
For a long time, researchers tested these librarians with a sneaky trick: they let the librarian peek at the question before they started throwing pages away. It's like asking the librarian, "Hey, we're going to ask about the dragon, so please keep the dragon pages!" Of course, the librarian does a great job. They keep the dragon pages and toss the rest. Everyone cheers and says, "This librarian is a genius!"
But in the real world, that's not how it works. In a real app, you compress the library once to save space, and then later, hundreds of people might ask different questions. The librarian has to throw away pages without knowing what the question will be. This is the "query-agnostic" reality.
This paper is a massive, fair audit that asked: What happens when we stop letting the librarian peek at the question?
The Big Surprise: The "Genius" Librarians Fail
The authors ran a huge experiment with 144,300 test cases using three different AI models. They tested six popular "librarian" methods against three super-simple, boring strategies (like "keep the first page and the last few pages" or "keep random pages").
Here is the twist: When the librarian couldn't see the question, almost all the "fancy" methods crashed.
- SnapKV, the most popular method in the industry, actually performed worse than the simple "keep the start and the end" strategy. On average, it lost by a small but clear margin.
- Out of the five methods they could fairly compare, only one kept winning even when blind to the question: KeyDiff.
The paper suggests that the reason the other methods failed is that they were secretly cheating. They weren't actually measuring "what is important in the book"; they were measuring "what is relevant to the specific question sitting right in front of me." When you take the question away, their scoring system goes haywire.
The "Blind" Librarian Who Won
KeyDiff is the only method that didn't need to peek. Instead of looking at attention (which is like looking at what the AI is focusing on), it looks at the "shape" of the information. It keeps pages that are weird or unique and throws away pages that are repetitive and boring. Because it doesn't care about the question at all, it works perfectly whether the question is there or not.
The paper measured this "cheating" effect precisely. For SnapKV, the performance jumped by +0.198 just because it got to see the question. For KeyDiff, the jump was almost zero (+0.011). The authors propose a hypothesis: the more a method's scoring system relies on the question being visible, the bigger the drop in performance when the question is hidden.
The "Gotchas" the Authors Caught
The paper didn't just test the librarians; it also found two massive traps that could ruin any future test:
- The "Engine" Trap: One method, H2O, requires a specific type of computer engine (called "eager") to run, while the others use a different one ("sdpa"). The authors found that just switching engines changes the results by -0.221—a huge difference that is bigger than the gap between the best and worst librarians! Because of this, they had to withdraw any ranking for H2O. You can't compare apples to oranges, and you can't compare librarians running on different engines.
- The "Ruler" Trap: The test they used (RULER) claims to test up to 8192 tokens. But for one specific model (gemma-2), the way it counts words is different. The "8192" limit actually overflowed by 30%, causing the model to fail silently on 7 out of 13 tasks. It wasn't that the librarian was bad; it was that the ruler was broken for that specific model.
What This Means for the Future
The authors are very careful not to say they have found the "perfect" solution. They found that KeyDiff is the only one that works well when you don't know the question, but on natural text (like real stories), other methods catch up to it.
The main takeaway is a warning to the whole AI community: Don't trust test results where the AI gets to peek at the answer before it starts working. If a method only works when it sees the question, it's not a good compression tool for real-world reuse. The paper proves that for a method to be truly useful, it must be able to compress the library blindly, and right now, most of the "fancy" methods aren't ready for that job.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.