Optimisers · a visual explainer

Muon vs AdamW, one update at a time

A teammate, Shaurya, trained the same speech recognition model twice this week, once with AdamW and once with Muon. He tuned the learning rate only for AdamW and reused it for Muon, and Muon still won on 23 of his 29 test sets. That made me want to understand what Muon actually does differently. This page starts from what an optimiser is for, goes through momentum, Adam and AdamW, and then spends the second half on Muon.

Reading time ≈ 15 min3 interactive figuresNo libraries, no web fonts
01 / The training loop

What an optimiser does

A neural network is a long list of numbers called weights. Training is a loop that nudges those numbers so the model's mistakes get smaller. Each pass through the loop does four things, and the optimiser owns only the last one. Click through the steps.

Step 1 of 4

The training loop: forward pass, loss, backward pass, optimiser update, and back to the forward pass repeat for every batch · a large language model does this hundreds of thousands of times Forward passbatch in, predictions out Lossone number: how wrong? Backward passa gradient for every weight Optimiser stepturn gradients into a changeSGD · Adam · AdamW · Muon

The simplest optimiser takes each weight and moves it a little in the opposite direction of its gradient. That is plain gradient descent, or SGD when the gradient comes from a random batch. The size of the move is the learning rate, usually written η.

w ← w − η · gw is a weight, g is its gradient. Everything on this page is a different answer to the question "what should we subtract?"

So why do we need anything fancier? Because the loss surface of a real network is a bad shape to walk down. Some directions are very steep and others are almost flat. One learning rate is too big for the steep directions and too small for the flat ones. Every optimiser after SGD is a way of fixing that.

02 / Momentum

Walking down a long narrow valley

Here is the problem in two dimensions. The loss is a valley that is a hundred times steeper across than along. Every optimiser starts at the same point on the left and gets 60 steps to reach the bottom at the centre. Press play, or drag the slider to scrub through the steps.

Figure 2 · Three optimisers in a narrow valley toy problem
60
SGD, η = 0.45SGD with momentum, β = 0.9, η = 0.1Adam, η = 0.3
What to look for. SGD's learning rate is just under the point where it would blow up across the steep direction. It zigzags at first, and after 60 steps it has still covered only two-thirds of the long direction. Momentum keeps a running sum of past gradients, so the side-to-side pushes cancel out and the along-the-valley pushes add up. Adam rescales each coordinate separately, so the flat direction gets as big a step as the steep one. It covers the long distance quickly and overshoots a little at the end. Loss here is ½(0.04x² + 4y²).
m ← β · m + gMomentum: keep a running sum of recent gradients, decaying by β each step (0.9 is typical).
w ← w − η · mStep along the running sum instead of the raw gradient.

Momentum dates back to Boris Polyak in 1964, and Sutskever and colleagues showed in 2013 that it matters a lot for deep networks. It is still inside every optimiser on this page, Muon included.

03 / Adam

Adam gives every number its own step size

Adam, from Diederik Kingma and Jimmy Ba in 2014, keeps two running averages for each weight. The first, m, is momentum. The second, v, is the average of the squared gradient, which tells you how big that weight's gradients usually are. Adam divides one by the square root of the other.

m ← β₁ m + (1 − β₁) gAverage gradient, β₁ = 0.9. Which way has this weight been pushed lately?
v ← β₂ v + (1 − β₂) g²Average squared gradient, β₂ = 0.999 (LLMs often use 0.95). How hard has it been pushed?
w ← w − η · m̂ / (√v̂ + ε)The hats are a bias correction for the first few steps, when m and v start at zero.

The division is the whole trick. If a weight's gradients are large, the step is divided by something large. If they are tiny, it is divided by something tiny. When the gradient is steady, m̂ / √v̂ comes out close to ±1, so every weight moves by roughly η no matter how big its gradient was. When the gradient keeps flipping sign, the average in m cancels out while v stays large, and the step shrinks. The figure below shows three weights that get very different gradients.

