Skip to content
all longreads
Longread#MLSystems#PlatformEngineering

LLM Inference as a Distributed System: From KV Cache and vLLM to Phase Disaggregation

Why a fast forward pass is not yet a fast service, how the university-built vLLM turned KV memory into a managed resource, and why a modern cluster may separate prompt processing from generation—or deliberately keep them together. This is the history of inference moving from a model function to a distributed system with queues, state, and SLOs of its own.

20 August 2026≈ 36 minprimary sources ↓

The research and tool state were checked against sources on 8 August 2026. Every paper figure applies only to the authors' models, accelerators, input distributions, and baselines. Project and company results are treated as vendor claims; 2026 preprints are signals of direction, not established production norms.

01

LLM inference is not a single model pass

In the textbook definition, inference begins after training: parameters are fixed, an object arrives, and the model returns a prediction. For gradient boosting, an image classifier, or a modest neural network, that definition is close to the operational unit of work. A server can collect independent inputs, run one bounded pass, return fixed-shape results, and release request memory.

An autoregressive LLM is still a function physically, but serving it is no longer one call. The model first processes the entire prompt, emits one token, appends it to context, and invokes almost the whole model again. Output length is unknown. The user expects a stream. Other requests arrive with different lengths and priorities, while short sequences free their slots before long neighbors.

diagram 01 · one bounded pass versus a request with growing state
Classic ML inference versus LLM inferenceTHE REQUEST CHANGED SHAPECLASSIC ONLINE MLone bounded forward passAUTOREGRESSIVE LLMprefill + a serial token loopINPUTfixed tensor / rowSTATEusually request-localOUTPUTfixed shape or small setPRIMARY SLOlatency + requests/sINPUTvariable prompt + shared prefixesSTATEKV cache grows every tokenOUTPUTunknown length + streamingPRIMARY SLOfirst token + token cadence+ goodputThe model is still a function; the service becomes a stateful scheduler
Property
Unit of work
Conventional ML
One bounded forward pass
Autoregressive LLM
Prompt processing plus an unknown number of serial steps
Property
Output shape
Conventional ML
A fixed tensor, class, or small set
Autoregressive LLM
A variable-length token stream
Property
Request state
Conventional ML
Usually released after the pass
Autoregressive LLM
The KV cache grows with each token; when work pauses, it is retained or offloaded so generation can resume
Property
Batch lifecycle
Conventional ML
The batch lives until all items finish
Autoregressive LLM
The batch should be rebuilt after every iteration
Property
Primary metric
Conventional ML
Request latency, queries per second, cost per example
Autoregressive LLM
Time to first token, subsequent-token cadence, end-to-end time, and goodput
Property
Primary resource
Conventional ML
Model-dependent; often compute
Autoregressive LLM
Prefill is usually compute-bound, decode bandwidth-bound
Property
Scaling
Conventional ML
Replicas and ordinary model/data parallelism
Autoregressive LLM
Replicas, TP/PP/EP, cache-aware routing, and phase splitting

The pivotal difference is the KV cache. Each attention layer retains keys and values for tokens already processed so the next step need not recompute the whole history. Computationally, this is an enormous saving. Systemically, it creates a large state object that grows with context length, concurrent requests, branching samples, and replica count. It must be placed, shared, evicted, transferred, or reconstructed after failure.

Average tokens per second therefore says little about the user's experience. A larger batch can raise aggregate throughput while making interactive requests wait for their first token. A service can start quickly yet emit the rest in bursts. LLM serving needs at least four views of time and capacity.

Metric
Time to First Token (TTFT)
What it measures
Request arrival to first token
What contributes
Queue, tokenization, prefill, and state transfer
Metric
Time per Output Token (TPOT) / Inter-Token Latency (ITL)
What it measures
Time between subsequent tokens
What contributes
Active batch, context length, HBM bandwidth, and interference from new prefills
Metric
End-to-End Latency (E2E)
What it measures
The full request through the final token
What contributes
TTFT plus the count and duration of decode steps
Metric
Throughput
What it measures
All requests or tokens completed per unit time
What contributes
Can rise at the expense of tail latency
Metric
Goodput
What it measures
Work completed inside the declared SLOs
What contributes
Requires simultaneous TTFT, TPOT, and workload constraints

Goodput puts the SLO back into the capacity definition: only work completed inside the stated TTFT and TPOT limits counts. That is why two configurations with identical aggregate tokens per second can have different operational value.

02

One request creates two machine profiles

After tokenization comes prefill. The model receives many prompt positions at once, computes their representations, and populates the KV cache. Large matrix operations can use the accelerator's compute units efficiently. As the input grows, more of the attention and linear-layer work is parallel—until memory behavior and operation shapes impose another limit.

After the first output token has been generated, decode produces the remaining tokens one step at a time. At each step, every active sequence contributes only one new position. Matrix operations narrow, yet the step must read weights and a growing KV cache. At typical low-to-medium load, arithmetic units wait for data from HBM and the phase is bandwidth-bound. A larger batch raises arithmetic intensity but also grows active state and often worsens TPOT.

diagram 02 · prompt processing loads compute; generation waits for memory
Prefill and decode stress different hardware limitsONE REQUEST · TWO MACHINE PROFILESPREFILLmany prompt tokens in parallelusually compute-intensiveDECODEone new token per sequenceusually bandwidth-intensiveFIRST OUTPUTTOKENTTFTqueue + prefill + handoffTPOTtime per subsequent tokenE2ETTFT + output loopSCHEDULER'S JOBtrade waiting, batching and memory without violating either SLOPrompt processing handles many positions at once; generation adds one per sequence

Weight memory is only the first budget line

A lower bound for weight memory is straightforward. For a model with P parameters represented with B bits, before runtime buffers:

M_weights ≈ P × B / 8

