Understanding PD Asymmetric Activation in Large Language Model Inference

    This article explains why Prefill and Decode stages are inherently asymmetric in standard decoder-only models, and how newer architectures amplify this existing asymmetry through shared KV caching. It covers the two goals of Prefill, the classic optimization of skipping LM Head computation for non-final tokens, and how shifting the computation boundary reduces TTFT. It also outlines practical benchmarking metrics, deployment considerations, and common misconceptions, helping developers evaluate whether an inference architecture delivers measurable gains in latency and cost.

    1. The Starting Point: A Long-Ignored Stage Asymmetry

    In discussions of LLM inference architecture, the asymmetry between Prefill and Decode is often treated as a unique innovation of a new architecture. In reality, this asymmetry already exists objectively in traditional decoder-only structures. Its benefits are simply marginal and have long been overlooked in engineering practice. To evaluate whether a new architecture truly adds value, you first need to separate the asymmetry that was already there from the asymmetry that the architecture amplifies.

    1.1 The Two Goals of the Prefill Stage

    Prefill processes an entire input sequence and handles two tasks at once:

    1. Compute and write the KV Cache layer by layer, so later autoregressive steps can reuse it.
    2. Predict the next token of the sequence, which is also the first token of the answer.

    The key point is that goal 2 depends only on the hidden state at the final position. The feed-forward network (MLP) and the output vocabulary projection (LM Head) contribute nothing to the correctness of the cache contents; they only affect the output logits.

    1.2 The Classic Optimization That Follows

    Since only the final position needs to produce logits, every position except the last token can skip the final layer’s MLP and LM Head computation. The following minimal pseudocode illustrates this masking idea:

    1. # Illustrates the computation boundary only; not a specific implementation
    2. for layer in layers[:-1]:
    3. hidden = layer.forward(hidden) # Full sequence participates and writes to the KV Cache
    4. last = hidden[:, -1:, :] # Take only the final position
    5. logits = lm_head(last_layer_mlp(last)) # The expensive vocabulary projection runs only once

    The vocabulary size is typically on the order of one hundred thousand, and the hidden dimension is in the thousands. The LM Head is often the most parameter-heavy single operator. For long inputs, skipping N-1 vocabulary projections is not trivial. Yet relative to the overall matrix multiplication workload, the share remains limited. This is the root reason why optimizing this single point yields negligible speedup in conventional architectures.

    2. Why Shared-Cache Architectures Amplify the Gains

    The core change in this new class of architectures (commonly implemented with ideas such as an encoder-decoder causal structure and cross-layer cache sharing) is that Prefill’s main computation only needs to advance to the representation that must be cached at the final layer, rather than running through all layers and the output head. The amplification logic has three layers:

    • Shifting the computation boundary forward: Prefill’s compute cost is compressed from “all layers + full vocabulary projection” to “the minimal closure required to build the cache.”
    • Decoupling input and output activations: Input-side activated parameters and output-side activated parameters are no longer forced to be equal, and can be set independently according to their respective workload characteristics.
    • Higher cache reuse rate: Shared representations allow multiple decode steps, and even multiple requests, to reuse the same intermediate results, reducing repeated computation.

    An illustrative capacity comparison (expressing order-of-magnitude relationships only, not data from any specific product):

    Dimension Traditional Symmetric Activation Asymmetric Activation + Cache Sharing
    Input activated parameters Same as output Significantly smaller than total parameters
    Output activated parameters Same as input Set independently, usually smaller
    Prefill computation boundary All layers + LM Head Up to the final cached layer
    Gains in long-input scenarios Minimal Scale with input length

    3. Engineering Implementation: Turning Asymmetry into Measurable Gains

    3.1 Align the Metrics First

    Evaluating this class of architecture requires more than single-request latency. At minimum, measure the following separately:

    • TTFT (time to first token), determined mainly by Prefill.
    • TPOT (time per output token), determined mainly by Decode’s memory bandwidth.
    • Cost per token and concurrent throughput.
    • The GPU memory usage curve under long contexts.

    Asymmetric activation mainly optimizes TTFT and Prefill throughput. Its improvement to TPOT comes indirectly from cache and memory-access path optimizations. The two should not be conflated.

    3.2 Load Testing Must Cover the Real Distribution

    1. Scenario A: Short input, long output (e.g., summarization) -> focus on TPOT and memory
    2. Scenario B: Long input, short output (e.g., document QA) -> focus on TTFT and Prefill throughput
    3. Scenario C: Mixed concurrency -> focus on queueing latency and SLO attainment

    Load testing in only a single scenario makes it easy to misjudge an architectural gain as a universal improvement.

    3.3 Deployment-Side Support

    When hosting inference services on a container platform, it is recommended to split Prefill and Decode deployments according to their resource profiles, combined with batch scheduling, request prioritization, and monitoring-alert-based elastic scaling. Cache hit rate and the variance of sequence lengths within a batch should be included as core observability items in the logging service. These are general engineering practices, independent of any specific vendor implementation.

    4. Common Misconceptions and Rational Expectations

    1. Treating stage asymmetry as a new invention: It stems from the structural fact that only the final position needs logits.
    2. Ignoring the memory-access bottleneck: The Decode stage is often constrained by memory bandwidth, so reductions in parameters and activations do not necessarily translate linearly into speed gains.
    3. Overlooking quality regression: Any architecture that changes the computation boundary must verify on standard evaluation sets whether the output distribution drifts.
    4. Binding version numbers to the architecture narrative: A major version number by itself is not a technical conclusion and still requires reproducible benchmark data.

    5. Conclusion

    PD asymmetry is not the exclusive property of a new architecture; it is a structural dividend that can be explicitly designed and amplified. To judge whether an inference solution is worth adopting, return to three verifiable questions: whether Prefill’s computation boundary is genuinely shifted forward, whether input and output activations can be configured independently, and whether TTFT and cost per token improve under the real business distribution. Quantify these three points before debating architectural superiority. That is the approach responsible to both developers and cost owners.