When running multi-turn agents behind a shared vLLM replica with automatic prefix caching enabled, teams often sample a small fraction of turns for online auditing, reward scoring, or log-probability checks using prompt_logprobs.
At 5% sampling, that looks harmless on paper. Most turns never ask for prompt logprobs, and your Prometheus prefix-cache hit rate dashboard barely moves.
This experiment tests what actually happens on the shared GPU and API server. Auditing just 5% of turns at 75% of measured baseline capacity (18.0 req/s) pushes p95 time-to-first-token (TTFT) for the other, completely unscored streaming turns up by +523.3% (6.2×) in steady state, while the reported Prometheus prefix-cache hit ratio stays pinned at 97.94% (0.00 percentage points of change).
Experiment note. All code, raw manifests, and plotting scripts are in
bajajku/vllm-prompt-logprobs-spillover(pinned to commitaa52129). Runs executed onvllm==0.34.0servingQwen/Qwen2.5-3B-Instructinbfloat16on 1× NVIDIA A100-SXM4-80GB (--enable-prefix-caching,--generation-config vllm,repetition_penalty=1.0,max_model_len=16384,gpu_memory_utilization=0.85). Across all 76 benchmark runs (58,368requests covering calibration, main sweep, and three diagnostic hunts), there were 0 errors, 0 KV-cache preemptions, 0 Hugging Facegeneration_configoverrides, and 0 mid-run Triton JIT compilations (prompt_logprobskernels fork ∈ {0, 1, 5}were warmed before prefix-cache reset and timing).
1. The mechanism and the telemetry blind spot
Three implementation details in vllm==0.34.0 combine to create both the slowdown and the monitoring gap:
- Prefix-cache read bypass: When a request sets
prompt_logprobs,Request.get_prefix_cache_hit_limit()returns0, causingKVCacheManager.get_computed_blocks()to bypass prefix-cache reads and recompute full-prompt prefill for that turn. - Telemetry exclusion:
KVCacheManager.record_prefix_cache_stats()skips requests whereprefix_cache_lookup_enabled(request)isFalse. Bypassed turns are excluded from bothvllm:prefix_cache_queriesandvllm:prefix_cache_hits. - Nonstreaming constraint:
vllm/entrypoints/openai/completion/protocol.pyrejectsprompt_logprobs > 0whenstream=True, so audited turns (and their matched controls) must hit the nonstreaming/v1/completionsendpoint.
That led to a pre-registered hypothesis before running the sweep:
- Hypothesis: At 75% of measured baseline capacity, auditing 5% of turns raises p95 TTFT for a separate, unscored streaming cohort by at least 20%, while the reported prefix-cache hit ratio moves by less than 3 percentage points.
2. Experimental design and isolation
To avoid confounding cache effects with ramp-up artifacts or client-side JSON bottlenecks, the benchmark isolates the workload along three axes:
- Stationary multi-turn workload: 24 seeded, 32-turn sessions (768 total turns per run) with staggered starting turn depths and pre-primed rollover histories. That keeps the aggregate prompt-length distribution stationary from start to finish (
4,224to8,192prompt tokens, exact6,208.0mean prompt tokens per quarter), with fixedoutput_tokens=64,ignore_eos=True, andtemperature=0.0. - OS-process cohort isolation:
- Sessions 0–15 (512 turns): The unscored streaming measurement cohort (
stream=True, never audited in any condition), executed in its own isolated OS process synchronized viaCLOCK_MONOTONIC. Nonstreaming logprob downloads and JSON parsing cannot stall streaming timers or SSE reads; streaming client dispatch lag remained tight (dlag_p95 = 1.9–2.7 msin steady state and2.45 mseven atk=5). - Sessions 16–23 (256 turns): The nonstreaming audit/control pool (
stream=Falseacross all conditions, with JSON parsing deferred strictly post-run). Audited turns form nested subsets (1% ⊂ 5% ⊂ 10%) within each replicate (audit_seed = 9000 + arrival_seed), paired against exact nonstreaming controls at0%and a5%cache-miss-only control (token0mutated,prompt_logprobsunset).
- Sessions 0–15 (512 turns): The unscored streaming measurement cohort (
- Arrivals and baseline calibration: Stationary round-robin turn-shuffled Poisson arrivals across three arrival seeds (
101, 202, 303) with boundary separation so consecutive turns of the same session never collide. Sweeping0%auditing across4–40 req/sunder an SLO ofp95 TTFT ≤ 500 msmeasured baseline capacity at24.0 req/s(p95 = 161.1 msat24 req/s, transitioning into overload at28 req/s), fixing the 75% target load at18.0 req/s.
For every run, the harness records client-side TTFT, E2E, TPOT ((t_end - t_first) / (completion_tokens - 1)), TTFB, body transfer time, dispatch lag, and response payload bytes alongside server-side Prometheus /metrics deltas before and after replay (vllm:prefix_cache_hits / vllm:prefix_cache_queries, vllm:request_prefill_kv_computed_tokens_sum, vllm:prompt_tokens_by_source{source="computed"}, vllm:num_preemptions, and fine-grained latency histograms).
3. Main sweep: 5% auditing vs. the other 95%

Unscored streaming cohort p95 TTFT (log scale, mean ± SD across 3 seeds) at 18.0 req/s. Reported prefix-cache hit rate stays pinned at 97.9% even as 10% auditing pushes the server into queueing collapse.
| Audit % | Unscored p50 TTFT | Unscored p95 TTFT (mean ± SD) | vs. 0% Baseline | Reported Hit % | True Effective Hit % | Newly Computed Prefill | Achieved RPS | Regime |
|---|---|---|---|---|---|---|---|---|
| 0% | 62.2 ms | 95.4 ± 8.9 ms | +0.0% | 97.94% | 97.94% | 98,304 tok (1.0×) | 17.84 | steady |
| 1% | 64.5 ms | 266.2 ± 28.3 ms | +179.1% | 97.94% | 96.97% | 144,555 tok (1.5×) | 17.76 | steady |
| 5% | 138.8 ms | 594.4 ± 71.6 ms | +523.3% | 97.94% | 93.10% | 329,131 tok (3.3×) | 17.40 | steady |
| 10% | 5,221.4 ms | 15,033.0 ± 3,005.6 ms | +15,664.4% | 97.94% | 88.08% | 568,192 tok (5.8×) | 12.42 | UNSTABLE |
The hypothesis is strongly confirmed:
- At 5% auditing, unscored streaming p95 TTFT jumps from
95.4 msto594.4 ± 71.6 ms(+523.3%, 6.2×) in steady state, newly computed prefill tokens rise 3.3× (98,304 → 329,131tokens), and the reported cache hit rate moves by 0.00 percentage points (97.94% → 97.94%). - Even 1% auditing (8 turns out of 768) nearly triples unscored p95 TTFT (
+179.1%). - At 10% auditing, the server enters queueing collapse (
achieved_rps = 12.42 < 0.90 × 18.0, p95 TTFT15,033.0 ms), yet Prometheus continues to report97.94%.
4. Hunt 1: Late turns hurt more than many early turns
Because session starting depths are staggered uniformly across time, we can test whether spillover scales simply with total newly computed prefill tokens or with the size of individual prefill spikes.

Unscored cohort p95 TTFT across baseline (92 ms, 98K new prefill tokens), early_24 (322 ms, 206K), early_36 (360 ms, 260K), late_5 (244 ms, 136K), and late_10 (423 ms, 176K) at 75% load.
Auditing just 10 late turns (1.3% of all turns, 176K newly computed prefill tokens) raises unscored p95 TTFT to 423.4 ± 22.9 ms (+358.5%). That is worse than auditing 36 early turns (4.7% of turns, 260K new prefill tokens, 360.4 ± 24.8 ms / +290.3%) or 24 early turns (206K new prefill tokens, 321.8 ± 22.2 ms / +248.5%), and even 5 late turns (136K new tokens) pushes p95 TTFT to 244 ms.
Tail latency here is governed by bursty per-request prefill spikes rather than aggregate prefill token count alone: a handful of deep 8K-token recomputations create longer head-of-line stalls for co-scheduled streaming turns than three times as many 4K-token early recomputations.
5. Hunt 2: Separating cache bypass, logprobs compute, and API-server serialization
A prompt_logprobs request does three distinct things: it bypasses prefix-cache reads, computes lm_head + log_softmax over the full prompt, and serializes a large JSON payload (0.48 MB at k=0, 0.87 MB at k=1, 2.44 MB at k=5 per audited turn) inside the vLLM API server. Hunt 2 isolates those components at 75% load (18.0 req/s):

3-seed medians (bars) and individual seeds (dots) comparing isolated client unscored p95 TTFT against server Prometheus p95 TTFT and queue time.
| Condition | Payload / Audited Turn | Reported Hit % | Client Unscored p95 (median) | Server Prometheus p95 (median) |
|---|---|---|---|---|
baseline_0pct |
0.00 MB | 97.94% | 90.5 ms | ~70 ms |
cache_miss_5pct |
0.00 MB | 93.01% | 461.8 ms | ~467 ms |
audit5pct_k0 |
0.48 MB | 97.94% | 536.9 ms | 483.4 ms |
audit5pct_k1 |
0.87 MB | 97.94% | 635.1 ms | 487.7 ms |
audit5pct_k5 |
2.44 MB | 97.94% | 1,468.8 ms | 901.7 ms |
Three findings stand out across the 3-seed medians (90.5 → 461.8 → 536.9 → 635.1 → 1,468.8 ms):
- Prefix-cache bypass drives most of the
k=0/k=1spillover, and Prometheus sees it whenprompt_logprobsis off. Mutating token0on 5% of turns withoutprompt_logprobs(cache_miss_5pct) raises median unscored p95 TTFT to461.8 ms(per-seed:333.6,461.8,2,339.3 ms; mean1,044.9 ms), while Prometheus accurately reports the hit-rate drop (97.94% → 93.01%). On seeds202(2,339.3 msclient /2,726 msserver), decode concurrency briefly spiraled (Running: 19 → 82 → 153 → 228 reqs) right on the18 req/sstability cliff, compounded by token-0 mutation orphaning the next non-audited turn's 128-token prefix block (+4,096to+4,480extra prefill tokens, or+1.25%–1.36%overaudit5pct). audit5pct_k0andaudit5pct_k1closely track server Prometheus p95, while telemetry goes blind. Client medians of536.9 ms(mean582.0 ± 151.8 ms) and635.1 ms(mean602.5 ± 73.3 ms) align with server Prometheus p95 medians (483.4 msand487.7 ms), while reported cache hit stays stuck at97.94%.- At
k=5, API-server JSON serialization adds a major event-loop stall. With2.44 MBper audited response, client unscored p95 surges to1,468.8 msmedian (1,297.6 ± 395.6 msmean, client p50389.6 ms) versus901.7 msmedian (886.0 msmean) on server Prometheus, a+567 msmedian (+412 msmean) vLLM API-server serialization / event-loop gap cleanly separated from client parsing (dlag_p95 = 2.45 ms). Because Prometheus histograms aggregate all768requests (including the38slow audited turns), whereas client unscored p95 measures only the512streaming turns, that+567 msgap is a conservative lower bound on API-server serialization overhead.
6. Hunt 3: Spillover across the load curve
Does this spillover only appear near saturation? Running 0% vs. 5% auditing across 35%, 50%, 75%, and 90% of measured baseline capacity (24.0 req/s) shows that even lightly loaded replicas suffer severe tail degradation:

Unscored cohort p95 TTFT for 0% vs. 5% auditing across 35% to 90% of measured baseline capacity (24.0 req/s).
| Load (% of 24.0 req/s) | Target RPS | 0% Audit p95 TTFT | 5% Audit p95 TTFT | Delta |
|---|---|---|---|---|
| 35% | 8.4 req/s | 68.0 ms | 356.9 ms | +425.0% |
| 50% | 12.0 req/s | 73.5 ms | 438.7 ms | +496.8% |
| 75% | 18.0 req/s | 92.5 ms | 605.7 ms | +554.7% |
| 90% | 21.6 req/s | 155.6 ms | 7,189.2 ms | +4,521.6% (all 3 seeds unstable) |
Even at 35% load (8.4 req/s), auditing 5% of turns pushes unscored p95 TTFT up +425.0% (68.0 → 356.9 ms). At 90% load, all three replicates collapse.
7. Scope, limitations, and operational takeaways
- High-reuse multi-turn geometry (
4,096 + 128tokens,97.94%baseline hit rate): Spillover amplification scales with the ratio of cached prefix to newly appended tokens (~48:1 here, representative of long-context coding and tool-use agents). Short single-turn prompts or low-reuse workloads will show a proportionally smaller prefill multiplier. - Model-to-GPU headroom and vocabulary size (
Qwen2.5-3B-Instructon A100-80GB): This pairing left ample KV headroom (~22% active KV utilization,0evictions/preemptions), isolating compute, queueing, and serialization contention. Tighter memory ratios (such as 70B models at high concurrency) may additionally trigger KV eviction or preemption cascades. Conversely, Qwen2.5's151,936-token vocabulary makes full-promptlm_head+log_softmaxheavier relative to a 3B backbone than on models with smaller vocabularies. - Unpinned chunked-prefill budget:
start_server.shuses vLLMv0.34.0's default--max-num-batched-tokens; tuning chunk budgets trades off per-request prefill latency against inter-token smoothness and tail spillover. - Practical mitigations:
- Isolate pools: Route
prompt_logprobsauditing or offline scoring to dedicated shadow/batch replicas rather than sharing pools with latency-sensitive streaming traffic. - Minimize
kif inline scoring is unavoidable: Returningk=5top logprobs per prompt token inflates nonstreaming payloads to2.44 MBand introduces hundreds of milliseconds of API-server serialization delay. - Watch computed-prefill counters, not just hit ratio: Alert on
vllm:request_prefill_kv_computed_tokens_sumandvllm:prompt_tokens_by_source{source="computed"}alongsidevllm:prefix_cache_hits / vllm:prefix_cache_queries.
- Isolate pools: Route
8. Reproducing the benchmark
On a Linux host with 1× NVIDIA A100-SXM4-80GB (or comparable GPU) and a Python 3.12 virtual environment with vllm==0.34.0, httpx, numpy, and matplotlib:
git clone https://github.com/bajajku/vllm-prompt-logprobs-spillover.git
cd vllm-prompt-logprobs-spillover
git checkout aa521295e4c2d7bbfa565d6e498e6e54fe5cb9ee
# Terminal 1: start vLLM v0.34.0 with prefix caching & custom buckets
GPU_ID=0 PORT=8025 ./start_server.sh
# Terminal 2: run calibration, main 4x3 sweep, 3 hunts, and plot generation
./run_experiment.shIndividual stages can also be invoked directly via benchmark.py calibrate, benchmark.py sweep, benchmark.py hunts, and plot_results.py.