A 70-billion-parameter model occupies roughly 140 decimal gigabytes in BF16, or roughly 35 GB at four bits before scales, metadata, unquantized layers, and runtime workspace. Freed capacity does not all become new requests: KV state, temporary activations, collective buffers, and headroom to avoid an out-of-memory (OOM) failure remain.

KV memory for one sequence can be approximated as follows, where L is layer count, H_kv is KV-head count, D_h is head dimension, S is bytes per element, and T is processed tokens:

M_KV ≈ 2 × L × H_kv × D_h × S × T

The factor of two is K plus V. Under Multi-Query Attention (MQA), all query heads share one K/V set; under Grouped-Query Attention (GQA), each of several groups has one. Model architecture therefore fixes the cost of each active token in advance. Runtime selection cannot rely on parameter count alone: two similarly sized models with different KV-head counts behave differently at long context.

diagram 03 · the coefficients in KV-cache memory
KV cache memory formulaKV MEMORY GROWS WITH CONTEXT AND CONCURRENCY2 (K and V)×layers×KV heads×head dim×bytes×tokensMulti-Head Attention (MHA)one KV head per query headlargest cacheGrouped-Query Attention (GQA)several groups share K and Vmiddle groundMulti-Query Attention (MQA)one shared K and V setsmallest cacheFLEET BUDGETcache per token × active tokens × replicas + fragmentation + headroomThe model architecture fixes the coefficient; the workload supplies the multiplier

Four distributions matter more than one average length

  • Input length controls work before the first token and initial KV state.
  • Output length controls serial passes and the lifetime of that state.
  • Concurrency controls how much weight movement can be amortized by a batch.
  • Prefix overlap controls how much prompt work can be reused.

These axes interact nonlinearly. Ten short requests may fill tensor cores better than one long request, while ten long outputs retain KV orders of magnitude longer. High prefix overlap removes compute only after warmup and only when routing finds the right replica. A concurrency burst changes more than the queue: it simultaneously increases batch size, arithmetic intensity, and memory pressure. The profile therefore cannot be reduced to three separate means: input sequence length (ISL), output sequence length (OSL), and queries per second (QPS). It needs their joint trace with temporal correlations intact.

Long-document RAG, short-turn chat, code generation, and reasoning with thousands of output tokens are not one workload. An average of 2K input and 500 output tokens can hide rare 100K-context requests that hold memory and break the TTFT tail. A credible benchmark must replay the joint length and arrival distribution instead of looping over one string.

03

Before vLLM, the model, kernels, and scheduling evolved separately

Most techniques now exposed as engine flags did not begin with vLLM. KV caching had long supported autoregressive decoding. In 2019 Noam Shazeer proposed multi-query attention, letting query heads share K/V to reduce bandwidth. In 2023 GQA occupied a middle point: several KV groups rather than one or one per query head.

Weight sharding, pipeline execution, specialized GEMMs, fusion, and low-precision formats evolved alongside them. GPTQ compressed weights with approximate second-order information, SmoothQuant moved outlier difficulty from activations into weights for W8A8, and AWQ protected a small share of salient channels. These methods solve different problems. Weight-only INT4 reduces weight traffic and capacity but does not promise a fourfold speedup: without a fast hardware kernel, unpacking and conversion consume the saving.

FlashAttention opened another line in 2022: make exact attention faster without changing its mathematical output by tiling and reducing HBM ↔ SRAM traffic. The lesson was broader than attention. Nominal FLOPS do not determine wall time when the GPU spends most of the cycle moving data.

Approach
KV cache
Mechanism
Avoid recomputing prior tokens
Resource saved
Compute
Boundary
Memory grows with context and concurrency
Approach
MQA / GQA
Mechanism
Reduce the number of KV heads
Resource saved
HBM traffic and cache size
Boundary
The choice is baked into model architecture
Approach
Quantization
Mechanism
Store and compute at lower precision
Resource saved
Memory, bandwidth, sometimes FLOPS
Boundary
Needs appropriate kernels and quality validation
Approach
TP / PP
Mechanism
Place a model across accelerators
Resource saved
Capacity and compute
Boundary
Introduces collectives and pipeline bubbles
Approach
FlashAttention
Mechanism
Reduce HBM ↔ SRAM transfers
Resource saved
Attention data movement
Boundary
Does not solve scheduling or whole-service memory
Approach
Orca
Mechanism
Rebuild work after every iteration
Resource saved
Idle GPU time and batch waiting
Boundary
The scheduler enters the critical path

Orca changed the scheduling unit

Traditional serving often formed a static batch and waited for every request to finish. A 20-token completion next to a 500-token completion therefore waited through 480 irrelevant iterations while new work could not enter. At OSDI 2022, Orca introduced iteration-level scheduling and selective batching.

Modern continuous batching inherits that idea: completed sequences leave, new ones enter, and paused work may be preempted. This attribution matters. vLLM implemented and popularized continuous batching in an accessible engine, but it did not invent the iteration-level scheduling principle.

diagram 04 · the bottleneck moved from model architecture toward the cluster
A short history of LLM serving systemsTHE BOTTLENECK MOVED UP THE STACK2019MQAless KV bandwidth2022ORCAiteration scheduling2022FLASHATTNIO-aware kernels2023vLLMpaged KV memory2023SARATHIchunked prefill2023/24SPLITWISEDistServephase split2024SGLANGradix prefix reuse2024–26MOONCAKEDYNAMO · llm-ddistributedKV planeNo single paper replaced the previous layer; modern engines compose the ideas
04

vLLM brought virtual memory to the KV cache

In spring 2023 LMSYS served Vicuna and Chatbot Arena on a constrained university GPU fleet. According to the original vLLM announcement, the Hugging Face Transformers backend became a bottleneck as traffic grew. The UC Berkeley team built vLLM and integrated it with FastChat. The practical question was not how to speed up one GEMM, but how to keep more live requests on the same GPUs.

