AI Architecture · Plain English
What is Mixture of Experts?Big model brains, small model speed.
A regular language model runs every weight it owns for every single word it writes. A Mixture of Experts (MoE) model uses a quick router to wake up only a few matching specialist blocks per token. That is why models like Mixtral, DeepSeek-V3, Qwen3 and Llama 4 can store massive knowledge while answering as fast as much smaller models.
Imagine walking into a clinic with a twisted ankle. In a regular clinic, one solo doctor handles everything. Before wrapping your ankle, that doctor has to flip through every heart, skin, eye and dental book on the shelf. It works, but every visit takes longer as the clinic learns more.
Now imagine a specialist clinic instead. A triage nurse at the front desk glances at your chart and sends you straight to Room 2 (bone care) and Room 4 (rehab). The other six specialists stay at their desks. You get deep care without waking up the whole building.
That specialist clinic is Mixture of Experts (MoE), and it sits behind most of today's largest open and frontier language models.
01 / Why it exists
Why did regular models hit a wall?
Standard transformers are dense models. When a dense model writes one
token (a word or word piece like "def" or "ankle"),
that token passes through every parameter in the model.
Want the model to hold twice as many facts? You roughly double the weights, and every single token now has to push through twice as much math. For years, capacity and speed were tied together. Back in 2017, Google researchers wrote that conditional computation could break that link by turning on only parts of a network for each input [2]. (The core MoE idea itself goes back to Jacobs, Jordan, Nowlan and Hinton in 1991 [1].)
- In the clinic
- One solo doctor reads every medical binder for every patient, whether they came in for a cough or a broken bone.
- In a dense model
- Every token activates 100% of the model's weights. Double the model's knowledge, and you double the work per token.
02 / The idea
How does Mixture of Experts work?
An MoE transformer does not replace the whole model. Every layer keeps its shared attention block (the part that looks at surrounding words in your prompt). What changes is the big feed-forward network (FFN) block inside each layer, where much of a model's knowledge lives [9].
Instead of one giant feed-forward block, the layer holds several smaller ones called experts, paired with a tiny gate called a router [4] [9]. For every token:
- Attention runs first so the token carries context from earlier words.
- The router scores every expert for that token in one fast calculation.
- Only the top few experts run (often 1, 2 or 8). The rest are skipped for that token [3] [4].
- Their outputs are weighted and added together before moving to the next layer.
Some newer designs, like DeepSeek-V3 and Llama 4 Maverick, also keep a shared expert that runs for every single token alongside the picked experts [6] [7]. Think of it as a quick general vitals desk every patient visits before seeing a specialist.
Figure 1 · Watch one token move through an 8-expert layer
- Shared attention reads context around the token.
- Router scores all 8 experts for this token.
- Top 2 experts run; the other 6 skip compute.
- Active expert outputs merge and move to the next layer.
- In the clinic
- Everyone checks in at reception (attention), then the triage nurse (router) sends you to 2 specialist rooms while the other 6 stay free.
- In the model
- The router sends each token to only the top-k expert FFNs per layer, keeping compute per token small.
03 / Real numbers
What do real MoE models look like?
Once you separate total parameters (how many weights exist) from active parameters (how many weights run per token), the model names in news feeds suddenly make sense.
Take Mixtral 8x7B. It has 8 experts per layer and picks 2 per token. Because only the feedforward blocks are split into 8 experts rather than copying the entire 7B model 8 times, it is not 56B parameters: Mistral reports 46.7B total parameters and only 12.9B active per token, matching or beating Llama 2 70B on most standard benchmarks while running at the speed and cost of a 12.9B model [4] [5].
Modern models push that gap even wider with many smaller experts:
| Model | Total params | Active per token | Expert setup |
|---|---|---|---|
| Mixtral 8x7B | 46.7B | 12.9B | 2 of 8 routed experts [5] |
| Qwen3-30B-A3B | 30B | 3B | 8 of 128 routed experts [8] |
| Qwen3-235B-A22B | 235B | 22B | 8 of 128 routed experts [8] |
| Llama 4 Scout | 109B | 17B | 16 experts [7] |
| Llama 4 Maverick | 400B | 17B | 128 routed + 1 shared expert [7] |
| DeepSeek-V3 | 671B | 37B | 8 of 256 routed + 1 shared expert [6] |
Figure 2 · Memory bill vs. speed per token
- Total in VRAM
- All weights
- Compute per token
- Only active
- Routing setup
- 2 of 8 experts per layer
04 / The surprise
Do experts really split by topic like "math" and "coding"?
That is the most common myth about MoE. People picture Expert 1 as the Python coder, Expert 2 as the poet, and Expert 3 as the doctor.
When the Mixtral team actually checked what tokens went where, they found a surprise: "we do not observe obvious patterns in the assignment of experts based on the topic" [4]. Across ArXiv papers, biology abstracts and philosophy texts, expert usage looked almost uniform. Instead, the router leaned on local patterns and consistency, often sending consecutive tokens to the same experts [4].
And remember: routing happens at every single layer, token by token. A single word can visit Experts 2 and 6 on Layer 1, then switch to Experts 4 and 7 on Layer 2. Experts are fine-grained internal specialists, not human job titles.
- In the clinic
- Instead of strict "heart" or "skin" departments, each room handles tiny recurring symptoms across many kinds of patients.
- In the model
- Experts rarely line up neatly with school subjects. They specialize in token patterns across each layer.
05 / The trade-offs
What is the catch?
If MoE gives big-model smarts at small-model speed, why isn't every model an MoE? Because three real costs show up fast.
- Memory stays huge. You only run 2 experts on a given word, yet the next word might pick two completely different ones. As Hugging Face's MoE guide notes, "all parameters need to be loaded in RAM, so memory requirements are high" [9]. DeepSeek-V3 thinks at 37B cost per token, yet a serving cluster still has to store all 671B parameters [6].
- Training can collapse onto a few favorites. Without guardrails, a router quickly learns to send most tokens to the same two experts. The others stop improving, a failure called routing collapse [6]. Switch Transformers fought this with an auxiliary load-balancing loss and a fixed capacity factor (excess tokens skip the busy expert) [3]. DeepSeek-V3 replaced that extra loss with a small per-expert routing bias that nudges traffic away from overloaded experts without hurting quality [6].
-
Multi-GPU traffic goes up. When an MoE is too big for one GPU, engines like
vLLM use expert parallelism (
--enable-expert-parallel) to place different experts on different GPUs [10]. Tokens then have to hop between GPUs on every layer, which makes fast GPU interconnects matter.
06 / Practical advice
When should you pick an MoE model?
Whether you are calling a cloud API or sizing your own GPUs, one simple rule keeps you out of trouble: price speed by active parameters, and size hardware by total parameters.
- Pick MoE when serving many users or calling hosted APIs. Providers absorb the multi-GPU memory footprint across clusters and pass the active-compute savings to you as faster responses and lower token bills.
- Check total weights before downloading for a laptop or single GPU. A model like Qwen3-30B-A3B runs as fast as a 3B model, yet still needs memory for 30B weights [8].
- Use a dense model on tight single-machine budgets. If you have 16 GB of VRAM and want maximum quality that fits cleanly on one card, a quantized dense model is often simpler to run.
Keep these names
A small glossary
- Dense model
- A standard model where every parameter runs for every token.
- Expert
- One of several feed-forward sub-networks inside an MoE layer.
- Router (gating network)
- The small layer that scores all experts for each token and picks the top few.
- Shared expert
- An always-on expert that runs for every token alongside the routed experts.
- Active parameters
- The subset of weights actually used to compute one token.
- Routing collapse
- A training failure where the router sends most tokens to only a few favorite experts.
- Expert parallelism
- Spreading different experts across separate GPUs during training or serving.
Check yourself
Can you explain it back?
1. Why is Mixtral 8x7B faster than a 47B dense model?
Even though Mixtral stores 46.7B parameters in total, its router only activates 2 of 8 experts per token, using 12.9B active parameters on each step.
2. Does an MoE with 3B active parameters fit in 3B worth of GPU memory?
No. Every expert still has to sit in memory because any token might pick any expert. Total parameters decide memory size.
3. Do experts neatly specialize into "Python" and "history"?
No. Mixtral's routing analysis found similar expert distributions across ArXiv, biology and philosophy, with more sensitivity to local token patterns and consecutive tokens.
4. Why do MoE models need load balancing during training?
Without it, the router tends to favor a few experts and starve the rest (routing collapse), wasting capacity and bottlenecking GPUs.
Continue the thread
More on how LLMs run
- KV Cache Explained. Why models keep index cards for every word in your chat.
- Quantization Explained. How shrinking weights to FP8 or INT4 helps big models fit in less GPU memory.
- Inference Engineering Masterclass. How batching, memory bandwidth and vLLM work end to end.
Read further
Sources
Checked on 2 December 2026.
- Jacobs, Jordan, Nowlan and Hinton, Adaptive Mixtures of Local Experts (Neural Computation, 1991)
- Shazeer et al., Outrageously Large Neural Networks: The Sparsely-Gated Mixture-of-Experts Layer (ICLR 2017)
- Fedus, Zoph and Shazeer, Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity (arXiv:2101.03961)
- Jiang et al., Mixtral of Experts (arXiv:2401.04088)
- Mistral AI: Mixtral of Experts
- DeepSeek-AI, DeepSeek-V3 Technical Report (arXiv:2412.19437)
- Meta AI: The Llama 4 herd
- Qwen: Qwen3: Think Deeper, Act Faster
- Hugging Face: Mixture of Experts Explained
- vLLM docs: Expert Parallel Deployment
Written with AI assistance. Technical sources are listed above.