Mingxin

How vLLM Prefix Caching Reduces Multi-Turn Inference Latency

vLLM前缀缓存推理延迟
Direct answer

vLLM's Prefix Caching mechanism reuses KV states already computed from prior conversation turns

vLLM's Prefix Caching mechanism reuses KV states already computed from prior conversation turns, measurably reducing time-to-first-token (TTFT) in multi-turn dialogue scenarios. In measured results from Mingxin FX100 on a 480B-parameter model, enabling tiered KV acceleration reduced TTFT by 26–32%【measured, report R2】. This article explains how the mechanism works, its applicable boundaries, and provides a reproducible measurement methodology.

Why Prefix Caching Lowers Latency: Memory Access, Not Compute, Is the Bottleneck

The latency bottleneck in multi-turn dialogue is not matrix computation but memory access. According to FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness, the core cost of attention is HBM bandwidth rather than compute—meaning KV Cache read/write efficiency directly determines inference latency.

vLLM's RadixAttention mechanism (per SGLang: Efficient Execution of Structured Language Model Programs) organizes conversation history prefixes in a tree structure: when a new request carries a prefix identical to one in the cache, the system directly reuses the already-computed KV tensors, skipping redundant forward computation. In multi-turn dialogue, the system prompt and historical turns form a stable prefix, with hit rates rising as turns accumulate.

Cache hits depend on token-level prefix consistency. Any minor variation—such as timestamps or randomized sampling temperature—invalidates the cache. Consequently, the mechanism yields the highest gains in scenarios with fixed system prompts and deterministic sampling parameters.

Measurement Methodology: Reproducible Validation of TTFT Reduction and Throughput Gains

Mingxin conducted signature-level tests on an 8× AMD Instinct MI308X platform (192 GB HBM per GPU), using Qwen3-Coder-480B-FP8 (MoE, ~450 GB weights) as the workload against the FX100 all-flash NVMe-oF array【measured, reports R1–R4】. Key results:

Metric Baseline (local NVMe single drive) FX100 array Change Source
TTFT p50 (conc8) 10.17s 7.53s ↓26% Measured, R2
TTFT p50 (conc16) 35.73s 26.35s ↓32% Measured, R2
Tiered KV throughput (conc8) Baseline Optimized +29% Measured, R2/R3
Tiered KV throughput (conc16, optimal operating point) Baseline Optimized +40% Measured, R2/R3
TP4×2 full-system throughput Baseline Optimized +35–36% Measured, R3

Three points on validation methodology: first, TTFT uses the p50 percentile rather than the mean to exclude long-tail interference; second, tests employ a long-context cold-restore workload—i.e., the first request after cache flush—to rule out inflated hot-cache results; third, concurrency levels must cover both 8 and 16 to observe how gains vary with load—the lower and upper bounds correspond to these two levels.

Applicable Boundaries and Selection Criteria for Prefix Caching

This mechanism is not a universal solution. Its ceiling is bounded by prefix hit rate, which depends on workload characteristics. Per Mooncake: A KVCache-centric Disaggregated Architecture for LLM Serving, prefix caching in disaggregated storage-compute architectures can further pool cross-node reuse, but this requires additional scheduling-layer support.

When selecting, first clarify constraints: SLA requirements (TTFT ceiling), context-length distribution, and concurrency patterns. If the workload is dominated by short dialogues with low prefix hit rates, caching gains are limited; if dominated by long-document Q&A or multi-turn agent conversations, gains are substantial. Mingxin FX100 measurements cover a 480B-parameter model under both TP8 and TP4×2 parallelism, but cross-platform extrapolation requires caution—different GPUs' HBM bandwidth and interconnect topologies shift where the memory-access bottleneck lies.

For scenarios requiring validation, Mingxin offers a roughly 10-week gated joint-testing process (G1 arrival acceptance through G4 72-hour stability), with primary gates being TTFT reduction ≥25% and throughput +29–40% measured in-band; failure triggers immediate stop-loss. The estimation model is reproducible in Python under NDA.

Key Q&A

Q: What is the mechanism by which vLLM prefix caching reduces latency? A: It reuses KV states already computed from prior conversation turns via RadixAttention, skipping redundant forward computation. Its effectiveness stems from the memory-access bottleneck of attention; gains depend on prefix hit rate.

Q: What TTFT reduction did Mingxin measure? A: On the 480B model under TP8 across three concurrency levels, TTFT p50 dropped from 10.17–35.73s to 7.53–26.35s, a 26–32% reduction【measured, report R2】.

Q: In which scenarios is this mechanism most beneficial? A: Hit rates are highest with fixed system prompts, long contexts, multi-turn dialogue, and deterministic sampling parameters. Workloads with short dialogues or frequently changing prefixes see limited gains.

References

  1. SGLang: Efficient Execution of Structured Language Model Programs — https://arxiv.org/abs/2312.07104
  2. Mooncake: A KVCache-centric Disaggregated Architecture for LLM Serving — https://arxiv.org/abs/2407.00079
  3. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness — https://arxiv.org/abs/2205.14135

Data sources (verifiable)

R1FX100 Comprehensive LLM Inference & Training Benchmark (8× AMD MI308X)2026-07-03
Download report PDF ↓
R2FX100 KV-Cache Benchmark (480B, TP8 long-context, signed)2026-07-05
Download report PDF ↓
R3FX100 KV-Cache Benchmark Summary (480B, TP4×2, all metrics, brand-unified edition)2026-07-06
Download report PDF ↓
R4FX100 KV-Cache Benchmark (480B, multi-instance, official, No.-006)2026-07-06
Download report PDF ↓
Generated by Mingxin's content engine with automated QC; headline numbers cite signed test reports (see the evidence library). Translated from the Chinese original. Questions or corrections: contact us.

Related articles