Search

Search papers and lessons

Muon Optimizer

Level 4 · 11 min read

Muon is a training method for weight matrices that keeps a momentum average of the gradient and then replaces it with the nearest orthogonal matrix, so every update direction has equal strength in all directions.

On this page

  • Colour = topic mix
  • Linear algebra
  • Discrete math
  • Calculus
  • Probability
  • Optimizers
  • Losses & regularization
  • ReadReady to readNot yet

TL;DR

Muon is an optimizer for the weight matrices of a neural network. It keeps a running average of the gradient, the same idea as momentum, and then replaces that average with a matrix that has the same directions but all its stretch factors set to 1. The update therefore has the same strength in every direction it moves. This solves the problem that a plain gradient step is dominated by a few large directions and makes slow progress along the rest.

Builds on: Stochastic Gradient Descent, Singular Value Decomposition (SVD) · Leads to: Kimi K2, a large language model trained with a Muon variant

Where it's used

Training large language models. The Kimi K2 report describes a mixture-of-experts language model with 1 trillion total parameters, 32 billion of them active per token, pretrained on 15.5 trillion tokens. Its authors trained it with MuonClip, a variant of Muon, and they report that the run had no loss spikes. The report says the team chose Muon because their earlier Moonlight work found that, under the same compute budget and model size, Muon substantially outperforms AdamW.

Fine-tuning after pretraining. The same report uses Muon in its post-training stages as well, including supervised fine-tuning and reinforcement learning, on the grounds that a model pretrained with Muon fine-tunes best with Muon.

Any model with large weight matrices. The method is designed for the two-dimensional weight matrices in the hidden layers of a Transformer, where the attention and feed-forward projections live. Other parameters, such as vectors of biases and normalisation scales, need a different update rule, and the Muon write-up is titled for hidden layers.

How it works

Take one weight matrix W and follow one training step. For the purpose of the walkthrough, think of W as a matrix, a grid of numbers that acts on vectors. The gradient G is the matrix of partial derivatives of the loss with respect to W. Muon takes three steps.

  1. Average the gradients. Keep a buffer M that remembers past gradients. At each step, M ← μM + G, with a momentum factor μ between 0 and 1. Check: if G is zero for a while, M shrinks by the factor μ each step, so old gradients fade.
  2. Orthogonalize the average. Replace M by the matrix O with the same left and right singular directions but all singular values set to 1. Check: O has the same shape as M, and O's columns are perpendicular and of unit length, so it is an orthogonal matrix when M is square.
  3. Step against it. Update W ← W − η O, where η is the learning rate. Check: the size of the step no longer depends on how large the gradient was, only on the direction it points.

The example in the worked section shows what step 2 does to a diagonal matrix. For a general matrix the construction needs the singular value decomposition: write M = UΣVᵀ and set O = UVᵀ. In practice the authors do not compute an SVD. They use an iteration called Newton-Schulz, which approximates UVᵀ from M using only matrix multiplications, which run well on GPUs.

00.511.522.533.5401234singular value of the gradient average Mstrength of the step
  • plain step: strength = gradient singular value
  • Muon: strength 1 in every direction
A plain step grows with the gradient; Muon's stays at 1 whatever the gradient's size.

The math

Let W be an n × m weight matrix, G_t its gradient at step t, and μ the momentum factor. The update in the paper's Algorithm 1 has the form below, with weight decay λ and a learning rate η. The scaling of Step 3 below is left out of the formula.

Definition: Muon update

Set M_0 = 0 and, for each step t,

Mt=μMt−1+Gt,Ot=msign(Mt),Wt=Wt−1−η (Ot+λWt−1).M_t = \mu M_{t-1} + G_t, \qquad O_t = \mathrm{msign}(M_t), \qquad W_t = W_{t-1} - \eta\,(O_t + \lambda W_{t-1}).

Here msign(M) = UVᵀ, where M = UΣVᵀ is a singular value decomposition. Equivalently, msign(M) replaces every singular value of M by 1 and keeps the singular vectors.

