arXiv:2607.21604cs.AI2026-07

通过智能修正提升记忆检索效率,显著降低大模型推理延迟。

AgentKVShift: Efficient KV Cache Reuse for Agentic Memory Systems

论文配图:AgentKVShift: Efficient KV Cache Reuse for Agentic Memory Systems
图 1 · 摘自论文原文
  • 基于探针估计缓存偏移量,对重用的键值对进行精准校正。
  • 仅刷新10%-30%缓存即达接近全重算性能,延迟降低2-3.5倍。
  • 适用于长程对话与代理应用,兼容低比特量化,适合部署优化。

增强记忆的大型语言模型代理通过主动整理检索内容(如摘要、关键词)维持数百轮交互上下文。但每次检索需重新编码这些结构化记忆单元为键值(KV)状态,主导预填充延迟。现有无需训练的缓存复用方法针对原始文本片段设计,对结构化记忆效果下降。我们提出AgentKVShift,一种无需训练、探针引导的键值残差修正方法,按每个检索记忆单元独立运作。关键发现:每条记忆的缓存复用残差可分解为共享的记忆级偏移量与微小的词元级波动。通过小规模探针集估计该偏移量,即可用单一加权修正所有重用词元。不同于以往仅选择部分词元重算而让其余缓存保持过时的方法,AgentKVShift同时修正未重算的词元,使刷新预算转化为整个块的有效信号。在四个开源模型(3B至32B参数)及两个长周期代理记忆基准(长期对话与代理应用)上,该方法在仅刷新10%-30%缓存时达到近乎全重算性能,优于同刷新率基线。其达到近全性能所需重算比例仅为先前方法的1/2(45%-55%),在该条件下,单个A100上实现2-3.5倍预填充加速。且与缓存量化正交,即使在2-4比特极端压缩下仍保持超过两倍于先前方法的F1得分。

原文摘要 · Abstract (English)

Memory-augmented LLM agents maintain context across hundreds of interactions through agentic memory systems that actively curate retrieved content with LLM-generated metadata such as summaries, keywords, and tags. From an inference cost standpoint, every retrieval triggers a full re-encoding of these structured memory units into Key-Value (KV) states, which dominates prefill latency. Existing training-free KV reuse methods mitigate this by selectively recomputing a small fraction of tokens, but were designed for RAG-style raw passages and degrade on structured agentic memories. We present AgentKVShift, a training-free, probe-guided KV residual correction method that operates per retrieved memory unit. One of the crucial insights we demonstrate is that the per-memory KV reuse residual decomposes into a shared memory-level offset plus small token-wise fluctuations. Estimating this offset from a small probe set allows us to correct every reused token by a single weighted correction. Unlike prior reuse methods which decide which tokens to recompute and leave the rest of the cache stale, AgentKVShift also corrects the tokens it does not recompute, turning the refresh budget into useful signal across the entire chunk. Across four open-source LLMs spanning 3B to 32B parameters and two long-horizon agentic memory benchmarks (long-term dialogue and agentic applications), AgentKVShift achieves near full recompute performance while refreshing only 10-30% of the cache, outperforming baselines at the same recompute ratio. It requires up to 5x lower recompute to reach this near-full performance, which prior reuse methods only attain at 45-55% refresh. In this regime, AgentKVShift delivers prefill speedups of 2-3.5x over no-KV-reuse on a single A100. AgentKVShift orthogonally composes with KV cache quantization, retaining over 2x the F1 of prior reuse methods under aggressive 2- and 4-bit settings.

KV缓存推理优化大模型记忆系统

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。