Figure 3 · How big a step does each weight take? made-up gradients
10
Same learning rate, η = 0.01, for both. SGD's step is just η times the gradient, so the weight with tiny gradients barely moves and the weight with large ones moves 200 times more. Adam's steps for the two steady weights are both about 0.01. The noisy weight, whose gradient alternates between +3 and −2.6, gets a small Adam step because its average direction is weak compared to its size.

The cost. Adam stores two extra numbers, m and v, for every weight. A model with 7 billion weights carries 14 billion more numbers of optimiser state. Muon keeps only m.

One way to read Adam that becomes useful later: if you turn off the averaging, g / √g² is just the sign of g. Adam is a smoothed version of "move every number by the same amount in the direction of its gradient." Each number is treated on its own. Adam has no idea that the 4,096 × 4,096 numbers in one attention projection belong together as a matrix.

04 / AdamW

AdamW fixes how Adam shrinks weights

Weight decay pulls every weight slightly towards zero on each step. It stops weights from growing without bound and acts as a regulariser. With SGD, the usual way to do it is to add λw to the gradient, which is the same as adding ½λw² to the loss. Ilya Loshchilov and Frank Hutter noticed in 2017 that this stops being the same thing once Adam is involved.

Adam with L2

The decay term is added to the gradient, g + λw, and then the whole thing goes through Adam's division by √v. A weight that gets large gradients has a large √v, so its decay is divided away to almost nothing. Weights that are pushed hardest get regularised least.

m, v ← from (g + λw)
w ← w − η · m̂/√v̂

AdamW, decoupled

Adam only sees the real gradient. The decay is applied separately, straight to the weight, after the Adam step. Every weight shrinks by the same fraction ηλ, whatever its gradients look like.

m, v ← from g
w ← w − η · (m̂/√v̂ + λw)

Figure 4 · Pull towards zero per step, for two weights both equal to 1.0 illustrative
Why this mattered. Both weights are the same size, so a regulariser should treat them the same. AdamW pulls each by 0.1 η. Adam with L2 pulls weight B, the quiet one, about 46 times harder than weight A, because A's large gradients swamp the decay term before the division. AdamW became the default for training Transformers. Most LLMs from GPT-3 onwards were trained with it, usually with β₂ = 0.95 and λ = 0.1.

That is the baseline Muon is up against. AdamW is robust, well understood, and has a decade of tuning folklore behind it. It is also elementwise. Every one of the millions of numbers in a weight matrix gets its own step, worked out without looking at any of the others.

05 / Muon

Muon treats a weight matrix as a matrix

Muon was written up by Keller Jordan in December 2024, after it set records in the NanoGPT and CIFAR-10 speedruns. The name stands for MomentUm Orthogonalized by Newton–Schulz. It applies only to the 2D weight matrices inside the network, and it does one thing differently from SGD with momentum: before applying the momentum, it replaces it with the nearest orthogonal matrix.

M ← μ M + GMomentum on the whole gradient matrix G, μ = 0.95, usually Nesterov-style.
O ← Orthogonalise(M)If M = U S Vᵀ, then O = U Vᵀ. Same directions, every singular value set to 1.
W ← W − η · OApply the orthogonalised update. Moonshot's version also scales it and adds AdamW-style decay (section 08).

To see why that helps, picture what a weight update does. A matrix maps input vectors to output vectors. If you feed it every unit-length input, the outputs trace out an ellipse (in many dimensions, an ellipsoid). The lengths of the ellipse's axes are the matrix's singular values. Gradient updates for Transformer layers turn out to have very lopsided singular values. A few directions dominate and the rest are close to zero, so the update is nearly low rank.

