mixture-of-experts, drawn

What is an “expert,” really?

Not a specialist you can name. Just one of many parallel feed-forward blocks (MLPs) — and a small router that picks a few of them per token.

Decoder ring — every term on this page, in one line each

token
a chunk of text (a word or word-piece) — the unit the model reads and writes
parameter / weight
one learned number; a “7B model” has 7 billion of them
layer
one repeated stage of the model; dozens to ~100 stacked make the whole thing
attention
the part of a layer where tokens look at each other; stays normal in MoE
feed-forward block
= FFN = MLP
Three names, one thing. FFN = Feed-Forward Network; MLP = Multi-Layer Perceptron. It is the part of a layer applied to each token by itself (no looking at other tokens) — two matrix multiplies with a squashing function between. Holds ~⅔ of all parameters, and an “expert” is one copy of it
dense model
the normal kind — every token passes through every parameter
MoE
Mixture of Experts — a layer holding many parallel feed-forward blocks, of which only a few run per token
expert
one of those parallel feed-forward blocks. Not a subject specialist
router / gate
a tiny layer that scores the experts and picks which ones run for this token
top-k
how many experts the router keeps per token — commonly 1, 2, or 8
softmax
turns raw scores into fractions that add to 1 — the router’s blend weights
total vs active
parameters
total = what you must store; active = what actually runs for one token
shared expert
an expert that always runs, unrouted — some designs keep one
capacity factor /
token dropping
each expert has a seat limit per batch; overflow tokens get skipped
all-to-all
the network step where every GPU ships tokens to whichever GPU holds their expert
HBM
High-Bandwidth Memory — the GPU’s on-package memory; parameters live here

Read this once and every panel below is plain English. The only word doing sneaky work is “expert” — panel 3 is about exactly that.

1 · Start with the dense layer — every token walks the same hallway

tokens cat ∫dx def FEED-FORWARD BLOCK (MLP) ~2/3 of all parameters every token pays the FULL block

In a normal (“dense”) transformer, each layer has one feed-forward block, and every token goes through all of it. Want the model smarter? Make that block wider — and every token gets more expensive. Capacity and cost are welded together.

2 · An expert is just a copy of that block — and a router picks a few

∫dx ROUTER one tiny linear layer expert 1 0.02 expert 2 0.41 ✓ expert 3 0.05 expert 4 0.03 expert 5 0.33 ✓ expert 6 0.06 expert 7…8 0.10 WEIGHTED SUM out 0.41·E2 + 0.33·E5 6 of 8 experts never run for this token — their weights stay dark

Replace that one block with E copies of it (say 8, or 256). Add a tiny router: a linear layer that scores the experts for this token and keeps the top-k (usually 1, 2, or 8). Only those run; their outputs are blended by the router’s weights. Everything else in the layer — attention, norms — stays completely normal and dense.

total params = big (all E experts must be STORED) active params = small (only k experts RUN per token) DeepSeek-V3-class: 671B total → ~37B active

That is the whole trick: capacity is decoupled from cost. You buy knowledge with memory, and pay compute only for the slice each token uses.

3 · Are experts actually “experts”? — mostly no

THE MYTH 🇫🇷 French 🐍 Python 🧬 Biology 📜 Poetry tidy, human-shaped subjects THE REALITY punctuation after digits code indentation plural noun endings …no clean label at all token-level statistical niches, learned not assigned
Nobody assigns the specialties. The router is trained with everything else; experts drift into whatever split reduces loss. When researchers inspect them, the specializations are usually low-level and token-shaped — surface patterns, not school subjects. Routing is also per token, per layer: one word can use experts 2+5 in layer 3 and 41+199 in layer 4.

Which is why the name is the most misleading word in the field. “Expert” means “one of the parallel blocks the router may pick,” nothing more.

4 · A worked example — one token through one MoE layer

① token arrives “ ∫dx ” a vector, mid-layer, after attention shared experts (if any) always run ② router scores 256 scores, softmax top-8 kept e.g. 17, 41, 88, 90, 133, 199, 204, 251 a capacity cap may DROP the token if an expert is overfull ③ gather & compute those 8 blocks may live on 8 DIFFERENT GPUs all-to-all dispatch each runs its MLP; outputs return Σ wᵢ · Eᵢ(x) ④ next layer …and it routes again, to a different 8. stored: 671B ran: ~37B ≈ 5% of the model did the work

Two costs the picture makes visible. Memory: all 671B must sit in HBM even though 37B ran — MoE buys compute savings with capacity. Network: step ③ is a data-dependent all-to-all — the traffic pattern is decided by the router at runtime, so a popular expert becomes everyone’s bottleneck (a straggler with a fan club).

An expert is a spare copy of the feed-forward block.
The mixture is a router choosing a few, per token, per layer.