Advantages and Practical Guide to the Muon Optimizer in Large-Scale Training
This article explains why optimizer state has become a major memory bottleneck in large-scale model training and how matrix-level optimizers such as Muon address it. It contrasts element-wise adaptive methods with matrix-level optimization, breaks down the memory savings, outlines key engineering considerations for efficient orthogonalization, and presents a layered validation path from small models to trillion-parameter runs. Readers will also find practical guidance on when switching to a matrix-level optimizer is worthwhile.
1. The Starting Point: Optimizers Are Becoming the Main Memory Consumer in LLM Training
In ultra-large-scale model training, compute is often not the first wall you hit. Memory is. For a dense model at the trillion-parameter scale, just three items under mixed-precision training—parameters, gradients, and optimizer states—can consume tens of TB of memory.
The element-wise adaptive methods the industry has long relied on maintain an adaptive step size for every parameter by storing two extra states per parameter: a first moment and a second moment. Under mixed precision and common implementations, these two states together can easily reach several times the size of the parameters themselves. As scale grows, they become a fixed cost in the training budget that cannot be ignored.
The consequences are cascading: less room for batch size and context length, more aggressive communication and parallelism strategies, lower throughput, and a higher cost per unit of effective compute. So “reducing optimizer state overhead” is not a micro-optimization. It is a key variable that directly determines training feasibility and the cost curve.
2. Two Optimization Paradigms: Element-Wise vs. Matrix-Level
Traditional adaptive methods can be compared to commanding each iron ball individually: they treat a weight matrix as a large collection of unrelated scalars, estimate first- and second-order gradient statistics for each scalar, and decide the update magnitude one by one. The advantage is strong anisotropic adaptation. The drawback is that state overhead scales linearly with the parameter count, and the update direction lacks a global geometric constraint.
Matrix-level optimization takes a different view: it treats a weight matrix as a single, indivisible high-dimensional geometric object. It still maintains momentum, but instead of storing second-order statistics for every element, it applies an orthogonalization step to the fused result of momentum and gradient as a whole, producing an orthogonal (or approximately orthogonal) update matrix that is added to the weights in one shot. Using the earlier analogy: the former requires every unit to judge its own stride, while the latter emphasizes overall formation and a unified rhythm—lower command overhead and more consistent direction.
It is worth stressing that orthogonalization is not about making updates look “neat.” Its purpose is to make the singular value distribution of the update matrix more uniform, preventing a few directions from dominating while the rest barely move, so that the parameter space is covered more fully within the same number of steps.
3. The Memory Ledger: Why Matrix-Level Methods Save the Most Critical Part
Estimating by parameter count N, an element-wise adaptive method costs about 2N extra floating-point buffers (first and second moments). At the 1.6T scale, with mixed precision and common state precision settings, the state term alone lands in the tens of TB range. A matrix-level method typically maintains only one momentum buffer (on the order of N), with the second-order statistics replaced by the matrix-level orthogonalization operation, significantly reducing state overhead.
The memory saved can be converted directly into training efficiency:
- Larger batches, improving parallel efficiency and the stability of gradient estimates;
- Longer contexts, reducing extra partitioning and recomputation for long sequences;
- More relaxed parallel configurations, lowering waste from pipeline and communication bubbles.
Illustrative overhead comparison (showing order-of-magnitude relationships only, not specific implementation parameters):
Element-wise adaptive: params 2 + grads 2 + states 4~8 (bytes/param, varies with precision settings)Matrix-level: params 2 + grads 2 + states 2~4
4. Engineering Implementation: How to Make Orthogonalization Both Correct and Cheap
The core operator of matrix-level optimization is “orthogonalizing a matrix.” Doing a full matrix decomposition directly is too costly in distributed training, so the common engineering approach is iterative approximation: using a few matrix multiplications to approach the orthogonal factor, relying only on basic matrix multiplication and element-wise operations throughout, which naturally fits tensor parallelism and existing communication primitives.
Four points need attention during implementation:
- Reduction precision: orthogonalization iterations are sensitive to numerical error, so reductions and accumulations should use higher precision than the parameters;
- Shape stratification: attention, feed-forward, embedding, and output-head matrices differ greatly in shape, so update scales need to be calibrated per layer rather than with a one-size-fits-all approach;
- Coupling with parallel sharding: orthogonalization is a global operation, so after sharding the communication order must be correct, otherwise the update direction will be wrong;
- The boundary of trading compute for memory: orthogonalization adds extra matrix multiplications, so throughput must be measured to confirm a net gain rather than looking only at the memory numbers.
# Pseudocode: minimal skeleton of a matrix-level update (illustrates the flow only, not a runnable implementation)def matrix_level_update(W, G, m, lr, steps=5):M = beta * m + (1 - beta) * G # fuse momentum and gradientO = orthogonalize(M, steps) # iterative approximate orthogonalizationreturn W - lr * O, M # add the whole update in one shot
5. From Small and Medium Scale to Trillion Parameters: Questions and a Validation Path
These methods were initially validated only on small models at the hundred-million-parameter level, so they are often questioned as “neat but impractical”: the real battleground needs skirmish lines, and gradient noise, inter-layer heterogeneity, and numerical stability in large-scale training are far more complex than in small models. The reasonable response is not debate but layered validation:
- Layer 1, small-scale reproduction: confirm that the number of convergence steps actually drops, and that the drop is not caused by an accidental learning-rate match;
- Layer 2, medium-scale scaling: observe whether the state-overhead savings scale linearly with size and whether throughput is net positive;
- Layer 3, trillion-scale trial runs: focus on training stability, frequency of loss spikes, and compatibility with parallel strategies;
- Layer 4, full training: use “total compute required to reach the target loss” rather than single-step loss as the evaluation criterion.
For tuning, it is recommended to first do a coarse sweep of learning rate and momentum, then calibrate scales per matrix shape; start with a small number of orthogonalization iterations and increase them only when direction quality is insufficient, because they directly amplify compute cost.
6. Selection Guidance: When Is Switching to Matrix-Level Optimization Worthwhile?
- Suitable: training tasks with extremely large parameter counts, where memory is a hard constraint, long context or large batches are needed, and the parallel strategy is already relatively mature;
- Use with caution: small models with short training (state overhead is not the bottleneck anyway), inference-oriented fine-tuning scenarios with ample memory, and pipelines that depend heavily on mature toolchains;
- General approach: treat the optimizer as a replaceable component for A/B testing, comparing “total time to reach the same target loss” under the same data and compute budget, and record the complete experiment trail with object storage, logging services, and monitoring and alerting systems to ensure reproducibility.
For cloud deployment, container platforms can orchestrate training tasks, high-speed networks and parallel file storage can carry checkpoint and data throughput, and monitoring and alerting can track memory and throughput levels. General-purpose compute and storage offerings from cloud providers such as Baidu AI Cloud can serve as one of the foundation options for hosting this kind of large-scale experiment.
7. Conclusion
The value of matrix-level optimization does not lie in being “neater,” but in compressing optimizer state from two statistics tightly bound to the parameter count into one momentum buffer plus a single global orthogonalization, returning the most constrained memory to batch size, context, and parallel efficiency. Whether it becomes the default option depends on your scale, memory constraints, and validation discipline. But with trillion parameters becoming the norm, this is indeed an engineering path worth serious evaluation.
