How MoE Models Support 1M Long Context: An Architecture Breakdown

    A technical breakdown of how a Mixture-of-Experts (MoE) architecture supports 1M-token long context, covering sparse attention with a gated indexer, shared experts, multi-path residual streams, multi-token prediction, precision options, and a practical checklist for deploying long-context agents.

    1. Why Large Models Are Moving to Sparse Architectures

    The way large models are used has shifted from single-turn Q&A toward long-context understanding and multi-turn Agent collaboration. Dense models activate all parameters on every inference pass, so the longer the context, the greater the compute and memory pressure. For this reason, Mixture-of-Experts (MoE) combined with sparse attention has become a common technical approach.

    According to publicly disclosed material, one MoE model makes three key changes: scaling up total parameters and the number of experts, using sparse attention to support 1M-token context, and adopting multi-path residual streams plus multi-token prediction (MTP) to improve training and inference efficiency. This article examines each change in turn, and notes which conclusions still need independent verification.

    2. Parameter Scale and Routing: Which Numbers Can Be Trusted

    In an MoE model, total parameters determine knowledge capacity, while activated parameters determine the compute cost of a single inference pass. The table below compares the old and new versions as disclosed in the original material. These figures come from public disclosures and have not been independently verified; always cross-check them against the official technical report before citing.

    Item Old Version (disclosed) New Version (disclosed)
    Total parameters 295B 770B
    Activated parameters 21B 49B
    Layers 80 78
    Hidden size 4096 6144
    Routed experts 192 256
    Routing strategy Top-8 Top-8 plus 1 shared expert

    Based on the disclosed figures, total parameters grew roughly 2.6x, and activated parameters roughly 2.3x. In the new version, activated parameters account for about 6.4% of total parameters (49 out of 770), and this ratio determines the per-inference compute cost.

    The shared expert handles general features, allowing routed experts to specialize in finer-grained capabilities. The material claims this reduces feature redundancy, but how much redundancy is actually reduced can only be judged from ablation results—not from the architecture description alone.

    3. Attention: How Sparse Selection Replaces Full Computation

    With full attention, both compute and KV cache memory grow rapidly with context length. The idea behind Gated Sparse Attention (Gated DSA) is: a lightweight Indexer first selects the 2048 most relevant positions for the current query, and the main attention computes only over those positions.

    The original material states that the old version used Grouped Query Attention (GQA), while the new version uses Multi-head Latent Attention (MLA) combined with sparse attention and an index cache. Attention configurations may differ between versions; consult the official configuration files when writing or selecting a model.

    The IndexCache is a further optimization to reduce overhead. According to the material, all 78 layers deploy DSA, but only the first 21 layers run the full Indexer; the remaining 57 layers reuse the indices selected by earlier layers.

    The applicable boundaries of this design are as follows:

    • Suitable: long documents where the content a query depends on is relatively concentrated—for example, long-document Q&A or codebase retrieval.
    • Not suitable: tasks that require uniformly drawing on the full text, such as full-text statistics or fine-grained cross-paragraph comparison. Index reuse may miss information at low-relevance positions.
    • Requires testing: the accuracy loss from reusing indices across layers should be measured with your own evaluation set; do not rely directly on vendor-reported numbers.

    4. Multi-Path Residual Streams and MTP: Two Easily Confused Concepts

    The material says the model uses 4 residual streams, referred to as iHC (multi-path information flow). The full English name is not given in the material, so readers should consult the original paper or report to confirm. The design goal of multi-path residual streams is to provide deeper networks with more information propagation paths, mitigating gradient vanishing and enabling stable training of large-parameter models.

    The MTP module plays different roles in the two phases:

    • Training: MTP serves as an auxiliary training objective, having the model predict multiple upcoming tokens simultaneously, which helps improve model quality.
    • Inference: the MTP module can act as a draft model for speculative decoding, quickly predicting multiple tokens that the main model then verifies in parallel.

    The material discloses draft-layer parameters of 10B with 0.7B activated parameters. It does not specify whether this count includes components such as the embedding layer. Whether the draft module delivers throughput gains depends on the draft acceptance rate—the higher the acceptance rate, the more tokens pass verification per step, and the higher the throughput.

    5. Precision and Cost: Don’t Look Only at Unit Price

    The material states that, in addition to BF16, the model supports MXFP8 precision. Each FP8 parameter occupies 1 byte versus 2 bytes for BF16, so for the same tensors, weights and the KV cache consume roughly half the memory. GPTQ, AWQ, and similar methods are a different category of weight quantization from MXFP8; the combined effect of stacking them needs real-world testing.

    On pricing, the material suggests the model’s per-token price is relatively high compared with its lightweight variant. However, cloud service prices vary over time and by region, input/output ratio, and cache discounts, so this article makes no specific pricing judgment.

    To estimate the cost of a single Agent task, use the following formula:

    Cost per task = uncached input tokens × input price + cached input tokens × cached-token price + output tokens × output price

    Recommended steps when putting this into practice:

    1. Measure the average input and output length of your real workloads.
    2. Estimate the cache hit rate. Long-context Agents typically resend the same prefix repeatedly, so the hit rate strongly affects cost.
    3. Convert into daily and monthly total costs based on concurrency and peak traffic.
    4. Compare completion rates across models on the same batch of tasks. A model with a lower unit price but a lower completion rate is not necessarily cheaper per task.

    6. A Deployment Checklist for 1M-Context Agents

    • Does the task really need 1M context? Many scenarios can be covered with retrieval plus summarization.
    • Does your evaluation set include long-range retrieval and cross-paragraph reasoning, rather than only short-passage Q&A?
    • Does time-to-first-token meet your interactivity requirements?
    • Is there a fallback strategy—for example, switching to retrieval plus short context for extremely long inputs?
    • Long context may contain user privacy or business secrets; logs and caches need sanitization and defined retention periods.

    7. FAQ

    How should you decide whether to use 1M context?
    Start by estimating real needs. Problems solvable with retrieval and summarization don’t require ultra-long context.

    How does Gated DSA differ from full attention?
    Full attention computes over all historical positions, giving more complete results at high cost. Sparse attention computes only over selected positions, which is friendlier to speed and memory, but may miss information at low-relevance positions.

    What should you watch out for when using the IndexCache?
    Focus on the accuracy degradation caused by index reuse, and validate with your own datasets.

    How does MTP affect throughput?
    The draft acceptance rate determines the speedup. It must be measured on real request distributions—theoretical values alone are not sufficient.