Notes

Switch Transformer

Mixture-of-Experts models had a reputation for being fiddly: route each token to several experts, blend the results, then fight the instability that follows. Switch Transformer, published by Google in 2021, made the simplest choice available and showed it was enough — send each token to exactly one expert.

The design

In alternate transformer layers the feed-forward block is replaced by a bank of parallel experts, each a full feed-forward network, with a small router that picks the single highest-scoring one per token. That is top-1 routing, and it halves the compute and communication a two-expert scheme needs. Each expert accepts only a fixed quota of tokens, set by a capacity factor; tokens beyond the quota skip the layer through the residual connection. Three further tricks made training hold: a load-balancing loss so the router spreads work, computation in bfloat16 with the router kept in float32, and a smaller weight initialisation.

Results and legacy

Switch-Base reached T5-Base quality roughly seven times faster in wall-clock training time, and the largest configuration, Switch-C, carried 1.6 trillion parameters while costing about as much per token as a dense model a fraction of that size. The vocabulary every later sparse model uses — experts, routing, capacity factor, load balancing — is largely from this paper, and Mixtral and DeepSeek's sparse models follow the same shape. The paper also exposed the standing drawbacks: the full parameter set must fit across the available devices, and such models overfit easily when fine-tuned on small datasets.

Switch Transformer is a Google sparse model from 2021 that replaces the feed-forward block of alternate transformer layers with many parallel experts and routes each token to exactly one of them. This top-1 routing stripped Mixture-of-Experts down to a stable, cheap form, reaching T5 quality about seven times faster to train and scaling to 1.6 trillion parameters at near-constant compute per token. Its recipe — capacity factor, load-balancing loss, selective precision — is the template later sparse models follow.

Imagine a company that answers customer letters. Rather than have every employee read every letter, a sorter in the mailroom sends each one to exactly one specialist. Switch Transformer is an AI model built that way, and it was the design that proved the idea works at enormous scale. It holds thousands of specialist sections, but each word passing through visits only one of them. That let it carry more than a trillion adjustable settings while running about as fast as a far smaller model. Nearly every "mixture of experts" system since has borrowed its approach.