arXiv:2611.08902cs.DCNov 2026

Manuscript Offprint

arXiv:2611.08902

Inside the Trap: A Renewal Law for Prefix-Cache Collapse in LLM Agent Serving

Akshat Valse, Ali Jannesari

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

Abstract

Prefix caching lets an LLM agent's follow-up turns reuse cached KV, but a burst can tip an engine into a trap in which every turn misses and the backlog does not drain, at a load it served before. In registered paired tests on two engines, two GPUs and two models (passed at 9 of 10 rates), a 200-session burst left the engine at zero hits to the end in all 30 runs, while every matched no-burst run stayed good and a session cap prevented the trap in all 30 capped runs. We analyse an idealization of the trapped state exactly: for a fluid FIFO server on which every turn misses, we prove that along FIFO orbits its cycles obey a linear renewal recursion. As is classical, the trap drains if and only if arrivals are below the all-miss capacity; above it, a Perron root fixes the dynamics: every trapped state converges to a known self-similar regime in which the gap between turns grows linearly and the turns served are young and short. For our workload the backlog grows at 0.6 to 0.8 of the excess load and sessions complete faster than the all-miss capacity, a youth premium with turn-count and cost-growth factors, so in the model a trap's measured throughput overstates the recovery threshold. Retrospectively, with nothing fitted to trap data, the theory matches 57 stuck runs: the mean served prompt within 3% in 50 runs, completions above the all-miss capacity in every run, and the pooled gap growth. Blind in outcome, 4 runs trapped by a tool slowdown met 4 of 5 pre-set scores, cut traps persisted, and with a 20-step budget, trapped runs completed below the all-miss capacity, as predicted. Of two exits, refusing arrivals sheds sessions; a session cap restores reuse: in registered tests it rescued 9 of 9 established traps at the same load without shedding, and the engine stayed good after release. We do not prove that the engine converges to the model.

1 Introduction

An LLM agent that calls tools sends its serving engine sessions of many turns: each prompt is the previous context plus the output of the tool just run. Prefix caching keeps the key-value (KV) state of the previous turn, so a follow-up turn whose prefix is still cached prefills only its new tokens [96]. In our workload a hit prefills 551 tokens and a miss about 11,100,

and a session's prefill work with every turn missing is about 16 times that with every follow-up hitting. The cached KV belongs to sessions that sit idle in tool calls, and admitting waiting work evicts it. A burst of new sessions can therefore tip the engine into a state in which every turn misses, the queue grows, the gap between a session's turns grows with it, and idle KV is evicted before its owner returns. Fig. 1 shows this stampede on SGLang: at loads that the engine carried from empty, a burst of 200 sessions left it at zero hits for the remaining 7500 s.

The question. This paper asks what the trapped state is. Quasi-static models treat it as the falling branch of a throughput curve, n˙=λ−μ(n)\dot{n} = \lambda - \mu(n); read literally in congestion, sessions then complete at the curve's low end and accumulate at the excess over it. On our engines, where every trapped turn misses, both statements are wrong. Trapped runs of our workload at loads above the all-miss capacity measured with caching disabled (λref\lambda_{\text{ref}}, the unit of every rate below) complete sessions faster than it, by up to 2.4 times (one from-empty run at 6.5λref6.5 \lambda_{\text{ref}}), while over the 57 stuck runs of our paired-test protocol their backlog grows, on average, at about two thirds of the quasi-static rate. The gap matters to an operator: in model F below, for our workload, a cut to just below the throughput measured in an all-miss trap does not clear it.

References (92)