RestoreKV: Recovering Full-Cache Behavior Under Aggressive Query-Agnostic KV Cache Eviction

Changwoo Baek, Seungjun Shin, Kyeongbo KongarXiv 2026

TL;DR

Existing query-agnostic KV cache eviction methods suffer from severe performance drops under aggressive compression because they rely purely on selecting a subset of original KV pairs. RestoreKV solves this by introducing a learned restoration mechanism that generates a compact "restore cache" to complement the retained pairs within the exact same memory budget. It recovers near full-cache performance with negligible computational overhead (<0.5% compression time) and requires no task-specific tuning.

What Problem Does This Paper Address?

Large Language Models (LLMs) are increasingly used for long-context tasks, but their Key-Value (KV) caches grow linearly with sequence length, creating massive memory bottlenecks. To mitigate this, researchers use query-agnostic KV cache eviction, which compresses the context once during the prefill stage so the compressed cache can be reused across arbitrary future queries.

However, existing methods operate under a strict selection-based paradigm: they try to figure out which original KV pairs are the most important to keep and discard the rest. When memory budgets get tight (e.g., compressing the cache down to 5% of its original size), selection alone fails. Crucial context-specific information is inevitably lost, causing model performance to collapse.

The authors of RestoreKV ask a complementary question: Instead of just picking a better subset of original pairs, can we generate a tiny, context-conditioned complement before eviction to restore the behavior that would otherwise be lost?

Methods

RestoreKV introduces a budget-matched, single-pass plug-in that works on top of any existing selection-based eviction method (like KVzip, SnapKV, or H2O).

Figure 2: Overview of RestoreKV. After context prefill, a single LoRA-adapted restore pass processes n restore tokens (n=8 by default) with causal access to the full KV cache, generating nLH context-conditioned KV pairs. These restore states are combined with the retained context states under the same total KV budget. LoRA is active only during restore-cache generation; subsequent query processing and decoding use the original frozen backbone. Training (offline): The restore-token embeddings and LoRA adapters (0.4% of the 4B backbone) are optimized by self-distillation from the frozen full-cache teacher, Inference: The trained restore tokens and LoRA adapters generate the restore cache once for each new context.

The process unfolds in three main steps:

  1. Restore-Cache Generation: After the initial context prefill, a small number of learnable "restore tokens" ($n=8$ by default) are appended to the sequence. In a single forward pass, these tokens utilize causal attention to look at the full KV cache before any eviction happens. This pass is modulated by lightweight LoRA adapters to generate a highly compact, context-conditioned "restore cache."
  2. Budget Matching: To ensure a fair memory footprint, RestoreKV subtracts the size of this new restore cache from the total allowed KV budget. The base eviction method then fills the remaining slots with the best-retained original context pairs.
  3. Frozen Inference: Once the final budget-matched cache is constructed, the LoRA adapters are completely disabled. All subsequent query processing and token decoding use the original, unmodified, frozen LLM backbone.

Training via Self-Distillation: The restore token embeddings and LoRA adapters (amounting to just 0.4% of the model's parameters) are trained offline. The model minimizes a symmetric KL-divergence loss to match the token-distribution outputs of a frozen, full-cache "teacher" model. Crucially, the budget ratio is randomized during training so that a single set of weights can support multiple compression tiers at runtime.

Datasets

The authors trained and evaluated RestoreKV across diverse long-context benchmarks:

  • Training Data: A mixture of 6,248 context-query pairs derived from LongAlpaca, PG-19, and Tulu-3 Flan.
  • Evaluation Benchmarks:
  • RULER-4K: A synthetic suite testing retrieval, aggregation, and tracking.
  • QASPER: Free-form question answering over scientific papers (~5K tokens).
  • QuALITY: Multiple-choice reading comprehension over long articles (~6K tokens).
  • LongHealth: Multiple-choice QA over clinical patient records (~11K tokens).
  • SCBench & LongBench (Appendix): Evaluated for extreme context lengths up to 104K tokens.

Key Insights and Ideas

  • Shared Mechanism for Context-Specific Loss: While the specific information lost during eviction varies wildly from one document to another, the mechanism required to synthesize a compact summary of that lost information can be shared and learned across contexts.
  • Attention-Side Adaptation is King: Through ablation studies, the authors discovered that simply optimizing the restore token embeddings yields minimal improvement. The heavy lifting is done by the LoRA adapters modifying the attention projections ($q/k/v$). This proves that RestoreKV succeeds by dynamically transforming full-context attention rather than just memorizing static, generic information.
  • Pre-Eviction Conditioning Matters: Generating the restore cache from the full KV cache before eviction provides an 8.8-point accuracy boost compared to trying to generate it from an already-evicted cache. Access to the complete context is vital for capturing vulnerable information.

Key Results

RestoreKV consistently mitigates performance degradation across four model backbones (Qwen3-0.6B/4B/8B and Llama-3.1-8B-Instruct) and five different base eviction algorithms.

Figure 3: Performance across four model backbones and four benchmarks. RestoreKV and RestoreKV+ are applied to KVzip and KVzip+, respectively, under the same KV budget. Both methods reduce compression-induced performance loss, with larger gains under tighter cache budgets.
  • Massive Accuracy Recovery: On Qwen3-4B at a tight 5% KV budget ($20\times$ compression), RestoreKV boosts the baseline KVzip score on RULER-4K from a collapsed 38.2 to 73.2.
  • State-of-the-Art Compression: Applied to KVzip+, RestoreKV achieves 86.4 accuracy at 16× compression on the KVPress Benchmark.
  • Negligible Overhead: In a 32K-context evaluation, the 8-token restore pass adds a mere 0.03 to 0.04 seconds of latency (<0.5% of total compression time) and only 84 MB (0.4%) of peak memory, while introducing zero additional cost during the actual query decoding phase.

Limitations and Future Work

  • Cross-Evictor Mismatch: RestoreKV checkpoints adapt to the specific compression behavior of the evictor they were trained with. If a RestoreKV module is trained using SnapKV but deployed using KVzip at extreme compression ratios (e.g., 5%), its performance drops significantly compared to a matched setup.
  • Offline Training Requirement: Although parameter-efficient, RestoreKV still requires an offline self-distillation training phase for each specific model architecture and base eviction method.
  • Transformer-Specific Design: The current formulation relies strictly on standard multi-head/grouped-query attention mechanisms in decoder-only transformers and hasn't been tested on alternative architectures like linear attention or state-space models (SSMs).

Summary updated

BibTeX
@misc{baek2026restorekv,
  author = {Changwoo Baek and Seungjun Shin and Kyeongbo Kong},
  title = {{RestoreKV: Recovering Full-Cache Behavior Under Aggressive Query-Agnostic KV Cache Eviction}},
  year = {2026},
  eprint = {2608.01247},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.01247},
}
Figure