Manuscript Offprint

arXiv:2611.06397

Where Should a KV-Cache Repair Budget Go? Distractor Structure and Contextual Compatibility in Non-Prefix Reuse

Yuxing Peng, Zhiqing Tang, Weijia Jia

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Non-prefix KV-cache reuse encodes retrieved chunks independently and concatenates their caches. To find where a small repair budget should be spent, we vary the chunks around the answer-bearing one (the target) across three 7B–8B models and four datasets of dialogue memory, open-domain QA and API documentation. Reuse loses 19–100% of the context-dependent questions that full prefill answers, and it loses more when the other chunks are of the same kind as the target. Because the recoverable damage is spread over these other chunks, restoring a few of them recovers little, and the budget is better spent on the target. This works through contextual compatibility: recomputing the target against the reused cache beats inserting its full-prefill KV in all seven settings tested, although the recomputed KV stays far from the full-prefill KV. Question attention over reused caches, however, selects the target in at most 18.8% of development questions. A retriever finds it more often, and recomputing its top chunk after moving it next to the question significantly beats InfoFlow-style reordering at the same 5% budget in six of nine open-domain QA and API-documentation settings. On dialogue memory, though, recomputing chunks never significantly beats the token-level selector chosen for each setting.

1 Introduction

Retrieval-augmented generation, long-term conversational memory and tool-use agents build each prompt from retrieved units such as passages, dialogue sessions or API documents. Because the retrieved combination changes from request to request, prefix caching rarely applies. Non-prefix KV-cache reuse instead encodes each chunk once, stores its keys and values, and concatenates the stored caches at query time after assigning or correcting positions (Gim et al., 2024; Lu et al., 2025; Ma et al., 2025; Yang et al., 2025b,c). This saves the prefill over the retrieved context, but no chunk is ever encoded in the presence of the others (Figure 1). Repair methods either select a small fraction of tokens and recompute them online (Yao et al., 2025; Hu et al., 2025; Wang et al., 2026; Teng et al., 2026), which we call token-level selectors, or encode chunks after a fixed surrogate prefix (SurroKV; Anonymous, 2026a). Most of them choose scattered tokens by KV deviation, by position or by the question's attention over the reused cache, and most use full prefill either as the reference that a repair should approach or to explain what a repair restores (Appendix Table 9).

To find out where a small repair budget should be spent, we trace which parts of a retrieved context account for the accuracy that reuse loses. A retriever returns the chunks most similar to the query, and these chunks are often similar to one another: several passages about the same entity, sessions from the same conversation, or documentation for APIs of the same kind. In Figure 1, Qwen3-8B answers correctly from the full-prefill cache, but when the same passages are reused it names the actress from a similar passage. For each question we fix the answer-bearing chunk (the target) and its position, and we draw the other chunks (the distractors) from off-domain prose, from unrelated chunks of the same corpus, or from retrieved chunks similar to the target (Section 2). We evaluate Qwen3-8B, Llama-3.1-8B-Instruct and Mistral-7B-Instruct-v0.2 on dialogue memory (LoCoMo), open-domain QA (NQ-Open and TriviaQA) and API documentation (Gorilla), and we call each model–dataset pair a setting. In each setting we use the questions that full prefill answers and that require the retrieved context ( Q∗Q^{*}).

The loss grows as the other chunks become more like the target. Position-corrected reuse loses 19–100% of these questions. Part of the loss remains

∗^{*}Corresponding author: zhiqingtang@bnu.edu.cn.

Figure

Figure 1: Reuse cuts each chunk off from the chunks before it, and similar chunks then mislead the model. (a) Full prefill encodes each chunk after the earlier ones, whereas non-prefix reuse encodes each chunk alone and joins the caches, so only the question and the answer attend across chunks. (b) An NQ-Open question answered by Qwen3-8B with 30 passages (actual outputs and passages, both shortened). (c) Where a small repair budget goes. The inset shows that, when the target is unknown, the retriever's top chunk is moved last (Sections 3–5).

even when the distractors are off-domain prose. Unrelated chunks of the same kind add to the loss significantly in nine of twelve settings, and on open-domain QA, passages similar to the target reduce accuracy further in all six settings, significantly in five (Section 3). A model that Ma et al. (2025) fine-tune to encode documents as independent blocks still loses 60% of these questions on NQ-Open, and most of this loss comes from the similar chunks (Appendix D).

The damage is spread over the distractors, and a small budget does not undo it. Restoring the full-prefill caches of all distractors recovers more than restoring the target's cache, in all twelve settings and significantly in eleven. By contrast, restoring a single distractor, the most similar or a random one in each setting, changes retention significantly in only two of these 24 cases. The effects of the distractors add up. In a simple model, each reused distractor adds a weight to the odds of losing the answer. Calibrated only at its two measured end points, with no distractor restored and with every distractor restored, this model predicts how retention grows as random distractors are restored, and its prediction beats a linear one in five of the six open-domain QA settings (Section 3.2). Restoring the distractors' caches needs the full prefill that reuse avoids, and a small budget spent on a few similar chunks does worse than the same budget spent on selected tokens (Section 5).

Spending the budget on the target works through contextual compatibility. When the question is processed, it attends to the target together with the reused KV of the other chunks.

Recomputing the target against the reused cache encodes it in that reused context. This recomputation beats inserting the target's full-prefill KV in all seven settings tested (four after Holm's correction), although the recomputed KV stays at a median relative distance of 0.23–0.30 from the full-prefill KV. Recomputing only the known target chunk, which makes up a median of 2.5–3.3% of the context, beats the token-level selector chosen for each setting with a 5% budget in all nine open-domain QA and API-documentation settings, by 0.10 to 0.49.

Question attention rarely finds the target; a retriever finds it more often. In deployment the target is unknown. Over reused caches, question attention selects the target in at most 18.8% of development questions, and the question's summed attention selects the last chunk before the question in 58–100% of them (Section 4). Because a recomputed chunk attends only to the chunks before it, we move the retriever's top-ranked chunk to the position just before the question and recompute it there. At the same 5% budget, this significantly beats InfoFlow-style reordering (Teng et al., 2026) in six of the nine open-domain QA and API-documentation settings (five after Holm's correction). On the same reordered prompt, recomputing the moved chunk is never significantly worse than recomputing selected tokens, and it is significantly better in four settings (Section 5). These gains are bounded by retrieval. On questions where the retriever's top chunk is not the target, recomputing the moved chunk does worse than recomputing selected tokens on the same prompt. Moving the top three chunks extends the gain to some of these questions, and with a 10% budget its gain over moving only the top chunk matches a prediction from the retriever's hit rate in seven of the nine settings. With this budget, however, selected tokens recomputed on the same prompt remain competitive with the three chunks, which are significantly better in only three settings and significantly worse in two. On dialogue memory, chunk-level recomputation brings the 7B–8B models no significant gain over the token-level selector chosen for each setting.

Qwen3-14B and Qwen3-32B each reproduce all five results that we test for replication (Section 5 and Table 2).

References (71)