Contiguity, Not Importance: Budgeted Repair of Stale KV Caches After Document Edits

Mingyang Mao, Wyatt Mackey, Xiaomin Lin
9/16/2026
cs.AI
rag

No confident code implementation found for this paper.

Abstract

KV-cache reuse can reduce inference cost in retrieval-augmented generation and agentic systems, but cached contexts may become stale when retrieved knowledge, working memory, or user state is edited. Under causal self-attention, even a local edit can affect downstream KV states.

Show full abstract

A full re-prefill reliably restores consistency but is costly, whereas refreshing only the edited span can leave downstream dependencies stale. We formulate in-place repair as budgeted recomputation and compare training-free position-selection policies on a factual RAG benchmark with matched direct and derived edits. Across three model families, all policies repair direct cases, but derived cases clearly separate them. At the primary budget, a contiguous edit-local window recovers at least 0.94 of the post-edit answer margin and substantially outperforms attention-based, KV-deviation, and structural selectors. Mechanistic analysis shows that position sets effective under clean-state transplantation can fail under actual recomputation because scattered positions inherit surrounding staleness. The edit-local advantage also depends on adjacency and largely disappears when the answer-bearing text moves downstream. Because answer-relevant edits almost always corrupt model behavior, failure severity is difficult to predict, and repair is 13-21 times faster than full re-prefill, our results support unconditional edit-local repair when the dependent text remains adjacent to the edit.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{mao2026contiguity,
  title  = {Contiguity, Not Importance: Budgeted Repair of Stale KV Caches After Document Edits},
  author = {Mingyang Mao and Wyatt Mackey and Xiaomin Lin},
  year   = {2026},
  eprint = {2609.17983},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.17983v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.17983.svg)](https://codeofpaper.com/paper/2609.17983)

Discussion