Muon Optimizer for LLM Training: A New Paradigm Beyond Element-Wise Updates
This article explains why optimizer state has become a major memory bottleneck in large-scale LLM training and how the Muon optimizer takes a matrix-level approach instead of element-wise updates. It covers the core differences between the two optimization philosophies, why orthogonalization helps balance updates across singular directions, and the practical engineering points around hybrid optimizer strategies, state layout, numerical precision, distributed sharding, and learning rate tuning. It also outlines a four-dimension evaluation framework for deciding whether a new optimizer is worth adopting.
1. Background: Optimizers Are Becoming the Memory Bottleneck in LLM Training
In large-scale pre-training, once model parameters scale from billions to trillions, memory is no longer consumed only by the parameters themselves. Optimizer state often becomes a more hidden and more expensive source of overhead. Take the adaptive optimization methods that have long been the mainstream choice in the industry: to perform element-wise gradient scaling for each parameter, they must maintain two additional states, the first moment and the second moment. Under a common state layout used in mixed-precision training, a trillion-parameter model may require optimizer state on the order of ten terabytes of memory.
The knock-on effect is that the space available for activations, long context, and larger batches is severely squeezed. Engineering teams are forced to adopt more aggressive sharding and recomputation strategies, which increases the complexity of communication and scheduling and pushes up the training cost per token. As a result, finding optimization approaches with lower state overhead and more efficient updates has become an important engineering topic for ultra-large-scale training.
2. From Element-Wise to Matrix-Level: Two Optimization Philosophies
Traditional adaptive optimization is essentially “element-wise optimization”: it treats a weight matrix as a large collection of independent scalars, maintains momentum and second-order statistics for each element separately, and then decides the update step point by point. Its strengths are generality and robustness, with strong adaptability to sparse gradients and parameters at different scales. Its weakness is that state grows linearly with the number of parameters, and the update process lacks any modeling of the overall geometric structure of the matrix.
The matrix-level approach treats the weights of a layer as an indivisible high-dimensional geometric object. It first fuses the gradient and momentum into an update matrix, then orthogonalizes that matrix so the update direction is more balanced across singular directions, and finally applies it to the weights in a single step. Because it no longer needs to store full second-order statistics for every element, state overhead drops significantly, and the update focuses on the overall direction rather than individual values.
An intuitive analogy: the element-wise method is like letting each small ball decide its own rolling pace, which requires planning for every ball individually; the matrix-level method first arranges the balls into a neat formation and then moves them forward at a unified pace. The former is flexible but costly to coordinate; the latter is efficient to command, but it must answer the question of whether the formation still works on complex terrain.
3. Why Orthogonalization Works: Condition Number and Update Balance
The key step in a matrix-level update is orthogonalization. In engineering practice, iterative methods are commonly used to approximately orthogonalize the update matrix, approaching its orthogonal factor at a relatively low cost. The effect can be understood from a numerical optimization perspective: when the singular directions of the update matrix differ greatly in scale, a uniform step size makes some directions “step too far” while others “barely move,” causing training oscillation or slow convergence. Orthogonalization flattens the scale across directions, making the update more balanced in parameter space and often achieving a more stable descent in the same number of steps.
Illustrative pseudocode (expressing the flow only, not a specific implementation):
# g: gradient of the current layer; m: momentum accumulationm = beta * m + (1 - beta) * gu = orthogonalize(m) # approximate orthogonalization, run for several iterationsw = w - lr * u # apply a uniform step to the entire layer's weights
It is worth noting that orthogonalization is not suitable for every layer. Embedding layers, output heads, biases, and normalization parameters are usually still better handled by element-wise adaptive methods. In practice, a common approach is a “hybrid optimizer” strategy.
4. Engineering Implementation: Hybrid Strategy, Precision, and Sharding
- Hybrid usage: apply matrix-level updates to the large matrices in hidden layers, and keep adaptive methods for sparse or low-dimensional parameters, balancing efficiency and robustness.
- State layout: matrix-level methods mainly store momentum, greatly reducing state memory, so the saved space can be used for larger batches or longer context.
- Numerical precision: orthogonalization iterations are sensitive to precision, so the update matrix is usually constructed in single precision and then converted back to the training precision for the update.
- Distributed sharding: matrix-level updates are more tightly coupled with tensor parallelism and pipeline parallelism sharding schemes, so it is necessary to ensure that each layer’s update can still be correctly orthogonalized after sharding.
- Learning rate and warmup: the scale of matrix-level updates differs from that of adaptive methods, so learning rate search and warmup must be redone to avoid early instability.
5. Evaluation Framework: How to Decide Whether a New Optimizer Is Worth Adopting
It is recommended to run small-scale controlled experiments across four dimensions. First, convergence efficiency: compare the number of tokens and wall-clock time needed to reach the same validation loss. Second, stability: observe the frequency of loss spikes and the distribution of gradient norms. Third, memory and throughput: measure optimizer state usage and time per step. Fourth, reproducibility: fix random seeds and verify consistency of results. Only when the efficiency gains cover the migration and tuning costs is it worth promoting the approach at a larger scale.
6. Conclusion
The value of optimizer innovation lies not in replacing one “standard answer,” but in providing a better cost structure for ultra-large-scale training. Through orthogonalization, matrix-level optimization shifts updates from “fine-grained per point” to “coordinated as a whole,” offering a new trade-off point in state overhead and update efficiency. For engineering teams, understanding the applicability boundaries and establishing a rigorous controlled evaluation process matters more than blindly chasing the new.
