Decoding Next-Gen Efficient LLM Architecture: Asymmetric Activation, Causal Encoder-Decoder, and N-gram Memory

    This article explains why symmetric MoE hits bottlenecks in prefill versus decode, and how a next-generation design combines causal encoder-decoder split, N-gram hash memory, shared KV, and two-level sparse attention. It covers the resulting asymmetric activation, reported speed and cost gains, and practical implications for long-context and agent workloads.

    Why Traditional Symmetric MoE Hits a Bottleneck

    Recent large models commonly use mixture-of-experts (MoE) so sparse activation can grow parameters while limiting compute per inference. A structural assumption is often overlooked: prefill and decode share the same network path and the same amount of activated parameters.

    That “symmetric activation” design creates two problems:

    1. Compute mismatch. Prefill compresses input context into a key-value cache and behaves more like encoding. Decode generates token by token and depends more on generation. The tasks differ, yet they are given the same compute budget.
    2. High cost for long context. In agents, codebase analysis, and long-document Q&A, input tokens often outnumber output tokens by tens or hundreds of times. Prefill dominates latency, and a symmetric stack cannot optimize that split.

    The newer architecture is a systematic response to both issues.

    Design 1: Causal Encoder-Decoder

    The model is split into two logical regions—a causal encoder-decoder. A simplified picture:

    • Lower layers as encoder: run mainly in prefill and compress long context into a compact intermediate representation.
    • Upper layers as decoder: run mainly in decode. Global KV cache is projected from the encoder’s last-layer hidden states.

    Decoders no longer build global KV from their own hidden states; they reuse the encoder’s compact representation, so context can be compressed. Prefill/decode flow in pseudocode:

    1. # prefill: activate encoder only (fewer active parameters)
    2. encoder_out = model.encoder_layers(input_ids)
    3. # global KV projected once from the last encoder hidden state
    4. global_kv = kv_projection(encoder_out[-1])
    5. # decode: activate decoder only
    6. for _ in range(max_new_tokens):
    7. hidden = model.decoder_layers(last_token, global_kv)
    8. last_token = sample(hidden)

    This yields asymmetric activation: about 8B parameters per token in prefill and about 16B per token in decode. “Cheap to read, expensive to write” matches agent-style token mix—long input, short output—and can lower overall inference cost.

    Design 2: N-gram Hash Memory in the Main Model

    An N-gram memory module is folded into the main model. Capabilities are decoupled:

    • Reasoning, planning, and complex composition stay in the Transformer backbone.
    • Local patterns, entity names, and fixed collocations that need memory but little compute are retrieved via N-gram hash lookup instead of fully parameterized memory.

    This is similar to N-gram embedding: a large embedding table stores frequent fragments; the model learns when to look up versus compute. That reduces pressure on backbone parameters and keeps lookup cheap, which can help generation speed.

    Attention: Shared KV and Two-Level Sparse Indexing

    Cross-layer attention is reorganized as shared KV plus two-level sparse indexing:

    1. Shared KV: multiple layers reuse one KV cache, cutting memory and cache bandwidth.
    2. Two-level sparse index: coarse index finds relevant context blocks, then fine attention inside the block, bringing long-sequence attention from quadratic toward near-linear cost.

    With prefix caching, measured cache hit rates can exceed 99%, so repeated context is reused at almost no extra cost.

    Performance: About 3× Generation Speed

    Public evaluations on multimodal long tasks report:

    • Generation speed from about 120 token/s to around 360 token/s; community measurements often fall in 300–400 token/s.
    • Wall time on the same visual eval from about 30 minutes to about 19 minutes.
    • Total token consumption down more than 40%, with output tokens roughly unchanged—savings come mainly from representation compression and cache reuse, not truncated answers.

    The speedup is attributed to asymmetric activation, compact context, shared KV, and N-gram lookup together—not a single factor.

    Implications for Developers

    1. Revisit cost models. Input and output must be measured separately; “cost by output only” can fail under asymmetric activation.
    2. Agents and long documents benefit first. Code analysis, multi-step tool use, and knowledge-base Q&A (long read, short write) gain the most.
    3. Co-train model and toolchain. Training already targets specific agent call patterns, so evaluate model plus orchestration together, not benchmarks alone.
    4. Design for cache. High prefix-cache hits reward putting static content (system prompts, document prefixes) at the front of the input.

    Summary

    The idea is allocate compute by task: separate encode from decode, decouple reasoning from memory, and share plus sparsify attention. LLM design is moving from a single stacked path to structured division of labor. Understanding prefill/decode asymmetry and matching architecture to workload is central to the next round of cost and latency optimization.