Home Knowledge Base Mixture of Experts (MoE)

Mixture of Experts (MoE) is the neural network architecture that routes each input token through only a subset of specialized sub-networks (experts) selected by a learned gating mechanism — enabling models with trillions of parameters while keeping per-token computation constant, because only 1-2 experts out of hundreds are activated for any given input.

The Scaling Dilemma MoE Solves

Dense transformer models scale by increasing width (hidden dimension) and depth (layers), but compute cost grows proportionally with parameter count. A 1.8T parameter dense model would require enormous FLOPs per token. MoE decouples parameter count from compute cost: a 1.8T MoE model with 128 experts and top-2 routing activates only ~28B parameters per token — the same compute as a 28B dense model but with access to a much larger knowledge capacity.

Architecture

In a typical MoE transformer, every other feed-forward network (FFN) layer is replaced with an MoE layer:

Load Balancing Challenge

Without constraints, the router tends to collapse — sending all tokens to a few popular experts while others remain unused. This wastes capacity and creates compute imbalance across devices (each expert is placed on a different GPU). Solutions:

Training Infrastructure

MoE layers require expert parallelism: experts are distributed across GPUs, and all-to-all communication shuffles tokens to their assigned expert's GPU and back. This all-to-all pattern is bandwidth-intensive and requires careful overlap with computation. Frameworks like Megatron-LM and DeepSpeed-MoE provide optimized implementations combining data, tensor, expert, and pipeline parallelism.

Notable MoE Models

Mixture of Experts is the architectural paradigm that breaks the linear relationship between model capacity and inference cost — enabling foundation models to store vastly more knowledge in their parameters while maintaining practical serving latency and throughput.

mixture of experts moesparse moeexpert routinggating network moeconditional computation

Explore 500+ Semiconductor & AI Topics

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