Muon Optimizer Advantages: A New Paradigm for Large Model Training
This article explains why optimizer state, rather than model parameters, often dominates memory in large-scale pretraining, and how matrix-level optimization such as Muon addresses the issue. It compares element-wise adaptive methods with matrix-level updates, explains the geometric intuition behind orthogonalization, and outlines the engineering challenges of scaling these methods from toy models to industrial systems, including parameter grouping, distributed sharding, numerical stability, and learning rate coupling. A practical evaluation framework and deployment recommendations are included to help teams decide when matrix-level updates offer the best trade-off.
1. The Starting Point: Optimizers Are Eating the Training Budget
In the pretraining of very large dense models, GPU memory is often exhausted not by the parameters themselves but by the optimizer state. Take mainstream element-wise adaptive optimization methods as an example: to maintain an adaptive step size for every scalar parameter, they must store two extra states, the first moment and the second moment. In mixed-precision training, once parameter copies and gradient copies are added, a trillion-parameter-scale model can consume GPU memory on the order of tens of terabytes for optimizer state alone.
This overhead has two direct consequences:
- Compressed usable batch size: Once memory is occupied by optimizer state, the batch size has to shrink, which reduces communication efficiency and throughput.
- Limited context length: Activation growth from long contexts is already tight on memory, and optimizer state further squeezes the room for expansion.
A natural engineering question therefore emerges: Can optimizer state overhead be tied to matrix size rather than the number of matrix elements?
2. Two Optimization Philosophies: Element-wise vs. Matrix-level
2.1 Element-wise Adaptation: Precise but Expensive
Element-wise methods treat a weight matrix as a collection of independent scalars, estimate first- and second-order gradient statistics for each scalar separately, and decide the update magnitude accordingly. Their strength is strong anisotropic adaptation and robustness to sparse, noisy gradients. The drawbacks are equally clear: the number of states scales linearly with the number of parameters, and element-wise scaling destroys the original spectral structure of the matrix.
2.2 Matrix-level Optimization: Treating the Weight Matrix as a Geometric Whole
Matrix-level methods (commonly referred to in the industry under the name Muon) argue that a 1000x1000 weight matrix is an indivisible high-dimensional geometric object. The update process can be summarized in three steps:
- Accumulate momentum on the gradient to obtain a momentum matrix;
- Orthogonalize the momentum matrix, pulling all of its singular values close to 1;
- Multiply the orthogonalized matrix by a global step size and add it to the weights in one shot.
# Illustrative pseudocode: core flow of a matrix-level updatedef matrix_update(W, G, momentum, lr):# 1) Momentum accumulation (one state only, vs. two states in element-wise methods)momentum = beta * momentum + (1 - beta) * G# 2) Orthogonalization: iterative approximation of UV^T so singular values approach 1O = orthogonalize(momentum) # same shape as W# 3) Uniform step-size updateW = W - lr * Oreturn W, momentum
Orthogonalization usually does not require an exact matrix decomposition. Instead, it is completed with a polynomial approximation using a small number of iterations, so the computation is dominated by matrix multiplications on modern accelerators, leading to higher hardware utilization.
3. Geometric Intuition: Skirmishers vs. a Formation
A memorable analogy is that element-wise methods act like scattered skirmishers fighting independently, requiring step-size instructions to be issued to each unit separately, while matrix-level methods first arrange all units into a neat formation and then advance at a unified pace.
This analogy also explains the role of orthogonalization: all singular values of an orthogonal matrix are 1, which means the step size of the update is balanced across all directions and training stability is not undermined by abnormal gradient amplification in a few directions. In effect, this performs a spectral-level normalization of the update, making the effective learning rate closer in meaning to an identity-matrix displacement. As a result, a larger global step size can be used, reducing the number of training steps needed to reach the target loss.
4. From Toy Scale to Industrial Scale: Questions and Answers
These methods were initially validated only on small models around 100 million parameters, which raises a sharp question: can benchmark results at small scale be extrapolated to the hundreds-of-billions scale? The question is reasonable. The key to industrialization is not whether the method can run, but whether the following engineering aspects are closed.
4.1 Parameter Grouping: Not All Matrices Suit the Same Rules
In practice, matrix-level updates are usually applied only to the two-dimensional weight matrices in hidden layers, while embedding layers, output heads, normalization parameters, and biases still use element-wise adaptive methods. The reason is that these parameter matrices have special shapes or small parameter counts, so the benefit of orthogonalization is insignificant or even harmful.
4.2 Distributed Sharding: Orthogonalization Requires Cross-device Collaboration
Matrix-level updates impose extra requirements on tensor parallelism and pipeline parallelism: orthogonalization must be performed on a complete matrix view, so necessary aggregation is required along the sharded dimension, or a block approximation is adopted and then merged. Engineering-wise, a trade-off must be made between communication volume and approximation error.
4.3 Numerical Stability: Iterative Convergence at Low Precision
Orthogonalization iterations involve multiple matrix multiplications and are prone to numerical drift at lower precision. A common practice is to accumulate in higher precision during the iterations and apply bias correction to the momentum.
4.4 Coupling with the Learning Rate Schedule
Because the update is normalized, the dimensions of the learning rate and weight decay change, so existing tuning experience cannot be transferred directly and a new small-scale sweep is required.
5. A Framework for Quantifying Benefits and Costs
It is advisable to make decisions along the following dimensions rather than concluding from “it saves memory” alone:
| Evaluation dimension | Focus |
|---|---|
| Memory usage | Number of optimizer state copies, peak memory, supported batch size and context length |
| Throughput | Time per step, extra matrix multiplication overhead from orthogonalization iterations |
| Convergence quality | Target loss under the same compute budget, stability under different data mixtures |
| Engineering complexity | Amount of change to the parallel strategy, checkpoint resumption and state compatibility |
| Reproducibility | Whether mixed-precision settings and sources of randomness are controllable |
A practical rule of thumb is: matrix-level updates offer the best cost-performance ratio when model scale makes optimizer state the main memory bottleneck and two-dimensional hidden-layer matrices account for the bulk of the parameters; otherwise, the benefit is limited for small models or scenarios with sparse matrix structures.
6. Recommendations for Implementation
- Align at small scale first: Compare loss curves in the range of 100 million to 1 billion parameters and confirm that convergence does not degrade before scaling up.
- Prioritize a hybrid strategy: Use matrix-level updates for hidden layers and keep adaptive methods for the remaining parameters to lower the cost of modification.
- Complete the monitoring metrics: Add gradient norm, update norm, and orthogonalization iteration residual to the monitoring and alerting system to detect anomalies early.
- Govern state and logs: Optimizer state should be included in the archiving strategy of log services and object storage to ensure checkpoint resumption and traceability.
- Combine with elastic compute: The space freed up by batch size and context length can be combined with elastic scaling on container platforms and message queues to decouple the data pipeline and improve overall resource utilization.
7. Conclusion
The main line of optimizer evolution is moving from “making a separate decision for each parameter” toward “respecting the overall geometric structure of the parameter matrix.” Matrix-level updates trade fewer state copies for a larger usable batch size and context space, at the cost of parallel refactoring and rebuilding of tuning. For very large-scale pretraining, this is an engineering calculation worth doing carefully. In general-purpose compute and containerized environments such as Baidu AI Cloud, together with comprehensive monitoring, alerting, and logging services, teams can make a smoother transition from validation to scale.
