# Switch Transformers: route every token to exactly one expert

> Satyajit Ghana — Head of Engineering @ Inkers Technology
> canonical: https://ai.satyajit.si/articles/switch-transformer
> date: 2026-07-10
> tags: mixture-of-experts

**Switch Transformers** ([Fedus, Zoph and Shazeer, 2021](https://arxiv.org/abs/2101.03961)) 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.

<SwitchRouting />

<Figure
  src="https://media.thesatyajit.com/ai/articles/switch-transformer/fig1.png?v=e000c3d29adaa170"
  alt="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."
  caption="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](/articles/mixture-of-experts-from-scratch#switch-one-expert-a-buffer-and-the-tokens-that-fall-off), 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:

- **Top-1 halves the traffic.** Each routed copy of a token is an activation shipped to another device. One copy instead of two roughly halves the router's work and the all-to-all volume. In the paper's Table 1, Switch-Base at capacity factor 1.0 trains at 1,000 examples a second against 860 for the top-2 MoE-Base.
- **A fixed buffer, and the tokens that fall off it.** Each expert gets (tokens per batch / number of experts) × capacity factor slots, so tensor shapes stay fixed. The paper tests 1.0, 1.25 and 2.0. A token that finds its expert full is dropped: it skips the layer and rides the residual connection. With the balancing loss, drops were typically under 1%.
- **Two guardrails.** A balancing loss, $\alpha N \sum_i f_i P_i$ with $\alpha = 10^{-2}$, which equals $\alpha$ under perfectly even routing. And a router computed in float32 inside an otherwise bfloat16 model, since that softmax is where small errors flip the argmax.
- **Read the 7× precisely.** At equal FLOPs per token, Switch-Base reaches T5-Base's quality in about a seventh of the steps, and Switch-XXL reaches T5-XXL's about 4× faster. That is sample efficiency bought with memory and communication, not a wall-clock promise. Switch-C stores about 1.6 trillion parameters in 2,048 experts per layer, and a token still runs one expert's FFN.
- **Distillation keeps a slice.** Distilling the sparse teacher into a dense student compressed it by up to 99% while keeping about 30% of the sparse model's gain.

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](/articles/mixture-of-experts-from-scratch#switch-one-expert-a-buffer-and-the-tokens-that-fall-off) has the derivations and the measurements.
