A mixture of experts replaces one big feed-forward block with many experts and a router that sends each token to a few of them, so a model with hundreds of billions of parameters works on only tens of billions per token. Compute falls with sparsity, but every expert must still be held somewhere, so memory, balance and the router decide whether it pays.
Router hall
The router scores a token against every expert in the layer, keeps the top few, and sends the token only to them. The layer is huge in total but only a small share works on any token; the hall has to keep that share balanced.
- The router desk scores the token against every expert of the layer and writes the scores on a ticket.
- The pick board keeps the few highest-scoring experts, eight in a typical layer, and drops the rest.
- The dispatch chute sends the token only to the devices that hold the picked experts.
- 295B total, 21B active
- Parameters of one 192-expert, top-8 open model: the share that works on one token; reported in a newsletter recap of the release AINews
- 16 of 896
- Routed experts a 2.8T-parameter model activates per token, reported by its own paper Hugging Face
- 5.9-13.9%
- Cut in median time per output token from routing requests by expert locality, over the best of four load-only routers; paper authors, up to 40 GPUs Hugging Face
- 59.3%
- Largest cut in the MoE dispatch memory peak from capping tokens per dispatch chunk, in component tests, without losing throughput; paper authors Hugging Face
- In a standard layer one router scores every expert with softmax gate weights, and the token takes the K highest; K=8 is a typical choice. Hugging Face
- The layer output is the sum, over the picked experts, of each expert's output times its gate weight. Hugging Face
- Router rows act as proxies for the experts: a token's dot product with a row stands for its affinity to that expert. Hugging Face
When it breaksThe balance that broke after fine-tuning. A lab trained an MoE whose balanced use of experts held in pretraining. The post-training data looked very different from the pretraining data, and the experts became massively imbalanced. The team fixed it by cranking up the load-balancing coefficient during fine-tuning. Varun Singh
Expert cellar
The experts are most of the weights, and all of them have to be somewhere. Sparsity cuts the work per token, not the bytes held, so the cellar decides whether the model runs at all: resident, streamed through a bounded cache, or cut down.
- The cache vault holds the picked experts in a bounded set of slots and reads each miss from the SSD.
- The expert bench runs every picked expert on the token together, in one grouped pass.
- The gate scale weights each expert output by its gate weight and adds them into one vector for the next layer.
- 12 GiB cached, 49 GB on disk
- Expert store of one 48-layer, 512-expert model run on a 32 GB laptop: 3-bit experts on disk, the cache on the device; reported by the post author Hugging Face
- 0.16 tok/s
- Decode speed of a 35B-A3B model on one 24 GB GPU through the offload that copies whole expert banks; measured by the post author Hugging Face
- 82-88 tok/s
- Decode speed of the same model on the same GPU through an engine that keeps hot experts in VRAM and streams the rest; measured by the post author Hugging Face
- 19.5 GB
- Size of a 35B-class MoE at 4-bit: the bytes that must be held although sparsity shrinks compute; paper authors Hugging Face
- ~14 tok/s
- Decode speed of streaming a 121 GB-of-experts model from SSD on a 32 GB laptop, which the author calls too slow for coding agents Hugging Face
- 20 tok/s in 3 GiB
- A 35B MoE served from SSD with a prerouter on one 24 GB machine, peak active memory; paper authors Hugging Face
- 42.3 vs 36.2
- SWE-Bench Pro score of one 35B-A3B model with half its experts pruned by a method that keeps cooperating experts, against a method that scores experts one by one (the unpruned model scores 41.8); post authors Hugging Face
- Experts are most of an MoE model's weights, so keeping only the hot experts in GPU memory lets a 180B model run on a small card. Hugging Face
- In one 122B model nearly all of the memory footprint is expert layers, yet only 8 of 256 experts per layer work on a token. Hugging Face
- Weight memory bounds MoE inference on consumer hardware: sparsity cuts compute per token, not the bytes that must be held. Hugging Face
When it breaksThe offload that copied the whole bank. A user ran a 35B model with 3B active parameters on one 24 GB GPU through the common Transformers offload. For each token it copied every expert of every offloaded layer to the GPU to use 8 or 10 of them, with no cache. It decoded at 0.16 tokens per second; an engine that kept hot experts on the GPU and streamed the rest reached 82 to 88. Hugging Face
Open questionWhen an MoE does not fit in memory, delete experts for good or stream them from disk?
- Delete the least useful experts for good: no training, composes with quantization, and no on-demand loading latency; a method that keeps cooperating experts held SWE-Bench Pro at half the experts. Hugging Face
- Keep every expert and stream only what the router picks through a bounded cache, fast enough that the SSD is the bottleneck. Hugging Face