Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Eviction

Ngoc Bui, Hieu Trung Nguyen, Arman Cohan, Rex Ying

TL;DR

DBTrimKV (Dynamic Budget TrimKV) introduces a learnable, globally calibrated Key-Value (KV) cache eviction strategy that dynamically allocates memory across all layers, heads, and modalities. Crucially, the paper demonstrates that full-cache attention is not always optimal; by filtering out irrelevant "distractor" tokens, selective eviction can actually improve long-context reasoning performance while drastically reducing memory overhead.

What Problem Does This Paper Address?

As the context windows of Large Language Models (LLMs) and Vision-Language Models (VLMs) expand to handle tens of thousands of tokens, managing the Key-Value (KV) cache has become a massive infrastructure bottleneck. The KV cache grows linearly with sequence length, driving up memory consumption and slowing down decoding.

Existing KV cache eviction methods treat this purely as a lossy compression problem—trying to approximate full-cache inference under a strict memory budget. Consequently, these heuristic-based approaches (e.g., keeping only recent tokens or heavy-hitter attention heads) almost always degrade model accuracy.

The authors challenge a fundamental assumption in this space: Is full-cache inference actually the gold standard? They argue that in very long contexts, keeping every token causes "attention dilution," where irrelevant tokens accumulate and wash out the attention scores of truly useful evidence.

Methods

The authors propose DBTrimKV, a global retention-based KV eviction framework consisting of three main components:

  1. Lightweight Retention Gates: Small Multi-Layer Perceptrons (MLPs) are attached to each transformer block to predict a scalar future-utility score ($\beta$) for each token based on its contextual embedding.
  2. Weight-Tied Calibration: To make these utility scores comparable across different layers, heads, and modalities (text vs. vision), the final scoring projection layer of all retention gates is shared (weight-tied). This maps all scores onto a unified, global scale.
  3. Unified Global Eviction: Instead of enforcing rigid, hand-crafted budgets per layer or head, DBTrimKV pools all cached entries globally. Tokens from any layer, head, or modality compete directly for a single global cache budget ($M_{\text{global}}$).
  4. PagedAttention Layout: To physically support the highly variable cache sizes across different attention heads resulting from dynamic budgeting, the authors implement a paged-memory layout with variable-length attention kernels.

Datasets

  • Training: The retention gates are trained efficiently by freezing the base model and optimizing only the gate parameters on a mixed subset of M4Instruct, Academic Video, R1-OneVision, and OpenR1-Math-220k.
  • Evaluation: The method was rigorously tested across multiple benchmarks:
  • Short-form VQA: VQAText, MME, GQA.
  • Long-horizon/Multimodal Reasoning: MMStar, MathVisionmini, MMMUProvision, VideoMME, VideoMathQAmcq, VideoMMMU.
  • Pure Text Reasoning: AIME24, GSM8K, MATH-500, LongBench-V2.
  • Multi-turn Dialogue: MMDU.

Key Insights and Ideas

  • Attention Dilution is Real: The paper provides theoretical and empirical proof that keeping too many competitive distractors in the softmax denominator forces the attention mass of useful tokens to vanish. Eviction acts as a form of attention regularization.
  • Cache Heterogeneity: Token survival rates vary drastically across attention heads. As shown in the paper's analysis, a small number of heads preserve long-range tokens, while many heads lose relevance almost immediately. Global budget allocation naturally adapts to this imbalance.
Figure 2: a) Fraction of tokens whose attention persists to horizon L for layer 15, head 24. b) Per-layer, per- head survival at L = 4096 and top-K = 128.
  • Structural Anchors over Fine Details: Qualitative visualizations reveal that DBTrimKV aggressively prunes fine-grained visual patches during text-centric reasoning but persistently retains structural boundary tokens like <|vision_start|> and <|vision_end|>. These act as compressed anchors for multimodal reasoning.

Key Results

  • Surpassing Full Cache: On long-form reasoning tasks (like AIME24 and MathVision), DBTrimKV with constrained budgets (1024, 512, and 256 tokens) consistently outperformed vanilla full-cache inference by up to 3.75%.
  • Multi-Turn Dialogue Gains: In interactive MMDU evaluations, DBTrimKV outperformed the vanilla full-cache baseline across all tested budgets, achieving a 14% relative improvement at a budget of 512 tokens.
  • Flat Efficiency Profile: While vanilla inference suffers from quadratically increasing decoding times as generation length scales, DBTrimKV maintains a stable, flat efficiency profile, significantly boosting throughput.
Figure 1: a): Multi-key, -value, -needle NIAH accuracy across increasing context lengths. b): Accuracy at 64k context and varying budgets.

Limitations and Future Work

  • Frozen Base Weights: The retention gates were trained while keeping the base LLM/VLM weights entirely frozen. The authors note that end-to-end joint fine-tuning remains unexplored and could allow the model to structure its internal representations to be even more eviction-friendly.
  • Scale Constraints: Evaluations were conducted on models up to the 8B parameter scale (e.g., Qwen3-VL-8B). Validating whether these global calibration properties hold true for frontier 70B+ models is an open question.
  • Reinforcement Learning: Future work could frame token retention as an action space, utilizing reinforcement learning (RL) post-training to optimize eviction policies directly for downstream task rewards.

Summary updated

BibTeX
@inproceedings{bui2026make,
  author = {Ngoc Bui and Hieu Trung Nguyen and Arman Cohan and Rex Ying},
  title = {{Make Each Token Count: Towards Improving Long-Context Performance with KV Cache Eviction}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=VBVa8FIJRl},
}
Figure