Manuscript Offprint

arXiv:2610.06286

DeferKV: Rethinking Eviction Timing for One-Shot KV Cache Compression

Zhe Wang, Jiakai Li, Yujia Sun, Rongzheng Wang, Shuang Liang

Abstract

Long-context large language models (LLMs) have demonstrated strong capabilities across a wide range of tasks, but the growing KV cache introduces substantial memory and inference overhead. Existing one-shot KV cache compression methods typically commit to irreversible eviction immediately after prefill, before any signal from actual generation becomes available. Our quantitative analysis shows that early queries from the actual generation stage provide attention signals that are more consistent with subsequent decode attention, with the largest single-step gain occurring at the prefill–decode boundary. Based on this observation, we propose DeferKV, which moves the eviction decision from the end of prefill to the first real decoding step and temporally combines prompt-side and decode-side observations, thereby better aligning KV importance estimation with subsequent generation requirements. DeferKV requires no additional training, draft model, or future-query prediction module, making it simple and easy to deploy. Experiments on LongBench, RULER, and Needle-in-a-Haystack demonstrate that DeferKV consistently improves model performance under KV cache compression while maintaining low inference latency.

1 Introduction

Large language models (LLMs) with long-context capabilities (OpenAI, 2023; Team, 2025) have demonstrated strong performance in document question answering (Dasigi et al., 2021), multi-document summarization (Fabbri et al., 2019), code understanding (Bai et al., 2024), retrieval-augmented generation (Lewis et al., 2020), and complex reasoning (Yao et al., 2023). However, long-context inference also introduces substantial system overhead. In particular, the KV cache has become a major bottleneck affecting memory consumption and inference throughput (Li et al., 2025; Shi et al., 2024; Yuan et al., 2024). For autoregressive Transformer decoders (Vaswani et al., 2017), the key and value representations of historical tokens must be cached at every layer to avoid redundant computation during generation. As the context length increases, the memory consumption of the KV cache grows linearly with the sequence length, making long-context inference more challenging on memory-constrained devices and in high-concurrency serving scenarios. Therefore, compressing the KV cache while preserving generation quality has become an important research problem in efficient LLM inference.

Existing KV cache compression methods often perform one-time KV eviction immediately after the prefill stage. Representative methods such as SnapKV (Li et al., 2024) use a small set of queries near the end of the prompt as an observation window and estimate the importance of historical tokens based on the attention scores between these queries and historical keys, thereby selecting the KV tokens to retain. These methods are simple to implement, require no additional training, and offer favorable efficiency in practice.

However, these methods (Li et al., 2024; Liu et al., 2025) typically rely on a key assumption: the queries within the observation window at the end of the prompt are sufficient to reflect the actual attention requirements of subsequent decoding. This assumption does not always hold in long-text generation tasks. As shown in Figure 1, more historical KV tokens lie closer to the diagonal when using the first real decode query. Its attention scores are therefore more consistent with subsequent decode attention than those aggregated from the final 32 prefill queries. This suggests that prompt-end attention alone may not fully capture the access patterns observed during subsequent generation. Consequently, estimating KV importance solely

∗^{*}Corresponding author: shuangliang@uestc.edu.cn

Figure

Figure 1: Consistency of prompt-end and first-decode attention with subsequent decode attention on GovReport using Qwen3-8B. Each point denotes a historical KV token. The horizontal axis shows its average attention from D2D_{2} to the end of generation, while the vertical axis shows the average over the last 32 prefill queries and the attention from the first decode query. The dashed diagonal marks exact agreement, and the shaded region indicates values within a factor of two.

from prompt-side queries may lead to suboptimal token selection for later decoding.

Recent methods have begun to address this issue by incorporating information related to future generation into KV token importance estimation. For example, SpecKV (Galim et al., 2026), LAQ (Wang et al., 2025), and LookaheadKV (Ahn et al., 2026) construct or predict future queries or attention patterns to make KV compression more closely aligned with the requirements of the actual generation stage. Although these methods alleviate the limitations of prompt-only observation from different perspectives, they usually require additional models, auxiliary modules, or extra training procedures and inevitably face uncertainty introduced by prediction errors.

Based on these observations, we propose a more direct and lightweight approach. Unlike existing methods that rely solely on prompt-side information, our strategy postpones irreversible KV eviction until the first real decode-side signal becomes available and incorporates a small amount of attention feedback from actual generation. This explicitly aligns the importance estimation of historical tokens with the requirements of subsequent decoding. We further consider how to effectively integrate observations from the input and generation stages. To this end, we introduce a simple yet effective temporal weighting strategy to improve the reliability and accuracy of importance estimation.

Our main contributions are summarized as follows:

• We revisit the timing assumption of existing KV cache compression methods that perform eviction immediately after prefill. We propose a compression approach that postpones irreversible KV eviction until the earliest real decode-side feedback becomes available, thereby better aligning KV selection with subsequent decoding.

• Our method is simple, direct, and lightweight. It does not require additional training, a draft model, an auxiliary network, or a future-query prediction module. It only requires minor modifications to the existing inference process, enabling straightforward implementation and deployment.

• Extensive experiments show that our method consistently outperforms state-of-the-art baselines under constrained KV cache budgets, achieving relative performance gains of up to 3.58% on LongBench and 8.03% on RULER.

References (19)