LazyEviction: Lagged KV Eviction with Attention Pattern Observation for Efficient Long Reasoning

Haoyue Zhang, Hualei Zhang, Xiaosong Ma, Jie Zhang, Song GuoarXiv 2025 · DOI

Abstract

As Large Language Models (LLMs) transition toward "slow thinking" via long Chain-of-Thought (CoT) reasoning, the memory footprint of the Key-Value (KV) cache becomes a critical bottleneck. Existing KV eviction methods often rely on greedy, per-step importance scores, which lead to significant performance degradation in reasoning tasks. This paper introduces LazyEviction, a framework that leverages the "Token Importance Recurrence" (TIR) phenomenon. By employing an observation window-based lagged eviction strategy, LazyEviction reduces GPU memory usage by 50–70% while preserving reasoning accuracy across complex mathematical and scientific benchmarks.

Introduction

Modern reasoning models, such as OpenAI’s o1 or DeepSeek-R1, generate extensive intermediate tokens to solve complex problems. For a sequence of 16k tokens, the KV cache can exceed 100GB, surpassing the capacity of standard hardware. While KV cache compression is essential, standard algorithms like H2O and TOVA often fail in reasoning contexts. In tasks like mathematics or coding, a model may ignore an initial condition for hundreds of steps before suddenly requiring it to finalize a proof. Greedy eviction methods delete these "temporarily" unimportant tokens, causing catastrophic performance loss.

Performance degradation of greedy eviction methods on reasoning tasks (GSM8K) compared to standard language modeling (PG-19).

The Token Importance Recurrence (TIR) Phenomenon

The core insight of this work is the identification of Token Importance Recurrence (TIR). Analysis reveals that over 95% of tokens in reasoning tasks exhibit a pattern where their attention scores "spike" periodically. A token might have a low attention score for a long interval but reactivate during verification or summarization phases.

Existing state-of-the-art (SOTA) methods lose approximately 20% accuracy on reasoning tasks because they mistake a "resting" token for a useless one. However, the researchers found that the Maximum Recurrence Interval (MRI)—the longest gap between these spikes—is relatively small (under 175 tokens) for 80% of tokens, suggesting that a lagged observation window can effectively capture these patterns.

LazyEviction Framework

LazyEviction shifts from per-step greedy eviction to an Observation Window-based Lagged Eviction mechanism. Instead of immediate deletion, the system monitors tokens over a fixed window $W$ to learn their "heartbeat."

Comparison of eviction strategies: (a) TOVA (current attention), (b) H2O (accumulated attention), and (c) LazyEviction (lagged eviction with observation windows).

The framework utilizes two primary metrics for its eviction policy:

  1. Recurrence Interval Tracking: The system records each token’s MRI to predict future utility.
  2. MRI-Centric Scoring:
    • H1-score: Predicts if a token is likely to be needed soon based on the time elapsed since its last activation relative to its MRI.
  3. H2-score: Prioritizes tokens with smaller MRIs, as they are more frequently recurring and critical for the reasoning chain.

By waiting for an observation window to pass, LazyEviction allows "latent" tokens to prove their utility before they are permanently removed from the cache.

Key Results

LazyEviction was evaluated using DeepSeek-R1-Distill, Qwen, and QwQ models across benchmarks including MATH-500, AIME, and GPQA Diamond.

  • Memory Efficiency: The framework maintains full-cache accuracy while utilizing only 30% to 50% of the memory budget.
  • Superior Reasoning Performance: On MATH-500 and AIME, LazyEviction consistently outperformed other compression methods like TOVA, H2O, and RaaS. In some cases, it slightly exceeded the Full KV baseline by filtering out "noise" tokens that did not contribute to the reasoning path.
  • Scalability: While adding minor computational overhead for tracking, LazyEviction becomes more efficient than Full KV for sequences exceeding 16k tokens by preventing the linear growth of attention computation.

Conclusion

LazyEviction demonstrates that "lazy" or lagged eviction is superior to greedy strategies for long-chain reasoning. By acknowledging that token importance is recurrent rather than static, the framework provides a robust solution for deploying high-performance reasoning models on memory-constrained hardware. Future work will explore dynamically adjusting window sizes to further optimize performance across varying task characteristics.

Summary updated

Abstract

Large Language Models (LLMs) exhibit enhanced capabilities by Chain-of-Thought reasoning. However, the extended reasoning sequences introduce significant GPU memory overhead due to increased key-value (KV) cache. Existing KV cache compression methods mitigate memory bottlenecks but struggle in long reasoning tasks. In this paper, we analyze attention patterns in reasoning tasks and reveal a Token Importance Recurrence phenomenon: a large proportion of tokens regain high attention after multiple decoding steps, which is failed to capture by existing works and may lead to unpredictable eviction on such periodically critical tokens. To address this, we propose LazyEviction, an observation window-based lagged eviction framework retaining latent recurring tokens by prioritized eviction based on tokens' recurrence patterns. Extensive experiments demonstrate that LazyEviction reduces KV cache by 50%~70% while maintaining comparable accuracy, outperforming existing KV cache compression baselines. Our implementation code can be found at https://github.com/Halo-949/LazyEviction.
BibTeX
@misc{zhang2025lazyeviction,
  author = {Haoyue Zhang and Hualei Zhang and Xiaosong Ma and Jie Zhang and Song Guo},
  title = {{LazyEviction: Lagged KV Eviction with Attention Pattern Observation for Efficient Long Reasoning}},
  year = {2025},
  eprint = {2506.15969},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.15969},
}
Figure