Skip to content
AI.info

Research

LookaheadKV: Fast and Accurate KV Cache Eviction by Glimpsing into the Future without Generation

LookaheadKV: Fast and Accurate KV Cache Eviction by Glimpsing into the Future without Generation Overview Research area: Efficient inference for Transformer-based large language models (LLMs), specifi

arXiv
2603.10899
Published
2026-03-11
Authors
Jinwoo Ahn, Ingyu Seong, Akhil Kedia, Junhan Kim, Hyemi Jang, Kangwook Lee, Yongkweon Jeon

AI summary

LookaheadKV: Fast and Accurate KV Cache Eviction by Glimpsing into the Future without Generation

Overview

  • Research area: Efficient inference for Transformer-based large language models (LLMs), specifically KV cache compression/eviction for long-context tasks.
  • Technical level: Intermediate. The paper assumes familiarity with attention, key–value (KV) caching, prefill versus decoding, and parameter-efficient fine-tuning (LoRA), but the core idea is explained with accessible framing.
  • Scope: The paper proposes and evaluates a trainable KV cache eviction framework that predicts token importance without generating a draft response, tested across six models from the LLaMA and Qwen families on LongBench, RULER, LongProc, and MT-Bench.

Note: the full paper text supplied for this summary is truncated partway through Appendix B, so appendices C through F and some referenced tables are not available in the source content.

What This Paper Is About

LLMs using KV caching must store a key–value pair for every prompt token, and that cache grows linearly with sequence length — the paper states that for LLaMA3.1-70B in half precision, a 128K-token sequence takes 40 GB and 1M tokens requires 320 GB, exceeding high-end consumer hardware. Prior work (LAQ, SpecKV) improved accuracy by "glimpsing into the future": generating a cheap draft response and using it to estimate which prompt tokens matter, but the draft generation step adds substantial prefill latency. LookaheadKV aims to capture that future-response signal without ever generating a draft, by learning a small set of special tokens whose attention patterns imitate the true response's importance scores.

Key Contributions

  1. A no-generation eviction framework. LookaheadKV augments a frozen LLM with learnable lookahead tokens and selectively activated "lookahead LoRA" modules that predict importance scores matching those of the model's true response, eliminating the expensive draft generation step used by LAQ and SpecKV.
  2. Strong accuracy across models and budgets. Experiments on LongBench, RULER, LongProc, and MT-Bench across LLaMA3.2-1B, LLaMA3.2-3B, LLaMA3.1-8B, Qwen3-1.7B, Qwen3-4B, and Qwen3-8B show the method outperforming competitive baselines, with particular advantage in low-budget settings.
  3. Demonstrated low overhead. The paper reports less than 2.16% eviction overhead at 32K context length, up to 14.5× lower than draft-based approaches, based on both theoretical cost modeling and empirical time-to-first-token (TTFT) measurement.
  4. Parameter efficiency. LookaheadKV adds less than 0.5% additional trainable parameters across all tested models, leaving original model weights unaltered so the modules can be enabled or disabled per application.

