MoE Architecture Explained: How LLMs Achieve "Fat but Not Heavy" Efficient Computing

    This article explains the Mixture-of-Experts (MoE) architecture behind modern large language models. It covers the structural limitations of dense models, how sparse activation and the router mechanism decouple model capacity from compute cost, why activating only a subset of experts does not degrade model quality, and the engineering challenges of deploying MoE models in cloud environments, including memory constraints, load balancing, and inference batching.

    In the field of AI engineering, we often encounter a phenomenon that seems counterintuitive: when a technical report for an open-source LLM discloses a staggering 671B total parameters, many developers’ first reaction is to estimate the required GPU cluster size and the astronomical training cost. Yet the report shows that its training cost is only a fraction of that of a traditional dense model — even cheaper than many models in the tens-of-billions range. Behind this paradox of “enormous parameter count yet low compute cost” lies a core technique in modern LLM architecture design: the Mixture-of-Experts (MoE) model, whose essence can be summarized as “fat but not heavy.”

    1. The Structural Dilemma of Dense Models: The Tight Coupling of Parameters and Computation

    To understand the value of MoE, we first need to return to the fundamentals of the Transformer architecture. In a traditional dense model, a standard Transformer block consists of two core components: the self-attention mechanism and the feed-forward network (FFN).

    In terms of parameter distribution, the FFN accounts for the overwhelming majority of a model’s parameters. Taking a common 70B-class dense model as an example, the attention mechanism in each layer contains roughly 150 million parameters, while the FFN contains over 700 million — more than 80% of the layer’s total. The computation rule of dense models is extremely rigid: every input token must pass through all parameters of the entire network. This means the total parameter count determines not only the model’s “capacity” (how much knowledge it can store and how well it can fit data), but also directly determines its “compute cost” (the number of floating-point operations required to process each token).

    Under this tight coupling, capacity equals computation. Adding parameters to make the model smarter inevitably causes training and inference costs to rise linearly or even exponentially. This “brute force” approach quickly hits the ceiling of compute budgets and memory capacity.

    2. How MoE Breaks Through: Sparse Activation and Decoupling

    The MoE architecture was introduced precisely to break this tight coupling. It targets the “fattest” part of the network — the FFN layer — and performs a precise surgical transformation.

    In an MoE architecture, the original monolithic FFN is split into N smaller FFNs, called “experts.” The model also introduces a gating network, often called a router. When an input token arrives at this layer, the router performs a fast computation based on the token’s features, assigns scores, and selects only the Top-K highest-scoring experts for actual computation, while the remaining experts stay idle.

    Common industry parameter configurations illustrate this mechanism well. For example, a typical MoE architecture uses 8 FFN experts of 7B parameters each, totaling about 47B parameters. But because the router selects only 2 experts per token, the actual activated parameter count is only around 13B. A more extreme case: some frontier LLMs are designed with 256 routed experts plus 1 shared expert that is always active, reaching 671B total parameters. Yet since each token activates only 8 routed experts plus the 1 shared expert, the per-token activated parameter count is just 37B.

    This achieves the critical decoupling:

    • Total parameters = capacity: determines the upper limit of the model’s knowledge reserves and generalization ability.
    • Activated parameters = computation: determines the actual latency and compute consumed per token.

    With this design, the model retains the massive knowledge capacity of 671B parameters while paying only the compute cost of 37B. This is what “fat but not heavy” means, and it is the core logic behind MoE’s ability to get compute “for free.”

    3. The Precision Surgery: Why Sparse Activation Doesn’t Cause Intelligence Loss

    Developers encountering MoE for the first time often ask: if only a small subset of experts does the work while the rest sit idle, won’t model quality suffer?

    The answer lies in how the FFN works. In the Transformer architecture, self-attention captures contextual relationships between tokens — a global computation. The FFN, by contrast, independently applies nonlinear transformations and feature mapping to each token, essentially acting as the model’s “knowledge repository.”

    Because the FFN processes each token independently without interacting with other tokens, this “every token for itself” property makes it feasible to split the FFN into multiple experts. From a cognitive science perspective, the human brain also activates different regions when handling knowledge from different domains. Similarly, an LLM does not need to mobilize all of its knowledge for a given token. When generating code, it primarily activates expert networks related to programming logic; when answering history questions, it activates experts related to the humanities. The router allows the model to retrieve knowledge on demand, which not only avoids quality degradation but actually enhances the model’s representational capacity through specialized division of labor.

    4. Engineering Challenges and Cloud Practices for MoE in Production

    Although MoE achieves an ideal balance between compute and capacity in theory, real-world deployment brings new challenges, especially in cloud deployment and large-scale inference scenarios.

    1. The memory wall and communication overhead
    Although MoE models activate few parameters per token, all parameters must reside in memory. Even at low precision, 671B parameters require the combined memory of hundreds of high-end GPUs. Moreover, when tokens are routed to experts on different GPUs, cross-node communication overhead increases significantly. To address this, developers typically rely on high-performance cluster networking. On cloud-native infrastructures such as Baidu AI Cloud, heterogeneous compute platforms combined with high-performance RDMA networks can effectively mitigate cross-node communication latency in MoE architectures, ensuring high-speed data flow between expert nodes.

    2. Load balancing
    Early in MoE training, a “winner-takes-all” problem often occurs: the router tends to send tokens to a few well-performing experts, leaving the others undertrained. To solve this, engineers must introduce a load-balancing loss that forces tokens to be distributed evenly across experts. In cloud monitoring systems, this requires operations teams to track each expert’s activation frequency and compute load in real time, which can be achieved with general-purpose logging services and monitoring/alerting components for fine-grained metric collection.

    3. Fragmentation of inference batching
    During inference, if tokens in the same batch are routed to different experts, the computation graph becomes irregular, reducing GPU parallel efficiency. The industry commonly addresses this with dynamic batching and expert parallelism. Combined with container platforms and elastic compute resources from providers like Baidu AI Cloud, developers can dynamically schedule compute resources based on the MoE model’s routing distribution, aggregating tokens destined for the same expert and significantly improving actual GPU utilization.

    5. Conclusion

    Through its “fat but not heavy” design philosophy, the Mixture-of-Experts architecture cleverly decouples model capacity from computation, breaking through the compute cost constraints in LLM development. By sparsely activating the FFN layers, it achieves efficient use of compute resources without sacrificing model intelligence. For enterprise developers, understanding the underlying logic of MoE not only helps in optimizing model architectures, but also enables more rational planning of cloud compute and network resources when deploying hundred-billion-parameter models — truly achieving cost reduction and efficiency gains.