AgentKVShift: Efficient KV Cache Reuse for Agentic Memory Systems

Nilesh Prasad Pandey, Jason Kong, Lanxiang Hu, Quanling Zhao, Yujie Zhao, Onat Gungor, Hao Zhang, Tajana Rosing

TL;DR

AgentKVShift is a training-free, probe-guided Key-Value (KV) cache reuse method designed specifically for structured agentic memory systems. By identifying that KV cache divergence is dominated by a shared, memory-level bias, it corrects all tokens in a retrieved memory chunk using a small set of probe tokens, achieving near-full recompute accuracy at a fraction of the computational cost (2–3.5× prefill speedup).

What Problem Does This Paper Address?

Modern LLM agents rely on memory systems to maintain context over long conversations or complex workflows. Instead of just retrieving raw text passages (like standard Retrieval-Augmented Generation, or RAG), advanced agents actively curate memory into structured formats enriched with LLM-generated metadata—such as summaries, keywords, tags, or knowledge graphs.

However, every time the agent retrieves a structured memory unit, it must re-encode it into KV states because the surrounding context (the current query or history) changes. This re-encoding dominates the "prefill" latency of the LLM. While existing KV cache reuse methods (like CacheBlend or ProphetKV) try to save compute by selectively recomputing a small fraction of tokens, they were designed for raw text and fail catastrophically on structured agentic memories. They leave the unrecomputed tokens completely stale, leading to severe accuracy degradation.

Methods

The authors introduce AgentKVShift, a training-free algorithm that operates per retrieved memory unit. The core intuition is that the error introduced by reusing an old KV cache (the "reuse residual") isn't random noise; it is dominated by a shared, chunk-level offset plus minor token-wise fluctuations.

Figure 1: AgentKVShift: KV reuse via residual estimation. The mean residuals ∆Kavg and ∆Vavg are estimated using probe tokens are applied to non-probe tokens to produce Knew and Vnew, approxi- mating full recomputation.

The method works in three simple steps:

  1. Probe Selection: At the very first transformer layer, the system calculates a divergence score for the tokens and selects a small percentage (e.g., 10%) as "probe tokens."
  2. Mean Estimation: At each subsequent layer, it recomputes the fresh KV states only for these probe tokens and calculates the average difference (the offset) between their fresh and cached states.
  3. Weighted Correction: Instead of leaving the remaining 90% of the tokens stale, AgentKVShift applies a weighted shift using the estimated offset to update all non-probe tokens. This turns the small recompute budget into a corrective signal that improves the entire cache chunk.

Datasets

The authors evaluated AgentKVShift across two long-horizon agentic memory benchmarks using two distinct memory architectures: AMem (a note-based system with summaries and tags) and LiCoMemory (a hierarchical graph-based system).

The benchmarks used were:

  • LoCoMo: A standard benchmark for long-term conversational memory in dialogue, testing multi-hop, temporal, and reasoning capabilities over long, multi-session conversations.
  • AMA-Bench (specifically AMA-Bench-Recall): A rigorous benchmark designed for agentic applications, spanning six domains (Embodied AI, Game, OpenWorld QA, Software, Text2SQL, and Web).

Experiments were conducted across four open-source LLMs: Qwen2.5-3B-Instruct, Qwen3-4B-Instruct, Mistral-7B-Instruct-v0.3, and Qwen3-32B.

Key Insights and Ideas

  • Sharp Spectral Concentration: Through Singular Value Decomposition (SVD) analysis of the KV residuals, the authors discovered that a single dominant mode accounts for the bulk of the cache error in agentic memories. Subtracting the chunk mean drastically reduces this error, proving that a simple mathematical shift can salvage stale tokens.
Figure 2: SVD spectra of Rℓfor K and V.
  • Correction beats Selection: Prior methods focused entirely on token selection (deciding which tokens to refresh). AgentKVShift shifts the paradigm to cache correction, showing that updating un-recomputed tokens provides a much tighter mathematical error bound.
  • Quantization Synergy: Because the probe tokens measure the total gap between the fresh cache and the stored cache, the mean-shift estimate automatically absorbs both semantic context drift and average quantization noise. This makes it highly compatible with aggressive 2-bit and 4-bit KV cache quantization frameworks (like KIVI and OTT).

Key Results

  • Near-Lossless Accuracy at 10% Compute: On the LoCoMo benchmark, AgentKVShift narrows the performance gap to full recomputation to within 1.5–6% relative F1 while refreshing only 10% of the cache. Baselines like CacheBlend and ProphetKV suffer massive accuracy drops at this low budget.
  • 5× Lower Recompute Budget: To match the accuracy that AgentKVShift achieves at a 10% recompute ratio, baseline methods require refreshing 45–55% of the cache.
  • Substantial Prefill Speedups: By operating effectively at a low 10–30% recompute regime, AgentKVShift delivers 2–3.5× prefill speedups over full recomputation on a single NVIDIA A100 GPU.
Figure 3: Effect of recompute ratio on F1.
  • Quantization Robustness: When paired with aggressive 2-bit KV quantization, AgentKVShift retains over 2× the F1 score of prior reuse methods, preventing the total cache collapse seen in baselines.

Limitations and Future Work

  • K-V Asymmetry: The authors note that their sub-Gaussian fluctuation assumption fits Key (K) residuals more cleanly than Value (V) residuals, particularly in shallower transformer layers. Developing asymmetric correction strategies tailored separately for K and V could yield further improvements.
  • Cross-Chunk Reasoning Gaps: While AgentKVShift excels at chunk-local fidelity (retrieval tasks), a wider performance gap remains on complex tasks requiring heavy cross-chunk integration (like causal inference or state updating). The authors suggest that future work should explore state-aware KV reuse, where cache corrections are conditioned on the agent's current reasoning state rather than treated as purely memory-local.

Summary updated

BibTeX
@inproceedings{pandey2026agentkvshift,
  author = {Nilesh Prasad Pandey and Jason Kong and Lanxiang Hu and Quanling Zhao and Yujie Zhao and Onat Gungor and Hao Zhang and Tajana Rosing},
  title = {{AgentKVShift: Efficient KV Cache Reuse for Agentic Memory Systems}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=5uRXWGrFvm},
}
Figure