per-token-compute -- not every token needs the same amount of work

A language model does exactly the same amount of work on every word, whether it is a comma or the crux of the sentence. Several shipped designs let that vary: a scorer admits only some words to each layer and the rest skip past, or a word stops once the model is confident enough, or a hard word is sent round the same layers more than once. The arithmetic saved is real. The catch is that chips want every word in a batch doing the same thing at the same time, so ragged work must be padded back out to a uniform shape or shuffled into one — and there are settings where that overhead costs more than the skipped work saved.

Interactive page: a standard transformer spends identical compute on every token, however trivial -- N tokens × L blocks, one uniform rectangle. This page draws what happens when that rectangle is allowed to go ragged, what the ragged shape costs to schedule.

Scope: this page is about how much compute a token receives. Which expert a token picks is ../moe-routing/, per-expert load, capacity and drops are ../moe-balance/ -- routing is not re-taught here.

The four mechanisms (modes of one widget)

ModeMechanismShape it makes
Mixture-of-DepthsA router picks a capacity-limited subset of tokens to process in each block; the rest skip it via the residual (arXiv:2404.02258)Interior gaps, but a fixed count per block
Zero-computation expertsAn MoE where some "experts" are the identity, so routing to one costs nothing and the model learns which tokens deserve real expertsEach token decides for itself, so the batch width wanders block to block
Mixture-of-RecursionsShared layers applied a variable number of times per token, so a hard token loops more (arXiv:2507.10524)A clean skyline, contiguous from the bottom
Early exitThe simplest form: a token stops once a confidence threshold is metA skyline too, driven by a confidence trace rather than a budget

The picture is the same in all four: sequence on one axis, depth on the other, each token's actual compute path drawn as a ragged height. Easy tokens (punctuation, predictable continuations) are short; hard ones are tall.

The cost that makes it honest

Ragged compute is a scheduling problem. GPUs want dense, uniform work, so a batch whose tokens take different paths either wastes capacity on padding or needs gather/scatter to compact itself -- and the router that makes the decision is charged on every token at every block, including the ones it skips.

Both counters are reported against one named baseline, the uniform-depth model (every token through every block, dense, no router), as a percent with the direction stated -- these are lower-is-better axes, so >100% is worse:

Both are computed live from the reader's settings, and there are reachable configurations on both sides: a real saving, and a net loss where the ragged shape costs more than it saves.

Interactions

Render tier

T1 (Canvas2D): the profile grid, the skyline, the per-block width bars and the two baseline meters are all vector work -- nothing here needs a GPU tier.

Wiring

layout.mount + controls (mode, N, L, cap, spread, sched, tile, gs, seed) + an L-step transport (one step per block) + onPointer drags for the difficulty strip and the two knobs + hover. Source: page.js.