KV-cache management was the obstacle. Future output length is unknown, yet a traditional allocator either reserves a contiguous maximum or accumulates external fragmentation after differently sized requests depart. The launch post measured 60–80% memory waste from reservation and fragmentation in prior systems. That figure belongs to the authors' workloads and implementations, but the mechanism is general.

PagedAttention borrows the virtual-memory analogy. A sequence sees contiguous logical KV blocks, while a block table maps them to arbitrary physical GPU blocks. Capacity is allocated as generation proceeds, so free blocks remain in a common pool and can immediately hold another request's KV state; no request reserves space for an unknown maximum in advance. Waste largely remains in the final partially filled block. Parallel samples can reference the same prompt pages and diverge through copy-on-write.

diagram 05 · on-demand blocks return KV capacity to other requests
PagedAttention replaces per-request reservations with on-demand blocksFROM RESERVED EMPTY SPACE TO A SHARED KV POOLBEFORE · CONTIGUOUS RESERVEAFTER · ON-DEMAND BLOCKSAA0A1A2BB0B1EMPTY, BUT UNAVAILABLEreserved slots and gaps cannot serve another requestPHYSICAL GPU BLOCK POOLA0B0FREEA1B1A2FREEFREEFREEFREEBLOCK TABLE PRESERVES LOGICAL ORDERfree blocks serve any requestone prefix → several copy-on-write branchesLESS EMPTY MEMORY → MORE ACTIVE SEQUENCES → HIGHER THROUGHPUTOne attention operation did not become faster; more useful work now fits in memory

Memory efficiency does not make one attention operation magically faster. It admits a larger effective batch, amortizes weight reads, and raises GPU utilization. The SOSP paper reported 2–4x throughput at comparable latency versus FasterTransformer and Orca, with larger gains for longer sequences, larger models, and multi-output decoding such as parallel sampling and beam search, where branches can share blocks for their common prefix. The launch post reported up to 24x over a basic Hugging Face backend and up to 3.5x over TGI. Those are different baselines; they cannot be collapsed into “vLLM is 24x faster.”

vLLM's second contribution was organizational. An open API, broad model support, and one serving engine gave researchers a place to integrate new kernels, schedulers, and KV-transfer paths. It became to inference what a widely used runtime becomes to a language: not the only possible implementation, but common ground on which ideas reach operations faster.

05

The trick map: each one saves a different scarce resource

A page of engine flags suggests independent speedups. The real system is a stack of interacting transformations. Quantization shrinks weights and can expose the KV cache as the next bottleneck. Prefix caching saves prefill but creates key skew and a need for locality-aware routing. A large batch raises tensor-core utilization but retains more KV state and increases the time between tokens for the slowest requests, such as the P95/P99 tail of TPOT.

Layer
Architecture
Examples
MQA/GQA, MLA, MoE, distillation
Target
Bytes per token, active parameters
Why it may not pay
Requires a different model or training
Layer
Numerics
Examples
FP8, W8A8, W4A16, FP8 KV
Target
Capacity, HBM, matrix operations
Why it may not pay
A format without a fast kernel only saves memory
Layer
Kernels and graphs
Examples
FlashAttention, fusion, CUDA Graphs
Target
IO, launches, synchronization
Why it may not pay
Gains depend on tensor shapes and GPU generation
Layer
Memory
Examples
Paging, prefix cache, RAM/SSD offload
Target
Number of active tokens
Why it may not pay
Cache hits must repay lookup and transfer
Layer
Scheduler
Examples
Continuous batches, chunks, preemption
Target
Utilization and latency tails
Why it may not pay
Priority policy can create starvation
Layer
Decoder
Examples
Draft model, Medusa, EAGLE
Target
Number of serial steps
Why it may not pay
Low acceptance makes verification overhead dominate
Layer
Cluster
Examples
TP/PP/EP, cache routing, P/D
Target
Fleet goodput
Why it may not pay
Network, topology, scale, and failures enter the service

Roofline ties a speedup to the bytes it actually removes

A useful test for any technique begins with arithmetic intensity: operations executed per byte read from memory. The performance ceiling R is the smaller of the accelerator's peak compute and intensity multiplied by memory bandwidth:

R ≤ min(P_peak, I × BW), where I = FLOP / bytes

The difference is how much useful work follows one weight read. During a long prefill, a weight tile is loaded and immediately applied to many prompt positions: one HBM transfer serves many operations, so the point sits toward the right of the chart. During next-token generation, each sequence contributes only one new position; a similar volume of weights serves far fewer operations, so memory bandwidth more often sets the speed. Batching several sequences reuses the loaded weights and moves decode to the right, but consumes more KV capacity and makes requests wait for one another. Aggregate tokens per second can therefore rise while TPOT gets worse.

diagram 06 · prompt processing and generation on the roofline
Prompt processing and generation occupy different regions of the rooflineHOW MUCH WORK FOLLOWS ONE BYTE READ?PERFORMANCE · FLOP/SARITHMETIC INTENSITY · FLOP/BYTE →MEMORY-BANDWIDTHCEILINGCOMPUTE CEILINGGENERATIONsmall batchGENERATIONlarger batchLONG PROMPTmany positions per weight readTHE PRICE OF A LARGER BATCH+ KV memory · + waitingMoving right reuses each byte for more work; it does not make the trade-off free

Quantization pays only when fewer bytes match the workload's limit and the GPU can execute the chosen format efficiently. Weight-only W4A16 often helps small-batch decode because it reduces weight traffic. W8A8 or FP8 may accelerate prefill matrix operations when suitable tensor cores exist and outliers are calibrated. KV quantization shrinks growing request state but touches attention on every step and needs a separate long-context quality evaluation. None of these effects follows from bit width alone.

Kernels, fusion, and graphs remove different overheads

A specialized GPU kernel is a program the GPU launches for one operation; it defines data layout, HBM-to-SRAM traffic, vectorization, and numeric format. Operation fusion combines several consecutive operations into one such kernel. The intermediate tensor no longer needs an HBM write and read, and the separate launch and synchronization disappear. CUDA Graphs instead reduce the launch time of a repeated kernel sequence.

