CaliDrop: KV Cache Compression with Query-based Calibration

Yi Su, Quantong Qiu, Yuechi Zhou, Qingrong Xia, Ping Li, Xinyu Duan, Zhefeng Wang, Juntao Li, Min Zhang · Submission to ICLR 2026 · Rejected

TL;DR

Token eviction drastically cuts LLM Key-Value (KV) cache memory during long-context generation, but aggressively discarding tokens degrades model accuracy. CaliDrop recovers this lost accuracy by leveraging the fact that consecutive queries in LLMs are highly similar: it offloads evicted tokens and applies lightweight "speculative calibration" using precomputed attention outputs, recomputing against offloaded tokens only when queries drift.

What Problem Does This Paper Address?

In autoregressive generation, Large Language Models (LLMs) store Key-Value (KV) activations for all past tokens to avoid $O(n^2)$ recomputation. In long-context tasks, this KV cache explodes linearly with sequence length and batch size, rapidly exhausting GPU VRAM.

Existing token eviction methods (such as StreamingLLM, H2O, and SnapKV) combat this by keeping only a small budget of "important" tokens and discarding the rest. However, this introduces two major pitfalls under high compression ratios:

  1. Irreversibility: Tokens permanently purged early on may become crucial later.
  2. Accumulated Loss: While individual discarded tokens may have low attention weights, the cumulative weight of thousands of pruned tokens is non-negligible, degrading generation quality.

Methods

CaliDrop is a plug-and-play framework built around an Attention Decomposition Theorem: attention over the entire sequence can be split into an exact weighted sum of attention over retained tokens and attention over evicted tokens.

Full Attention = α_retained * Attn(Q, KV_retained) + α_evicted * Attn(Q, KV_evicted)

Rather than discarding pruned KV pairs permanently, CaliDrop offloads them and approximates their attention contribution during decoding:

  1. Prefill Offloading & Precomputation: When the prompt is compressed, evicted KV pairs are offloaded. CaliDrop computes an initial calibration vector (attention output and normalization denominator) using the prompt’s final query against the evicted KV cache.
  2. Dual-Threshold Gating ($\theta_1 < \theta_2$): During token generation, CaliDrop computes the cosine similarity $\rho$ between the current query $Q_t$ and the cached calibration query $C_q$:
  3. Recompute ($\rho < \theta_1$, default $0.7$): The query has drifted significantly. CaliDrop reloads the offloaded KV cache, updates the calibration values with $Q_t$, and applies the compensation.
  4. Apply Calibration ($\rho > \theta_2$, default $0.85$): The queries are sufficiently similar; CaliDrop speculatively applies the cached calibration without reloading or recomputing against the evicted cache.
  5. Pass ($\theta_1 \le \rho \le \theta_2$): Query similarity is ambiguous; no calibration or recomputation is performed.
  6. Calibration Size Filtering: To bound memory and computation during recomputation, CaliDrop allows keeping only a top-$k$ prioritized subset of evicted tokens rather than the full set.
       Current Query Q_t vs. Cached Calibration Query C_q
                            │
               ┌────────────┴────────────┐
          ρ < θ_1                   ρ > θ_2
      (Query Drift)             (High Similarity)
             │                         │
     Reload & Recompute         Reuse Cached Output
     Evicted KV Output                  │
             │                         │
             └────────► Apply ◄────────┘
                      Calibration

Datasets

The authors evaluated CaliDrop on three major long-context benchmarks using LLaMA-3-8B-Instruct, LLaMA-3-70B-Instruct, and Mistral-7B-Instruct:

  • LongBench: Multi-task benchmark covering single/multi-document QA, summarization, few-shot learning, synthetic tasks, and code completion.
  • RULER: Strict long-context evaluation suite testing multi-hop reasoning, variable tracking, and multi-key retrieval across sequence lengths up to 32k.
  • Needle-in-a-Haystack (NIAH): Retrieval stress-test placing specific facts at various depths and sequence lengths.

Key Insights and Ideas

  • Queries Exhibit Temporal Locality: Preliminary experiments showed that queries at nearby sequence positions share high cosine similarity across layers and heads. This allows historical attention results to reliably estimate future ones.
  • Speculative Compensation Works: You don't need exact attention scores for evicted tokens. Reusing an attention output computed from a nearby query recovers the bulk of the missing probability mass.
  • Amortized Recomputation: With $\theta_1 = 0.7$, query drift triggers recomputation only once every ~8 decoding steps on average, preserving high inference throughput while dramatically closing the accuracy gap.

Key Results

CaliDrop consistently boosts the performance of baseline eviction strategies (StreamingLLM, H2O, SnapKV):

  • RULER Benchmark: Under aggressive compression (KV budget = 64 tokens), CaliDrop lifts LLaMA-3-8B's SnapKV score from 14.95% to 23.32% (>56% relative gain) and H2O from 5.01% to 18.04%. On Mistral-7B, SnapKV jumps from 0.44% to 3.09%.
  • Needle-in-a-Haystack: On LLaMA-3-8B with an 8k context and a cache size of 128, CaliDrop raises H2O retrieval accuracy from 48.5% to 83.8%. At KV size = 256, SnapKV + CaliDrop reaches 98.4% accuracy (virtually lossless compared to Full KV).
  • LongBench: Across all cache budgets (64 to 512 tokens), CaliDrop provides uniform gains, particularly in complex multi-hop QA and summarization tasks. On LLaMA-3-70B (KV budget = 64), H2O average score improves from 47.53 to 49.99.
  • Throughput: Throughput tests on an A800 GPU show CaliDrop maintains near-identical throughput to SnapKV across various batch sizes, far outperforming the throughput of uncompressed FullKV.

Limitations and Future Work

  • Host-Device Communication: CaliDrop relies on offloading evicted tokens. Under very tight host memory or slow PCIe interconnects, offloading and reloading overhead could become a bottleneck.
  • Diminishing Returns at Large Cache Budgets: When the KV budget is already large (e.g., 512+ on modest sequence lengths), the proportion of attention mass attributed to evicted tokens ($\alpha_{\text{evicted}}$) shrinks, diminishing the calibration benefit.
  • System-Level Engineering: The current evaluation does not yet implement custom CUDA kernels or asynchronous PCIe communication overlapping, which the authors identify as key future directions to optimize hardware efficiency further.

Summary updated

BibTeX
@misc{su2025calidrop,
  author = {Yi Su and Quantong Qiu and Yuechi Zhou and Qingrong Xia and Ping Li and Xinyu Duan and Zhefeng Wang and Juntao Li and Min Zhang},
  title = {{CaliDrop: KV Cache Compression with Query-based Calibration}},
  year = {2025},
  eprint = {2507.19906},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.19906},
}
Figure