Figure 5 · What orthogonalising does to a 2 × 2 update
A unit circle mapped by the momentum matrix and by its orthogonalised versionOn the left, a unit circle of inputs. In the middle, the momentum matrix stretches it into a long thin ellipse with axes 1.0 and 0.08. On the right, the orthogonalised matrix maps it to a circle of radius 1, rotated. every input of length 1 momentum MMuon: U Vᵀ long axis σ₁ = 1.0short axis σ₂ = 0.08 the update mostly pushes one way both directions get a full step
Same directions, different lengths. Orthogonalising keeps the axes of the ellipse where they were and makes them all the same length. The weak direction, which plain momentum would have nudged by 8% of the strong one, now gets an equal share of the update. Keller Jordan's explanation is that those rare directions matter for learning but get drowned out in an ordinary update.
Adam's view of a weight matrix

Each entry is normalised on its own, so roughly every entry moves by the same amount. In the language of Bernstein and Newhouse, that is steepest descent when you measure the size of a step by its largest entry.

Muon's view

The whole matrix is normalised, so every singular direction moves by the same amount. That is steepest descent when you measure the size of a step by its largest singular value, the spectral norm. For a layer that maps vectors to vectors, that is the natural way to measure how much the layer's behaviour changed.

06 / Newton–Schulz

Orthogonalising without an SVD

The obvious way to compute U Vᵀ is a singular value decomposition, which is far too slow to run on every weight matrix at every step. Muon uses a Newton–Schulz iteration instead. It is five rounds of the same small polynomial, built only from matrix multiplications, and it runs fine in bfloat16 on a GPU.

X₀ = M / ‖M‖F    then five times:   X ← a X + (b A + c A²) X,   A = X Xᵀ(a, b, c) = (3.4445, −4.7750, 2.0315). Dividing by the Frobenius norm first guarantees every singular value starts at 1 or below.

The trick is that this polynomial acts on each singular value separately and leaves the directions alone. Each round sends a singular value σ to aσ + bσ³ + cσ⁵. Near zero that is about 3.4 times bigger, so small values grow fast, while values near 1 stay near 1. Drag the slider to watch sixteen singular values from a lopsided update go through the five rounds.

Figure 6 · Singular values through the Newton–Schulz iteration real coefficients
0
Not exactly 1, and that is fine. The coefficients were tuned to pull small values up as fast as possible, at the cost of landing in a band of roughly 0.7 to 1.2 rather than on 1 exactly. Keller Jordan found the noise did not hurt training. A value below about 0.001 does not make it into the band in five rounds, but those directions are tiny to begin with. The starting values here are spaced evenly on a log scale from 0.9 down to 0.003.

This is the core of the PyTorch reference code, lightly trimmed. It transposes tall matrices so X Xᵀ is the smaller of the two products.

def newton_schulz(G, steps=5):
    a, b, c = 3.4445, -4.7750, 2.0315
    X = G.bfloat16()
    tall = G.size(-2) > G.size(-1)
    if tall: X = X.mT
    X = X / (X.norm(dim=(-2, -1), keepdim=True) + 1e-7)
    for _ in range(steps):
        A = X @ X.mT
        B = b * A + c * A @ A
        X = a * X + B @ X
    if tall: X = X.mT
    return X
5Newton–Schulz rounds per step, each three matmuls
< 1%extra FLOPs for typical LM training, per Keller Jordan's estimate
1 bufferof optimiser state per weight (momentum), against Adam's 2
0.95momentum μ, Nesterov-style, the common default
07 / The parameter split

Muon does not replace AdamW, it shares the model with it

Orthogonalising only means something for a matrix that maps one hidden vector to another. The embedding table is a lookup, not a linear map in that sense, and the output head behaves differently too. Norm gains and biases are vectors. So every Muon setup I have seen runs two optimisers side by side.

