Practical Online KV Cache Compaction for LLM Agents: An Empirical Study
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. 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.
Cite
@article{arxiv.2608.00902,
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},
journal= {arXiv preprint arXiv:2608.00902},
year = {2026}
}