KVpop -- Key-Value Cache Compression with Predictive Online Pruning

Lukas Hauzenberger, Niklas Schmidinger, Anamaria-Roberta Hartl, David Stap, Thomas Schmied, Sebastian Böck, Günter Klambauer, Sepp HochreiterarXiv 2026

TL;DR

KVpop introduces a learned, fixed-budget key-value (KV) cache eviction policy for Large Language Models (LLMs) that directly predicts future token utility using a novel future-attention target. By combining an efficient training-time transposed-attention pass with a stateful mLSTM scorer that defers eviction decisions, KVpop compresses the KV cache by up to 88% while retaining up to 100% of full-attention performance on complex reasoning tasks.

What Problem Does This Paper Address?

As LLMs process longer sequences, the Key-Value (KV) cache—which stores past token representations to avoid recomputation during autoregressive decoding—grows linearly with context length. This creates a massive memory and bandwidth bottleneck for long-context inference.

Existing solutions try to evict "unimportant" tokens from the cache, but they typically rely on static heuristics (e.g., keeping only the first few "sink" tokens and a local sliding window) or immediate proxy scores. These methods fail because token utility changes dynamically: a token that seems irrelevant now might become crucial many steps later, especially in multi-step mathematical or logical reasoning. Prior learned eviction methods also force a decision the moment a token enters the cache, ignoring the context that accumulates while the token sits in a temporary buffer.

Methods

The authors introduce KVpop (KV compression with Predictive Online Pruning), a sparse-attention retrofit that directly supervises the keep-or-drop decision at the eviction boundary.

Overview of the KVpop framework showing training and inference pipelines

Its core technical components include:

  1. Cheap Future-Attention Target: To train the eviction policy, the model needs to know which tokens actually get attended to in the future. KVpop computes this target using a training-only transposed-attention pass. By swapping the roles of queries and keys and reusing the log-sum-exp (LSE) normalizers from the forward pass, it calculates future-attention mass without ever materializing a dense, memory-heavy $S \times S$ attention map.
  2. Stateful Scoring with Delayed Context: Unlike methods that score tokens at insertion time, KVpop features a stateful scorer built on a lightweight mini-LSTM (mLSTM) architecture. It defers the final scoring decision until a token reaches the eviction boundary (exiting the protected recent window), allowing the scorer to integrate "near-future" context before deciding a token's fate.
  3. Efficient Running Top-K Execution: At inference time, KVpop maintains a fixed budget per head. It uses an online Fenwick tree over static ranks implemented in a custom Triton kernel to compute query-specific cutoff thresholds on the fly, integrating seamlessly with FlexAttention to avoid dense matrix storage.

Datasets

  • Training / Sparsification: A high-reasoning-effort subset of the Nemotron-Math v2 dataset, filtered for sequences up to 16,384 tokens.
  • Evaluation (Mathematical Reasoning): AIME 24/25 and HMMT (Feb/Nov 2025) benchmarks.
  • Evaluation (Out-of-Domain Generalization): GPQA Diamond (graduate-level scientific reasoning) and LiveCodeBench v6 (LCB) (code generation) to test how well the math-trained eviction policy transfers to other domains.

Key Insights and Ideas

  • Supervising the Future Matters: Directly training a scorer against actual future attention signals yields significantly more robust cache retention than relying on implicit relaxations (like Gumbel-sigmoid gates used in DMS).
  • The Power of Procrastination: Deferring the eviction decision pays off. As shown in the paper's ablation study, waiting until the eviction boundary allows the stateful mLSTM scorer to accumulate context, leading to a measurable boost in token accuracy over immediate scoring.
  • Hardware-Friendly Homogeneity: While some dynamic methods allow different attention heads to keep different cache sizes, KVpop enforces a strict, identical budget across all heads. This design choice makes the sparse attention pattern highly uniform, making it much faster to execute and compile on modern GPUs.

Key Results

KVpop was evaluated on Qwen3-4B-Instruct and Qwen3-8B, demonstrating substantial efficiency gains with minimal performance degradation:

  • Performance Retention: At 75% KV cache compression, KVpop retains 98% of full-attention performance on Qwen3-4B and 100% on Qwen3-8B across math benchmarks. Even at an aggressive 88% compression, it maintains 97% (4B) and 100% (8B) relative performance, vastly outperforming training-free baselines like StreamLLM and TOVA which collapse under high compression.
  • Inference Efficiency: For a 131k token generation length on Qwen3-8B, dense attention causes peak VRAM to skyrocket to 36GB. KVpop caps VRAM growth at just 19GB (a mere 19% increase from the 16k baseline) while significantly reducing end-to-end decoding latency.
Inference efficiency comparison (latency and VRAM) on Qwen3-8B
  • Domain Transfer: Despite being trained purely on math data, the eviction policy successfully generalized to coding (LCB) and science (GPQA-D), matching or nearly matching the dense teacher models.

Limitations and Future Work

  • Scorer Architectures: The paper focuses primarily on mLSTM for stateful scoring; the authors note that exploring alternative memory-based architectures remains an open avenue.
  • Retrofit Constraint: KVpop is designed as a post-training retrofit for standard Transformers rather than an architecture trained with compression from the ground up.
  • Per-Head Budgeting: While homogeneous per-head budgets maximize GPU execution efficiency, the authors suggest that hybrid dense-sparse layer configurations could potentially unlock an even better quality-efficiency trade-off.

Summary updated

BibTeX
@misc{hauzenberger2026kvpop,
  author = {Lukas Hauzenberger and Niklas Schmidinger and Anamaria-Roberta Hartl and David Stap and Thomas Schmied and Sebastian Böck and Günter Klambauer and Sepp Hochreiter},
  title = {{KVpop -- Key-Value Cache Compression with Predictive Online Pruning}},
  year = {2026},
  eprint = {2607.05061},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.05061},
}
Figure