A mixture-of-experts (MoE) architecture replaces dense feed-forward layers with many "expert" sub-networks and a router that activates only a few per token. Mixtral 8x7B and DeepSeek-V3 use it.
Top-k routing per token
For each input token, a gating network evaluates the available experts and selects the top-k, typically a couple out of a larger set such as 2 from 8.
- The input token flows to the gating network.
- The gating network selects the top-k experts.
- The active experts process the token while the others stay dormant.
- The output is aggregated from the active experts.
Mixtral 8x7B holds about 46.7 billion parameters in total and uses 12.9 billion per token, because a router picks 2 of 8 experts at every layer. Compute scales with the active experts rather than the total parameter count. A dense model runs all parameters for every input, so MoE decouples a model's capacity from its inference compute. That keeps a large MoE model cheaper to run than a dense model with the same total parameters.
The software analogue is a load balancer sending each request to a specialized worker. The routing here is learned dynamically per token. Unlike a worker pool that can scale down to the busy members, all experts must stay resident in memory, because the router can pick any of them.
Memory footprint for self-hosting
All experts must reside in VRAM at once, so the memory footprint reflects the total parameter count even though few experts are active. This is the practical constraint when you self-host. If memory capacity is exceeded, performance suffers or the model cannot run at all.
| Constraint | Better fit |
|---|---|
| Enough VRAM for the total parameters | MoE, for strong quality per active FLOP |
| Tight memory, such as edge devices | A smaller dense model, simpler to deploy and manage |
Example scenario: router load imbalance
Example scenario: an MoE model scores 60% accuracy on a validation set where 85% was expected. Both figures are illustrative.
The router may distribute tokens unevenly, overloading some experts and leaving others underused. The imbalance can come from the router's learned preferences or from input characteristics that favor particular experts. Checks:
- Log token distribution across experts to see utilization rates.
- Measure the effect of adding an auxiliary load-balancing loss to the training objective.
- Try a capacity factor for each expert to cap the tokens it handles.
The likely fix is an auxiliary load-balancing loss that encourages a more uniform spread, at the cost of some training complexity. Monitor expert utilization and overall model quality. The scenario sets an illustrative target of at least 50% utilization across all experts.