A New LLM Inference Paradigm: Asymmetric Activation and N-gram Memory
Symmetric MoE designs force prefill and decode to share the same activation path, which is a poor fit for long-read, short-write Agent workloads. This article explains Causal Encoder-Decoder (CED) asymmetric activation, compact global KV reuse, N-gram memory offload, and practical implications for inference cost and architecture.
1. Background: The Inference Bottleneck of Symmetric MoE
Mainstream mixture-of-experts (MoE) models typically use symmetric activation: a token follows nearly the same network path in prefill (reading context) and decode (generating output), and activates a similar amount of parameters. The design is simple and training-stable, but it mismatches real production loads.
A typical Agent workflow first ingests hundreds of thousands of tokens of system prompts, tool definitions, and history (a long read), then generates a few hundred to a few thousand tokens of decisions and tool calls (a shorter write). Under a symmetric architecture, every prefill token fully activates the selected experts. Prefill is usually the largest share of compute, so much capacity is spent “understanding context,” while the KV cache that results is often bulky.
The core issue is that reading and writing have very different compute profiles but share one activation policy. That is why the industry has been exploring asymmetric activation.
2. Causal Encoder-Decoder (CED): Splitting the Network in Half
2.1 Core idea
Causal Encoder-Decoder (CED) splits a single Transformer along depth:
- Lower layers act as an Encoder: they run mainly in prefill and compress long context into a compact intermediate representation.
- Upper layers act as a Decoder: decode mostly runs this half for autoregressive generation.
This is not classic Seq2Seq. Both halves remain one causal model; only when they activate and what they are responsible for changes.
2.2 Key mechanism: projecting and reusing global KV
In a standard decoder-only model, every layer builds its own global KV from its hidden states, which sets a lower bound on how large the context representation is. In CED, Decoder layers do not build global KV themselves; they project it from the Encoder’s last-layer hidden states. Two benefits follow:
- Tighter context compression: a single high-quality global KV is kept at the Encoder exit; intermediate layers need not store duplicates.
- Fewer parameters in prefill: the Encoder only needs to compress, so prefill can activate a smaller subset (on the order of a few billion to tens of billions of parameters), while decode activates more (for example, more than ten billion to tens of billions) to protect generation quality.
Illustrative difference in the two paths:
# Traditional symmetric MoEfor layer in all_layers: # prefill and decode activate the same expert subsetkv[layer] = build_kv(h) # each layer keeps its own global KVh = moe_forward(h, active_experts=full_set)# Asymmetric activation (CED sketch)# prefill: run lower layers only, small parameter seth = lower_layers.forward(x, active_params=small_set)compact_kv = project(h[-1]) # project global KV from the last Encoder layer# decode: run upper layers only, large parameter sety = upper_layers.forward(y, global_kv=compact_kv, active_params=large_set)
2.3 Impact on cost structure
Asymmetric activation changes how inference cost is composed. In long-read, short-write settings, prefill tokens can outnumber decode tokens by tens or hundreds of times. Lowering per-token activation cost in prefill yields large overall savings. Decode activates more per token, but token count is small and the global context representation is higher quality—compute is spent where it matters.
3. N-gram Memory: Separating Reasoning from Memorization
A parallel direction splits capability:
- Content that needs reasoning stays on the Transformer backbone: logic, multi-step planning, code generation, and similar work.
- Local patterns that need a lot of memory but little compute—entity names, collocations, common code snippets, high-frequency n-grams—are hit via n-gram hash lookup, without using backbone parameters or FLOPs.
Language contains a huge amount of statistical memory. Using trillions of neural parameters to store what often follows “the” is inefficient. Hash tables handle those patterns at near-zero compute so the backbone can focus on reasoning. Some models already attach n-gram embeddings on the order of tens of billions of parameters as an external memory layer, which supports this path.
Attention is reorganized accordingly: shared KV plus two-level sparse indexing—a coarse index to locate relevant context blocks, then a fine index inside the block—to control both compute and memory traffic on long context.
4. Practical Takeaways for Engineering Teams
For teams deploying or fine-tuning LLM inference:
- Profile read vs. write load. Measure prefill/decode token ratios and latency needs. Long-read, short-write cases (document understanding, codebase analysis, Agent orchestration) benefit most from asymmetric activation.
- Treat cache hit rate as first-class. In long-context serving, prefix-cache hits strongly affect latency and cost; each extra percentage point of hit rate saves token throughput. Keep system prompts, tool definitions, and other prefixes stable.
- Align training and inference stacks. New architectures often couple tightly to the inference runtime; models may need per-framework tuning. Evaluate whether training and inference are designed as one stack.
- Know the bounds of external memory. N-gram lookup fits high-frequency, low-reasoning patterns. It does not replace RAG: the former is statistical language memory; the latter is knowledge freshness. They complement each other.
5. Outlook
Asymmetric activation and memory augmentation are two sides of the same trend: spend FLOPs and VRAM where they match the value of the work. As Agents become the dominant LLM use case, long-read, short-write traffic will amplify these designs. Competitiveness will depend not only on parameter count but on read/write split and layered memory. For engineering teams, now is a good time to re-examine inference load profiles and prepare for the next generation of inference architectures.
