MoE LLM Architecture Explained: Total Parameters, Active Parameters, and Long Context

    An overview of how Mixture-of-Experts (MoE) models actually spend their compute: the difference between total parameters, activated parameters per token, and context window; how sparse routing and expert specialization work; how attention optimization, KV cache compression, and PD disaggregation make long context practical; the engineering factors such as expert parallelism, batching, quantization, caching, and serving frameworks that shape real inference cost; and why tool calling and code ability depend on training recipes rather than parameter count. Includes practical guidance for choosing and deploying an MoE model.

    Over the past year, the parameter tables of open-weight and API models have started to read like an engineering bill: 560B, 671B, 1T, 1.6T — numbers that are hard to ignore, but that tend to hide a more important fact. What really determines the inference cost of each token is usually not a model’s total parameter count, but how many parameters are actually activated per token, how attention and caching are made cheaper, how long context is served efficiently, and how tool calling and code ability were trained in the first place.

    This article therefore does not treat any single model family as the main subject. Instead, it places different architecture routes on the same evaluation axis. There is only one core goal: to explain the architecture logic of MoE models, the conventions behind their parameter counts, and the engineering tradeoffs involved, so that readers can make rational decisions when selecting and deploying them.

    1. Getting the definitions right: total parameters, active parameters, and context are different things

    Three metrics are the most commonly confused when people discuss MoE models, and they describe entirely different things.

    The first is total parameters. This is closer to the total capacity of everything in the model repository: all experts, attention layers, embeddings, the router, and auxiliary modules. A larger total parameter count usually means a larger knowledge and expert space, but it also directly raises the complexity of weight loading, distributed deployment, GPU/memory footprint, and cross-node communication. It is best understood as the total inventory of the warehouse.

    The second is activated parameters per token. This is the essence of MoE: the model does not run the full network every time. Instead, a router (gating network) selects a subset of experts to participate in the computation for each token. Typical configurations might be described as “1T total parameters, about 30B activated,” or “670B total parameters, about 37B activated,” while some routes push activation down to the 3B level with extreme sparsity. This number is closer to a per-token forward-pass compute budget, but it is not equivalent to real latency, because actual latency is also affected by expert parallelism, communication, batch size, KV cache, quantization strategy, and the scheduling behavior of the inference framework.

    The third is the context window. Numbers such as 256K, 262K, or 1M appear to say only “how many tokens fit,” but what is genuinely difficult in engineering is attention compute complexity and cache overhead. As sequence length grows, the compute and memory cost of standard attention rises sharply, and so prefill, decode, KV/latent cache, offload, PD disaggregation (Prefill-Decode disaggregation), and expert communication all gradually become bottlenecks.

    When these three metrics are compared side by side, one common intuition holds: total parameters represent how large the expert pool is, while activated parameters represent how cheap a single token’s compute is. A 1T/32B model does not mean every token runs 1T parameters; an 80B/3B model cannot simply be understood as having “only 3B worth of capability.” The expert pool implied by the total parameter count often carries richer knowledge, while the activated parameter count determines compute cost — the two need to be understood separately.

    2. Why MoE is sparse: routing and expert specialization

    The essence of MoE is to replace the feed-forward layers (FFN) of a dense Transformer with a set of parallel experts, plus a router that dynamically picks a few experts for each token. A simplified version of the routing logic looks like this:

    1. # Pseudocode: sparse routing in an MoE feed-forward layer
    2. def moe_forward(x, experts, router, top_k=2):
    3. logits = router(x) # score how well each expert matches
    4. topk_idx, topk_weight = topk_softmax(logits, k=top_k)
    5. out = 0
    6. for idx, w in zip(topk_idx, topk_weight):
    7. out = out + w * experts[idx](x) # only the selected experts are activated
    8. return out

    This design brings two benefits. The first is decoupling capacity from compute: total parameters can be very large while activation stays controllable. The second is expert specialization: different experts can learn different knowledge distributions or modality features. The costs are equally clear: the router requires load balancing (to avoid a few experts being overused while the rest sit idle), communication overhead grows with the number of experts, and training stability becomes harder to guarantee. This is why total parameter count reflects the upper bound of knowledge capacity, while activated parameter count reflects the per-token compute budget — together they shape the model’s performance and cost curve.

    3. Attention and caching: the real battlefield of long context

    When the context grows from a few thousand tokens to hundreds of thousands or even a million, optimizing the attention mechanism often decides success or failure more than the number of experts does. Common engineering approaches fall into a few categories:

    • Attention sparsification: letting each token attend to only part of the history, which pulls attention complexity well below quadratic.
    • KV cache compression: storing key/value caches in compressed form through low-rank projections or latent vectors (latent cache), reducing memory footprint and memory-bandwidth pressure.
    • Sliding window and local attention: combining a small number of globally important tokens with a nearby local window, balancing efficiency and long-range dependency.
    • PD disaggregation (Prefill-Decode disaggregation): separating the compute-intensive prefill stage from the memory-access-intensive decode stage onto different resources for scheduling, improving overall throughput.

    It is worth stressing that long context is not as simple as enlarging a window number. What really determines the experience is whether, at the target sequence length, prefill latency, per-token decode throughput, and cache memory usage can all be kept within acceptable bounds. The approach of many newer models is to sparsify, compress, and mix attention structures rather than simply expanding the window.

    4. Engineering tradeoffs: from expert parallelism to quantized deployment

    The real inference cost of an MoE model is the sum of multiple engineering factors, not something you can read off the parameter table. A few dimensions deserve particular attention:

    1. Expert parallelism: experts are split across devices, which introduces communication overhead. Cross-node bandwidth and the efficiency of routing All-to-All communication directly affect throughput.
    2. Batching and scheduling: how batches are organized in the decode stage, along with request queuing and scheduling policies, can significantly change unit cost.
    3. Quantization: quantizing weights and activations lowers memory and bandwidth requirements, but requires a tradeoff between accuracy and efficiency.
    4. Caching and offload: where the KV/latent cache lives (GPU memory, host memory, remote) and its eviction policy determine whether long context is sustainable.
    5. Serving frameworks: different inference engines differ in scheduling, operator fusion, and memory management, so the same model can deliver very different price-performance.

    For this reason, when evaluating an MoE model, “activated parameters × engineering implementation” is often a better predictor of real cost than total parameters.

    5. Capability training: tool calling and code environments

    Parameters and architecture determine the skeleton; the training recipe determines the capability. Recent models have invested significantly in two areas:

    • Tool calling (function calling / tool use): through structured output, multi-turn interaction, and tool-orchestration training, models learn to invoke external functions at the right moment, which improves their usefulness in AI agent scenarios.
    • Code and environment interaction: training aimed at code generation and completion, and at iterating on feedback inside real execution environments, makes models steadier on programming and automation tasks.

    These capabilities depend far more on data quality, training pipelines, and alignment strategy than on simply piling up parameters — an easily overlooked but crucial part of model selection.

    6. Selection advice for developers

    Putting the above together, here are a few actionable principles:

    • Look at activation, not only total parameters: use the “per-token compute budget” to estimate cost, and the “expert pool size” to gauge knowledge capacity.
    • Match the business context length: define the target sequence length first, then evaluate whether the attention structure and caching approach can support it.
    • Pay attention to serving and deployment conditions: the same model can differ several-fold in price-performance across inference frameworks, quantization schemes, and hardware.
    • Separate skeleton from capability: architecture sets the lower bound, while the training recipe and alignment set the upper bound; tool calling and code ability should be validated separately.
    • Prefer measurements over paper specs: the parameter table is only a starting point; real selection decisions should come from load tests and evaluations close to your own workload.

    When deploying models like these in the cloud, general-purpose capabilities can help reduce complexity: container platforms can host distributed inference services, object storage can manage weights and datasets, and monitoring, alerting, and logging services can track throughput, latency, and cache hit rates — making the path from training to inference observable and elastically scalable.

    Summary: The “scale” of MoE has at least two layers — total parameters represent the expert pool and knowledge capacity, while activated parameters represent the per-token compute budget; the engineering difficulty of the context window lies in attention and caching. Understanding these three, then layering on the engineering tradeoffs of expert parallelism, quantization, scheduling, and training recipes, is what lets you see past the “bill” on the parameter table to the real inference cost and capability boundaries.