Deep fusion means combining a long operation chain into one kernel. The longer the chain, the more registers and shared memory it needs, so fewer blocks may execute concurrently. Such a kernel is also harder to adapt to new model architectures. Engines therefore retain multiple execution paths and dispatch by shape. A variable length, rare branch, new adapter, or uncommon batch size may return execution to an eager path.

diagram 07 · kernels, fusion, and CUDA Graphs remove different execution costs
GPU kernels, operation fusion, and CUDA Graphs accelerate different parts of executionTHREE LEVELS · THREE SOURCES OF SPEEDUPGPU KERNELONE OPERATIONgeneric layout and formatSPECIALIZED KERNELlayout · SRAM · vectorsaccelerates the operation itselfOPERATION FUSIONA → TENSOR IN HBM → Bwrite · read · synchronizeONE KERNEL: A + Bno intermediate tensorremoves data movementCUDA GRAPHCPU → K1 · CPU → K2 · CPU → K3three separate launchesCPU → GRAPH [K1 → K2 → K3]one repeatable launchremoves launch overheadThe three optimizations compose, but none substitutes for the other two

The parallelism strategy determines what accelerators exchange and how often

There are two fundamentally different ways to distribute work. TP, PP, and EP split one model pass across accelerators: a request completes only through their joint execution. Replicas instead perform complete passes and split independent requests. The choice therefore changes the network path, synchronization points, and source of idle time.

With tensor parallelism, parts of one matrix operation run at the same time. In the variant shown, each GPU computes a partial result and all-reduce sums the partials before the next layer. This lowers weights and compute per GPU, but makes a collective part of nearly every layer. During a short decode step, interconnect latency can consume the compute saved by sharding.

diagram 08 · tensor parallelism: a collective inside the layer
Tensor parallelism splits a layer and synchronizes its resultSPLIT ACTIVATION + MATRIX ROWS · SUM PARTIALSACTIVATIONsplit: x₀ · x₁ · x₂GPU 0 · x₀ × W₀partial output y₀GPU 1 · x₁ × W₁partial output y₁GPU 2 · x₂ × W₂partial output y₂ALL-REDUCEsum partial resultsinside the layerNEXTLAYERGAINless compute and model state per GPUPRICEa collective on almost every stepThe layer becomes faster only while the interconnect keeps up

Pipeline parallelism sends a request through consecutive layer groups on different GPUs. The batch is split into microbatches so stages can run concurrently. The edge stages idle while the pipeline fills and drains, and unbalanced layer groups create additional bubbles. PP therefore works best with enough microbatches and a predictable workload.

diagram 09 · pipeline parallelism: activations between stages and bubbles
Pipeline parallelism passes activations between layer groupsSPLIT THE LAYERS · KEEP THE STAGES BUSYSTAGE 1 · GPU 0consecutive layer group 1STAGE 2 · GPU 1consecutive layer group 2STAGE 3 · GPU 2consecutive layer group 3ACTIVATIONSACTIVATIONSMICROBATCHES OVER TIME →STAGE 1μ1μ2μ3BUBBLEBUBBLESTAGE 2BUBBLEμ1μ2μ3BUBBLESTAGE 3BUBBLEBUBBLEμ1μ2μ3MORE MICROBATCHES → SMALLER BUBBLE SHAREUnbalanced stages and pipeline fill/drain time leave accelerators idle

Expert parallelism applies to MoE models. A router selects experts for each token; token data travels to the GPUs that own those experts and returns after computation. The network is therefore used twice. If one expert is selected more often, it queues work while other GPUs remain underused: activating fewer parameters does not by itself balance the system.

diagram 10 · expert parallelism: all-to-all exchange and routing skew
Expert parallelism routes each token to selected expertsROUTE TOKENS · DISPATCH + RETURN · WATCH THE SKEWTOKENS8 tokensROUTERselects expertsALL-TO-ALLdispatchto expertsEXPERT 0 · GPU 02 tokensEXPERT 1 · GPU 15 tokens · queueEXPERT 2 · GPU 21 tokenALL-TO-ALLreturnto source ranksCOMBINEtoken resultsROUTING SKEW → SOME EXPERTS WAIT WHILE ANOTHER QUEUESOnly selected experts compute, but token data crosses the network twice

A replica instead receives an independent request and performs the complete pass within its accelerator group. Replicas do not exchange data on every token; a load balancer only chooses a destination for a new request. This scales request throughput and isolates tenants or failures, but every replica group holds another copy of the model. TP, PP, or EP may still be used inside a replica.

diagram 11 · replicas: independent requests without inter-replica exchange
Replicas split the request stream, not one model passONE REQUEST STAYS INSIDE ONE REPLICA GROUPREQUEST STREAMR1 · R2 · R3independentLOAD BALANCERone request →one replicaREPLICA Aits own accelerator groupcomplete model passREPLICA Bits own accelerator groupcomplete model passREPLICA Cits own accelerator groupcomplete model passINDEPENDENTRESPONSESNO INTER-REPLICA EXCHANGE DURING THE PASSA replica may occupy one accelerator or its own TP/PP accelerator group

The optimal layout may differ between prefill and decode. A long prompt can keep a wide TP group busy, while a short decode step may spend more time in collectives than it saves in compute. This is a reason to evaluate phase disaggregation, not proof that it will help. First benchmark layouts in which both phases remain in one pool: TP alone, TP with PP, and—for MoE—EP as well. Separate pools are justified only when two specialized layouts outweigh KV transfer and the additional queue.

Multi-LoRA turns one base model into a multi-tenant service

Multi-LoRA serves several fine-tuned variants of one base model at the same time. The server keeps one copy of the base weights and applies the selected LoRA adapter—a small set of low-rank deltas—for each request. That saves HBM relative to one replica per tenant and lets different adapters share a batch. The cost appears in scattered reads from different deltas, loading cold adapters, more complex kernels, and fairness scheduling. If the active adapter set is large or traffic is highly skewed, the adapter cache and queue become the next bottleneck. The mechanism preserves the behavior of each adapter, but it cannot fix a tokenizer mismatch, a different base-model revision, or incompatible quantization formats.