Main Findings

  • LongBench accuracy: Across budgets ranging from 64 to 2048, LookaheadKV consistently achieves the best average score on all models tested. The paper attributes this to learning to estimate future importance rather than relying on a partial draft response, and reports the largest gains at low budgets. Results for 1B-scale models are given in Appendix E, which is not included in the supplied text.
  • RULER scaling: With a fixed budget of 128 across 4K, 8K, 16K, and 32K context lengths, LookaheadKV outperforms baselines at every tested length. Despite being trained on a maximum sequence length of 16K, it generalizes to 32K.
  • Long-form generation: On the LongProc HTML-to-TSV task with LLaMA3.1-8B, at 12K–0.5K and 23K–2K token settings with a fixed 30% cache budget ratio, LookaheadKV outperforms prior approaches. The authors hypothesize this is because it learns the attention pattern of the entire future response, whereas draft-based methods only observe a partial response.
  • Multi-turn dialogue: On MT-Bench (judged by Qwen3-235B-A22B), LookaheadKV is reported as on par or superior across all models and budgets, with particular robustness at budgets of 64 and 128. FullKV reference scores are 5.72 (LLaMA3.2-1B), 7.35 (LLaMA3.2-3B), 7.77 (LLaMA3.1-8B), 7.19 (Qwen3-1.7B), 8.02 (Qwen3-4B), and 8.48 (Qwen3-8B). At a budget of 256, LookaheadKV scores 5.62 for LLaMA3.2-1B (versus 5.67 for SnapKV and 5.64 for LAQ) and 8.06 for Qwen3-4B (versus 8.20 for SnapKV and 8.12 for LAQ), so it is not uniformly best at that budget. SpecKV is not applicable (N/A) for the 1B-scale models.
  • Latency overhead: For LLaMA3.1-8B at cache budget 128, empirical TTFT overhead at 8K context is 10.88 ms for LookaheadKV (301.69 ms total), compared with 20.17 ms for SnapKV, 120.51 ms for SpecKV, and 509.38 ms for LAQ. At 32K context, LookaheadKV overhead is 38.04 ms (1798.26 ms total), versus 77.67 ms for SnapKV, 502.87 ms for SpecKV, and 553.68 ms for LAQ. Theoretical compute is estimated at 136.53 TFLOPs (8K) and 928.91 TFLOPs (32K) for LookaheadKV versus 136.00 and 928.00 for a forward pass alone; LAQ's theoretical memory traffic is 444.52 GB at 8K and 450.52 GB at 32K.
  • Stochastic decoding robustness: At temperatures of 0.2 and 0.8 on LLaMA3.1-8B with budget 128, LookaheadKV remains ahead of baselines. Greedy average LongBench scores are FullKV 49.88, SnapKV 43.50, SpecKV 45.45, LAQ 46.61, LookaheadKV 47.72; at T=0.8 the values are 47.82 (-4.13%), 41.39 (-4.85%), 43.43 (-4.44%), 45.27 (-2.87%), and 45.81 (-4.00%) respectively. The paper notes 3–4% degradation at T=0.8 is consistent across all methods including FullKV.
  • Ablation on lookahead size and LoRA placement: A 2D ablation on LLaMA3.2-1B at budget 64 across lookahead sizes 4, 8, 16, 32, 64, and 128 with three module configurations shows larger windows and broader LoRA coverage generally help, but gains saturate at n_lookahead = 32. For the "all" configuration the scores were 26.60, 27.02, 27.01, 27.12, 27.1, and 27.0 with overheads of 4.20%, 4.20%, 4.67%, 4.96%, 8.5%, and 11.0%; for "emb-only" the scores were 25.53, 25.67, 26.36, 26.40, 25.8, and 26.2 with overheads of 3.36%, 3.77%, 3.42%, 4.18%, 7.3%, and 10.7%.
  • Training-context generalization: Training LLaMA-3B with limited context lengths of 2K, 4K, and 8K and evaluating on RULER showed that longer training contexts perform better, but shorter contexts still yield effective results with relatively minor degradation.
  • LoRA overhead bound: Even with lookahead LoRA applied to every linear layer, the paper reports a latency increase of less than 1.3% compared to using no lookahead LoRA at all.

Methodology in Plain English

The core insight is that the best way to decide which prompt tokens to keep is to know which ones the model will actually attend to when generating its response. Since the real response is unknown during prefill, prior work generated an approximation. LookaheadKV instead learns the approximation directly.

The framework appends a sequence of trainable soft tokens — the lookahead tokens, set to n_lookahead = 32 — to the input prompt during prefill. The attention from these tokens back to the prompt acts as a stand-in for attention from the real future response. To make these tokens expressive enough, the authors add "lookahead LoRA" modules (low-rank adapters) that activate only on the lookahead token positions, leaving the outputs for normal tokens unchanged.

Training uses paired (X, Y) data. First, a "GT forward pass" computes ground-truth importance scores by averaging cross-attention between the prompt keys and the model's own generated response across all layers and heads. Then a "lookahead forward pass" computes estimated scores from the lookahead tokens. The loss is the average KL divergence between the L1-normalized score vectors, summed over all layers L and heads H. Because the scores are normalized, this is equivalent to the ListNet ranking loss with an identity transformation. Only the lookahead embeddings and LoRA modules are updated; the LLM itself stays frozen. FlashAttention is used in the forward pass, with eager attention for score computation and loss backpropagation.

At inference, the lookahead tokens are appended during prefill only. The attention between them and the prompt is mean-reduced and pooled into a single score vector, and the Top-K KV pairs by score are retained. Lookahead tokens introduce no decoding-stage overhead.

