Prefill-Decode (PD) Disaggregation: A Key Path to Faster LLM Inference
This article explains why disaggregating the prefill and decode stages improves large language model inference, and what it takes to make it work. It covers the resource mismatch, interference, and scaling problems of mixed deployment; the three hard engineering problems after splitting, including cross-node KV-Cache transfer, routing and batch assembly, and consistency and failure recovery; capacity planning based on TTFT, TPOT, throughput, and cost per token; heterogeneous compute and chip adaptation; observability metrics; and a four-step rollout path. Readers will learn the tradeoffs of PD disaggregation and the engineering details that determine whether it pays off.
1. Why PD Disaggregation Is Needed
LLM inference naturally splits into two stages. The Prefill stage processes all input tokens at once. It is a compute-intensive workload with high parallelism that saturates compute. The Decode stage generates tokens autoregressively, one position at a time. It is a memory-intensive workload whose bottleneck is memory bandwidth and KV-Cache reads.
Running both stages on the same GPU and the same instance creates three structural problems:
- Resource profile mismatch: compute-rich GPUs sit largely idle during memory-bound decoding, while memory-friendly GPUs are maxed out during prefill.
- Mutual interference: prefill of a long input occupies the device for a long time, causing visible output stalls for requests that are decoding. Time to first token (TTFT) and time per output token (TPOT) trade off against each other, making it hard to meet both SLAs.
- Capacity cannot scale independently: the ratio of “long input, short output” to “short input, long output” traffic shifts constantly. Mixed deployment can only scale the whole fleet as a fallback, which wastes resources.
The core idea of PD disaggregation is to split the two workloads into separate resource pools. The prefill pool pursues compute density and parallel efficiency; the decode pool pursues memory capacity and bandwidth. The two sides are connected by passing the KV-Cache. Each side can then choose suitable hardware and scale independently, and the interference problem is downgraded from a scheduling challenge to an engineering problem.
2. The Three Hard Problems After Splitting
2.1 Moving the KV-Cache Across Nodes
The context cache produced by prefill must be handed to the decode side in full, or the work is wasted. There are typically three engineering paths: point-to-point transfer over high-speed interconnects and RDMA-style networks; relaying through shared memory or a distributed cache layer; and tiered caching, where cold contexts are pushed down to a memory pool or even object storage and fetched back on a hit. A clear recent industry trend is “dual-path loading”: hot data travels over a low-latency link and cold data over a high-capacity link, with the scheduler choosing the path based on hit probability.
The transfer volume is estimable: roughly number of layers × 2 (K and V) × number of heads × per-head dimension × sequence length × bytes per element. For example, a mid-sized model under long-context conditions can easily move hundreds of megabytes per request, so network bandwidth and topology directly set the architecture’s ceiling.
2.2 Routing and Batch Assembly
The decode side’s biggest fear is “mixing large and small requests in one batch”: a single long-sequence request forces the whole batch to wait in sync. Workable approaches include bucketing by estimated output length, delayed batching with a maximum wait window, and routing extra-long requests to a separate queue. The prefill side should use chunked processing, splitting long inputs into fixed-size blocks so a single request does not monopolize the device for long.
A sketch of the routing logic (pseudocode that expresses strategy only and is not bound to any specific interface):
def route(req, pools, cache_index):# 1) Check whether the context is already cached on the decode sidehit = cache_index.lookup(req.prefix_hash)if hit and hit.ttl > req.expected_decode_time:return pools.decode # Reuse directly, skip redundant prefill# 2) Bucket by input length and estimated output lengthbucket = pick_bucket(req.input_len, req.est_output_len)# 3) Chunk prefill to reduce long-request monopolizationchunks = split_into_blocks(req.tokens, block_size=512)ctx = pools.prefill.run_chunked(chunks, bucket=bucket)# 4) Transfer the KV-Cache asynchronously, choosing the hot/cold pathpath = "fast" if ctx.size < FAST_LINK_THRESHOLD else "bulk"pools.transfer(ctx, target=pools.decode, path=path)return pools.decode
2.3 Consistency and Failure Recovery
After disaggregation, a single request spans multiple nodes, so timeouts, node failures, and cache invalidation all need fallbacks: fall back to local recomputation after a transfer timeout; add version numbers and TTLs to the prefix cache to avoid reading stale context; and if a decode node fails during streaming output, support resuming from the last confirmed token.
3. Capacity Planning and Metric Definitions
To judge whether PD disaggregation pays off, do not look only at single-GPU peaks. Look at four quantities: TTFT, TPOT, throughput (tokens/second), and cost per token. A practical approach is to use small-traffic tests to find each side’s inflection point first: on the prefill side, when compute utilization saturates; on the decode side, when memory and bandwidth become the bottleneck. Then configure the number of instances on each side to the target ratio, keeping 10%–20% elastic headroom for sudden shifts in traffic mix.
It is worth stressing that disaggregation is not always a net gain. When inputs are short and outputs are also short, transfer overhead can exceed the benefit, and mixed deployment is better. It is therefore advisable to make it a switchable deployment form, with the gateway gray-selecting the execution path based on request characteristics.
4. Heterogeneous Compute and Domestic Chip Adaptation
The most valuable aspect of PD disaggregation is that it turns “heterogeneity” from a burden into an option. The prefill pool can sit on high-compute general-purpose GPUs, while the decode pool can sit on high-memory, high-bandwidth accelerator cards or dedicated inference chips, with differences hidden behind a unified memory abstraction and collective communication layer. Three things matter in practice: first, consistency of operators and data types on both sides to avoid precision drift; second, communication libraries and topology awareness, aligning transfer paths with the physical topology as much as possible; third, driver and runtime version matrix management, bringing compatibility verification into continuous integration.
5. Observability and Rollout Path
Collect at least: per-stage queueing time, per-block time for chunked prefill, cache hit rate, transfer bandwidth and tail latency, and resource utilization on both sides. Alerts must be split by stage; otherwise you cannot tell whether the bottleneck is on the compute side or the network side.
The recommended rollout has four steps: first, run side-by-side load tests to align the metric baseline with mixed deployment; then enable disaggregation at 5% traffic and compare only SLAs; then scale up gradually and add elastic scaling; finally turn on prefix caching and tiered storage to further eliminate redundant prefill. If you use general cloud capabilities, a container platform handles elasticity, object storage holds cold contexts, and monitoring, alerting, and logging services handle attribution, which covers the required pieces.
6. Conclusion
The essence of PD disaggregation is trading architecture for efficiency: paying one controllable KV-Cache transfer cost in exchange for independent scaling and non-interference on both sides. Its success does not depend on the split itself, but on three engineering details: transfer path design, batch scheduling strategy, and observability completeness. Get these three solid, and PD disaggregation becomes a stable foundation for cutting cost and improving efficiency in LLM inference.
