Muon Optimizer: From Principles to Large-Scale Training Practice

    This article explains the Muon optimizer, which applies Newton-Schulz orthogonalization to the momentum of weight matrices. It covers why Muon is gaining attention for large-scale model training, how it can be combined with AdamW, the stability challenges that come with it, and practical guidance for adopting it in your own projects.

    1. Background: Why a New Optimizer Is Needed

    Since deep learning entered the era of large-scale pretraining, AdamW has become the default optimizer for most teams. It builds on SGD by adding second-moment estimation and decoupled weight decay, and it has shown good stability when training Transformer-based models. However, as parameter counts grow from billions to trillions, practitioners have consistently observed several limiting factors: slower loss reduction in later training stages, uneven update quality for matrix-shaped parameters, and high sensitivity of training stability to hyperparameters.

    Against this backdrop, a family of optimizers built on the idea of gradient orthogonalization has drawn attention. Its best-known member is Muon (MomentUm Orthogonalized by Newton-Schulz). Muon goes beyond a simple patch on Adam. It starts from the geometry of matrix updates and redesigns the direction of parameter updates. Recently, public technical reports from some very large mixture-of-experts models have described using a variant of this approach to support stable training at the trillion-parameter scale. This is a sign that such methods are moving from research into industrial-scale training.

    2. Core Idea: Balancing Matrix Updates Across Directions

    2.1 Matrix Updates from the SGD Perspective

    For a two-dimensional weight matrix W in a neural network, the SGD update takes the following form:

    W ← W − η · G

    Here, G is the gradient. The main problem with plain SGD is that the singular values of the gradient are often highly unbalanced. A few directions have large magnitudes, while most have small ones. As a result, updates are dominated by a few leading directions. Convergence in the remaining directions slows down, and the effective rank of the matrix is underused.

    2.2 Newton-Schulz Orthogonalization

    Muon takes the momentum-averaged gradient matrix and approximately projects it onto the set of orthogonal matrices using a Newton-Schulz iteration. Intuitively, this flattens the singular value spectrum of the gradient, so every direction receives an update of roughly the same magnitude.

    A sketch of the core flow is shown below:

    1. # Pseudocode for illustration of the core flow only
    2. for g in param_grads:
    3. m = momentum_beta * m + g # First-order momentum
    4. o = newton_schulz_orth(m) # Orthogonalization (iterative approximation)
    5. param -= lr * scale * o

    The Newton-Schulz iteration can be written as follows, where X is the normalized matrix:

    X ← 1.5X − 0.5X³

    After a few iterations, X converges to an approximately orthogonal matrix whose singular values all sit close to 1. The iteration involves only matrix multiplications, which suits the hardware characteristics of GPUs and other accelerators. Its practical overhead is manageable.

    2.3 Division of Labor with Adam

    A key practical conclusion is that Muon does not need to replace AdamW for every parameter. A common approach is:

    • Two-dimensional matrix parameters, such as attention projections and feed-forward weights: use Muon.
    • One-dimensional parameters, such as biases, normalization parameters, embeddings, and output heads: keep using AdamW.

    This hybrid strategy keeps the benefits of orthogonalized updates for matrix parameters. It also retains the well-established handling of scalar-like parameters.

    3. Why It Matters for Large-Scale Training

    3.1 Higher Sample Efficiency

    Several public studies and practical reports show that, under a similar compute budget, orthogonalized updates can improve training efficiency. In other words, less effective compute is needed to reach the same loss level. The intuition is that all matrix directions advance together, which avoids slow convergence along long-tail directions.

    3.2 Friendly to Memory and Communication

    Compared with AdamW, Muon does not need to keep a second-moment estimate for every parameter, so its optimizer state is lighter. Orthogonalization can usually be performed locally within each compute shard. Combined with a distributed sharding strategy, this can effectively reduce synchronization overhead.

    3.3 Stability Challenges Remain

    Stability at very large scale cannot be guaranteed by a single optimizer. The original form of Muon may show problems at extremely large parameter counts, such as divergence of attention logits. Common responses in industrial training include:

    • Update norm control: constraining the magnitude of each parameter update to prevent occasional oversized updates in individual layers.
    • Soft constraints on the QK term of output logits: applying regularization to the variance of attention query-key dot products to suppress outlier growth.
    • Layer-wise learning rates and a unified update scale: keeping update magnitudes consistent across layers, which makes tuning simpler.

    These improvements form the typical variants of this family of methods used in large-scale training. They also show that the optimizer and its stability techniques need to be designed together.

    4. Practical Recommendations

    4.1 Deciding Where It Applies

    • Small and medium models: the gains may not be significant, and AdamW remains a low-risk choice.
    • Large, matrix-heavy models: there is more room for gains, so it is worth evaluating.
    • Embedding layers, output heads, and similar parameters: orthogonalized updates are not recommended.

    4.2 Hyperparameter Transfer

    When migrating from AdamW, the learning rate and weight decay cannot be carried over directly. A practical approach is to calibrate the learning rate magnitude with small-scale proxy experiments, then extrapolate according to parameter scale. The momentum coefficient is usually lower than the values typically used with AdamW, so it needs to be swept again.

    4.3 Coordination with Infrastructure

    The extra matrix multiplications introduced by orthogonalization should be included in the overall FLOPs budget. In mixed-precision training, the iteration should run at higher precision to keep numerics stable. Pairing the optimizer with a general-purpose distributed training framework, along with monitoring, alerting, and logging, helps detect anomalies early. Tracking per-layer update norms and gradient singular values is especially useful.

    5. Simplified Implementation Example

    The following is a simplified teaching version that illustrates the principle. Production use requires handling distributed execution and numerical stability.

    1. import torch
    2. def newton_schulz(G, steps=5):
    3. a, b, c = 3.4445, -4.7750, 2.0315
    4. X = G / (G.norm() + 1e-7)
    5. transpose = G.size(0) > G.size(1)
    6. if transpose:
    7. X = X.T
    8. for _ in range(steps):
    9. A = X @ X.T
    10. X = a * X + b * A @ X + c * A @ A @ X
    11. return X.T if transpose else X
    12. # Inside the training loop (illustrative)
    13. # m = beta * m + (1 - beta) * grad
    14. # orth = newton_schulz(m)
    15. # param -= lr * orth

    6. Summary

    Muon represents a new direction in optimizer research. Instead of relying on element-wise estimates from second-moment statistics, it directly shapes the geometry of matrix updates. Its efficiency potential at large scale, combined with stability techniques, has begun to support actual training runs at the trillion-parameter level. For engineers, the main lesson is the design principle behind it: balancing the spectrum of updates. The broader engineering approach is to co-design the optimizer with the model architecture, stability methods, and infrastructure. In your next training project, start with a small-scale controlled experiment to measure the gains in your own setting, then decide whether to adopt it.