Home Knowledge Base Mixture of Experts (MoE)

Mixture of Experts (MoE) is the sparse architecture paradigm where each input token is routed to only a small subset (typically 1-2) of many parallel "expert" sub-networks within each layer — enabling models with trillions of total parameters while activating only a fraction per token, achieving dramatically better quality-per-FLOP than equivalent dense models.

The Core Idea

A dense Transformer applies every parameter to every token. An MoE layer replaces the single feed-forward network (FFN) with N parallel FFN experts (e.g., 8, 16, or 64) and a lightweight gating network that decides which expert(s) each token should use. If only 2 of 64 experts fire per token, the active computation is ~32x smaller than a dense model with the same total parameter count.

Gating and Routing

Load Balancing

Without intervention, the gating network tends to collapse — sending most tokens to a few "popular" experts while others receive no traffic (expert dropout). Mitigation strategies include auxiliary load-balancing losses that penalize uneven expert utilization, noise injection into gate scores during training, and capacity factors that cap the maximum tokens per expert.

Scaling Results

Infrastructure Challenges

MoE models require expert parallelism — different experts reside on different GPUs, and all-to-all communication routes tokens to their assigned experts. This communication overhead can dominate training time if not carefully optimized with techniques like expert buffering, hierarchical routing, and capacity-aware placement.

Mixture of Experts is the architecture that broke the linear relationship between model quality and inference cost — proving that bigger models can actually be cheaper to run by activating only the knowledge each token needs.

mixture of experts moesparse moe transformerexpert routingmoe load balancingswitch transformer gating

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.