Notes

Sparse Routing

Most neural networks are dense: every parameter does work on every token, so a bigger model makes every single prediction more expensive. Sparse routing is the escape from that bargain — the network decides, token by token, which small part of itself to switch on.

How the decision gets made

A layer that routes sparsely holds several parallel sub-networks and one small learned router in front of them. The router scores those sub-networks for the token currently being processed, keeps the highest one or two, and leaves the rest untouched — they produce nothing and cost nothing. The scoring itself is trivial, a single matrix multiply and a softmax, so nearly all the arithmetic still happens in the chosen paths. This is conditional computation: total parameters and active parameters become two different numbers, and only the second one sets the cost of a token.

Why it is worth the trouble

Mixtral advertises 46 billion parameters and runs roughly 13 billion of them per token; that gap is sparse routing. It buys capacity in exactly the regime where serving cost rather than training cost is the binding constraint. The bill arrives elsewhere:

  • Memory stays dense — every sub-network has to sit in GPU memory even while idle, so the hardware requirement tracks the total parameter count.
  • Communication grows — the paths live on different devices, so tokens are shipped across the interconnect inside every routed layer.
  • The router can collapse — without a load-balancing penalty it settles on a few favourite paths and the others never learn, which is the usual reason a sparse model fails to beat the dense one it replaced.

Sparse routing is a design in which a small learned router sends each token through only a few of a layer's many parallel sub-networks, leaving the rest idle. It separates a model's total parameter count from the active parameters that set compute per token, so capacity can grow without a matching rise in serving cost. The model still occupies full memory, and the router needs a load-balancing penalty to stop it favouring a handful of paths.

Picture a huge library where, instead of making you read every shelf, a librarian at the door glances at your question and walks you to one or two shelves. Sparse routing works like that inside an AI model. The model is enormous, but for each word it handles, a tiny decision-maker inside it picks just a couple of its many sub-sections to do the thinking. So the model can know a great deal while each answer stays fast and affordable. The catch is space: all those unused sections still have to be kept ready, like shelves you paid for but did not visit today.