Ask anyone who has paid a cloud bill for model training what limits them and you will hear the same word: compute. Every token that passes through a dense transformer touches every weight in every layer, every time. That predictability is a virtue. It is also the reason costs climb so steeply as models grow.
Mixture-of-experts architectures break that rule on purpose. Instead of one large network doing all the work, you get many smaller expert networks plus a router that decides, token by token, which few of them should run. The result is a model that can hold a huge number of parameters while spending the compute of a much smaller one.
A dense model is a generalist. Every parameter participates in every prediction, so capacity and cost rise in lockstep. MoE keeps the capacity but loosens the link to cost.
The swap usually happens inside the feed-forward block of a transformer, which is typically the bulkiest part of the layer. One large feed-forward network becomes a set of parallel ones. A small gating network examines each token and selects the top few experts — commonly two out of eight, sometimes one out of dozens. Only the chosen experts execute. The others sit idle for that token, but they still occupy memory.
Two numbers matter, and conflating them causes most of the confusion around these models:
A model can carry hundreds of billions of total parameters and activate a small fraction of them per token. That gap is the whole appeal. It is also the source of most of the engineering pain.
Capacity and compute used to move together. Sparsity is what pulls them apart.
Nothing about the routing decision is hand-coded. It is learned, and it happens fresh for every token at every MoE layer. The mechanics are straightforward:
Different tokens in the same sentence can take different paths. That is the point: a token about a chemical formula and a token about a legal clause do not need identical machinery.
During training, the floating-point operations needed per token roughly track active parameters, not total parameters. But memory and bandwidth still scale with everything you keep resident. So the trade is specific: you spend memory and network traffic to buy back compute.
That trade looks great on a cluster with plenty of high-bandwidth memory and fast interconnects between accelerators. It looks terrible on one consumer GPU, where experts must be shuffled in and out of scarce memory. This is why MoE models are typically sharded across many devices rather than squeezed onto one.
Inference has two distinct regimes, and they behave differently:
If you are evaluating an MoE for a real deployment, measure both. A benchmark that reports only one of them is telling you half a story.
Left alone, routers tend to collapse onto a handful of favored experts while the rest go unused. Training recipes add auxiliary losses that nudge the router toward even distribution. That introduces a tuning knob with real consequences: push too hard and the router stops caring about quality, push too little and you are paying for experts that never learn.
Experts live on separate devices. Tokens must be sent to whichever device holds their chosen expert, and results sent back. These all-to-all exchanges can dominate step time. Fast interconnects matter more here than raw FLOPs.
Each expert sees only a subset of tokens, so its gradient signal is thinner. Standard tricks — careful initialization, conservative learning rates, gradient clipping — matter more than they do in dense training, and instability shows up early if the setup is wrong.
The architecture is not free. A short list of the honest downsides:
Skip the architecture debate and start from your constraint. If your bottleneck is compute per token and you have memory and interconnect bandwidth to spare, MoE is a strong fit. If your bottleneck is memory, or you need to run on a single device, a dense model with comparable active parameters will usually be simpler and cheaper to operate.
Three questions will settle most decisions. First: what am I optimizing — latency, throughput, or quality per dollar? Second: can I batch requests, or is every call a one-off? Third: can I shard across fast links, or am I stuck with slow ones?
Then measure instead of assuming. Establish a dense baseline at the quality you need, record tokens per second, memory, and cost per million tokens, and compare an MoE at matched active parameters. Report total and active parameters separately, and test with your own batching pattern rather than a vendor's. The architecture is only interesting when those numbers beat what you already have.
Photo: geralt / Pixabay