MoE Mixed Expert Architecture
In conventional Transformer models, the feed-forward network is often the dominant part of the parameter budget. For many large models, it accounts for the majority of all stored weights. If researchers simply increase the hidden dimension of that feed-forward block, they gain more capacity, but they also pay for it in compute. Training and inference costs tend to grow in a nearly linear fashion, which quickly becomes impractical.
Mixture of Experts proposes a different way to think about scale. Instead of enlarging one feed-forward network, the model divides it into several parallel subnetworks. Each subnetwork is called an expert. During each forward pass, only a small number of experts are used. The result is a model with a very large number of total parameters, while the actual computation per token remains limited.
Anatomy of an MoE Layer
A standard Mixture of Experts layer consists of two core components.
- Experts: independent subnetworks, usually feed-forward networks. They may share the same structure, but their weights are separate.
- Router or gate: a lightweight module that decides which experts should process a token.
For an input token, the layer gathers outputs from selected experts and combines them into a final representation.
The router can produce scores, turn them into probabilities, and choose a small set of experts. The chosen weights are often renormalized so that they sum to one. This keeps the output stable and interpretable as a weighted ensemble.
Routing Strategies and Expert Selection
How a token is routed is central to MoE performance.
- Top-1 routing: one expert handles the token. This is efficient but can create uneven usage.
- Top-2 routing: two experts handle the token. It is often more robust and is used in several influential systems.
- Top-k routing: a small group of experts is selected, with renormalized gates.
The router itself can be simple or more sophisticated. A simple linear router may be enough, but learned or shared routing mechanisms can improve performance.
Load Balancing in MoE Training
A frequent problem is that a few experts receive too many tokens while others are rarely used. This leads to overload, undertraining, and wasted capacity.
Several remedies exist.
- Auxiliary load-balancing losses encourage more uniform routing.
- Capacity limits control how many tokens each expert can process.
- Token dropping can discard overflow tokens.
- Expert choice routing lets experts select tokens themselves.
- Shared experts can handle general behavior while fine-grained experts specialize.
Without careful design, MoE training can become unstable or fail to exploit the full parameter capacity.
Parallelism and Engineering
MoE models often have parameter counts that exceed what a single device can hold. Expert parallelism is commonly used, where different experts live on different devices.
During inference or training, a token may need to travel through communication to reach its assigned expert. After computation, the result returns. This involves all-to-all communication, which can be expensive. Fast network fabrics such as NVLink or InfiniBand are important.
MoE systems often combine expert parallelism with data parallelism or tensor parallelism. The exact design depends on hardware, batch size, and latency requirements.
Practical Tradeoffs
MoE offers clear benefits. It can decouple parameter growth from per-token compute. It can create large models with relatively modest activation costs. It can also allow experts to specialize.
However, challenges remain. Routing imbalance can hurt training. Communication overhead can be significant. Fine-tuning may cause overfitting unless regularization or partial training is applied.
These difficulties do not stop MoE from being adopted. They simply shape how systems are built and tuned.
Representative Architectures
Several influential projects illustrate different design choices.
- Switch Transformer: popularized Top-1 routing at scale.
- GShard: explored Top-2 routing with auxiliary losses.
- Mixtral: used eight experts per layer with Top-2 activation.
- DeepSeekMoE: used shared and fine-grained experts with biased routing.
These systems show that MoE is not a single fixed recipe. It is a family of techniques.
Conclusion
Mixture of Experts has become a major approach for scaling large models. By combining many specialized subnetworks with selective activation, it separates parameter capacity from per-token computation. The key challenges are routing, balancing, communication, and training stability, but progress has been rapid. Understanding MoE is now essential for anyone working on large-scale model architecture.