Practical Online KV Cache Compaction for LLM Agents: An Empirical Study

Yujian Liu, Jiabao Ji, Li An, Rohit Jain, Gungor Polatkan +2 more
8/2/2026
cs.CL

No confident code implementation found for this paper.

Abstract

LLM agents accumulate long trajectories of reasoning steps, tool calls, and environment feedback, making the KV cache a major inference bottleneck. KV cache compaction can reduce this cost, but most prior methods assume a static context where future queries are known or can be approximated offline.

Show full abstract

Agents instead require online compaction: new information must be compressed before future relevance is known, using proxy queries cheap enough for the inference path. We study online compaction across token eviction (TE) and attention matching (AM), adapting both to compact agent turns and comparing cheap proxy sources such as boundary, repeat-prefill, and delayed future-generation queries. Experiments on BrowseComp-Plus and WideSearch show that immediate compaction often hurts performance, whereas delaying compaction to use the agent's future queries recovers much of the gap. Moreover, TE is often more robust than AM under imperfect proxies. Across models at different scales, TE preserves most of the accuracy while reducing KV cache by 80%, and can improve throughput over the no compaction baseline. These results position proxy-query selection as a core design choice for practical online KV compaction.

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{liu2026practical,
  title  = {Practical Online KV Cache Compaction for LLM Agents: An Empirical Study},
  author = {Yujian Liu and Jiabao Ji and Li An and Rohit Jain and Gungor Polatkan and Siyu Zhu and Shiyu Chang},
  year   = {2026},
  eprint = {2608.00902},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2608.00902v1}
}

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/2608.00902.svg)](https://codeofpaper.com/paper/2608.00902)

Discussion