Understanding Asymmetric Activation in Large Language Models: From Prefill Optimization to Encoder-Decoder Design

    This article explains why some large language model upgrades matter more for their rewritten computation graphs than for benchmark scores. It shows that decoder-only architectures are already asymmetric between prefill and decode, describes how cache sharing and encoder-decoder division of labor amplify this asymmetry into throughput gains, and outlines a metrics framework and deployment approach for evaluating such architectures. Readers will learn what these designs can and cannot improve, along with common misconceptions to avoid.

    1. Introduction: What a “Rebuild-Style” Version Upgrade Reveals

    While the industry usually frames model releases around benchmark scores, another kind of update occasionally appears: the version number moves forward only slightly, but the underlying computation graph is rewritten from scratch. The value of such updates lies not in evaluation numbers but in recalculating the structure of inference cost. For developers and enterprise users, this is exactly the direction worth watching—because the long-term bill is determined by the compute cost per token, not by leaderboard rankings.

    Using “a new-generation large language model version upgrade” as an abstract case, this article discusses its most broadly applicable technical point: the asymmetric compute characteristics of prefill and decode, and how cache sharing and an encoder-decoder division of labor turn that characteristic into real throughput gains. All architecture descriptions here stay at the level of industry-general concepts.

    2. The Overlooked Fact: Traditional Decoder Architectures Are Already Asymmetric

    Many discussions treat “prefill/decode asymmetry” as a new architectural invention, which is a misunderstanding. Standard autoregressive models do not have the same objective in the two phases:

    • The prefill phase has two goals: build the key-value cache (KV Cache), and predict the first output token of the sequence.
    • The decode phase has only one goal: perform token-by-token forward passes on top of the existing cache and append new cache entries.

    The key implication is that the feed-forward network layers and the output vocabulary projection layer are unrelated to cache construction. So during prefill, apart from the last position, the remaining positions do not need to compute the final feed-forward layer or the output projection. The masking idea can be expressed with illustrative pseudocode:

    1. # Standard forward pass: every position computes full depth
    2. for layer in layers:
    3. h = layer(h)
    4. # Prefill-oriented pruning: intermediate positions stop at the depth needed for cache
    5. cache_h = h[:-1] # only need to advance to the depth that produces cache
    6. first_logit = lm_head(mlp(h[-1])) # only the last position needs full depth

    In other words, prefill naturally saves part of the activations and computation compared with decode. In conventional architectures, however, this saving is a tiny fraction and is rarely worth optimizing in engineering practice.

    3. The Amplification Mechanism: How Cache Sharing Turns “Saving a Little” into “Saving a Lot”

    The real contribution of the new architecture is to amplify the structural gap described above. With a cache-sharing approach (where different layers or branches reuse the same context representation), prefill’s main computation only needs to advance to the depth at which “the last layer’s cache can be generated,” without traversing the entire network. The gains stack up in three places:

    1. Depth pruning: the total matrix multiplications in prefill decrease linearly as effective depth drops.
    2. Lower activations: intermediate positions no longer produce high-layer activations, reducing both peak memory and write-back bandwidth.
    3. Memory-access convergence: in long-context scenarios, cache writes are the dominant bandwidth cost, and reducing the number of layers written directly eases the memory wall.

    It is worth stressing that the decode phase remains constrained by the memory-access bottleneck of a single token. Asymmetric design does not shorten single-step latency; what it improves is time to first token (TTFT) and overall throughput.

    4. Encoder-Decoder Division of Labor: The Systematic Form of Asymmetric Activation

    Pushing the asymmetry idea to its limit yields a causal encoder-decoder style division of labor: the encoder side compresses the input context into a compact representation, and the decoder side performs autoregressive generation. The two sides can be deliberately designed at different scales of input/output activations—this is the engineering meaning of “asymmetric activation.”

    Its costs and benefits must be evaluated together:

    • Benefits: prefill cost drops significantly for long-input scenarios; the context representation is more compact, and cache usage is lower.
    • Costs: context compression is lossy, so retrieval and exact-copying tasks may degrade; training and inference configurations need to be tuned separately; the debugging chain becomes longer.

    In engineering, it is advisable to run sensitivity experiments on the compression ratio and treat the “compression factor vs. task accuracy” curve as the launch gate, rather than looking only at average leaderboard results.

    5. How to Evaluate Such Architectures Scientifically: A Metrics Framework

    To avoid being misled by a single score, cover at least five dimensions:

    Dimension Key Metrics Notes
    Latency TTFT, TPOT Reflect prefill and decode characteristics respectively
    Throughput Output tokens per unit of compute Closer to cost than peak QPS
    Memory Peak usage, cache growth rate Determines how much concurrency can be supported
    Quality Per-task accuracy, long-text recall Checks whether compression is lossy
    Stability Long-session drift, jitter Reflects side effects of cache reuse

    A reusable load-testing skeleton:

    1. def bench(model, prompts, max_new=256):
    2. ttft, tpot = [], []
    3. for p in prompts:
    4. t0 = time.perf_counter()
    5. out = model.generate(p, max_new_tokens=max_new)
    6. dt = time.perf_counter() - t0
    7. ttft.append(model.metrics.first_token_ms)
    8. tpot.append((dt * 1000 - model.metrics.first_token_ms) / max_new)
    9. return {
    10. "ttft_p50": percentile(ttft, 50),
    11. "tpot_p50": percentile(tpot, 50),
    12. "tokens_per_gpu_s": total_tokens(p, max_new) / elapsed
    13. }

    6. Deployment Advice: Building on General Cloud Capabilities

    To validate such an architecture in your own environment, you can build a closed loop on general cloud capabilities: use a container platform to host inference services and elastic scaling, object storage to hold models and datasets, a message queue to smooth request spikes, and logging and monitoring with alerts to observe TTFT, throughput, and cache hit rate. General-purpose capabilities such as containers, storage, logging, and monitoring offered by Baidu AI Cloud can serve as reference building blocks for this kind of validation environment.

    7. Common Misconceptions

    • Misconception 1: Asymmetric activation reduces single-token latency. In fact, it mainly optimizes prefill and throughput.
    • Misconception 2: Cache sharing has no quality cost. Any compression must be validated per task.
    • Misconception 3: A leaderboard improvement equals a cost reduction. The two often have no causal relationship.
    • Misconception 4: An architecture upgrade is just a configuration change. Rewriting the computation graph usually involves changes on both the training and inference sides.

    8. Conclusion

    From an engineering-rationality standpoint, rebuilding the foundation may not win in commercial narrative, but it directly improves the core variable of per-token cost. For users, the right approach is to establish an evaluation framework centered on latency, throughput, memory, and per-task quality, validate at small scale first, and then decide whether to migrate.