ParameterShapeOptimiserWhy
Attention Q, K, V, output projections2D, hidden × hiddenMuonHidden-to-hidden maps. Keller Jordan reports Q, K and V work better orthogonalised separately than as one fused matrix.
Feed-forward / expert matrices2DMuonMost of the model's weights live here, so most of the benefit does too.
Conv filters4DMuon, flattened to 2DUsed in the CIFAR-10 speedrun and in ASR encoders with conv modules.
Token embedding2D, vocab × hiddenAdamWEach step only touches the rows for tokens in the batch. It is a table, not a map between hidden spaces.
Output head / classifier2D, hidden × vocabAdamWEmpirically better with AdamW in the original speedrun work.
Norm gains, biases, scalars1D or 0DAdamWThere is nothing to orthogonalise in a vector.
# PyTorch has shipped torch.optim.Muon since 2.9; it only accepts 2D params
hidden = [p for n, p in model.named_parameters() if p.ndim == 2 and "embed" not in n and "head" not in n]
ids    = {id(p) for p in hidden}
rest   = [p for p in model.parameters() if id(p) not in ids]
opt_muon  = torch.optim.Muon(hidden, lr=0.02, momentum=0.95, weight_decay=0.1)
opt_adamw = torch.optim.AdamW(rest, lr=3e-4, betas=(0.9, 0.95), weight_decay=0.1)
# every step: loss.backward(); opt_muon.step(); opt_adamw.step(); zero both

The learning rates above are placeholders to show that the two groups usually have different values. PyTorch's adjust_lr_fn="match_rms_adamw" option rescales Muon's update so the two can share one learning rate, which is the Moonshot trick in the next section.

08 / Evidence

Does it actually work?

Muon started on small speedrun benchmarks, and the obvious worry was whether it would hold up at scale. Over 2025 and 2026 several large training runs answered that.

WhenWhoWhat they found
Oct–Dec 2024Keller Jordan et al.NanoGPT speedrun about 1.35× faster than AdamW. CIFAR-10 to 94% in 2.6 A100-seconds, down from 3.3. A 1.5B model hit GPT-2 XL HellaSwag in 10 8×H100-hours against 13.3 for AdamW.
Feb 2025Moonshot AI, "Muon is Scalable for LLM Training"Two changes were needed at scale. They added AdamW-style weight decay, and scaled each update by 0.2·√max(A, B) for an A × B matrix so its RMS matches a typical AdamW update. Muon needed about 52% of AdamW's FLOPs to reach the same loss. They trained Moonlight, a 16B-total, 3B-active MoE, on 5.7T tokens.
Jul 2025Moonshot AI, Kimi K2A 1T-parameter MoE (32B active) trained on 15.5T tokens with MuonClip, which adds QK-clip to stop attention logits from blowing up. The report says "zero loss spike".
2026DeepSeek V4 and V4.1 FlashMuon for matrix parameters, AdamW for the rest. Their reports list momentum 0.95 and weight decay 0.1.
Oct 2026Shaurya Sharthak, ASRTwo-epoch run on a streaming ASR model with CTC and RNN-T heads. Learning rate swept for AdamW only. Muon WER 20.64 against 21.11, better on 23 of 29 sets.
Figure 7 · Shaurya's run, word error rate on a few test sets (lower is better)
MuonAdamW
Numbers from the screenshots in Shaurya's post. Muon gained most on phone audio, noisy far-field audio and meetings. AMI headset went the other way in both of his run pairs, which he flagged as worth looking into. At equal wall-clock time (28.8 minutes, about 10,160 Muon steps against 11,250 AdamW steps) Muon still came out ahead, 20.78 against 21.11. In his one-epoch pair the two optimisers tied, so I would treat this as one promising result rather than a settled one.

Things that are still open. Muon needs the full gradient matrix to orthogonalise it, which complicates sharded training where each GPU holds a slice. Fine-tuning a model that was pre-trained with AdamW using Muon has given mixed results, and Moonshot's fine-tuning experiments did best when pre-training and fine-tuning used the same optimiser. And the learning rate does not transfer one-to-one from AdamW unless you use the RMS-matching scale.

09 / Sources

Papers and posts

Figures 2, 3 and 4 are toy problems I computed in this page so the mechanism is easy to see. They are not measurements of real training. Figure 6 runs Muon's actual polynomial on a made-up set of singular values. Figure 7 copies numbers from Shaurya's screenshots.