Offload and tiered caches trade capacity for latency

Once HBM is full, weights, adapters, or KV can be moved to host memory, local storage, or a remote cache. The service can then retain more state than GPU memory can hold, but off-device data is slower to access. It must be brought back into HBM before computation, so lookup, queueing, and the RAM, storage, or network-to-GPU transfer path determine the cost. For a large prefix, one fast transfer may beat recomputation; for a short continuation, finding a remote block can take longer than rebuilding it.

In a cluster, locality conflicts with load balance. A router that always selects the hot cache overloads a popular replica; one that always selects the shortest queue destroys computation reuse. Distributed inference systems with KV-cache-aware routing address this conflict. Preble is a research serving system for scheduling requests with shared prefixes; llm-d is an open Kubernetes-native stack whose router considers both prefix-cache state and replica load. Their scope differs, but the principle is the same: choose a destination from cache locality and queue pressure together rather than applying a blanket “cache first” rule. The right result is the goodput improvement after misses, evictions, block duplication, and index recovery time are included.

Chunked prefill attacks stalls, not the amount of compute

When a scheduler inserts a long prompt between steps of active completions, TPOT spikes. SARATHI split a large prefill into chunks and inserted one into a decode-maximal batch. At OSDI 2024, Sarathi-Serve reported serving-capacity gains under tail-latency SLOs: 2.6x for Mistral-7B on one A100, 3.7x for Yi-34B on two A100s, and up to 5.6x for Falcon-180B with pipeline parallelism against the authors' selected baselines. These are three experiments, not multipliers for one deployment.

diagram 12 · four serving levers measured on four non-composable axes
Four serving levers measured on four different axesFOUR SERVING LEVERS · FOUR DIFFERENT METRICSEach row is a separate benchmark with its own baselineMETRICLEVERMEASURED RESULTTHROUGHPUTPAGED ATTENTION2–4×at equal latencySERVED LOADCHUNKED PREFILL2.6–5.6×under the same tail SLOTIME TOFIRST TOKENCACHE-AWAREROUTING92.551s → 0.542sP90, versus random routingINPUT-TOKENPRICEKV-CACHEREUSE≈10× CHEAPERfor a cached tokenRead each row left to right · results from different benchmarks must not be multiplied

Prefix reuse turns computation into placement

SGLang introduced RadixAttention: retain KV for shared prefixes in a radix tree and reuse them across calls in a language-model program. A few-shot template, common system instruction, or shared RAG document can avoid most prompt computation. On one GPU the policy is lookup plus eviction. In a cluster the request must reach a replica that already owns the prefix without turning that replica into a hotspot. Preble adds global scheduling based on recomputation cost and fairness.

Speculation changes the number of serial target passes

Speculative decoding uses a cheap draft model to propose several tokens; the target verifies them in parallel and accepts a valid prefix without changing its target distribution. Medusa adds several heads to the target; EAGLE predicts penultimate-layer features. Their economics depend on acceptance rate, draft cost, verification batch, and the original bottleneck. If the target is already compute-bound on a large batch, extra verification can reduce throughput even while improving one request's latency.

  • Freeze a baseline with identical model, sampling policy, and request trace.
  • Change one layer and measure TTFT, TPOT, goodput, memory, and quality together.
  • Test interactions: quantization × kernels, chunk size × scheduler, cache × router.
  • Never multiply vLLM, Sarathi, EAGLE, and cache figures from different papers.
06

Phase disaggregation began with incompatible machine profiles

By late 2023 a shared GPU pool was coupling two decisions that operators wanted to make independently. Fast TTFT for a long prompt benefits from high compute and one tensor/pipeline-parallel plan. Stable TPOT needs memory bandwidth, another batch shape, and sometimes a cheaper accelerator. One compromise plan either harms one phase or reserves excess capacity for both.

Disaggregated inference gives prefill and decode independent worker pools. A prefill worker constructs KV, state moves to a decode worker, and that worker continues the sequence and streams output. This is not pipeline parallelism. PP places layers of one model pass on different devices; phase disaggregation assigns whole temporal phases of a request to separate replicas of the model.

Papers often abbreviate this architecture as P/D: P (prefill) processes the input context and builds the KV cache, while D (decode) generates tokens step by step from that state. The full phase names are used below whenever the abbreviation would hide the mechanism.

Splitwise made the first explicit phase-splitting proposal

Microsoft's Splitwise preprint appeared on 30 November 2023. It characterized compute-intensive prompt computation and memory-intensive token generation, proposed placing them on different machines, selecting GPU generations independently, and transferring state over a fast cluster interconnect. Its objectives included throughput, cost, and power.

On 18 January 2024 DistServe independently framed the problem through SLOs: remove interference, select phase-specific resources and parallelism, and maximize goodput under TTFT and TPOT constraints. Its experiments reported up to 7.4x more served requests or a 12.6x tighter SLO than selected systems while meeting constraints for more than 90% of requests. Those results describe large configurations, not a promise for two GPUs.

diagram 13 · prompt processing and token generation in one pool, in chunks, or in separate pools
Three strategies for prompt-processing and generation interferenceTHREE ANSWERS TO THE SAME INTERFERENCEONE SHARED POOLSAME WORKERSPROMPTPROCESSINGTOKENGENERATIONKV stays localsimple · phases interfereCHUNKED PROMPTPROMPTCHUNKONEGENERATIONSTEPPROMPTCHUNKless blockingboth phases share a poolSEPARATE PHASE POOLSPROMPTPROCESSINGPOOLKVTOKENGENERATIONPOOLindependent capacity + SLOscost: network + rate matchingMEASURE PHASE INTERFERENCE FIRST → THEN CHOOSE THE DESIGNDisaggregation is a conditional architecture choice, not a maturity level
Strategy
Colocated pool
Strength
Simple, KV stays local, easy to start
Cost
Long prefills stall active decodes; both phases share one parallelism plan
Strategy
Chunked prefill
Strength
Controls stalls without inter-node KV transfer
Cost
Chunk size must be tuned; TTFT and TPOT still share one pool
Strategy
Separate prompt-processing and generation pools
Strength
Independent capacity, parallelism, and SLOs
Cost
KV transfer, rate matching, topology, more failures, and more operational state

