Muon: An optimizer for hidden layers in neural networks
arXiv ↗PDF ↗Paper ↗Code ↗Blog ↗
Read first: Decoupled Weight Decay Regularization (AdamW)
TL;DR. Muon (MomentUm Orthogonalized by Newton-Schulz) is an optimizer for the 2D weight matrices of hidden layers. It approximately orthogonalizes each hidden-layer momentum update using five Newton-Schulz iterations in bfloat16, targeting the polar-factor direction rather than computing the exact nearest semi-orthogonal matrix. Jordan introduced it in December 2024 through speed records (CIFAR-10, NanoGPT). Moonshot’s Moonlight paper then made it work for large-scale LLM training by adding weight decay and per-matrix update scaling. Their scaling-law study finds Muon matches AdamW with about 52% of the training FLOPs.
Sources. Primary: Jordan’s blog post (December 2024), which defines the method. Companion: Liu et al., “Muon is Scalable for LLM Training” (arXiv 2502.16982, February 2025), the Moonlight paper behind the scaling results. The card’s year is the blog’s; its arXiv ID is the companion paper’s.
Why it matters now. AdamW has been the default optimizer for LLM training for years, and many claimed replacements did not survive careful tuning. Muon is one of the first to be used for frontier pretraining (Moonlight, and the Kimi K2 report). The underlying idea, choosing an update that is steepest under a matrix-aware norm, is a useful lens for any model you train, including retrievers and rerankers.
Key idea
Section titled “Key idea”For a hidden weight matrix with gradient :
is the semi-orthogonal matrix closest to in Frobenius norm. It is also the steepest-descent direction under the spectral norm. All singular values of the update become about 1, so rare directions are no longer drowned out by a few dominant ones.
Newton-Schulz. Normalise so that all singular values lie in , then repeat
Since , each step maps every singular value through and leaves and unchanged. The coefficients make (the growth rate of small ) as large as possible, while letting the limit stay anywhere in about . A singular value of 0.01 reaches 0.70 after five steps (0.034, 0.118, 0.400, 1.093, 0.699). On a random 512×2048 matrix, five steps bring all singular values into about 0.75–1.13. Only matrix multiplications are needed, which run well on GPUs in bfloat16.
Moonlight’s changes. Decoupled weight decay, and an update scaled so that every matrix has the same update RMS as AdamW:
The scale corrects Lemma 1: an orthogonal update has RMS , so wide MLP matrices would otherwise get smaller steps than square ones.
Key results
Section titled “Key results”Jordan’s blog (Dec 2024).
- CIFAR-10 to 94% accuracy: speed record from 3.3 to 2.6 A100-seconds.
- NanoGPT speedrun (3.28 validation loss on FineWeb): 1.35× faster.
- A 1.5B model reaches GPT-2 XL HellaSwag performance in 10 8×H100-hours, against 13.3 with AdamW.
- Third- and seventh-order polynomials did not lower the wall-clock overhead further.
Moonlight (Liu et al., 2025).
- Update scaling (800M, Table 1). Validation loss 2.812 when scaling by 0.2·√H, 2.789 with per-shape scaling (chosen).
- Scaling law. Dense Llama-style models from 399M to 1.5B, with AdamW tuned by grid search. Muon reaches the same loss with about 52% of AdamW’s FLOPs.
- Moonlight model. A 3B-active / 16B-total MoE (DeepSeek-V3-small style) trained on 5.7T tokens. At 1.2T tokens, Muon against an identical AdamW run (Moonlight-A): MMLU 60.4 vs 60.2, HumanEval 37.2 vs 29.3, MBPP 52.9 vs 49.2, GSM8K 45.0 vs 43.8, MATH 19.8 vs 16.1, BBH 43.2 vs 45.3.
- Weight spectra. SVD entropy is higher with Muon for over 90% of weight matrices.
- SFT mismatch (Table 6). Muon-pretrained, Muon-SFT gives MMLU 55.7 and GSM8K 68.0; switching SFT to AdamW gives 50.2 and 64.9. Fine-tuning AdamW-pretrained Qwen2.5-7B with Muon did not beat Adam.
- Systems. Distributed Muon works with ZeRO-1: gather the momentum across data-parallel ranks, run NS on the full matrix, then keep only the local shard.
Limitations & open questions
Section titled “Limitations & open questions”- Evidence base. Large-scale evidence is mainly from one lab (Moonshot) and one architecture family. Jordan’s own essay warns that many optimizers that claimed to beat AdamW were not adopted, and asks for well-tuned baselines.
- Hybrid optimizer. Embeddings, head and scalars still use AdamW, so there are two sets of hyperparameters.
- Approximate orthogonalisation. The tuned NS output is off by up to about ±30% in singular values; why this is harmless is understood only empirically.
- Fine-tuning mismatch. Gains depend on using the same optimizer in pretraining and SFT, which complicates fine-tuning existing AdamW models.
- Sharding. NS needs the whole matrix, which adds communication under tensor or fully sharded parallelism.
Connections
Section titled “Connections”- AdamW — the baseline; decoupled weight decay is reused by Moonlight.
- μP — another per-shape scaling rule for learning rates; compare with the √max(A, B) factor.
- FP8-LM — the other side of optimizer cost: memory and precision rather than update geometry.
- Kimi K2 — a frontier report from the same lab that trains with a Muon variant.
- DeepSeek-V3 — the architecture family Moonlight’s MoE follows.
- CS336 — course coverage of optimizers and training at scale.
Questions to think through
These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.
- Derive / compute
Show that one Newton-Schulz step X ← aX + b(XXᵀ)X + c(XXᵀ)²X acts on each singular value separately as φ(σ) = aσ + bσ³ + cσ⁵. Then, with (a, b, c) = (3.4445, −4.7750, 2.0315) and X₀ = G/‖G‖_F, trace σ = 0.01 and σ = 1 through five steps and explain why the output is only approximately orthogonal.
What a strong answer covers
- With X = USVᵀ, XXᵀ = US²Uᵀ, so (aI + bXXᵀ + c(XXᵀ)²)X = U(aS + bS³ + cS⁵)Vᵀ. The singular vectors are unchanged and each σ maps through φ.
- Dividing by the Frobenius norm puts every σ in (0, 1], since ‖G‖_F ≥ σ_max.
- σ = 0.01: 0.034, 0.118, 0.400, 1.093, 0.699. φ′(0) = a ≈ 3.4, so small values grow about 3.4× per step.
- σ = 1: 0.701, 1.114, 0.721, 1.090, 0.696. φ(1) ≈ 0.70, so the iteration oscillates rather than converging to 1.
- The coefficients were tuned to maximise a (fast growth of small σ) subject to the limit staying in about [0.7, 1.3]. Jordan found this error does not hurt training, so the output is U·diag(≈0.7–1.2)·Vᵀ rather than exactly UVᵀ.
- Derive / compute
Jordan bounds Muon's extra cost at T·m/B of the forward–backward FLOPs, where m is the model dimension, B the batch in tokens and T the number of NS steps. Derive the bound for an n×m weight (m ≤ n) and evaluate it for NanoGPT (m = 768, B = 524,288) and for a Llama-405B-like run (m = 16,384, B = 16M), with T = 5.
What a strong answer covers
- One NS step costs XXᵀ (2nm² for n ≥ m after transposing to m×n), the polynomial (about 2m³) and the product with X (2nm²): 2(2nm² + m³) ≤ 6nm² FLOPs. T steps cost at most 6Tnm².
- A linear layer's forward and backward pass over B tokens costs 6nmB. Ratio: 6Tnm²/(6nmB) = Tm/B.
- NanoGPT: 5·768/524,288 ≈ 0.7%. 405B: 5·16,384/16,000,000 ≈ 0.5%.
- The bound is in FLOPs. Wall-clock overhead can be higher, because NS needs the full matrix, which conflicts with sharded optimizer states (Moonlight gathers the matrix across data-parallel ranks, runs NS, then keeps its own shard).
- Mechanism
Muon can be described as steepest descent under the spectral norm, and as Shampoo with no accumulation. Explain both views and why replacing a momentum matrix by UVᵀ can help when gradient matrices have very low stable rank.
What a strong answer covers
- Steepest descent: the direction ΔW that maximises ⟨G, ΔW⟩ subject to ‖ΔW‖₂ ≤ 1 is UVᵀ from the SVD of G. Muon takes this direction (using momentum M instead of G).
- Shampoo updates with (GGᵀ)^(−1/4) G (GᵀG)^(−1/4). Without accumulating statistics over time this equals (GGᵀ)^(−1/2)G = UVᵀ, so Muon is "accumulation-free Shampoo".
- Momentum updates for transformer weights tend to be dominated by a few directions. Setting all singular values to about 1 increases the step along rare directions relative to the dominant ones.
- Moonlight reports higher SVD entropy of the trained weight matrices with Muon for over 90% of matrices, consistent with more diverse update directions.
- What if…
Moonlight changes Muon in two ways: decoupled weight decay, and scaling each update by 0.2·√max(A, B). Explain the problem each change fixes, using Lemma 1 (an orthogonal A×B update has RMS √(1/max(A, B))), and compute the unscaled RMS for H×H and H×4H matrices at H = 2048.
What a strong answer covers
- Weight decay: in an 800M model trained on 100B tokens (about 5× compute-optimal), plain Muon converged faster at first, but some weights grew too large over time. With W ← W − η(O + λW), Muon beat both plain Muon and AdamW in this over-trained regime.
- Lemma 1: an A×B semi-orthogonal matrix has min(A, B) unit singular values, so its RMS is √(min/(A·B)) = 1/√max(A, B).
- At H = 2048: 1/√2048 ≈ 0.022 for H×H and 1/√8192 ≈ 0.011 for H×4H. Wide MLP matrices get half the update size, and small per-head matrices get much larger ones.
- Scaling by 0.2·√max(A, B) gives every matrix an update RMS of 0.2, matching AdamW's typical 0.2–0.4. AdamW's learning rate and weight decay can then be reused.
- In their 800M test the per-shape fix gave validation loss 2.789 against 2.812 for scaling by 0.2·√H.
- Design
You pretrained a model with Muon and want to fine-tune it for a retrieval task. Moonlight's SFT table shows the best results when pretraining and SFT use the same optimizer, and a public AdamW model fine-tuned with Muon did not gain. Design a fine-tuning plan and the ablation that would justify it.
What a strong answer covers
- Moonlight (pretrain/SFT optimizer): Muon/Muon gives MMLU 55.7 and GSM8K 68.0; Muon/AdamW 50.2 and 64.9; AdamW/AdamW 52.0 and 64.6.
- With Qwen2.5-7B (pretrained with AdamW), SFT with Muon was not better than Adam (MMLU 70.8 against 71.4), so there is a pretrain–finetune optimizer mismatch.
- Plan: fine-tune the Muon checkpoint with Muon on hidden matrices and AdamW on embeddings, head and scalars, using the same update-RMS scaling as pretraining.
- Ablation: Muon vs AdamW for SFT with matched learning-rate sweeps, several seeds, and retrieval metrics (nDCG, recall) as well as general benchmarks.
- Research idea
Muon is applied only to 2D hidden matrices; embeddings, output head and scalars stay on AdamW. Propose a study of whether a single geometry-aware optimizer could cover all parameters, with a falsifiable prediction.
What a strong answer covers
- Jordan reports that embeddings and the output layer work better with AdamW, and the modular-norm view suggests embeddings need a different norm, since each step only touches a few rows.
- Hypothesis: choosing a per-module norm (spectral for hidden matrices, row-wise or ℓ∞-like for embeddings) and taking the steepest-descent step in each matches the current hybrid.
- Experiment: at two or three scales, compare hybrid Muon+AdamW, all-Muon, and the per-norm optimizer at tuned learning rates; measure loss against FLOPs and stability (loss spikes, max logits).
- Falsified if the per-norm optimizer is worse than the hybrid at equal tuning budget at every scale.
- Moonlight lists these as open problems: putting all parameters under one framework, Schatten-p norms, and the fine-tuning mismatch.