Autoregressive generation hides an inequality: the model spends the same compute on every token. A nearly free next word like 'the' and the pivotal step of a long derivation cost the same inside a standard Transformer. Early-exit methods (CALM, LayerSkip) attack this along depth — easy tokens leave early and skip layers (https://arxiv.org/abs/2207.07061); width-elastic models (slimmable networks, MatFormer) cut channels instead. But the width route has a flaw nobody bypassed: widen the model and the activations the smaller model already computed get rewritten, so earlier work is wasted. Prefix-LM, just posted to arXiv (paper: https://arxiv.org/abs/2611.41819), offers a structural answer.
Why widening tears up the ledger
The paper first separates parameter nesting from representation nesting. The nine-author team from Polytechnic Institute of Turin, the University of Wisconsin-Madison, MBZUAI, and Amazon Science point out that in slimmable networks additional channels alter existing activations and therefore the inputs of every later layer; MatFormer shares cached context between a narrower drafter and a wider verifier, but verification still recomputes the draft tokens' representations and replaces their cached states (https://arxiv.org/abs/2310.07707); Matryoshka embeddings only make the final vector prefix independently useful, with no per-layer agreement. Sharing weights, in other words, is not the same as reusing computation — whether old work survives a budget switch is decided by structure, not by training tricks.
The authors check this directly: on CIFAR-100 with ResNet-20, adding a prefix-matching penalty to the slimmable objective (exactly what Prefix-LM gets for free by construction) still leaves significant prediction disagreement and layerwise prefix discrepancy — widening errors accumulate across layers, and a training loss cannot fix a structural problem.
The missing property is prefix invariance
The authors name it prefix invariance: at every layer, the smaller submodel's intermediate representation is an exact prefix of the larger one's. The paper proves this is equivalent to a simple condition — block-triangular maps, where the leading d output coordinates depend only on the leading d input coordinates — and that the property survives composition, aligned residual addition, and coordinate-wise nonlinearities, so the whole network is prefix-invariant end to end.
Mapped onto Transformer components: linear maps and FFN projections are zeroed block-triangularly; normalization becomes hierarchical, with each block's statistics computed over cumulative feature dimensions; multi-head attention groups heads, widening only activates new groups, and each earlier head retains its queries, keys, values, and attention weights untouched; vocabulary logits become cumulative — the next budget's logits are the previous budget's plus one incremental term, avoiding the repeated large-vocabulary head multiplication that non-exited heads pay in early-exiting. KV caches can then be shared across submodels layer by layer and head by head: backfilling exactly computes the missing blocks in parallel without re-prefilling; masking lets newly activated heads attend only to tokens where they have entries; copying and imputing are cheaper approximations that skip the pass.
One theoretical result rounds this out: in the linear case the architecture class contains the truncated-SVD optimum for every depth and width simultaneously, so the block-triangular constraint costs nothing in the simplest world. The paper itself notes that beyond the linear case no such simultaneous optimality can be expected — later blocks never altering earlier ones is a structural guarantee, not an optimality one.
Training: one forward pass graduates the whole family
Prefix invariance has a by-product: one full-width forward pass exposes the logits of every nested submodel, so the losses of all K budgets share a single computation graph and backpropagate together — in contrast with slimmable training, which samples one submodel per step. Supervision uses hierarchical self-distillation (HSD): each submodel distills from its immediate successor rather than the full model; teacher and student differ by exactly one refinement block, which lowers stochastic-gradient variance. In a GPT-2 ablation the full model reaches a loss of 3.461 with HSD versus 3.494 with standard KD, while training throughput is 7% higher and peak memory 15% lower. The paper also normalizes gradients by membership (MNG) but concedes that AdamW cancels most of its effect, which only shows up under optimizers like SGD.
The 1B-scale ledger
Inference works like this: every token starts at the smallest width, a small MLP router estimates the KL gap between the current budget's predictive distribution and the full model's, accepts when it is below a threshold, and otherwise adds one more block; the language model stays frozen while the router is trained. The main experiments cover Llama 3.2-1B, Nemotron-Flash-1B, and Qwen 3.5-2B (Llama nested widths use 3, 6, and 8 of the 8 total attention/KV heads), with the Llama variant at an effective 916.5M parameters and a parameter-matched dense control at 918.9M. Batch-1 decoding on an A100: at fixed full width Prefix-LM is 6.85% slower than the parameter-matched dense model — the hardware tax of triangular structure; a randomly sparse model of the same size is 40% slower than its own dense version, so the block-triangular sparsity pattern is unusually GPU-friendly, and cascading converts the saved compute into wall-clock speedups. Generation quality is scored with first-turn MT-Bench plus an LLM-as-judge proxy: the masking strategy matches the quality of the fixed-width medium model with only 70.2% of its FLOPs, a 1.42x FLOPs speedup. At equal FLOP budgets the cascade reaches higher downstream accuracy than the depth-axis baselines CALM and LayerSkip; the paper also flags that CALM reaches a higher maximum score, so the advantage concerns compute at comparable accuracy. The cost has numbers too: triangular connectivity raises held-out cross-entropy by about 5%, and the gap to independently trained models is roughly 60% architectural and 40% parameter-count-related.
So what
What this paper does, in my view, is reduce compute-by-difficulty from a routing problem to a representation problem. In methods without prefix invariance, shared heads produce different keys and values at different widths, so switching width forces the receiving model to rebuild or approximate the context; Prefix-LM shows that wasted work is a structural choice, not a law — switch to block-triangular maps and cascading, routing, and KV reuse all fall into place. Whether a 5% cross-entropy regret is worth paying depends on how much your inference bill hurts. When per-token compute starts deciding which products live, is reusable compute worth more than a larger model?