The full request path is longer than the KV handoff between pools

The ingress router first chooses the model, adapter, and eligible pool, then checks whether a suitable prefix already exists. A miss enters the prompt-processing queue. After tokenization and prompt processing, the worker records the block map, numeric format, positional parameters, and continuation point. Only then can it select a token-generation replica based on free slots, topology, and existing state. The receiver confirms KV ownership before streaming begins; otherwise a failure between transfer and first token leaves the system without an unambiguous owner for the request.

A lower bound on transfer time is KV size divided by effective network bandwidth, plus queueing, connection setup, and protocol metadata. Effective bandwidth is almost always below the link's label: requests share the channel, blocks arrive unevenly, and the protocol may introduce extra copies. Block-wise or layer-wise transfer lets D start before P fully completes, but introduces backpressure: generation must not run ahead of the layer state it needs.

T_KV ≈ M_KV / BW_NET + T_QUEUE + T_PROTOCOL

Rate matching begins with two service rates: input tokens per second that P turns into KV, and active sequences that D can advance without violating TPOT. A sufficient mean rate does not guarantee stability. A burst of long prompts fills the transfer buffer, while long outputs retain D slots after P has finished its work. The system needs admission control, quantile headroom, and per-queue scaling, but those decisions must coordinate so that a new P worker does not overload the old D pool.

Recomputation remains a first-class recovery policy. For a short prompt, rebuilding KV on D may be cheaper than locating a remote copy; for a long shared prefix, replication or a durable cache tier is better. The policy must include block age, probability of a later turn, network cost, and accelerator queueing. Phase separation thereby turns a local memory object into a distributed contract: who owns a block, who may delete it, and which event means the request can safely continue.

Mooncake made the KV cache the center of architecture

In June 2024 Moonshot AI published Mooncake, the platform behind Kimi, combining disaggregated prefill with a distributed KV cache and tiered memory. The story was no longer merely about two GPU pools. KV became a data-plane object: blocks need indexing and placement across HBM, host memory, and storage, while the router needs cache affinity as well as load.

P/D-Serve described operating across tens of thousands of xPUs: dynamic prefiller/decoder ratios, rejection forwarding, and optimized device-to-device transfer. By 2025–2026 Dynamo and llm-d were packaging the same ideas into open orchestration layers above vLLM, SGLang, and TensorRT-LLM. The inference engine executes the model; a distributed runtime owns routing, cache state, scaling, and recovery.

07

KV transfer turns acceleration into a distributed-systems problem

Disaggregation removes local interference and creates a mandatory handoff. State volume grows linearly with input tokens and the model's KV coefficient. If a P node produces tens of gigabytes of KV faster than the fabric can deliver it to D, the queue merely moves from the model scheduler to transport. TTFT now includes both pools, metadata coordination, and KV movement.

DistServe therefore places phases with bandwidth in mind, Mooncake builds a separate transfer engine, vLLM exposes connectors over NIXL, Mooncake, and LMCache, and Dynamo separates request, control, and state planes. With NVLink/NVSwitch inside a domain and RDMA across nodes, a handoff can overlap with computation and layer-wise transfer. On ordinary Ethernet or a congested fabric the advantage can disappear.

diagram 14 · the data path and failure states of a P/D service
Disaggregated inference data pathTHE KV CACHE BECOMES A DISTRIBUTED OBJECTCLIENTstreamROUTERload + cachePREFILL POOLprompt → KV blocksTTFT budgetDECODE POOLKV → tokensTPOT budgetSSEKV TRANSFER PLANEGPU P2P · RDMA · host memory · SSDmetadata, ownership, retries, evictionRATE MATCHP capacity ↔ D capacityPLACE TOPOLOGYKV bytes ↔ link bandwidthRECOVER STATEworker loss ↔ recomputeMoving compute also creates a network, metadata and failure-recovery problem

Two production lines must be rate-matched

A P:D ratio cannot be copied from documentation. It depends on input/output ratio, reasoning length, cache hits, and target SLOs. If prefill produces KV faster than decode frees slots, D becomes the queue and P idles. For short generations, the prefiller can be hot. Scaling one phase changes pressure on the other, so an autoscaler needs arrivals, tokens in flight, and transfer backlog—not utilization alone.

Multi-turn agents break a one-way pipeline

On turn one, P → D is natural. After output, the KV state lives at D. On the next turn a user appends a small fragment: a canonical P/D design may send old state back to P for append-prefill and then forward it to D again. In an agent loop with tool calls, those bounces can dominate compute. The 2026 PPD preprint sometimes runs append-prefill on D; Load-Aware Prefill Deflection moves some new prefills to D when queueing and transfer cost more than local interference. These are hybrids, not repudiations of phase specialization.

Failure is a state-ownership question

If P dies before a confirmed handoff, the prompt can be replayed. If D dies after transfer, the system must locate a KV copy, restore it from another tier, or recompute the prompt. A stale cache index sends an affinity-routed request to an empty replica. Scaling down a node that holds a hot prefix can spike TTFT without any traffic growth. A production design must define block ownership, metadata lifetime, handoff idempotency, and partial-transfer behavior explicitly.

The paper Revisiting Disaggregated LLM Serving adds another caveat: performance and energy gains are not guaranteed and depend on workload, transfer path, and baseline. In its measurements, phase-specific frequency control did not offset the system's extra energy. “Disaggregation saves GPUs” is therefore a hypothesis until a trace, topology, and SLO prove it.