Step 1 in symbols

The momentum buffer is a weighted running sum of gradients: Mt=Gt+μGt−1+μ2Gt−2+⋯M_t = G_t + \mu G_{t-1} + \mu^2 G_{t-2} + \cdots. Each older gradient counts with weight μ\mu raised to a higher power.

Step 2 in symbols

Write the singular value decomposition as M = UΣVᵀ, where U and V have orthonormal columns and Σ is diagonal with entries σ₁ ≥ σ₂ ≥ ⋯ ≥ 0. Then msign(M) = UVᵀ, which has all its singular values equal to 1. Plain gradient descent would instead use M itself, whose step along direction i is scaled by σᵢ.

Step 3 in symbols

The weight update is Wt=Wt−1−η (Ot+λWt−1)W_t = W_{t-1} - \eta\,(O_t + \lambda W_{t-1}). The λW\lambda W term is weight decay, which shrinks the weights a little each step. The paper also scales OtO_t by max⁡(n,m)\sqrt{\max(n, m)} and a constant 0.20.2, so that the update's root-mean-square matches the scale that AdamW uses and learning rates can be reused.

Why equal singular values help

If Σ has entries 20 and 0.2, plain descent makes a step that is 100 times larger in one direction than the other. Muon gives both directions the same weight, so progress along small-gradient directions is not drowned out. This is the sense in which the update is "balanced".

Worked examples

Example
1. A diagonal gradient, step by step

Let the gradient at step 1 be the diagonal matrix G = diag(2, 0.5), with momentum μ = 0.9 and M_0 = 0.

  1. Momentum: M_1 = 0.9 × 0 + G = diag(2, 0.5). Check: the first step has no past.
  2. Singular values of M_1 are 2 and 0.5, and the singular vectors are the coordinate axes, so U = V = I.
  3. Muon sets both singular values to 1: O_1 = UVᵀ = I.
  4. Compare with plain descent: its step would be diag(2, 0.5), which moves 4 times as far in the first direction as in the second.

Now suppose the gradient is 10 times bigger, G = diag(20, 5). Muon still gives O = I. Interpretation: Muon's step does not depend on the gradient's size, only its direction.

Example
2. A rotation scaled by 3, then momentum

Let R = [[0, −1], [1, 0]] be a rotation by 90 degrees, and take the gradient G_1 = 3R = [[0, −3], [3, 0]]. Use μ = 0.9.

  1. Singular values of 3R: since R has orthonormal columns, 3R has both singular values equal to 3. Its singular vectors are the columns of R, so U = R and V = I.
  2. Orthogonalize: O_1 = UVᵀ = R. Check: the update is a unit-strength rotation with the same direction as the gradient.
  3. Next step the gradient is zero, G_2 = 0. Momentum gives M_2 = 0.9 × 3R = 2.7R.
  4. Orthogonalize again: O_2 = msign(2.7R) = R. The step is unchanged in direction and strength, although the buffer is smaller.

Interpretation: momentum keeps pushing in the same direction after the gradient disappears, and Muon ensures that the push keeps the same strength in every direction.

Example
3. A capped attention logit (realistic)

A query-key attention head computes attention scores as products q · k. In a long run, one head's largest score S_max may grow large enough to destabilise training. Kimi K2's report adds QK-Clip, which rescales the query and key weights whenever S_max exceeds a threshold τ. The paper uses τ = 100 in its main run. The scaling factor is γ = τ / S_max, and both the query and key weights are multiplied by √γ.

Suppose a head reaches S_max = 400 with τ = 100.

  1. Compute the factor: γ = 100 / 400 = 0.25.
  2. Multiply the query weights by √0.25 = 0.5, and the key weights by 0.5 as well.
  3. A score is q · k, so after scaling it is multiplied by 0.5 × 0.5 = 0.25 = γ.
  4. The largest score becomes 400 × 0.25 = 100, the threshold.

