Mixture of experts (MoE): a big model that uses only part of itself
A model can hold hundreds of billions of weights. Does every token really need to use all of them?
In the feed-forward network, a token meets the weights the model learned during training. Those weights let it apply what it has learned to this token.
What if we give that network more room?
More weights, more work
Widen the feed-forward network and we add more weights: more capacity for the model to learn.
But those larger matrices take more multiplications. That extra capacity comes with more work to process each token.
We could use fewer weights to do less work. But then we lose the extra capacity we just added.
Could we keep more weights, but use fewer for each token?
Keep the capacity, choose the work
Instead of one wider feed-forward network, put several smaller ones side by side. Each has its own learned weights.
A token could run through just a few of them. The others would stay available for tokens that need them.
These networks are the experts in a mixture of experts.
But which experts should a token use? We can let the model learn that choice too: multiply the token vector by another matrix of weights to produce a score for each expert. This is the router.
Each chosen expert produces an update for the token. We weight these updates using the router’s scores, then add them together.
Hold more, run the same
For example, a model can keep hundreds of experts in a layer while sending each token through only a few.
Keep the number used fixed, then increase the pool below. How much more work does that token do?
Add experts and keep the number chosen fixed: the layer holds more weights, but each token still runs through the same few. Raise the number chosen and the work per token grows too.
That gap between weights held and weights used is the reason to build a mixture of experts.
Who decides?
The router reads the token after attention has gathered its context. So the same token can go to different experts in different sentences.
We can also cut the experts into more, narrower pieces, so the router has more combinations to choose from. Or add one expert that every token uses, a shared expert.
That raises two questions. If tokens choose different experts, what happens to work that many of them share? And what stops every token from choosing the same few? Follow them in shared experts and routing and load balancing.
Sources and assumptions
The idea comes from Jacobs, Jordan, Nowlan and Hinton (1991). Shazeer and colleagues (Google, 2017) made it sparse and large.
- Shazeer and colleagues: sparse MoE, GShard, and Switch Transformers, for the scaling history.
- Mixtral, DeepSeekMoE, and DeepSeek-V3, for the worked architectures.
- Model totals: Qwen3-235B-A22B card, Meta’s Maverick description, and Kimi K2 report.
The model overview shows routed and shared expert counts from each architecture entry. Its squares represent several experts when there are more than 128. The interactive pool draws each routed expert separately and keeps the same token vector and router weights as the controls change. Its router is untrained; the scores and top-k selection are calculated from those vectors. The router matrix and score vector show compact samples. Shared experts are covered separately. All expert weights must be available even when only a few experts run for one token.