~/satyajit

Switch Transformers: route every token to exactly one expert

mdjsonmcp

2026-07-10 · 2 min · mixture-of-experts

Why read this

Nichelast 15%

A clear walk through top-1 routing, the capacity buffer and dropped tokens, the balancing loss and fp32 router, with the 7x and 1.6T read precisely.

  • Genuinely new idea
  • Evergreen reference
  • Widely used

LLM architectureNeeds datacenter GPUsPractitioner paper

How this was scored
Is it new?
3 of 3: Changes how the field does something
Can I trust it?
0 of 3: Restates claims
Can I run it?
1 of 3: API-only, gated or restrictive licence
Will I understand it?
2 of 3: Mechanism from first principles with figures
Can I act on it?
1 of 3: General advice
Will it last?
3 of 3: Evergreen fundamentals
Does it affect many?
2 of 3: A widely used model, tool or lab release
Only here?
0 of 3: Same as the press release

Score 49 of 100, ranked 664 of 773 rated articles. Each question is answered 0–3 by hand, and a 3 is rare. How articles are scored

Switch Transformers (Fedus, Zoph and Shazeer, 2021) made mixture-of-experts simple enough to scale with one blunt move: send each token to exactly one expert. The 2017 recipe argued for at least two, so the router could learn by comparing them. Switch keeps only the argmax.

Switch Transformer encoder block. Left, a standard transformer block with a Switching FFN Layer replacing the dense feed-forward network. Right, the layer expanded: two tokens x1 and x2 each pass through self-attention, then a Router that selects a single FFN. Token x1 goes to FFN 2 with probability 0.65, token x2 goes to FFN 1 with probability 0.8, and the chosen expert's output is scaled by that gate probability before the add-and-normalize.
The Switch layer: the router sends each token to one expert and scales that expert's output by the gate probability (Switch Transformers, Fedus et al. 2021, Figure 2).

This page used to carry the whole paper. It is now a summary, and the mechanism lives in Mixture of Experts, from scratch, next to GShard before it and DeepSeek's loss-free balancing after it, with a capacity-factor widget and drop rates measured on Qwen3-30B-A3B. The points worth keeping:

Newer models moved on from most of this: top-8 of many small experts instead of top-1, a per-expert bias instead of the loss, and no dropped tokens at all. They all start from this layer. The guide's Switch section has the derivations and the measurements.

Cite this article

For attribution, please use the following reference or BibTeX:

Satyajit Ghana, "Switch Transformers: route every token to exactly one expert", ai.satyajit.si, July 2026.

bibtex
@misc{ghana2026switchtransformer,
  author = {Satyajit Ghana},
  title  = {Switch Transformers: route every token to exactly one expert},
  url    = {https://ai.satyajit.si/articles/switch-transformer},
  year   = {2026}
}
share