Which Eviction Policy Should an LLM Cache Use? A Systematic Study Across Workloads, Capacities, and Encoders
Organizations: University of Michigan Ann Arbor, Michigan, USA
Abstract
Semantic caches reuse an LLM response when the incoming query embedding lies near a cached query, but proposed eviction policies have rarely been compared under one protocol. Using CLEVER, we evaluate FIFO, LRU, LFU, ARC, GDSF, a single-pass streaming adaptation of SISO, and a semantic-redundancy policy across three ordered, deduplicated query corpora, three cache capacities, and two encoders. No evaluated policy improves on LFU by more than 0.041 percentage points in any of the eighteen settings. Replacement is not irrelevant: FIFO and streaming SISO trail LFU by as much as 8.67 and 8.55 points, respectively, at tight capacity. We explain the missing upside with a conditional packing result. Under exact lookup and insert-on-miss, a newly inserted entry cannot have a resident neighbor within the hit radius, so a geometry-aware eviction rule receives little new redundancy signal. A separate audit exposes a larger problem with the evaluated operating point. At MiniLM's median nearest-neighbor threshold, only 2.1-3.9% of sampled LMSYS and QQP hits are judged answer-substitutable, reducing raw hit rates of 51-60% to quality-adjusted rates of 1.1-2.2%. The cross-encoder study further shows that thresholds do not transfer between embedding models. LFU is the strongest simple default in this protocol; deployment decisions should first establish answer validity and then test sub-point policy differences with exact search.
Figures & tables
| Parameter | Symbol | Value | Justification |
|---|---|---|---|
| Recency weight | 1.0 | Recency in utility denom. | |
| Frequency weight | 1.0 | Frequency in utility denom. | |
| Denominator floor | Prevents division by zero | ||
| Smoothing constant | 0.1 | Laplace-style smoothing | |
| Neighbor sample cap | 1024 | Bounds insert cost | |
| Penalty coefficient | 2.0 | Suppresses false accepts |
| Cache Size | LRU | LFU | Semantic |
|---|---|---|---|
| 10% | |||
| 20% | |||
| 30% |
| Cache Size | LRU | LFU | Semantic | Sem./LRU |
|---|---|---|---|---|
| 10% | 1.45 ms | 2.53 ms | 8.47 ms | |
| 30% | 1.90 ms | 3.67 ms | 15.70 ms |
| LMSYS | QQP | MOSS | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Policy | Raw | YES [95% CI] | QA | Raw | YES [95% CI] | QA | Raw | YES [95% CI] | QA |
| LRU | 55.5 | 3.6 [2.6, 4.9] | 2.0 | 57.5 | 2.5 [1.7, 3.7] | 1.4 | 97.6 | 25.1 [22.5, 27.9] | 24.5 |
| LFU | 57.0 | 3.9 [2.9, 5.3] | 2.2 | 60.0 | 2.6 [1.8, 3.8] | 1.6 | 97.6 | 26.1 [23.5, 28.9] | 25.5 |
| Semantic | 55.9 | 3.1 [2.2, 4.4] | 1.7 | 58.7 | 3.1 [2.2, 4.4] | 1.8 | 97.6 | 26.1 [23.5, 28.9] | 25.5 |
| ARC | 57.0 | 3.3 [2.4, 4.6] | 1.9 | 60.0 | 2.6 [1.8, 3.8] | 1.6 | 97.6 | 26.1 [23.5, 28.9] | 25.5 |
| GDSF | 56.8 | 3.9 [2.9, 5.3] | 2.2 | 59.5 | 2.3 [1.5, 3.4] | 1.4 | 97.6 | 24.7 [22.1, 27.5] | 24.1 |
| Claim | Artifact |
|---|---|
| Index Pareto frontier (Fig. 1 ) | results/benchmarks/index_benchmark_*.json |
| Adaptive routing, 60.33% savings at (Fig. 2 ) | results/routing/routing_eval_multi_seed.json |
| Three-policy full-LMSYS eviction (Fig. 3 , Table 2 ) | results/eviction/eviction_results_multi_seed.json |
| Seven-policy matrix (Figs. 4 , 5 ) | results/eviction/phase6_matrix_* , results/eviction/phase10_fifo_* |
| Recalibrated gte-base replication (Sec. 3.5 ) | results/eviction/phase6_recal_* |
| Judged hit quality (Table 4 , Figs. 6 , 7 ) | results/judge/ , paper/tables/phase8_judge_table.tex |
Semantic Caching
Semantic caching reuses results for meaningfully similar queries to reduce the latency and cost of AI, retrieval, and database systems.
See all 22 papers