08

By 2026, a composition of control loops had won—not one topology

A modern engine such as vLLM or SGLang combines continuous scheduling, optimized attention/GEMM/MoE kernels, multiple weight and KV formats, prefix caching, speculative decoding, and several parallelism strategies. Above it, a cluster runtime may add cache-aware routing, tiered memory, autoscaling, and P/D. Models are increasingly designed for serving too: GQA/MLA reduce KV, MoE reduces active parameters, and multi-token prediction supports speculation.

This does not mean every deployment should reproduce a hyperscaler's architecture. A single node with a colocated engine avoids KV transfer and has fewer failure modes. Chunked prefill often provides enough TPOT control. Prefix caching may matter more than P/D when the workload has a huge shared prompt. Disaggregation pays when scale can independently fill both pools and TTFT and TPOT genuinely need different plans.

Encoder disaggregation extends the idea but changes the transferred object

A multimodal LLM adds a vision or audio encoder that creates embeddings before the text decoder performs prefill and generation. vLLM's Disaggregated Encoder documentation describes an E/P/D topology: the encoder gets its own pool and transfers an embedding cache into prefill and decode instances. This reinforces phase specialization but does not make P/D details universal for diffusion or speech. Each family has its own state, recomputation boundary, and step granularity.

The next frontier splits attention, FFN, and experts

2026 preprints model deeper attention/FFN disaggregation and heterogeneous accelerators for the same reason: phase arithmetic intensity and communication differ—see Song et al. and the limits of AFD. The finer the boundary, however, the more often tensors cross the network and the more the system depends on a specialized interconnect. This is a co-design research direction, not a recommendation to build four-way disaggregation today.

Model → local engine → KV plane → router → capacity planner → SLO

The central shift is that inference is no longer a library function at the end of an ML pipeline. It is a distributed system in its own right: the model fixes state size and viable formats, hardware fixes the roofline and topology, the runtime fixes work order, and the product fixes request distributions and SLOs. Optimizing one layer works only until the next bottleneck.

09

Selection starts with a trace, not an engine name

The practical sequence begins with production replay. Capture the joint input/output length distributions, arrival process, concurrency, shared-prefix rate, multi-turn distance, and agent pauses. Then define SLOs and the cost of violation. Only then compare variants while holding model, sampling, quality, and request set constant.

Observation
The model fits one node and load is moderate
Next experiment
One engine, continuous batching, TTFT/TPOT measurement
Constraint
Do not pre-build a distributed KV plane
Observation
System and RAG prefixes repeat heavily
Next experiment
Prefix cache plus locality-aware routing
Constraint
Measure real hit rate and key skew
Observation
Long inputs damage the interval of active decodes
Next experiment
Try chunked prefill first
Constraint
Tune chunk size on a production-trace replay
Observation
TTFT and TPOT need different parallel plans
Next experiment
Model and test P/D disaggregation
Constraint
Include KV transfer and capacity headroom
Observation
Agents often wait for tools or people
Next experiment
Preserve/offload state and route continuation to its cache
Constraint
Do not bounce KV through P and D every turn by default
Observation
An MoE model does not fit or balance
Next experiment
Start with expert parallelism and topology-aware placement
Constraint
Do not confuse model sharding with request-phase splitting

A minimum comparison protocol

  • Establish a baseline on one colocated runtime without experimental flags.
  • Split TTFT into queueing, prompt processing, transfer, and first-byte delivery.
  • Split TPOT by batch size, active KV length, preemption, and new-prefill interference.
  • Replay a representative trace to stable P50/P95/P99, including warm-up and cold starts.
  • Validate quality after quantization/speculation and resilience after worker loss.
  • Compute goodput per GPU and fully loaded cost, not the best isolated tokens/s.
Layer
Profile
Record
input/output length (ISL/OSL) P50/P95/P99, arrivals, concurrency, prefix overlap
Validate
A representative trace, not one synthetic prompt
Layer
Latency
Record
TTFT, TPOT, and E2E percentiles
Validate
Separate queue, compute, KV transfer, and streaming
Layer
Capacity
Record
SLO-constrained goodput per GPU
Validate
Separate P and D, idle share, and headroom
Layer
Memory
Record
Weights, KV, fragmentation, hits, and evictions
Validate
Treat HBM, host RAM, and storage as separate tiers
Layer
Quality
Record
Regressions from formats and decoding methods
Validate
The same task set and sampling policy
Layer
Resilience
Record
Worker loss, KV loss, overload, and scaling
Validate
Recovery time and recomputation volume
Layer
Economics
Record
Cost per useful million tokens and request
Validate
Include network, idle capacity, reserve, and platform labor

The scorecard should not crown a universal winner among vLLM, SGLang, and TensorRT-LLM. It should prove that a particular runtime, format, scheduler, and topology sustain your profile. On one platform vLLM may have the required model coverage, SGLang the best prefix reuse, and TensorRT-LLM the strongest specialized kernel; after a model update the order can change. The durable contract is a reproducible trace and SLO, not the project name.

For a small fleet, the sensible default is intentionally boring: one validated model, a colocated engine, continuous batches, an appropriate numeric format, chunked prefill for long inputs, and a prefix cache where repetition is measured. Cache-aware routing comes with multiple replicas. P/D follows only when the profile shows a stable TTFT/TPOT conflict and the fabric demonstrably transports KV more cheaply than recomputation.

Takeaways

