ChatPaper.aiChatPaper

當經典快取策略失效:面向語義檢索緩衝區的學習增強替換

When Classic Cache Policies Fail: Learning-Augmented Replacement for Semantic Retrieval Buffers

July 1, 2026
作者: Yushi Sun, Bowen Cao, Wai Lam
cs.AI

摘要

LLM智能體日益依賴檢索緩衝區來儲存並重用過往經驗,然而管理這些緩衝區的快取策略仍 largely 停留在臨時性做法。我們將此問題形式化為一個具有切換成本的在線語義快取替代問題——其中項目透過嵌入相似度進行匹配,且命中品質是連續而非二元。透過在MemoryBench-Full(LoCoMo、DialSim)兩個資料集上,以8種替代策略進行的實驗,我們揭示了一個令人驚訝的發現:經典啟發式策略(LRU、LFU)在語義工作負載上 consistently 遜於樸素的FIFO基線,原因在於缺乏時間局部性與頻率集中性。我們提出SOLAR,這是一個學習增強的框架,其修改時機來自遺憾累積(達到sim17%的修改率),而內容選擇則基於對隱式檢索反饋的貝氏在線學習。我們證明SOLAR達到一個常數競爭比≤3,此比值與快取大小及時間跨度無關(相較於FIFO的Ω(K)),且逐出遺憾為O(KTlog T),在最壞情況下與Ω(KT)下界相比僅差對數因子。實驗表明,在緊繃的快取大小下,SOLAR相較FIFO有5%至75%的相對改進,並在工作集邊界處呈現出清晰的相變特徵。使用5000項目的合成實驗進一步揭示項目池大小與檢索品質之間的倒U型關係,從而論證容量限制本質上是一種檢索噪音現象,而非儲存限制。
English
LLM agents increasingly rely on retrieval buffers to store and reuse past experience, yet the cache management policies governing these buffers remain largely ad-hoc. We formalize this as an online semantic cache replacement problem with switching costs, where items are matched by embedding similarity and hit quality is continuous rather than binary. Through experiments on two datasets from MemoryBench-Full (LoCoMo, DialSim) with 8 replacement policies, we reveal a surprising finding: classic heuristics (LRU, LFU) consistently underperform the naive FIFO baseline on semantic workloads, due to the absence of temporal locality and frequency concentration. We propose SOLAR, a learning-augmented framework that derives modification timing from regret accumulation (achieving sim17\% modification rate) and content selection from Bayesian online learning over implicit retrieval feedback. We prove SOLAR achieves a constant competitive ratio leq 3, independent of cache size and horizon (vs.\ Ω(K) for FIFO), and eviction regret O(KTlog T), matching the Ω(KT) lower bound up to logarithmic factors. Experiments demonstrate 5--75\% relative improvement over FIFO at tight cache sizes, with a clearly characterized phase transition at the working set boundary. Synthetic experiments with 5000-item pools further reveal an inverted-U relationship between pool size and retrieval quality, justifying capacity constraints as a retrieval noise phenomenon rather than a storage limitation.