TL;DR
Classic cache replacement policies like LRU and LFU systematically fail when applied to the semantic memory buffers of LLM agents, frequently losing to a simple FIFO baseline. This paper introduces SOLAR, a learning-augmented framework that combines regret-gated admission control with Bayesian online eviction to achieve optimal cache management with a constant competitive ratio and significant empirical gains.
What Problem Does This Paper Address?
Large language model (LLM) agents rely on retrieval buffers to store past experiences—such as conversation histories or environment observations—acting as long-term memory. When these buffers hit their capacity limits, systems must decide which items to keep and which to evict. Naturally, production frameworks have inherited decades-old database buffer management heuristics like Least Recently Used (LRU) or Least Frequently Used (LFU).
However, the authors uncover a surprising phenomenon: classic cache heuristics consistently underperform a naive FIFO (First-In, First-Out) baseline on semantic workloads.
Traditional caching assumes that cache hits are binary and items are matched by exact IDs. Semantic memory buffers break these assumptions entirely:
- Soft Hits: Retrieval quality is continuous (measured via embedding similarity), meaning a cached item can partially answer a query.
- Semantic Matching: Items can serve queries from nearby topics even if they have never been accessed exactly.
- Non-Stationary Utility: As a conversation evolves, the relevance of past items naturally drifts over time.
Methods
The authors propose SOLAR (Semantic Online Learning-Augmented Replacement), a framework derived from first principles to address the unique challenges of semantic workloads. It decomposes cache management into two tightly coupled decisions:
- Regret-Gated Modification Timing (When to modify): Always admitting new items wastes the cache's switching budget on noise. SOLAR gates admission by accumulated regret: a new item enters the cache only when the cumulative cost of not having it exceeds an adaptive threshold. This self-regulating mechanism drives the admission rate down to roughly 17%, ensuring the cache is only modified when it is demonstrably inadequate.
- Posterior-Guided Content Selection (What to evict): When the cache is full and a modification is triggered, SOLAR must choose an eviction target under uncertainty. It maintains a Beta posterior distribution over each item's utility, updated via implicit retrieval feedback. It balances exploration and exploitation using Thompson Sampling, enhanced with a novelty bonus to protect new items and temporal decay to gracefully forget obsolete topics.
Datasets
SOLAR was evaluated using the MemoryBench-Full benchmark across two distinct real-world datasets:
- LoCoMo: Consists of 10 multi-session personal conversations (~2,000 interaction steps). It represents a moderate-difficulty task with a meaningful signal density (~30% hit rate).
- DialSim: Consists of 3 TV-show dialogue datasets (Friends, The Big Bang Theory, The Office) evaluating long-term memory over extended conversations (~19,000 messages). It represents an extremely sparse signal environment (~4% hit rate).
The authors also designed controlled synthetic workloads to stress-test specific edge cases, such as cycling workloads and massive 5,000-item pools.
Key Insights and Ideas
- Why Classic Heuristics Fail: LRU assumes temporal locality, but topic progression in LLMs is driven by evolving user intent; evicting items that haven't been recently retrieved accidentally destroys valuable long-tail knowledge. LFU preserves frequently accessed items, which biases the cache toward the earliest conversation topics simply because they have had more time to accumulate hits, turning the cache into a "museum of obsolete-but-popular items."
- Retrieval Noise is the True Bottleneck: In the LLM era, physical storage is cheap, raising the question of why capacity limits matter at all. The authors demonstrate an inverted-U relationship between pool size and retrieval quality. Past ~1,000 items, the embedding space becomes crowded, and near-duplicates introduce informational noise that confuses the retriever. Capacity constraints are vital for precision, not space saving.
- Super-Additive Synergy: Gating admission and optimizing eviction create a powerful feedback loop. Selective admission filters out noise, providing a cleaner item pool. This yields a higher signal-to-noise ratio for the Thompson Sampling posteriors, which in turn leads to better eviction choices.
Key Results
- Empirical Gains: SOLAR achieves a 5% to 75% relative improvement over FIFO at tight cache sizes ($K \le 50$), performing best when capacity constraints are most severe.
- Theoretical Guarantees: SOLAR uniquely achieves a constant competitive ratio $\le 3$ against an offline optimal policy (whereas FIFO's competitive ratio is unbounded) and matches the information-theoretic lower bound for eviction regret.
- Zero Latency Overhead: SOLAR's operations consist of simple arithmetic on cached scalars, taking <1ms per step. This is completely imperceptible compared to the ~1300ms latency of LLM inference and avoids the expensive LLM calls required by alternative memory curation methods.
Limitations and Future Work
While SOLAR demonstrates robust performance, its theoretical regret bound relies on a stylized stationary model for item utilities. In practice, agent interactions feature slowly shifting item sets and delayed feedback. The authors note that a fully non-stationary treatment (such as a restless-bandit formulation) remains an open area for future theoretical refinement. Additionally, exploring how SOLAR scales within hierarchical or multi-tier agent memory architectures is a promising direction for future deployment.
Summary updated