Basis Lab

Answers · How models work

Why do so many tokens end up routed to the same few experts?

In shortBecause picking and training reinforce each other: an expert chosen more often gets trained more, which gets it chosen more often again, so the traffic collapses onto a few.

Because choosing and training reinforce each other. Whichever expert is selected receives gradient and gets better at what it sees, which makes the chooser select it more often still, and the experts that were never selected produce no output at all, so nothing ever tells the chooser what they could have done. In an eight expert layer that starts with an even eighth of the traffic each, the busiest expert typically climbs to holding the large majority of tokens within a couple of thousand training steps.

The loop, one step at a time

Start from an accidental imbalance so small you would not notice it. One expert is picked for slightly more tokens than its siblings in the first few batches. More tokens means more training signal, so it becomes genuinely better at the kind of input it happened to see. The chooser now scores it higher, and it is right to: it is the better expert now, and the scoring is doing exactly what it was designed to do. So it receives more tokens again, which closes the loop. Four steps, each sensible on its own, and the layer ends up with one useful expert and seven inert ones. The irreversibility comes from the last step. An expert that is never picked emits nothing, so the chooser never observes whether it would have handled a token well, and there is no signal pushing back towards it.

Take one real batch of roughly 28,000 tokens spread over eight experts. An even split would be 3,500 tokens each. Here is a collapsed batch beside a balanced one, in thousands of tokens per expert.

FIG 1Tokens per expert in one batch, thousands
c1c2c3c4c5c6c7c8
collapsed1.10.40.624.20.30.80.50.1
balanced3.63.43.74.13.33.53.62.8
Both rows total 28,000 tokens. In the collapsed row one expert takes 24,200 of them, which is 86 per cent of the batch, while the other seven share 3,800 between them.

Two bills follow, and they are separate. The first is capacity: 24,200 tokens buy one expert, and the 3,800 remaining are spread so thinly across seven that none of them learns very much. The parameters were paid for in memory and are carried on every machine for the life of the model, so you get the deployment difficulty of a large model with the useful capacity of a small one. The second is time. A step finishes when its slowest expert finishes, and the busiest expert here has 24,200 tokens against 4,100 in the balanced row, so the step takes 24,200 divided by 4,100, about 5.9 times as long. The other seven experts sit idle for most of it.

Why a trained router does not spread the load by itself

The natural guess is that a router trained alongside the experts will learn to distribute work, or that a badly distributed router is a broken one. Neither holds. The gradient reaching an expert flows only through the tokens that expert was selected for, so an expert selected for nothing receives nothing to learn from and stays exactly as it was initialised. The chooser is not making an error when it concentrates traffic; it is correctly preferring the expert that has seen the most data, and that expert is better precisely because it saw the most data. There is no mistaken step in the loop to correct, which is why balancing has to be imposed from outside the loop rather than trained into it.

The traditional remedy adds a penalty to the loss. With nn experts, fif_i the share of the batch actually sent to expert ii, and PiP_i the chooser's average score for expert ii over the batch whether or not it was selected:

Lb=α n∑i=1nfiPiL_{b} = \alpha\, n \sum_{i=1}^{n} f_{i} P_{i}

The product matters, and each half alone fails. The share fif_i comes from a discrete selection, so on its own it gives nothing to differentiate; the mean score PiP_i can be made flat by a chooser that spreads its scores while still sending everything to one expert. Multiplied together they are smallest when both are flat, and the continuous half supplies the gradient. Check it on two experts with α=1\alpha = 1. Perfectly even, f=(0.5,0.5)f = (0.5, 0.5) and P=(0.5,0.5)P = (0.5, 0.5), gives 2×(0.25+0.25)=12 \times (0.25 + 0.25) = 1. Collapsed, f=(0.9,0.1)f = (0.9, 0.1) and P=(0.9,0.1)P = (0.9, 0.1), gives 2×(0.81+0.01)=1.642 \times (0.81 + 0.01) = 1.64. The penalty is 1.64 times larger on the collapsed routing, which is the pressure that pushes back.

The coefficient α\alpha is a dial between two failures rather than a setting with a right answer. Too small and the main objective overwhelms it and collapse happens anyway; too large and the chooser sends tokens to experts that handle them worse purely to even the numbers, costing quality. In practice it lands near a hundredth and has to be found again whenever the layer shape changes. The alternative avoids the dial entirely: keep one extra offset per expert, added to that expert's score for selection only and never in the blend weights, so it does not affect the output or the loss. After each step, nudge the offset down for an overused expert and up for a starved one, by a fixed small amount. Across a few steps the offsets might read −0.02-0.02, then −0.06-0.06, settling at −0.07-0.07 on the overloaded expert and +0.06+0.06 on the starved one, at which point traffic is even and they stop moving. Nothing has been added to the objective, but the offsets are a control loop rather than a guarantee, and they can lag a shifting distribution or oscillate if adjusted too aggressively.

Two things limit all of this. Balance within a batch is not balance within a sequence: an expert can receive its fair share of a batch while receiving nothing from most of the sequences in it, and where sequences arrive one at a time it is the second that decides how well the expert is trained. And with a very large number of experts and few tokens per batch, the shares are coarse, so the correction is noisy. Neither the penalty nor the offsets removes the feedback loop; they only hold it in check while the training distribution stays roughly where it was.

Worth keeping

  • An expert is only trained on the tokens it was selected for, so selecting it less is the same as training it less, which justifies selecting it less.
  • Collapse wastes capacity twice: parameters that are held in memory but never trained, and hardware that waits on one overloaded expert while the rest idle.
  • A balancing penalty trades traffic evenness against model quality through a coefficient that has to be retuned whenever the layer shape changes; per-expert score offsets avoid that trade but behave as a control loop rather than a guarantee.

Where this goes next

This question is one step of Many Specialists, One Model, a course that works through its subject from the beginning. The page that teaches this part of it is When Everything Goes to One Place, and it reads the whole way through whether or not you have an account.

What an account changes is the practice: problems standing under every idea, marked with a reason rather than a tick, in a copy of the course that is yours.

Read that pageThe whole course

Other questions people ask about this

  1. Why does a model cost the same to run no matter what you ask it?In an ordinary model every weight runs on every token, so the arithmetic per token is fixed by the model size, not by how hard the question is.
  2. Why does the model get stuck repeating the same sentence over and over?The model is not stuck in a memory loop: once it has written a phrase, that phrase is in its context and makes writing it again more likely, so a decoder that always picks the top word cannot leave.
  3. Why does diffusion add Gaussian noise instead of any random corruption?Diffusion adds Gaussian noise because Gaussian errors combine exactly: each step keeps the spread fixed and gives a closed-form noisy picture at any later step, which makes the reverse step learnable.
  4. Why does the same request cost more tokens in some languages than in others?A token is learned from a corpus, so a language that was rare in the training text is split into many more pieces for the same meaning, and the price multiplier follows.
  5. How do you turn the predicted noise into the mean of the previous image?Subtract a small scheduled fraction of the predicted noise from the current image, then rescale to undo the forward step's shrinkage.
  6. Why does the forward noising process have to be a Markov chain?The forward process is made memoryless so that each step is a fixed random rule and any later state can be computed straight from the original picture.

Read alongside