arXiv:2610.05833cs.AIOct 2026

Manuscript Offprint

arXiv:2610.05833

Request Order Matters: Cache-History Sensitivity in Selective KV-Cache Reuse for Rolling Agents

Tiffany Gu, Annie Guan, Manshu Huang, Nitin Rao, Siddhant Shah, Margaret Capetz

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

Tiffany Gu ∗^{*}

Carnegie Mellon University

tg2@andrew.cmu.edu

Manshu Huang

University of Chicago

huangms@uchicago.edu

Siddhant Shah

University of Southern California

shahsd@usc.edu

Annie Guan ∗^{*}

Capital One

xin.guan2@capitalone.com

Nitin Rao

University of California, Berkeley

nitinrao@berkeley.edu

Margaret Capetz

University of Washington

mcapetz@uw.edu

Abstract

Long-running agents repeatedly call an LLM while retaining most of their document window, evicting old documents, and appending new ones. These rolling updates break exact prefix caching and motivate non-prefix KV-cache reuse with selective recomputation. We show that persistent KV-cache reuse with selective recomputation can be history-dependent: in our rolling-agent workload, an unchanged prompt can produce different answers depending on the requests processed before it. At a matched 5% recomputation budget, document-aligned recomputation reduces answer variation across request orders from 69.0% with CacheBlend's token top-k policy to 26.1%. When each prompt is evaluated after a different sequence of preceding requests, document-aligned recomputation improves fidelity to full prefill by 34.5–52.5 percentage points over token top-k, while both policies achieve approximately 5.7×5.7\times median TTFT speedup. Our ablation study shows that, in our rolling-agent workload, contiguity is the main factor associated with robust selective recomputation.

1 Introduction

Long-running agents repeatedly call an LLM while retaining information from previous steps. A research agent may keep most papers while replacing outdated evidence; a financial monitoring agent may discard one stale quote or filing and append a new headline, price update, or 8-K title. Recomputing the entire prompt after every small update wastes prefill computation and increases time to first token.

Exact prefix caching avoids repeated prefill only when a new request begins with the same token sequence as a cached request. A rolling update breaks this condition. Once the oldest document is removed, the retained documents move to earlier positions and acquire different preceding context. Their text is unchanged, but their previously computed KV states are no longer the exact states produced by a full prefill of the new prompt.

∗^{*}Equal contribution.

Preprint.

Same prompt and 5% token budget; only request history and selection pattern change

Figure

Figure 1: Overview of the rolling workload, persistent cache history, and equal-budget recomputation policies. Different request orders expose the same prompt to different cached chunk KV states; every policy recomputes 5% of reusable tokens.

CacheBlend addresses this problem by loading cached KV states for reusable chunks and selectively recomputing tokens whose current keys deviate most from their cached keys [1]. LMCache implements this idea with token top-k: for a fixed recomputation budget, it selects the individual tokens with the largest deviations [2]. Because tokens are ranked independently, the resulting repair can be scattered across hundreds of disjoint regions.

We study two questions. First, when the number of recomputed tokens is fixed, does selecting a few contiguous spans work better than selecting scattered tokens with the largest KV deviations? Second, when KV cache state persists across requests, can different sequences of earlier requests cause the same current prompt to produce different answers? This is important for agents because each LLM call inherits cache state created by previous calls.

We compare token top-k with document-aligned recomputation at the same 5% budget. An ablation additionally tests a single contiguous window, fixed chunks crossing document boundaries, and randomly ranked document spans. This design separates contiguity from document boundaries and deviation-based ranking. Figure 1 summarizes the rolling workload, persistent cache histories, and five equal-budget recomputation policies.

Several systems have shown that non-prefix KV-cache reuse can reduce prefill latency [1–6]. We keep both policies at the same recomputation count and measure time to first token on the same rolling requests, so the comparison holds the prefill budget fixed rather than trading extra recomputation for higher fidelity.

We make two contributions:

  1. We show that selective KV-cache reuse depends on request history. The same prompts produce substantially more answer variation with token top-k than with document-aligned recomputation when request order changes.

  2. We show that recomputing a few contiguous regions is more robust than recomputing scattered high-deviation tokens under the tested persistent cache history.