CaliDrop: KV Cache Compression with Calibration

Yi Su, Quantong Qiu, Yuechi Zhou, Juntao Li, Qingrong Xia, Ping Li, Xinyu Duan, Zhefeng Wang, Min Zhang

TL;DR

CaliDrop is a novel plug-and-play strategy that rescues Large Language Model (LLM) accuracy during aggressive Key-Value (KV) cache compression. By leveraging the spatial similarity of adjacent queries, it speculatively compensates for evicted tokens using historical attention outputs, significantly boosting performance under high compression ratios with minimal computational overhead.

What Problem Does This Paper Address?

As LLMs handle increasingly massive context windows, managing the Key-Value (KV) cache becomes a critical bottleneck. The memory footprint of the KV cache scales linearly with sequence length, batch size, and model size, quickly overwhelming hardware limits during auto-regressive generation.

To mitigate this, researchers use token eviction strategies (like H2O or SnapKV) which drop "unimportant" tokens to maintain a fixed-size cache. However, permanently discarding tokens is a double-edged sword: if a deleted token becomes relevant later in the generation process, model accuracy plummets. This accuracy degradation becomes severe under high compression ratios (i.e., very small cache budgets).

Methods

Instead of permanently deleting evicted tokens, the authors propose CaliDrop, a method that offloads evicted tokens and uses them for speculative calibration.

CaliDrop is built on an Attention Decomposition Theorem, which mathematically proves that attention computation can be cleanly split into two disjoint subsets (important tokens vs. evicted tokens) and recombined using normalized weights.

During the decoding phase, CaliDrop calculates the cosine similarity ($\rho$) between the current query and a retained historical query. It then applies a dual-threshold strategy ($\theta_1 < \theta_2$) to balance accuracy and speed:

  1. Recomputation ($\rho < \theta_1$): If the current query is too different from the historical one, the evicted KV cache is reloaded to recompute the attention output accurately.
  2. Speculative Calibration ($\rho > \theta_2$): If the queries are highly similar, CaliDrop uses the historical attention outputs to approximate and compensate for the missing information from the evicted tokens.
  3. Pass ($\theta_1 \le \rho \le \theta_2$): If similarity falls in between, no action is taken.
Figure 1: Illustration of the proposed method and preliminary results. Left: Overview of the method in decoding. We first compute the cosine similarity between the current query and historical query, and then decide whether to perform recomputation, apply calibration, or take no action based on the similarity. Top-right: the heatmap of cosine similarity of the queries in an example. Bottom-right: L1 loss before and after calibration.

Datasets

The authors evaluated CaliDrop across three prominent long-context LLM benchmarks:

  • LongBench: A comprehensive multi-task benchmark covering single/multi-document QA, summarization, few-shot learning, code generation, and synthetic tasks.
  • RULER: An advanced benchmark designed to evaluate long-context modeling, specifically focusing on complex multi-hop reasoning and aggregation behaviors.
  • Needle-in-a-Haystack: A targeted test evaluating a model's ability to retrieve a specific piece of information hidden within long text sequences.

Evaluations were performed using popular open-weight models: Mistral-7B-Instruct, LLaMA-3-8B-Instruct, and LLaMA-3-70B-Instruct.

Key Insights and Ideas

  • Query Locality: A key empirical finding is that queries at nearby token positions exhibit remarkably high cosine similarity. This temporal/spatial consistency means an LLM's "focus" doesn't radically shift from one token to the next.
  • Historical Predictability: Because adjacent queries are lookalikes, historical attention outputs can reliably predict and approximate future attention outputs for the same set of tokens.
  • Strategic Offloading over Deletion: Transitioning from a hard deletion policy to an intelligent offload-and-calibrate framework allows models to operate effectively even with extremely constrained active cache sizes (e.g., keeping only 64 tokens in the primary cache).

Key Results

CaliDrop consistently improved the accuracy of standard token eviction baselines (StreamingLLM, H2O, and SnapKV), with the most dramatic gains observed at high compression ratios (KV cache size = 64 or 128):

  • Needle-in-a-Haystack: When applied to the H2O baseline on LLaMA-3-8B-Instruct (with a KV cache size of 128), CaliDrop boosted retrieval accuracy from 48.5% to 83.8%.
  • RULER Benchmark: On LLaMA-3-8B-Instruct with a tight cache size of 64, integrating CaliDrop with SnapKV improved the average score from 14.95% to 23.32%.
  • Throughput & Latency: Speed analysis showed that CaliDrop introduces only marginal computational overhead compared to the baselines. Because recomputation occurs infrequently (approximately once every eight steps when $\theta_1=0.7$), it successfully balances efficiency and performance.

Limitations and Future Work

  • Throughput Trade-off: While lightweight, CaliDrop is still an intermediate state between full cache offloading and pure compression. The infrequent recomputations and offloading mechanisms do incur a slight throughput penalty compared to purely destructive eviction methods.
  • Diminishing Returns: The benefits of CaliDrop diminish at larger KV cache sizes. When the cache budget is already generous, baseline eviction methods perform close to the uncompressed upper bound, leaving little room for calibration to help.
  • Prefill vs. Decoding Focus: For simplicity, the current implementation primarily applies compression during the prefilling phase. Extending this tightly to long-generation decoding scenarios remains an open area for more refined engineering.

Summary updated

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