When Fancy Eviction Fails: Rethinking Cache Replacement For LLM Prefix Reuse
Abstract
Long-running LLM applications and autonomous agents repeatedly send growing context, making prefix caching critical for reducing prefill cost. This raises a fundamental question: do decades of traditional cache-management techniques transfer directly to agentic and conversational LLM serving? We analyze production traces comprising over 20 billion processed tokens and evaluate 14 eviction algorithms across capacity-constrained HBM and large memory-pool settings. We find that simple Least Recently Used (LRU) is surprisingly robust, offering competitive performance against sophisticated traditional policies, though substantial headroom to Belady's optimum remains. The reason is structural: prefix reuse is dominated by the steady pacing of active sessions, making recency an unusually strong predictor for eviction. Nevertheless, prefix caching diverges from traditional workloads in ways that recency ignores, notably the prevalence of single-turn requests, extreme session footprint skew, and highly non-uniform miss costs because attention computation scales with token depth. To close the gap to optimality, we establish several design principles for prefix-cache management: keeping recency as the baseline while incorporating quick demotion to filter one-hit prompts, compute-aware eviction to prioritize expensive misses, and capacity-adaptive eviction granularity. Our traces and simulator are publicly available.
Create a lesson
Metadata
- Categories
- cs.DC, cs.LG
- Comments
- 20 pages, 20 figures, 6 tables. Simulator: https://github.com/cacheMon/PrefixSim Traces: https://huggingface.co/datasets/harvardMadsys/2026_prefixcache
Related papers
RR-Evict: Fine-Grained Prefix Cache Eviction beyond LRU for Agentic LLM Serving
Shared title terminologycs.DCZaifeng Pan, Chris Wu, Zhengding Hu et al.
PrefixChain: Compact Prefix Caching for Hybrid LLMs
Shared title terminologycs.DCGenglin Wang, Wangsong Yin, Liekang Zeng et al.
WavePP: High-Throughput Pipeline Parallel LLM Prefill under Prefix Reuse
Shared title terminologycs.DCAaryam Sharma
Half a Bit per Parameter: How Much Optimizer State Does Training Need to Survive a Failed GPU?
Shared title terminologycs.DCZiyang Lin, Zixuan Sun
KVSeal: Serving Long-Context LLMs with Losslessly Compressed KV Caches
Shared title terminologycs.DCHangyu Liang, Zeyu Mi
EviCastKV: Query-Conditioned Multimodal KV Cache Compression
Shared title terminologycs.DCArup Kumar Sarker, Mills Staylor, Aymen Alsaadi et al.