RR-Evict: Fine-Grained Prefix Cache Eviction beyond LRU for Agentic LLM Serving
Zaifeng Pan, Chris Wu, Zhengding Hu, Xinwei Qiang, Zhongkai Yu, Yufei Ding
Abstract
LLM-based agents execute long-horizon tasks through repeated model calls interleaved with tool execution and user interaction. As each call extends the history accumulated in previous turns, prefix caching avoids repeated prefill of the agent's entire context. However, the aggregate cache footprint grows with context length and concurrency, forcing serving systems to reclaim cached KV tensors. We identify recency synchronization: accesses to an agent's cached history refresh its cache nodes together, causing least recently used (LRU) eviction to concentrate on a few agents' private histories. When a fully evicted agent returns, it must recompute nearly its entire accumulated context, producing a large time-to-first-token (TTFT) outlier even if most other requests retain substantial cache reuse. We present RR-EVICT, a fine-grained prefix-cache eviction strategy that distributes reclamation across idle agent trajectories. RR-EVICT visits agents in round-robin order and evicts a tail chunk from each, preserving reusable prefixes for more agents when capacity remains for idle state. Returning agents can reuse these partial histories and recompute smaller missing suffixes. The policy requires no prediction of future arrivals or tool latency. We implement RR-EVICT in SGLang and evaluate conversational and coding-agent workloads under colocated and prefill-decode-disaggregated serving. Compared with LRU, RR-EVICT reduces P99 TTFT by up to 75.4% and P99 uncached prompt tokens by up to 65.7%.
Create a lesson
Related papers
MOLT: A Fine-Grained GPU Memory Sharing System for LLM Serving with Opportunistic Fine-Tuning
Shared title terminologycs.DCJaehoon Yang, Yongbeom Kim, Hojoon Kim et al.
When Fancy Eviction Fails: Rethinking Cache Replacement For LLM Prefix Reuse
Shared title terminologycs.DCYiyu Liu, Minlan Yu, Juncheng Yang
Weave: Fine-Grained Dynamic SM Scheduling in an MoE Megakernel for Compute-Communication Overlap
Shared title terminologycs.DCZiyu Huang, Yangjie Zhou, Chenhao Zhu et al.
μSmith: An Agentic Factory for the Fastest Specialized LLM Serving Engines
Shared title terminologycs.DCYaoyao Ding, Qidong Su, Baorun Mu et al.
KVSeal: Serving Long-Context LLMs with Losslessly Compressed KV Caches
Shared title terminologycs.DCHangyu Liang, Zeyu Mi
PrefixChain: Compact Prefix Caching for Hybrid LLMs
Shared title terminologycs.DCGenglin Wang, Wangsong Yin, Liekang Zeng et al.