Training data comprised 50K samples from the long_sft subset of ChatQA2, 20K from Tulu, 7K from Stack, and 9K few-shot completion samples created from the training splits of MetaMath, ARC, and HellaSwag as originally curated in Pal et al. (2024). Maximum input sequence length was 16K, maximum generation length 512, using greedy decoding. LoRA rank r = 8 with scaling factor α = 32 was applied to all projection and feed-forward modules (W_q, W_k, W_v, W_o, W_up, W_down, W_gate). Trainable parameters were 5.4M / 0.44% for LLaMA3.2-1B, 11.9M / 0.37% for LLaMA3.2-3B, 20.6M / 0.26% for LLaMA3.1-8B, 8.5M / 0.49% for Qwen3-1.7B, 16.2M / 0.40% for Qwen3-4B, and 21.5M / 0.26% for Qwen3-8B. Baselines were SnapKV, PyramidKV, StreamingLLM, LAQ, and (for 8B-scale models) SpecKV; Llama3.2-1B-Instruct and Qwen3-1.7B served as draft models for Llama3.1-8B-Instruct and Qwen3-8B respectively. Theoretical latency estimates follow the analytical FLOPs-and-memory-traffic model of Davies et al. (2025), assuming LLaMA3.1-8B on a single NVIDIA H100 80GB GPU with batch size 1 in half precision.

Why This Matters

This work targets the central infrastructure bottleneck in long-context LLM deployment: memory. It argues that the accuracy-versus-latency trade-off assumed by draft-based eviction is not fundamental — the future-response signal can be learned rather than generated, at a cost comparable to a trivial heuristic like SnapKV.

Real-world applications:

  • Long-document processing and question answering, where prompt caches for large documents must be compressed to fit on available hardware.
  • Repository-level code understanding and generation, cited by the paper as a motivating use case alongside long-document processing and in-context learning.
  • Mobile and edge deployment, where the paper specifically notes that draft generation's latency limits practicality in latency-sensitive applications such as mobile devices.
  • Multi-turn conversational agents, evaluated via MT-Bench, where caches accumulate across turns and context management matters.

Industry relevance: the work comes from Samsung Research, where memory-constrained on-device inference is a direct concern. Time-to-first-token is a user-perceptible metric, so a method that cuts eviction overhead by up to 14.5× while adding under 0.5% parameters is directly relevant to serving cost and responsiveness. The design choice to keep base model weights unaltered means the modules can be toggled per application.

Future Directions

  • Larger models. The authors state that limited compute prevented experiments on larger-sized models, leaving scaling behavior beyond 8B unverified.
  • Decoding-stage eviction. LookaheadKV currently targets prefill KV cache eviction only; extending it to evict during decoding is explicitly named as future work.
  • Broader LoRA placement trade-offs. The paper notes that lookahead LoRA can in principle be applied to any subset of linear layers to trade off accuracy and latency, which leaves room for task-specific configuration.
  • Training-data stochasticity. The paper references a discussion in Section E.3 (not included in the supplied text) on the interplay between stochastic decoding for training data generation and LookaheadKV performance, suggesting this remains an area of investigation.

Target Audience

Researchers and engineers working on LLM inference efficiency, KV cache compression, and long-context serving. It is most useful for readers already comfortable with attention mechanics and prefill/decode separation who want to understand how learned prompt tokens can replace explicit draft generation. Practitioners deploying long-context models under tight memory or latency budgets, particularly on-device or in latency-sensitive settings, are the most direct beneficiaries. Readers new to KV caching would need background reading on attention and cache eviction first.

Authors’ abstract

Transformer-based large language models (LLMs) rely on key-value (KV) caching to avoid redundant computation during autoregressive inference. While this mechanism greatly improves efficiency, the cache size grows linearly with the input sequence length, quickly becoming a bottleneck for long-context tasks. Existing solutions mitigate this problem by evicting prompt KV that are deemed unimportant, guided by estimated importance scores. Notably, a recent line of work proposes to improve eviction quality by "glimpsing into the future", in which a draft generator produces a surrogate future response approximating the target model's true response, and this surrogate is subsequently used to estimate the importance of cached KV more accurately. However, these approaches rely on computationally expensive draft generation, which introduces substantial prefilling overhead and limits their practicality in real-world deployment. To address this challenge, we propose LookaheadKV, a lightweight eviction framework that leverages the strength of surrogate future response without requiring explicit draft generation. LookaheadKV augments transformer layers with parameter-efficient modules trained to predict true importance scores with high accuracy. Our design ensures negligible runtime overhead comparable to existing inexpensive heuristics, while achieving accuracy superior to more costly approximation methods. Extensive experiments on long-context understanding benchmarks, across a wide range of models, demonstrate that our method not only outperforms recent competitive baselines in various long-context understanding tasks, but also reduces the eviction cost by up to 14.5x, leading to significantly faster time-to-first-token. Our code is available at https://github.com/SamsungLabs/LookaheadKV.

Read the original paper