Debug Foundry

A big model that only wakes the few experts each token needs.

Turn it, pause it, drag through the steps. Then route your own token.

Not a video. A small simulation of mixture-of-experts: a router scores, a gate picks two, the rest stay dark.

Drag to turn · scroll or pinch to zoom

Finished state of the MoE routing simulation

Experts
6 waiting

1/8First step sentence

    0.0s
    Replay the ending with

    What it's for

    Good to know

    The router is a tiny learned layer: one score per expert, softmax into shares, then a top-k gate — the same scores-to-shares move as decoding, one chapter back. Only the k winners run; their outputs combine weighted by those shares. Training adds a load-balancing loss so tokens spread across experts instead of crowding the same one, and real systems cap how many tokens each expert accepts per batch (its capacity) and drop or reroute the overflow. Six experts with toy specialties and hand-set shares here; production models route over far more — 8 in Mixtral 8x7B, 128 per layer in some Switch variants. The combine weights shown are the router's full-softmax shares over all six experts (52% + 31%, the rest scattered over the dark four); some real models renormalize them over just the winners. A real token's route depends on its layer and context, not just the word itself.

    How it works, step by step

      Why the steps go in this order

      Before you rely on it

      This is a toy: six experts, fixed toy specialties, hand-set router shares, one token at a time. "A third of the FFN work" is this toy's arithmetic (2 of 6), not a benchmark — real savings depend on k, expert count, capacity limits and routing overhead, and the cited papers report their own measured results. Two lit experts is not two-sixths of the model's total cost: attention, the router and dispatch still run for every token, and every expert's weights still need to be stored and reachable. Expert specialties in real models are learned, never labeled, and a token's route can change between model versions. And the dense block splitting into experts is a teaching metaphor — MoE models are trained sparse, with their router, from the start; nobody converts a dense model into one.

      References