Prefill-Decode Asymmetry in LLM Inference: KV Cache Sharing and Causal Encoder-Decoder Architectures
Prefill and decode are often treated as two sides of the same inference path, but they have fundamentally different computational goals and resource profiles. This article explains the structural PD asymmetry that already exists in conventional autoregressive Transformers, why its benefit is usually negligible, and how cross-layer KV cache sharing turns it into an architecture-level optimization. It then examines causal encoder-decoder designs, asymmetric activation, comparisons with symmetric MoE, and practical implications for TTFT, throughput, deployment evaluation, and inference engine optimizations such as PD disaggregation and chunked prefill.
1. Introduction: An Overlooked Fact
In recent discussions of LLM architecture evolution, the asymmetric design of Prefill and Decode—often called PD asymmetry—has attracted considerable attention. Many readers may initially wonder whether this is an entirely new idea. It is not. A close look at the inference flow of a conventional autoregressive Transformer shows that PD asymmetry has existed from the beginning. Its benefit under traditional architectures is simply so small that it has long been overlooked.
Understanding this point is a key prerequisite for understanding why a new generation of asymmetric architectures can be effective.
2. What Prefill and Decode Actually Do
LLM inference consists of two stages with very different characteristics:
- Prefill stage: Processes all user input tokens in parallel at once. Its main tasks are to build the KV cache and predict the first output token.
- Decode stage: Generates tokens autoregressively one by one. At each step, it reads the accumulated KV cache. The arithmetic intensity is low, but memory access pressure is high.
From the perspective of the computational graph, the two stages do not rely on the same model components in the same way. In a standard decoder-only architecture, for example, the KV cache is produced by the Key/Value projections in the attention modules. The MLP layers and the LM Head (output projection layer) are not directly involved in cache construction.
3. PD Asymmetry Inherent in Conventional Architectures
Based on this observation, we can derive a conclusion that is often ignored: during Prefill, except for the final token, the remaining tokens do not need to pass through the MLP and LM Head of the last layer at all.
The reasons can be broken down as follows:
- The first Prefill objective is to compute the cache: As long as the K/V projections in every layer are computed, the cache is complete. MLP outputs at later token positions do not contribute to the cache.
- The second Prefill objective is to predict the first output token: Only the final input position needs full logits. Therefore, only that position needs to go through the complete MLP and LM Head of the last layer.
This asymmetry can be expressed with simplified pseudocode:
for layer in model.layers:hidden, kv = layer.attn(hidden) # All tokens must be computed to produce the KV cacheif not layer.is_last or is_final_token:hidden = layer.mlp(hidden) # Non-final positions can be skipped in the last layerlogits = lm_head(last_hidden) # Only the last token needs this
In other words, Prefill can naturally avoid a small amount of activation-parameter and compute work compared with a fully symmetric path. In conventional architectures, however, this saving occurs only in the last layer. Relative to the overall computation across dozens or even hundreds of layers, the acceleration effect is almost negligible.
4. How Cache Sharing Amplifies the Advantage
The real turning point comes from the architectural idea of sharing the KV cache across layers, often represented by YOCO-style designs. If multiple attention layers reuse the same global cache, the main Prefill computation only needs to proceed up to the layer that produces this shared cache. Later layers can be substantially pruned during Prefill.
This creates a qualitative change:
- Conventional architecture: Asymmetric gain = the MLP and LM Head of the last layer, which account for a very small share of total computation.
- Cache-sharing architecture: Asymmetric gain = the Prefill computation of all layers after the cache-generation layer, which can account for a substantial share.
At this point, PD asymmetry changes from a theoretical edge case into an architecture-level acceleration lever. Prefill computation is compressed to only the portion needed to construct the cache, while the Decode stage keeps the full activation path to ensure generation quality. This is the core of the so-called asymmetric activation mechanism: the input side (Prefill) and the output side (Decode) use different effective activated parameter counts.
5. Asymmetric Activation and Causal Encoder-Decoder Architectures
Such new architectures are often summarized as a Causal Encoder-Decoder form, contrasting with the symmetric path of conventional MoE:
- Conventional symmetric MoE: Prefill and Decode follow the same expert-routing path, so input-side and output-side activated parameter counts are the same.
- Asymmetric architecture: The Encoder is responsible for efficiently building the global cache with a smaller activated parameter count, while the Decoder is responsible for high-quality generation with a larger activated parameter count. The two sides are decoupled and each performs its own role.
According to public discussions, a recently open-sourced model adopting this kind of architecture has substantially increased its total parameter count while keeping input-side activated parameters at a relatively low level. This enables the dual benefit of higher capacity and higher speed, and in high-throughput scenarios it may even outperform larger conventional symmetric models.
6. Engineering Benefits and Practical Recommendations
For developers and enterprise users, this architectural trend has several practical implications:
- Significant optimization of time to first token (TTFT): Prefill computation is structurally reduced, and the benefit is especially pronounced in long-context scenarios.
- More favorable throughput and cost: In online serving, Prefill is often the compute bottleneck. Asymmetric design directly alleviates this bottleneck.
- Deployment evaluation considerations: When choosing an inference service, measure TTFT and per-token generation rate separately. Their sources of cost-effectiveness may be completely different.
- Coordination with inference engines: Common optimizations such as PD-disaggregated deployment and chunked prefill are naturally complementary to this architecture and can further improve hardware utilization.
7. Conclusion
PD asymmetry is not a new concept that appeared out of nowhere. It is a structural characteristic that has always existed in the autoregressive inference flow but has not been fully exploited. The idea of cache sharing elevates this characteristic from a corner-case optimization to a core design principle. Combined with the asymmetric activation mechanism of causal encoder-decoder architectures, it ultimately enables simultaneous improvements in parameter scale and inference speed. For teams focused on inference cost and response speed, understanding the fundamental difference between Prefill and Decode is the first step in evaluating and making effective use of new-generation architecture models.
