ForesightKV: Optimizing KV Cache Eviction for Reasoning Models by Learning Long-Term Contribution

Zican Dong, Peiyu Liu, Junyi Li, Zhipeng Chen, Han Peng +2 more
2/3/2026
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

Recently, large language models (LLMs) have shown remarkable reasoning abilities by producing long reasoning traces. However, as the sequence length grows, the key-value (KV) cache expands linearly, incurring significant memory and computation costs. Existing KV cache eviction methods mitigate this issue by discarding less important KV pairs, but often fail to capture complex KV dependencies, resulting in performance degradation. To better balance efficiency and performance, we introduce ForesightKV, a training-based KV cache eviction framework that learns to predict which KV pairs to evict during long-text generations. We first design the Golden Eviction algorithm, which identifies the optimal eviction KV pairs at each step using future attention scores. These traces and the scores at each step are then distilled via supervised training with a Pairwise Ranking Loss. Furthermore, we formulate cache eviction as a Markov Decision Process and apply the GRPO algorithm to mitigate the significant language modeling loss increase on low-entropy tokens. Experiments on AIME2024 and AIME2025 benchmarks of three reasoning models demonstrate that ForesightKV consistently outperforms prior methods under only half the cache budget, while benefiting synergistically from both supervised and reinforcement learning approaches.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{dong2026foresightkv,
  title  = {ForesightKV: Optimizing KV Cache Eviction for Reasoning Models by Learning Long-Term Contribution},
  author = {Zican Dong and Peiyu Liu and Junyi Li and Zhipeng Chen and Han Peng and Shuo Wang and Wayne Xin Zhao},
  year   = {2026},
  eprint = {2602.03203},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.03203v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.03203.svg)](https://codeofpaper.com/paper/2602.03203)

Discussion