Training a larger language model usually means paying for proportionally more compute on every token. Mixture of Experts (MoE) breaks that trade-off. Instead of running the entire network for each token, an MoE model keeps many small subnetworks, called experts, and activates only a few of them per token. The model gains capacity without a matching rise in compute cost.
This article explains how MoE routing works, why it saves compute, what makes it hard to train, and where the architecture shows up in real models.
The core idea: many experts, few active
In a standard dense transformer, every parameter participates in processing every token. Double the parameters and you roughly double the compute per token. That linear relationship is what makes very large dense models so expensive to serve.
An MoE layer replaces one large feed-forward network with a set of smaller ones, the experts, plus a lightweight router. For each token, the router picks a small subset of experts, typically the top one or two, and only those experts process the token. Their outputs are combined, weighted by the router’s confidence scores.
The effect is sparse activation. A model can hold tens of billions of parameters in total while activating only a fraction of them for any given token. Capacity grows with the expert count; per-token compute stays close to the size of the active subset.
How the router decides
The router, sometimes called the gating network, is a small neural network trained alongside the experts. For each token it produces a score per expert, then selects the top-k experts. The most common setup is top-2: two experts handle each token, and their outputs mix in proportion to the router’s scores.
There are two routing styles worth knowing:
- Token choice. Each token picks its preferred experts. This is the standard approach: simple, and it lets different tokens in the same sentence take different paths through the network.
- Expert choice. Each expert picks the tokens it wants to process, up to a fixed capacity. This balances the workload more evenly but can leave some tokens unprocessed if experts fill up.
Routing decisions happen per token and per layer, so a single sentence fans out across many experts as it moves through the network. Specialization emerges on its own: during training, certain experts drift toward handling certain kinds of tokens, such as code, punctuation, or specific languages, because the router learns which expert reduces the loss most for each input.
Why this saves compute
The saving comes from the gap between total parameters and active parameters. Take Mixtral 8x7B, the open model Mistral released in late 2023: its release notes describe eight 7-billion-parameter experts with two active per token. That is roughly 47 billion parameters in total, with only about 13 billion active on any single token. The model behaves like a much larger network in terms of knowledge capacity while costing roughly as much per token as a 13B dense model.
This is the whole economic argument for MoE. Training cost still grows with total parameters, since every expert must be trained, but inference cost tracks active parameters. For a model served millions of times a day, inference dominates the bill, so the trade pays off.
The training problems MoE introduces
MoE is not free complexity. Training introduces failure modes that dense models never face:
- Expert collapse. Without intervention, the router converges on a few favorite experts and starves the rest. The unused experts never learn anything useful, and the model degenerates into a small dense network wearing a large costume.
- Load balancing. Researchers add an auxiliary loss term that penalizes the router for uneven expert usage. Tuning that term is delicate: too weak and collapse returns, too strong and it fights the main training objective.
- Communication overhead. In distributed training, tokens must be shuffled to whichever machine holds their assigned experts. That all-to-all communication becomes a bottleneck as expert counts grow.
- Capacity overflow. Each expert can only process a fixed number of tokens per batch. When too many tokens route to one expert, the overflow tokens get dropped or passed through unchanged, which injects noise into training.
These problems explain why MoE took years to move from research curiosity to production standard. The Switch Transformer paper from Google in 2021 showed that simplified top-1 routing with careful load balancing could scale reliably, and later open models refined the recipe.
What changes at inference time
Serving an MoE model has its own quirks. All experts must live in memory even though only a few run per token, so VRAM requirements track total parameters while compute tracks active ones. Inference becomes memory-bandwidth bound: the bottleneck is loading expert weights, not multiplying them.
Fine-tuning needs care too. Updating all experts is expensive, so practitioners often freeze most experts and train only the router plus a subset, or use parameter-efficient methods. And because routing is learned, fine-tuning on narrow data can shift routing patterns in ways that degrade general behavior, so evaluation after fine-tuning matters more than with dense models.
Where MoE shows up in real models
MoE moved from papers to products quickly once the training recipe stabilized. Mixtral 8x7B demonstrated that an open MoE model could match or beat larger dense models at lower serving cost. Later open-weight releases pushed expert counts far higher, with some designs using dozens of fine-grained experts and activating a handful per token. On the closed side, multiple frontier labs are widely reported to use MoE internally for their largest models, though they publish fewer architectural details.
The pattern is consistent: when a lab wants more capable models without multiplying its inference fleet, MoE is the standard answer.
MoE vs dense: picking the right shape
Neither architecture wins everywhere:
- Choose MoE when serving cost dominates and you need maximum capability per unit of inference compute: chat products, API platforms, and agents handling high request volumes.
- Choose dense when memory is the constraint, when you fine-tune heavily on small datasets, or when deployment simplicity matters more than raw efficiency. A dense model is easier to quantize, easier to serve on limited hardware, and its behavior is more predictable.
Mixture of Experts is best understood as a capacity multiplier, not a magic trick. It lets a model know more than its per-token compute budget would normally allow, in exchange for training complexity and memory footprint. For teams serving LLMs at scale, that trade is usually worth making.