Interpretation: the clip stops the score from growing past τ without changing the weights' directions. This is why the report uses Muon together with a clip.

Try it: a head reaches S_max = 900 with τ = 100. By what factor is each of its query and key weights multiplied? Answer: γ = 100 / 900 = 1/9, and √γ = 1/3, so each is multiplied by 1/3.

Common mistakes and tradeoffs

It is tempting to think that Muon is ordinary momentum SGD with a different learning rate. In fact the update direction is changed: step 2 replaces the averaged gradient by its orthogonal part. A large gradient and a small one give updates of equal strength in all directions, so the optimizer does not behave like SGD with a rescaling.

It is tempting to think that Muon should be applied to every parameter. In fact it is defined for matrices. Vectors, such as biases and normalisation scales, need a different update rule, and the Muon write-up is titled for hidden layers.

It is tempting to think that the orthogonal update makes training gentler. In fact the report found that attention logits exploded more often under Muon than under AdamW in its experiments. Because all singular values of a Muon update are equal, the update has full effective rank, and the authors hypothesise that this makes attention logits more likely to grow. That is the reason for QK-Clip. The report presents this as a hypothesis, supported by observations, not as a proven mechanism.

When to use it. Use Muon for the large hidden matrices of a model when you are training at scale and the token budget is the limit. The Kimi K2 report gives it as the reason for their choice.

When not to use it. Do not use it alone on parameters that are not matrices, and do not expect it to remove the need for stability tools in attention.

Alternatives. Adam and AdamW keep a per-parameter scale from running averages of squared gradients. They work well and are the default for most work. Plain stochastic gradient descent with momentum is simpler and needs less memory.

History

Adam, published in 2014, became the default optimizer for neural networks by adapting a step size to each parameter. Through the 2010s, the question of how to make the update of a weight matrix better balanced had been studied in several forms, including second-order methods and normalised updates.

Muon was introduced in 2024 by Keller Jordan and collaborators as an optimizer for the hidden layers of neural networks, using an orthogonalized momentum update. The Kimi K2 report cites it as "Muon: an optimizer for hidden layers in neural networks". In 2025 the team behind Kimi reported a large-scale model trained with a Muon variant, MuonClip, and reported that the run ran without loss spikes. That large run is what made the method a serious option for frontier language models.

Recap

  • Muon keeps a momentum average of the gradient of each weight matrix.
  • It replaces that average by its orthogonal part, which has all singular values equal to 1.
  • The step therefore has the same strength in every direction and does not grow with the gradient.
  • Attention can become unstable under Muon, so the Kimi K2 report adds QK-Clip, which rescales query and key weights to cap attention scores.
  • Muon is for matrices; other parameters use a different optimizer.

Read next: the Kimi K2 report, which uses Muon at scale, and the Adam optimizer, the usual baseline it is compared with.

Check yourself

QuestionRecall: what does Muon replace the momentum average M by?Show answer

By its orthogonal part O = UVᵀ, where M = UΣVᵀ is a singular value decomposition. This keeps the singular vectors and sets every singular value to 1.

QuestionComputation: the momentum buffer is M = diag(4, 1). What is the Muon update O, and what is the update for diag(40, 10)?Show answer

Both are the identity matrix I = diag(1, 1). The singular values are set to 1 in each case, so the step does not depend on the gradient's size.

QuestionWhy: why does Muon make the update direction balanced across directions?Show answer

Because the orthogonal part sets all singular values equal. A plain gradient step moves further along directions with larger singular values, so the balanced step lets progress happen along weak directions too.

QuestionApplied: a training run shows attention scores around 900 while the cap is 100. Using QK-Clip as in the report, what happens to the scores, and why does the direction of the weights stay the same?Show answer

The scaling factor is γ = 100 / 900 = 1/9, and the query and key weights are each multiplied by √γ = 1/3. The score is a product of the two, so it is multiplied by 1/9 and becomes 100. The weights are only scaled, not rotated, so their direction is unchanged.

Sources