In the registered rescue tests R1 and R4, all 9 runs were rescued without shedding a session. With the cap removed, every run stayed good at the same arrival process for the remaining 2560–4720 s. The price is waiting at the client: 386–569 s per paused session on average. One frozen prediction missed: the first-principles model predicted the rescue in every cell, but 4 of its 9 release times fell outside its ±15% tolerance.
Inside the Trap: A Renewal Law for Prefix-Cache Collapse in LLM Agent Serving
We study a failure of prefix-cached LLM serving in which a burst of agent sessions can trap the engine: every turn misses the cache, at a load it served before. We prove a renewal law for an idealization of the trapped state; in that model, for our workload, a trap's measured throughput overstates the recovery threshold. In registered tests, a 200-session burst left the engine at zero hits to the end in all 30 runs, and a session cap rescued all 9 established traps without shedding a session.
arXiv 2026 / cs.DC
Introduction
An LLM agent that calls tools sends sessions of many turns to its serving engine: each prompt is the previous context plus the output of the tool just run. Serving engines such as SGLang and vLLM keep the previous turn's KV in a prefix cache, so a follow-up turn whose prefix is still cached prefills only its new tokens. In our workload a hit prefills 551 tokens and a miss about 11,100; per session, prefill work with every turn missing is about 16 times that with every follow-up hitting.
Figure 1. The agent loop and why a hit is cheap. Each turn re-sends the whole context; the engine keeps the previous turn's KV, so a turn whose prefix is still cached prefills only its new tokens. The workload is the paper's: tool times are exponential with mean 5 s, token ids are random and sessions share no prefixes.
The catch is who owns that cache. The cached KV belongs to sessions that sit idle in tool calls, and admitting waiting work evicts it. A burst can tip the engine into a trap: every turn misses, the queue grows, the gap between a session's turns grows with it, and the backlog does not drain, at a load the engine served before.
Quasi-static models read the trap as the falling branch of , with the engine's throughput when sessions are kept running. On our engines, where every trapped turn misses, that reading gets the numbers wrong. Trapped runs complete sessions faster than the all-miss capacity, by up to 2.4 times (one from-empty run at 6.5 ), and over the 57 stuck runs of the paired-test protocol their backlog grows, on average, at about two thirds of the quasi-static rate. An operator should care: in model F below, for this workload, a cut to just below the throughput measured in an all-miss trap does not clear it. We therefore ask two questions:
What is the trapped state? We idealize it as model F, a fluid FIFO server on which every turn misses, and derive its law exactly: along FIFO orbits its cycles obey a linear renewal recursion, and every trapped state converges to a known self-similar regime. In the model, for our workload, a trapped server completes sessions faster than its all-miss capacity: a youth premium.
How does an engine get out? We test two exits on real engines. Refusing arrivals drains the queue by shedding sessions; a session cap restores reuse, and rescued all 9 established traps it was tried on without turning sessions away.
We claim none of the eviction, cold-prefill and queueing mechanisms that agent-serving systems describe; what we add is the law of the state they lead to, and a test of the ways out. Lu et al. (arXiv:2611.02543), who posted first, studied the same collapse concurrently and independently, on prefill–decode disaggregated SGLang. The table below collects our main results.
| Test | Result | Status |
|---|---|---|
| 200-session burst, no cap | engine at zero cache hits to the end in 30 of 30 runs | pre-registered (vLLM: registered) |
| Matched runs without the burst | every run stayed good | same tests |
| Client-side session cap from the start | trap prevented in 30 of 30 capped runs | same tests |
| The registered trap rule | met at 9 of 10 rates (the tenth failed on backlog growth); it called 23 of the 30 BURST runs trapped, though all 30 stayed at zero hits (why: Table 1 caption) | same tests |
| Session cap engaged inside an established trap | 9 of 9 rescued at the same load, no session shed | pre-registered |
| Model F against every stuck run | served prompt within 3% in 50 of 57; completions above the all-miss capacity in every one | retrospective, nothing fitted to trap data |
Model F: A Renewal Law for the Trapped State
To say what the trapped state is, we idealize it. We first give the intuition for why a trap holds, then the model and what it implies.
Why the Trap Holds
Once the burst has passed, why does the engine not recover? Our answer here is a heuristic consistency argument, not part of the theorem. In a trap the KV pool turns over every –78 s (a turnover scale, not a pathwise eviction bound; is the KV pool in tokens, and churn is the rate at which new KV is written: uncached prompt plus completion tokens per second), while the gap between a session's turns keeps growing: in every BURST run of the first three registered tests the gap was 4.1–9.7 times , so an idle session's KV is overwritten long before it returns. In the good arms the same ratio is 0.010–0.028.
Figure 2. The trap as a feedback loop, and the ways out. After a burst, admitting waiting work evicts the KV of sessions idling in tool calls; their follow-up turns miss, the GPU prefills at the all-miss token rate, and the backlog grows. In model F the gap between a session's turns then grows linearly, and on the engine it ran several times the pool turnover time. That closing step is a heuristic consistency argument, not part of the theorem, and gap/ is a descriptive proxy. Refusing arrivals drains the queue by shedding sessions; a session cap holds admitted sessions below the all-miss onset , where turns hit again, and the excess waits at the client. The onset is the smallest number of sessions at which the all-miss state can exist: the sessions in tool calls at the all-miss rate plus one pool's worth of running sessions, 32.7 at the 300k pool. A cut to a rate in does not empty model F's queue.
Drag the slider below to compare the two time scales in a good arm and in a trapped one. In the good arms a session comes back long before the pool has turned over; in the trapped arms it comes back after several turnovers.
Figure 3. Good state against trapped state, on one log time axis. Top bar: the gap between a session's consecutive turns; bottom bar: the pool turnover time . Each bar spans the range over arms. Good arms (NOBURST and CAPPED): gap 4.9–5.9 s against 188–505 s. BURST arms: gap 166–516 s against 26–78 s. The labels give what each arm measured. They are not a consequence of the ratio: these time scales do not make an idle time exceeding a sufficient miss condition here. Ranges over SGLang 300k, SGLang native and vLLM 300k.
A Renewal Recursion along FIFO Orbits
Model F is a fluid FIFO server on which every turn misses. Turn costs GPU seconds when it misses, and . The all-miss capacity and the load are
Its assumptions (F1)–(F6): every turn misses; the server works at unit rate while anything is pending; service is first come, first served at the request level; a completed turn rejoins the tail at once as turn ; new sessions arrive as turn 1 at rate ; and the initial pending mass is finite with positive work. A request joining at time completes at , where is the pending work, so is also the gap between a session's consecutive turns. A FIFO orbit is , with cycles .
FIFO maps the requests that join during one cycle onto the requests that complete during the next, and the turn- mass joining there is . Lemma 1 turns this into a linear recursion for the cycles,
with the largest possible turn count (60 for the standard workload), , for , and , where is the remaining all-miss work of every session present, which changes at rate while the server is busy. Its growth rate is a Perron root:
Where Every Trapped State Goes
Theorem 1(a): every trapped state converges to a known self-similar regime, in which
The gap between a session's turns grows linearly at rate , the number of sessions present grows at , sessions complete at rate , and the turns served follow the tilted mix rather than the stationary mix : the turns served are young and short. Proposition 1(a), classical in substance, covers the other side: the queue empties if and only if , at , and at with arrivals stopped. Near threshold, Proposition 1(c) gives and , where .
Figure 4. Model F as a renewal cycle. Left: along a FIFO orbit, a request joining at completes at ; what joins during one cycle completes during the next, so the cycle lengths obey a linear recursion. Right: that recursion is a Lotka–Leslie renewal equation, with arrivals as births, as survival, as net maternity and the tilted mix as the stable age distribution. The bars are computed for the standard workload at 1.65 , from this site's copy of the paper's cost model for the 300k cell.
The Youth Premium
In model F the turns served are young, and in our workload young turns are cheap, so a trapped server completes sessions faster than its all-miss capacity: a youth premium. Theorem 2 splits it into a turn-count factor and a cost-growth factor :
Near threshold, . For our workload lies in 0.60–0.62, and the premium is positive at every load checked: proved by Theorem 2's monotonicity for ; below that it rests on a floating-point bracket and a first-order expansion. The premium is not automatic. With slowly growing costs it is negative at every load checked, and for an untruncated geometric with constant costs there is none.
This is what an operator needs. Corollary 3: after a switch to at , the queue empties if and only if , after the busy period . The corollary is not new as mathematics, but with a premium it bites: a cut to any rate in , below the asymptotic trapped throughput, does not empty model F's queue. In the model, a trap's measured throughput overstates the recovery threshold. Remark 1 adds that solves with , so the trapped composition and are unchanged by a uniform GPU speed-up at equal ; this is not a general hardware claim.
The costs come from the paper's calibrated prefill model, , with ms, ms, s/token, ns per causal pair and chunk . Then , the miss prefill plus , the all-miss per-turn decode share, chosen so that matches the first-principles model's capacity. The calculator below evaluates these statements in your browser.
Figure 5. Model F, computed in your browser. For the chosen workload and load the calculator solves the Perron equation by bisection and evaluates Theorem 1(a) and Theorem 2. Left, the turns a trapped server serves (bars) against the stationary mix (line); right, across loads. The paper does not print . The site uses = 79.7 ms, and for the standard workload that value gives , and for MIRROR it is pinned to the stated . Beside each reading is the paper's published model-F value for the 300k cell, or MIRROR's frozen prediction, where one exists; agreement means within one unit of the last printed digit. These are model F's asymptotic values: in the registered window, a transient of order 10% remains. The calculator shows model values only; the comparisons with the engine in the next sections are retrospective except where marked blind.
Experiments
The registered tests on real engines come first, then the theory against every stuck run, a blind test, and the two ways out.
Setup and Baselines
The registered tests drive real engines on Iowa State's Nova cluster, via Slurm, with one NVIDIA A100 80GB PCIe or H200 NVL per engine, under a synthetic agent workload. A session has turns, and turn sends a prompt of tokens:
so . The engines are SGLang 0.5.22 and vLLM 0.32.0, serving Qwen2.5-7B-Instruct or Llama-3.1-8B-Instruct, with the KV pool capped at 300k tokens (150k or 600k in the pool sweep; SGLang's native 955,757 tokens in the native cell). Rates are multiples of each cell's reference rate , the all-miss session rate measured with prefix caching disabled.
The main protocol, E2, runs three arms per seed on common arrivals: BURST (200 sessions within 60 s
at 1200 s), NOBURST, and CAPPED, with a client-side FIFO session cap from the start. Runs last 8700 s
and are judged over s. BURST counts as trapped if its uncached
prefill token rate is within ±15% of the all-miss rate and its backlog slope is above
. Each test's rule was committed to git
before its jobs were submitted; there is no third-party registry. Pre-registered means the
rule was also pushed to GitHub before submission; registered means it was committed before
and pushed later. For the blind tests the record is a git tag on each frozen prediction or rule,
listed below with its commit and the time GitHub recorded its push (all on 2026-11-05, CST); the rest
is in Appendix E.12–E.13 of the paper and in the provenance/ folder of
the public repository.
| Tag | Commit | Pushed (CST) |
|---|---|---|
icml-trap-pred | 6b47a6c | 00:24:47 |
icml-cut-pred | 2f90267 | 02:25:43 |
r15-reg | e05a262 | 03:18:36 |
r15-cut-reg | 11b0e4e | 03:54:49 |
r16-mirror-reg | bc81ee7 | 14:07:35 |
The quasi-static baseline rests on the engine's closed-population throughput curve , the completion rate with sessions kept running, which has a cliff. The 300k-token pool limit did not create that cliff; it moved it. On an H200 at the 300k pool the window between the all-miss capacity and the curve's peak narrows: the all-miss capacity rose 2.71-fold and the peak of only 1.63-fold. A first-principles model of the curve put its 0.5-hit crossing off by 1.5 sessions on average (Lu et al.'s curve, read post hoc: 4.1); five of its cells were blind (three in time, two by access only), one of them partly seen.
Throughput curve:
against the engine's μ(n).
Figure 6. Closed-population throughput curves. Paper Fig. 5: real engine (black filled markers; one run per ) against the simulator (gray, open, dashed), for SGLang with a 300k-token pool, SGLang with its native pool and vLLM with a 300k-token pool, with the registered caps; the middle and right panels also show the simulator's blind predictions; bottom row, the hit fraction. Paper Fig. 8: first-principles predictions of (solid: fluid; dashed: with the demand-fluctuation layer H1, labelled F1 in the legend) against measured points for four cells. The first three panels are in sample; the H200 panel is out of sample.
Registered Results
Table 1 lists the registered tests and their outcomes, and Figure 7 shows the trap on SGLang.
| Test | Cell and design | Status | Outcome |
|---|---|---|---|
| E2 | SGLang 0.5.22, Qwen2.5-7B, A100, 300k pool; 1.35 and 1.65 ; cap 20 | pre-registered | Pass at both rates: BURST at zero hits 6/6 (trapped by the rule 5/6), NOBURST good 6/6, CAPPED recovered 6/6 |
| native E2 | SGLang's own pool (955,757 tokens); 2.5 and 4.0 ; cap 64 | pre-registered | Pass at both rates: 6/6 trapped, 6/6 good, 6/6 recovered |
| vLLM E2 | vLLM 0.32.0, 300k pool; 1.35 and 1.65 ; cap 20 | registered | Pass at both rates (zero hits 6/6, trapped 4/6); the BURST arm repeats earlier exploratory seeds; the frozen mechanism-check rule was not met (its detector alarmed in 2 CAPPED runs) |
| H200 E2 | H200 NVL, 600k pool; 1.5 and 2.0 ; cap 48 | pre-registered | Pass at both rates: zero hits 6/6 (trapped 5/6) |
| Llama E2 | Llama-3.1-8B, A100, 300k pool; 1.35 and 1.65 ; cap 20 | pre-registered | Pass at 1.65, fail at 1.35 (slope rule met by 1 of 3); all six BURST runs at zero hits |
| BASIN-1, BASIN-2 | 300k, 1.65 ; bursts of 25 and 100, then 40, 50 and 60 | pre-registered | 25 and 40 good 3/3; 60 and 100 stuck 3/3; 50 stuck in 1 of 3; boundary between 40 and 60 in every seed |
| TOOLSLOW | 300k, 1.35 , no burst; tool calls 10 or 30 s longer for 900 s | pre-registered | Rule not met: +10 s good 3/3; +30 s trapped 1/3 |
| SHED | 300k, 1.35 ; arrivals stopped from 1800 s for 600 or 3600 s | pre-registered | Pass: 600 s stop stuck 2/2 (56–59 sessions refused); 3600 s stop good 2/2 (355–378 refused) |
| R1, R4 (rescue) | cap 20 at 1800 s (300k; 1.35 and 1.65 ) and 64 at 2100 s (native; 4.0 ), inside an established trap | pre-registered | Rescued 9/9, no relapse, no session shed; stayed good after release, matching NOBURST |
Table 1. The registered tests, condensed from the paper's Table 1. Rates are nominal multiples of each cell's . Seeds 0–2 are shared across tests, so counts across tests are descriptive. Across the five E2 tests, 5 + 6 + 4 + 5 + 3 = 23 BURST runs were trapped by the rule. The other 7 of the 30 were also at zero hits; they missed only the rule's backlog-slope condition, since each one's uncached prefill rate was within ±15% of the all-miss rate (paper Table 7 and App. E.5). The slope line is , and at 1.35 model F puts the true slope only about 25% above it. Six of the 7 runs below the line are seed 1, whose arrival plan delivers 0.8–8.9% fewer arrivals than nominal over the window in every cell and rate (paper App. B). This account is post hoc and changes no registered verdict.
Figure 7. The stampede on SGLang. First panel (paper Fig. 1): the registered paired test E2 at 1.35 and 1.65 , with sessions/s, one A100 and a 300k-token pool; a burst of 200 sessions at 1200 s; shaded, the registered evaluation window. After the burst, BURST misses every turn to the end of the run, while NOBURST and CAPPED stay good. Second panel (paper Fig. 7): the same test with SGLang's native pool at 2.5 and 4.0 , sessions/s, cap 64. Use the dots to switch.
Once formed, the trap held. Over 50 trapped runs before the blind tests, about 100 trapped hours, no 300 s window after the trap formed reached a follow-up hit fraction of 0.5; the highest was 0.16 (a post hoc summary). The registered dose response places the basin boundary between bursts of 40 and 60 sessions in every seed, with a burst of 50 trapping 1 of 3. Not every registered rule was met: lengthening every tool call that starts in s by 30 s trapped 1 of 3 runs, so that rule (traps in 2 of 3) failed, and at the tenth rate, Llama-3.1-8B at the lower rate, the trap rule failed on its backlog-growth condition.
The Theory against 57 Stuck Runs
We derived the theory after the stuck runs were read, so this comparison is retrospective. No parameter is fitted to any trap measurement, and model F's capacity is within 4% of the all-miss capacity measured on the engine with prefix caching disabled and 32 sessions kept running. Across the 57 stuck runs:
the mean served prompt is within 3% of model F's in 50 of the 57 runs: the trapped engine serves turns 9–41% shorter than the stationary mix;
gap growth, measured over predicted, has median 1.01 (mean 0.96); per run it ranges from 0.04 to 1.81;
every stuck run completes sessions above , at 1.10–2.03 (up to 2.40 in the from-empty runs), and net of the congested engine's faster token rate, completions still exceed by a factor of 1.08–1.81 in every one of the 57;
the backlog slope, over model F's , has mean 0.99 and median 1.06, where the quasi-static reading gives 1.36–1.59.
(a) Mean prompt of the turns served, over the stationary mean: the tilted turn mix.
(b) Session completion rate over : the youth premium, above 1.
(c) Backlog growth over ; dashed, the quasi-static growth at .
(d) Growth rate of the gap between a session's turns, regressed on the turn's completion time, against model F's .
Figure 8. Theorem 1 against every stuck run of the workload (paper Fig. 2), against . Blue lines: model F for 8 cells; orange dots: 57 stuck E2-protocol runs; hollow green diamonds: 13 from-empty runs; dashed gray: the quasi-static reading. No parameter is fitted to any trap measurement. Retrospective: the theory was derived after these runs were read.
| Cell, rate | meas. / pred. | gap slope / | meas. / pred. | backlog/ (quasi-static) | |
|---|---|---|---|---|---|
| 300k 1.35 | 1.34 | 9125–9556 / 9324 | .004–.020 / .013 | 1.13–1.28 / 1.13 | 0.23–1.42 (1.58) |
| 300k 1.65 | 1.64 | 8417–8830 / 8606 | .015–.027 / .022 | 1.25–1.35 / 1.23 | 0.92–1.20 (1.53) |
| native 2.5 | 2.44 | 7264–7484 / 7374 | .044–.051 / .043 | 1.44–1.56 / 1.49 | 1.09–1.17 (1.46) |
| native 4.0 | 3.90 | 6127–6213 / 6115 | .066–.076 / .075 | 1.87–2.03 / 1.81 | 0.93–1.05 (1.36) |
| vLLM 1.35 | 1.32 | 9097–9547 / 9393 | .000–.016 / .012 | 1.18–1.28 / 1.14 | 0.00–1.26 (1.59) |
| vLLM 1.65 | 1.62 | 8104–8778 / 8676 | .013–.028 / .022 | 1.30–1.42 / 1.24 | 0.65–1.28 (1.55) |
| H200 1.5 | 1.45 | 9015–9177 / 9062 | .015–.022 / .016 | 1.20–1.27 / 1.20 | 0.83–1.32 (1.57) |
| H200 2.0 | 1.93 | 8058–8230 / 8082 | .023–.031 / .031 | 1.40–1.45 / 1.36 | 0.80–1.02 (1.51) |
| Llama 1.35 | 1.33 | 9075–9512 / 9356 | .003–.016 / .012 | 1.22–1.33 / 1.14 | 0.00–1.23 (1.57) |
| Llama 1.65 | 1.63 | 8459–8757 / 8631 | .013–.021 / .022 | 1.34–1.49 / 1.23 | 0.46–0.99 (1.53) |
Table 2. Model F against the engine, per cell (paper App. B, Table 3): measured ranges over seeds against model F's prediction; is the mean served prompt in tokens. Retrospective; no parameter fitted to any trap measurement. The last column gives the measured backlog slope over model F's , with the quasi-static reading in parentheses.
Blind Tests
We then tested the theory blind in outcome: the predictions were frozen before the runs they score existed. Each test carries its status from the paper's evidence ledger, with its caveats.
Tool-slowdown traps (pre-registered, blind in outcome; tolerances set on earlier runs). Across the four blind runs trapped by a tool slowdown alone, pre-set scores S1–S4 pass in both cells and S5 is close in 3 of 4. The per-run slope check failed in 2 of 4 runs.
Which seeds a slowdown traps (pre-registered, two frozen predictors). Outcome: NO-TRAP, as the simulator said, seed by seed; the first-principles fluid verdict, TRAPS, missed.
Cut traps, CUT-A and CUT-B (pre-registered, blind in outcome; the rule was fixed after the predictions were read). Cutting arrivals into : all three CUT-A runs stayed stuck to the end at zero hits, and all three seeds were theory-favoured. Cutting below capacity: all three CUT-B runs were still stuck at 8700 s, with 140, 77 and 89 sessions present against model F's 139, 79 and 94. Intermediate readings fit as well; what singles out model F against them is post hoc.
Figure 9. MIRROR at 1.65 (paper Fig. 4): the standard workload's three committed traps (gray), model F's frozen predictions for the step-capped workload (blue, dashed) and the MIRROR runs (orange). (a) Completions per 300 s bin; (b) sessions in the system.
Two Ways Out
In model F, Corollary 3 says a cut in arrivals must land below to drain the queue. We illustrate it in the all-miss fluid for the 300k cell at 1.65 , where , cutting at 5000 s with a backlog of 251. This is model output, not engine data.
| Cut to | Backlog after the cut (model F) |
|---|---|
| dips to 250.7 (−0.3%), then grows to 445 by 30,000 s | |
| dips to 246 (−2%), then grows to 352 | |
| dips to 241 (−4%), then grows to 295 | |
| dips to 237.6 (−5.5%), then grows to 261 | |
| undershoots to 234.6 (−6.7%), settles at 238.7 | |
| drains slowly; empty at 59,655 s, the busy period |
Table 3. Corollary 3 illustrated (paper App. A). Every cut at or above leaves the trap growing or level; only a cut below it drains, after a busy period that diverges as the cut approaches .
On the engine we tested two exits. Refusing arrivals works by shedding: a 600 s stop refused 56–59 sessions and left both runs stuck; a 3600 s stop refused 355–378 and left both good. A session cap restores reuse instead. Engaged inside an established trap, it holds the admitted sessions below the all-miss onset , so their turns hit again, and the excess waits at the client.
The cap comes off once both client queues have been empty for 300 s. Rows of Table 4 below the release row are descriptive, computed after the registered verdict.
Figure 10. Trap, rescue, release and persistence (paper Fig. 3): the registered rescue tests R1 (300k pool; 1.35 and 1.65 , cap 20 from 1800 s) and R4 (native pool; 4.0 , cap 64 from 2100 s), seed 0 of each cell. Top, follow-up hit fraction; bottom, outstanding work, for the rescue run and the same-seed BURST and NOBURST runs. Green shading: cap engaged; gray: the registered post-release interval.
| R1, 300k, 1.35 | R1, 300k, 1.65 | R4, native, 4.0 | |
|---|---|---|---|
| cap; engaged at | 20; 1800 s | 20; 1800 s | 64; 2100 s |
| rescued (relapses) | 3/3 (0) | 3/3 (0) | 3/3 (0) |
| release (s) | 3980–4550 | 4430–4920 | 5980–6140 |
| after release, hit fraction: rescue / NOBURST / BURST | 0.999–1.000 / 0.999–1.000 / 0.000 | 0.994–1.000 / 0.991–1.000 / 0.000 | 1.000 / 1.000 / 0.000 |
| after release, mean outstanding: rescue / NOBURST / BURST | 1.9–2.2 / 1.9–2.2 / 195–219 | 2.5–2.8 / 2.5–3.1 / 272–317 | 8.8–11.8 / 8.8–11.8 / 1133–1178 |
| sessions paused | 121–130 | 138–143 | 220–251 |
| delay (session-hours) | 38–65 | 50–78 | 222–230 |
Table 4. The rescue tests R1 and R4 (paper App. E.7). After release, the rescued runs match NOBURST, while the never-capped BURST runs stay at zero hits.
Visualizing the Trap and the Rescue
To see a trap form and a session cap rescue it, we run the paper's simulator on two copies of the same engine, side by side.
Figure 11. Both engines get the same agent traffic: 846 sessions at 1.35× the measured all-miss rate, plus a burst of 200 at 1,200 s. The top engine is left alone and stays at zero hits to the end. The bottom one gets the paper's rescue cap of 20 sessions at 1,800 s: its hits come back by 1,890 s, drop out again while the gate drains the backlog, and hold from 2,940 s; the cap comes off at 4,070 s and the engine stays good. Over the last 3,000 s the trapped engine's turns average 9,254 prompt tokens, against 9,324 in model F and 10,469 in the normal turn mix. The site's checks run the same code against the paper's Python engine and get identical counts.
The run was chosen from 40 seeds as one in which every burst session finishes before the end, the cap comes off inside the paper's engine range, and the completion rate is closest to model F's. Over 40 further seeds that played no part in the choice, every engine that gets the burst and no cap is stuck at zero hits, the trapped engines' served prompts average 1.03 times model F's, and their completion rates average 1.12 times the all-miss capacity, from 0.95 to 1.31.
Conclusions and Limitations
A burst of agent sessions can leave a prefix-cached LLM serving engine missing every turn, at a load it served before. In registered tests on two engines, two GPUs and two models, a 200-session burst left the engine at zero hits to the end in all 30 runs. For an idealization of the trapped state, model F, we proved that the cycles along FIFO orbits obey a linear renewal recursion whose Perron root fixes the dynamics: every trapped state converges to a self-similar regime in which the turns served are young and short. For our workload this gives a youth premium, so in the model a trap's measured throughput overstates the recovery threshold. Of the two exits, refusing arrivals sheds sessions, while a session cap rescued 9 of 9 established traps at the same load without shedding, and the engine stayed good after release.
Limitations:
Model F is an idealization, and the paper does not prove that the engine converges to it. It leaves out concurrency, preemption and the transitions into and out of the trap. In the registered window, about 33–37 generations after the burst, a transient of order 10% remains for this workload.
The premium is proved positive for ; below that it rests on a floating-point bracket and a first-order expansion. The repository's theory tests check most statements numerically, but not the exact identity of Lemma 1, Theorem 1(b), Remark 1, Corollary 3 beyond the subcritical busy period, or the monotonicity statements of Theorem 2.
Why the trap persists, the gap outrunning the pool turnover, is a heuristic consistency argument, not part of the theorem. "Stays stuck" always means within the run's horizon.
The match with the 57 stuck runs is retrospective. Among the blind tests, the CUT rule was fixed after the predictions were read, the tool-slowdown per-run slope check failed in 2 of 4 runs, and MIRROR's workload was chosen with the model.
One registered trap rule failed (Llama-3.1-8B at the lower rate), as did the first tool-slowdown rule. The tests use a synthetic workload with random token ids and no shared prefixes (MIRROR caps its steps), on two engines, two GPUs and two models.
Code, Data and Registrations
Our public repository holds the code, the data and the registrations behind the
paper. Tag trap-arxiv-v1
is the commit the preprint describes. (The repository's name comes from an earlier draft of the
paper, withdrawn before it was announced.)
Clone it and run the tests; a clone needs about 15 GB of free disk space, and Windows instructions are in the README.
git clone https://github.com/AkshatValse/surviving-llm-stampede.git
cd surviving-llm-stampede python3.12 -m venv .venv # Windows: py -3.12 -m venv .venv
echo .venv/ >> .git/info/exclude
source .venv/bin/activate # Windows: see below
python -m pip install -r env/requirements-local.txt
python -m pytest The suite has about 1,950 tests and takes about 25 minutes on the authors' Windows PC, where 32 fail for platform reasons.
One command, run from the root of a clone, checks every registration against the commits GitHub's
push log recorded. It should end with 28 proofs, 0 failures (exit status 0).
python provenance/registration-proofs/verify.py
The first command below recomputes 13 of the 16 tables in paper/derived/; the second
rebuilds Figures 1 and 5–8 of the paper.
python figures/paper/derived_numbers.py
bash figures/paper/build_all.sh 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.
Citation
To cite the preprint:
Akshat Valse and Ali Jannesari. Inside the Trap: A Renewal Law for Prefix-Cache Collapse in LLM Agent Serving. arXiv:2611.08902 [cs.DC], November 2026.
@misc{valse2026inside,
title = {Inside the Trap: A Renewal Law for Prefix-Cache Collapse in {LLM} Agent Serving},
author = {Valse, Akshat and Jannesari, Ali},
year = {2026},
eprint = {2611.08902},
archivePrefix = {arXiv},
primaryClass = {cs.DC},
url = {https://arxiv.org/abs/2611.08902}
}
MIRROR (pre-registered, blind in outcome; the workload was chosen with the model). Theorem 2 says the premium can reverse. With a 20-step budget, T=min(Geometric(1/1000),20), model F's asymptotic D/λmiss at 1.65 λref is 0.771 (H=0.699, Γ=1.103), below 1. Outcome: PASS at both rates, RENEWAL in 3 of 3 seeds each. In the last part of each run, the MIRROR runs at 1.65 λref completed 0.50–0.61 λref, below the measured capacity of 1.06 λref (Figure 9a). That is a transient lull: MIRROR measures it, not the asymptotic D (0.81 λref in model F), and rejects only the throughput-curve readings. For that same window, [6600,8700) s, model F driven by each seed's arrival plan had predicted 0.49–0.60 λref before the runs existed.
Model F's dashed lines in Figure 9 were frozen under tag
r16-mirror-regbefore any MIRROR job. Select MIRROR in the calculator above to recompute 0.771 (it gives 0.7705, within the rounding of the stated capacity 1.046 λref).