LLM Inference Architecture Evolution: PD Disaggregation and MoE Sparse Activation Explained

    This article explains why large language model inference needs architectural decoupling, covering two foundational concepts—MoE sparse activation and the two-phase nature of decode-only generation—and the two problems caused by colocating prefill and decode: stage interference and coupled resource/parallelism strategies. It then walks through PD (Prefill-Decode) disaggregation, including cross-stage KV cache transfer, engineering practices, and trade-offs, plus two adjacent decoupling directions and practical adoption advice. Readers will learn how to decide whether to disaggregate and how to do it based on TTFT, TPOT, network, scheduling, and observability.

    1. Introduction: Why Inference Needs Decoupling

    Once large models move into production, the real cost pressure is not training but inference. An online service has to promise two things at once: how quickly the first token appears after a user sends a request (the experience metric), and whether the speed of every subsequent token stays stable (throughput and latency metrics). As model size grows, contexts get longer, and concurrency rises, the naive approach of running all computation together in one mixed deployment hits a wall quickly.

    Two pieces of background are needed before the mainstream optimization directions make sense. The first is the mixture-of-experts (MoE) model structure. The second is the two-phase behavior of the autoregressive decode-only architecture. The former determines how many parameters a single request actually activates; the latter determines whether a given phase consumes compute or bandwidth. Put together, they lead directly to three main directions for decoupled inference deployment. This article focuses on the most fundamental and most critical one: PD disaggregation.

    2. Background: Two Concepts You Must Understand

    2.1 Mixture-of-Experts (MoE): Sparse Activation by Design

    A mixture-of-experts model has two parts: a gating network (gate/router) and several expert subnetworks. The gate takes the hidden state of the current token, scores how well each expert matches it, and selects the few highest-scoring experts to participate in this computation. The selected experts process the token, and their outputs are merged with a weighted sum using the gate weights.

    The defining property is sparse activation: total parameter count can be made very large, but any single request activates only a small fraction of it. The direct consequence is a mismatch—memory footprint is determined by total parameters, while compute is determined by activated parameters. This “large memory, low compute” mismatch is the core tension that any deployment strategy must handle: all experts have to sit in memory on standby, yet only a few are used each time.

    2.2 Autoregressive Decode-Only Architecture: The Prefill/Decode Split

    Decode-only models generate by predicting the next token from the preceding text, so inference naturally splits into two phases:

    • Prefill: processes the entire input prompt in parallel in one pass, produces the first token, and writes each layer’s Key and Value tensors into a cache.
    • Decode: takes the previous output as the new input, computes one token per step, and loops until generation ends.

    One detail is worth thinking about: why does the cache store only K and V, and not Q? In autoregressive decoding, a new token acts only as the querying party that retrieves from historical context; the Query of a historical token is never used again by later steps. The K and V of historical tokens, however, are accessed repeatedly by every new Query at every step. A cache exists to reuse intermediate results that stay unchanged and are read repeatedly, and Q does not meet that condition.

    3. The Core Tension: Two Problems With Mixed Deployment

    The original deployment shape for decode-only architectures colocated P and D on the same set of devices, serving both phases with one parallelism strategy. As teams kept pushing on TTFT (Time To First Token) and TPOT (Time Per Output Token), two structural problems surfaced.

    3.1 Strong Interference Between Phases

    Prefill is compute-intensive: with a long prompt, the matrix multiplications are large and saturate compute, pushing device resource usage high. Decode is memory-bandwidth-intensive: each step computes a single token, and the bottleneck is the bandwidth spent repeatedly moving weights and the KV cache, leaving compute largely idle.

    When the two are colocated, a long-prompt prefill task instantly seizes compute and bandwidth, slowing the decode loop already in progress. This shows up as generation stalling midway, with long-tail jitter in TPOT. In the other direction, many concurrent decode requests keep consuming memory bandwidth, so prefill for newly arriving requests queues longer and TTFT climbs. The two metrics pull against each other and cannot be optimized at the same time.

    3.2 Resource Allocation and Parallelism Strategy Are Coupled

    Prefill favors larger parallel sharding and batch sizes to amortize compute cost. Decode cares more about reducing per-step communication and memory access overhead while keeping enough concurrent batches to hide latency. Colocation means settling on one compromise parallelism scheme and resource ratio, so neither side gets its optimal configuration, and scaling cannot be done independently per phase.

    4. The Solution: PD Disaggregation and Its Engineering

    4.1 The Basic Idea

    To break this coupling, the industry first systematically proposed PD disaggregation (Prefill-Decode Disaggregation): split the two phases into separate resource pools, let each pick its own parallelism strategy, batching parameters, and scaling cadence, and pass intermediate results over a high-speed network. TTFT and TPOT can then be optimized separately without interfering with each other.

    4.2 Cross-Stage KV Cache Transfer

    The largest new cost after separation is moving intermediate state. When prefill finishes, each layer’s K and V caches must be sent to the decode side; the decode side receives them, rebuilds the cache, and continues token-by-token generation. In practice this traffic usually rides a high-speed network with IB or RoCE capability. It is also possible to place the two phases on different GPUs inside one machine, using intra-device interconnect to lower transfer cost.

    Transfer-layer practices:

    1. Prefill side: prompt -> compute Q/K/V -> produce first token -> export per-layer KV -> send asynchronously
    2. Transfer: chunk KV + pipeline it, overlapping transfer and compute at layer granularity
    3. Decode side: receive and place KV -> verify step count and token alignment -> enter token-by-token generation loop

    Key engineering details include: pipeline at layer granularity so the first layer’s KV transfer overlaps with the computation of later layers; keep the KV layout identical on both ends to avoid extra reordering overhead; add timeouts and retries to transfers so individual requests do not drag down the whole batch.

    4.3 Weighing Benefits Against Costs

    The benefits are clear: the two metrics can be optimized independently, failure domains are isolated, scaling can happen per phase, and long prompts no longer pollute decode latency. The costs deserve equal attention: extra KV transfer bandwidth and latency, more complex scheduling and routing, and cache lifecycle management across pools. So PD disaggregation is not unconditionally applicable—with short prompts and low concurrency, transfer overhead may cancel out the gains, while with long contexts and high-concurrency online serving, the gains are usually significant.

    5. Extension: Two Other Decoupling Directions

    PD disaggregation handles decoupling along the phase dimension. Two other main lines sit alongside it:

    • Expert-dimension decoupling: for MoE sparse activation, place hot experts and cold experts in tiers, or aggregate routing by expert affinity to cut unnecessary cross-device communication and ease the “high memory usage but idle compute” mismatch.
    • Resource-dimension decoupling: treat compute, memory, and bandwidth as independently scalable resources, and build an observability loop with container platforms, monitoring and alerting, and logging services, adjusting each along the real load curve.

    Together the three form the current methodology for inference systems: split by characteristic, optimize by bottleneck.

    6. Practical Recommendations

    1. Measure before splitting: use monitoring data to confirm whether the bottleneck is compute or bandwidth instead of disaggregating blindly.
    2. Network first: PD disaggregation depends on high-speed interconnect, so close network gaps first if capacity is insufficient.
    3. Set separate SLOs for each metric: define targets and alert thresholds for TTFT and TPOT independently.
    4. Coordinate scheduling and caching: cache lifecycle across phases needs explicit management to prevent memory leaks and falling hit rates.
    5. Roll out gradually: validate the gains on a portion of traffic first, then increase the share step by step.

    7. Conclusion

    The main line of LLM inference optimization is moving from all-in-one colocation toward decoupling by characteristic. Understanding MoE sparse activation and the two-phase resource differences of decode-only models is the prerequisite for judging whether to disaggregate and how. PD disaggregation opens up efficiency gains by optimizing TTFT and TPOT independently, but the quality of its implementation ultimately depends on the “invisible infrastructure”: network, scheduling, and observability.