Five conclusions from the history of inference

  1. 01LLM inference differs from conventional ML because of the work shape, not merely model size: one request becomes a compute-heavy prompt pass followed by a serial loop with growing state.
  2. 02vLLM shifted attention toward systems memory management: PagedAttention reduced KV-cache fragmentation and admitted more active sequences, while iteration-level scheduling had already appeared in Orca.
  3. 03No inference trick accelerates everything: quantization, kernels, caching, scheduling, and speculation target different resources and can simply move the bottleneck upward.
  4. 04Phase disaggregation emerged in Splitwise and DistServe as an answer to incompatible prefill/decode profiles; its price is a distributed KV cache, networking, rate matching, and new failure modes.
  5. 05Architecture should be selected by goodput on your trace under TTFT/TPOT SLOs: start colocated and add caching, chunking, and disaggregation only after measuring the conflict.
Sources

Papers, documentation, and evidence boundaries

Sources are grouped by mechanism rather than vendor. Every figure in the article retains its original baseline; project documentation captures feature state on the research date.

Architecture and early systems

  1. Shazeer · Fast Transformer Decoding: One Write-Head is All You Needthe 2019 paper introducing multi-query attention to reduce KV tensor size and memory traffic during incremental decoding
  2. Ainslie et al. · GQA: Training Generalized Multi-Query Transformer Modelsgrouped-query attention as a middle ground between MHA quality and MQA speed
  3. Yu et al. · OrcaOSDI 2022: iteration-level scheduling and selective batching, the historical predecessor of modern continuous batching
  4. Dao et al. · FlashAttentionexact attention made IO-aware by reducing transfers between HBM and SRAM

Quantization

  1. Frantar et al. · GPTQone-shot weight-only quantization for large generative transformers using approximate second-order information
  2. Xiao et al. · SmoothQuantmoving activation outlier difficulty into weights for W8A8 inference; gains depend on available kernels
  3. Lin et al. · AWQactivation-aware weight-only quantization and TinyChat, demonstrating the link between algorithm, weight packing, and specialized kernels

vLLM and memory management

  1. Kwon et al. · original vLLM announcementthe UC Berkeley/LMSYS origin, deployment in Vicuna/Chatbot Arena, and early Hugging Face/TGI comparisons
  2. Kwon et al. · Efficient Memory Management with PagedAttentionthe canonical SOSP 2023 paper: block-based KV management, block sharing, and 2–4x throughput over FasterTransformer/Orca in the measured configurations
  3. Kwon · vLLM: An Efficient Inference Engine for Large Language Modelsthe 2025 dissertation covering PagedAttention, the scheduler, and the engine's extensible architecture in retrospect

Scheduling and computation reuse

  1. Agrawal et al. · SARATHIthe original chunked-prefill and decode-maximal batching design for reducing generation stalls
  2. Agrawal et al. · Sarathi-ServeOSDI 2024: serving-capacity measurements under tail-latency constraints across several models and A100 configurations
  3. Holmes et al. · DeepSpeed-FastGenDynamic SplitFuse as an alternative strategy for composing long prompts and generation steps
  4. Zheng et al. · SGLangRadixAttention for shared-prefix reuse and a runtime for programs composed of multiple model calls
  5. Srivatsa et al. · Prebledistributed scheduling based on prefix-cache locality, recomputation cost, and queue fairness
  6. Prabhu et al. · vAttentiona CUDA virtual-memory alternative to PagedAttention: on-demand physical allocation with contiguous virtual addresses

Decoding acceleration

  1. Leviathan et al. · Fast Inference via Speculative Decodingexact speculative decoding: a draft model proposes several tokens and the target verifies them in parallel without changing the distribution
  2. Cai et al. · Medusamultiple extra heads build a candidate tree without a separate draft model; fine-tuning is required
  3. Li et al. · EAGLEspeculation at the penultimate-layer feature level; published speedups apply to the evaluated models and tasks

Phase disaggregation

  1. Patel et al. · Splitwisethe 30 November 2023 preprint: place compute-intensive prompt processing and memory-intensive generation on different machines and choose hardware independently
  2. Zhong et al. · DistServethe 18 January 2024 preprint: independent TTFT/TPOT resource, placement, and parallelism plans to maximize SLO-constrained goodput
  3. Qin et al. · Mooncakethe KVCache-centric architecture behind Kimi: disaggregated prefill, distributed caching, and networking as part of the data plane
  4. Jin et al. · P/D-Serveoperational P/D concerns across tens of thousands of xPUs: pool organization, rejection, dynamic phase ratios, and KV transfer

Current implementations

  1. vLLM · Disaggregated Prefillingdocumentation checked on 7 August 2026: the feature is marked experimental; it targets independent TTFT/ITL tuning and tail control, not throughput improvement
  2. vLLM · Disaggregated Encoderdocumentation checked on 8 August 2026: a separate encoder pool for multimodal models and embedding-cache transfer into prefill/decode instances; the basis for E/P/D topologies
  3. llm-d · project proposalan open Kubernetes stack around vLLM: prefix-cache-aware routing, tiered KV caching, and independently scalable xPyD topology
  4. NVIDIA Dynamo · architectureseparate request, control, and state planes, KV-aware routing, NIXL transfer, and failure recovery; project figures remain vendor claims

Limits and recent research

  1. Li et al. · Revisiting Disaggregated LLM Servingthe 14 November 2025 preprint: a systematic performance and energy re-evaluation — gains are not guaranteed and depend on workload and KV-transfer path
  2. Song et al. · Analytical Provisioning for Attention-FFN Disaggregated LLM Servinga preprint on attention/FFN disaggregation as a deeper split; the optimal pool ratio depends on the stochastic workload
  3. Liu et al. · Revealing the Challenges of Attention-FFN Disaggregationa preprint arguing that AFD is not universal: gains depend on interconnect bandwidth, expert granularity, and workload regime
  4. Li et al. · PPD Disaggregation for Multi-turn Servinga preprint arguing that later-turn append-prefill can sometimes run better on the decode node to preserve cache locality
  5. Arun et al. · Load-Aware Prefill Deflectiona preprint on deflecting some prefills back to decode nodes under queueing and expensive KV transfer; a research signal, not an established standard
Continue

Related reading

Share

This analysis continues the piece on the co-evolving AI stack, expanding inference into a system of its own.