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.

Mixture-of-Experts (MoE)Diagram with these labels, in reading order: process token; select experts; aggregate output; Input Token; Gating Network; (selects experts); Top-k Experts; (activated sub-networks); Output; (aggregated results).process tokenselect expertsaggregate outputInput TokenGating Network(selects experts)Top-k Experts(activated sub-networks)Output(aggregated results)
Mixture-of-Experts Architecture Overview

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.

  1. The input token flows to the gating network.
  2. The gating network selects the top-k experts.
  3. The active experts process the token while the others stay dormant.
  4. 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.

ConstraintBetter fit
Enough VRAM for the total parametersMoE, for strong quality per active FLOP
Tight memory, such as edge devicesA 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.

Mixture-of-Experts (MoE)Diagram with these labels, in reading order: Validation Accuracy Drop; Expert Activation Rate Low; Router Configuration Error; Insufficient Training Data; Overhead from Inactive; Experts; Adjust Router Threshold; Augment Training Dataset.Validation Accuracy DropExpert Activation Rate LowRouter Configuration ErrorInsufficient Training DataOverhead from InactiveExpertsAdjust Router ThresholdAugment Training Dataset
Debugging MoE Performance Issues

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:

  1. Log token distribution across experts to see utilization rates.
  2. Measure the effect of adding an auxiliary load-balancing loss to the training objective.
  3. 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.

Back to the knowledge baseRequest an assessment