LLM Inference Architecture Evolution: A Deep Dive into Asymmetric Activation

    This article examines how large language model architectures and inference engines can be co-designed to turn workload asymmetry into an advantage. It explains why prefill and decode behave as fundamentally different loads, reviews three general design patterns—cross-layer cache sharing, asymmetric input/output activation in MoE models, and causal encoder-decoder structures—and offers a quantitative intuition, engineering trade-offs, and a practical evaluation checklist for teams assessing similar redesigns.

    1. Introduction: What a “Refactor First” Release Teaches Us

    In the LLM space, a jump in version numbers usually signals more parameters or a higher benchmark score. But there is another kind of release: one whose core is not a slightly better score, but a complete teardown and reassembly of the inference path. The remark that “they prefer refactoring over chasing benchmark scores” captures this kind of work well—it may not be the best short-term commercial move, yet it often delivers more durable engineering returns.

    This article evaluates no specific product. Instead, it abstracts the discussion into a general technical question: when inference workloads are clearly asymmetric across stages, how should model structure and the inference engine be co-designed so that the asymmetry becomes a benefit rather than a burden?

    2. Background: Prefill and Decode Are Two Different Kinds of Workload

    A single request to an autoregressive LLM typically has two stages:

    • Prefill: processes all input tokens at once. It is compute-intensive, with large matrices and high parallelism, and can usually saturate the available compute.
    • Decode: generates tokens one at a time, handling only one new token per step. It is memory-bandwidth-intensive, with the bottleneck typically in moving weights and cache rather than in compute.

    Many readers assume a “standard dense model is symmetric.” It is not. Take the classic decoder-only structure. Prefill has two goals: write the intermediate state of every position into the cache, and predict the first token of the answer. The subsequent layer-wise feed-forward pass and the output vocabulary projection have nothing to do with writing the cache. So for every position except the last, the final feed-forward layer and the output projection can be skipped entirely:

    1. # Illustration: skipping tail computation during prefill
    2. def prefill(hidden, layer_stack, lm_head):
    3. for layer in layer_stack[:-1]:
    4. hidden = layer(hidden) # layer-by-layer forward pass, writing the K/V cache
    5. cache = collect_kv(hidden)
    6. last = layer_stack[-1](hidden[:, -1:, :]) # only the last position is needed
    7. first_token = lm_head(last) # only the first output token is predicted
    8. return cache, first_token

    Under a conventional architecture, the activations and compute saved by this optimization are negligible, because the last feed-forward layer and the vocabulary projection account for only a small fraction of total cost. But if the architecture itself makes cache-related computation the dominant part of prefill, the payoff from skipping the tail is amplified significantly.

    3. Amplifying the Asymmetry: Three General Design Patterns

    3.1 Cross-Layer Cache Sharing

    If multiple layers reuse the same key-value cache, or share encoded representations across layers, then the main work of prefill converges to “computing this shared representation,” and the share of tail computation drops further. At that point, skipping the tail is no longer a corner-case optimization but a main-path one. This line of thinking generally falls under the broad category of “cache sharing / representation reuse.”

    3.2 Separating Input and Output Activation Parameters

    Traditional mixture-of-experts (MoE) models are mostly symmetric: input and output use the same activation scale. Making them asymmetric—for example, activating very few parameters on the input side to build the representation and more parameters on the output side to generate—lets each stage match its own bottleneck. The magnitude comparison in the original discussion is telling: total parameters rose from the twenty-billion-plus range to the fifty-billion range, input activation dropped below ten billion, and output speed actually improved. This shows that “more parameters” and “faster per-token generation” are not contradictory; what matters is how many parameters are activated and when.

    3.3 Causal Encoder-Decoder Structure

    Splitting “understanding the input” and “generating the output” into two paths with different responsibilities—a causal encoder that builds the cache representation and a decoder that generates token by token—is, structurally, an acknowledgment of the two-stage asymmetry rather than forcing one set of computations to handle both workloads.

    4. Where the Gains Come From: A Quantitative Intuition

    Let the total prefill compute be C, and let r be the share of tail computation unrelated to the cache. Skipping the tail then saves r·C. In a conventional architecture r is small; once cache sharing makes cache construction dominant, r grows and the savings scale with it. Meanwhile, the time per decode step is roughly determined by the number of weight and cache bytes that must be moved, and reducing input-side activation parameters directly cuts that volume. Together, these produce the result of “more total parameters, faster per token.”

    To be clear: the above is a general order-of-magnitude intuition and not a performance commitment for any specific implementation. Real gains depend on batch size, sequence length, cache capacity, bandwidth, and other conditions.

    5. Costs and Engineering Constraints

    • Memory and bandwidth: shared caches reduce redundant storage, but the shared representation itself may be read repeatedly, so bandwidth pressure must be assessed.
    • Implementation complexity: asymmetric paths require the inference engine to schedule the two stages separately, making batching and paged-cache strategies more complex.
    • Fine-tuning and alignment: structural changes affect training and post-training pipelines, so convergence and stability need to be re-validated.
    • Observability: metrics for the two stages must be collected separately; otherwise, averages will hide the real bottleneck.

    6. How to Evaluate This Kind of Architecture: A Checklist

    1. Stage-wise stress testing: measure latency, throughput, and peak memory for prefill and decode separately.
    2. Variable length and long context: observe the marginal benefit of cache sharing on long sequences.
    3. Mixed in-batch workloads: check queuing and preemption behavior when short and long requests run together under real traffic.
    4. Quality regression: confirm the structural redesign has not caused a capability regression.
    5. Cost accounting: evaluate by “combined cost per million tokens” rather than a single-point speed metric.

    At the deployment level, container platforms can host inference services, object storage can hold model artifacts, and logging services with monitoring and alerting can track the two stages’ metrics separately—turning architectural gains into an operational cost advantage.

    7. Conclusion

    “Refactor over benchmark chasing” deserves respect because it acknowledges an engineering fact: the workload is inherently asymmetric, and the structure should be too. For developers and enterprise users, the truly reusable lesson is not a version number but a methodology: measure the real bottlenecks of both stages first, then decide what to share, what to skip, and how much to activate.