Muon is Scalable for LLM Training
Liu et al., Moonshot AI — arXiv:2502.16982. Muon itself is by Keller Jordan et al. (2024).
Muon is SGD with momentum, plus one extra step: before each update, the momentum matrix is replaced by its nearest semi-orthogonal matrix. Every direction then moves by about the same amount, so a few steep directions can no longer set the step size for the rest. Moonshot added the two changes that made it work at LLM scale: decoupled weight decay, and an update scale that keeps the update RMS at \(0.2\) for any matrix shape. Because of that scale, you can reuse your AdamW learning rate as is.
1 · Newton–Schulz orthogonalization
Build a matrix with a chosen condition number, then run muon.py's quintic on it. Each iteration applies the same scalar polynomial to every singular value, so small ones get pulled up and large ones pulled down. Move the step slider to watch the spread collapse. Five steps put the values in a band around \([0.65,\,1.2]\), not at exactly \(1\). The paper calls this inexact orthogonalization, and it's on purpose: it's cheaper, and Muon doesn't need more.
Step 0 is the input after dividing by its Frobenius norm, which guarantees every \(\sigma \le 1\). The repo runs this in bfloat16. This page uses float64, so it shows the polynomial without rounding noise. Push the condition number to \(10^4\) and five steps aren't enough: the smallest values are still climbing toward the band.
Every singular value, per iteration (log scale)
The scalar map \(f(\sigma) = 3.4445\,\sigma - 4.7750\,\sigma^3 + 2.0315\,\sigma^5\)
2 · Same RMS for every shape
An orthogonalized \(A\times B\) matrix has RMS \(1/\sqrt{\max(A,B)}\), so a \(16\times 512\) matrix moves about 3× less per step than a \(64\times 64\) one, and no single learning rate fits both. Moonshot multiplies by \(0.2\sqrt{\max(A,B)}\), which pins the RMS near \(0.2\) for every shape. That lands inside AdamW's usual \(0.2\)–\(0.4\) range. Same setup as test_update_rms_is_consistent_across_shapes: \(\eta = 1\), no momentum, a Gaussian gradient.
Computing…
With the scale, the spread stays under \(1.3\times\). Without it, the spread is over \(2.5\times\). Those are the same thresholds test_muon.py asserts.
3 · The mechanism, isolated
A deep linear net (two \(48\times 48\) layers) fits an ill-conditioned target using all 512 samples every step. Both runs use the same learning rate and the same momentum (\(\mu = 0.95\)). The only difference is whether the momentum goes through Newton–Schulz first. This mirrors test_orthogonalization_beats_raw_momentum.
What this does not show is Muon beating AdamW. On a full-batch toy like this, AdamW's \(m/\sqrt{v}\) saturates near \(1\), its effective step is about \(5\times\) larger, and it wins. The paper's \(\sim 2\times\) compute-efficiency result comes from billion-parameter pretraining, which a browser tab can't settle. That's why the repo's bench.py only checks that both optimizers train.
What this demo simplifies
Everything here is toy scale: matrices up to 512 wide and a two-layer linear net, not a transformer. The math runs in float64, while the repo's newtonschulz5 runs in bfloat16 on purpose, so real singular values are slightly noisier than the ones shown. Weight decay is off in the race, which matches the test it mirrors. Two things are left out entirely: the ZeRO-1 distributed sharding of the Newton–Schulz work (the paper's other systems contribution, and what makes Muon practical on a cluster), and the AdamW side of the hybrid that handles embeddings, the LM head and norms.