Muon Optimizer for LLM Training: Advantages, Trade-offs, and Adoption Tips
This article explains why optimizer state memory becomes a bottleneck in large-scale model training and how the Muon optimizer's matrix-level update approach differs from element-wise adaptive methods. It breaks down Muon's main advantages—lower state memory, more balanced update scales, faster early loss reduction, and more stable hyperparameter transfer—along with the open questions around large-scale validity and the engineering details needed to address them. Readers will find practical guidance on parameter partitioning, distributed adaptation, numerical stability, and how to run controlled experiments before switching optimizers.
1. The Starting Problem: Optimizer State Is Eating Your Training Budget
In very large model training, GPU memory is usually the first resource to hit its limit. Take the mainstream element-wise adaptive methods as an example: to maintain a first moment and a second moment for every parameter, you need to allocate two extra memory blocks on the same order of magnitude as the parameters themselves. When the parameter count reaches the trillions, these two state variables alone can occupy memory in the range of more than ten terabytes. Even with mixed precision and sharding strategies, the pressure remains enormous.
When state variables squeeze out available memory, the effects cascade. The usable batch size shrinks, context length cannot be extended, the proportion of activation recomputation rises, and communication and parallel partitioning schemes are forced to change. In the end, the effective output per unit of compute drops. In other words, the memory overhead of the optimizer is not an isolated problem; it amplifies costs along the entire training pipeline.
2. Two Technical Routes: Element-wise Adaptive vs. Matrix-level Whole-Block Update
The implicit assumption of traditional adaptive methods is that “parameters are independent of each other.” They break a weight matrix into individual scalars, estimate the first- and second-order statistics of the gradient for each one, and then decide the step size one by one. This approach is simple to implement and robust, but it completely ignores the geometric fact that a weight matrix is itself a high-dimensional linear transformation.
The matrix-level optimization idea treats an entire weight matrix as an indivisible object. It first normalizes and orthogonalizes the momentum to obtain an approximately orthogonal update matrix, then adds it to the weights as a whole. An intuitive analogy: the element-wise method is like individuals fighting on their own, each needing separate instructions; the matrix-level method first arranges the individuals into a neat formation and then advances them in step, with significantly lower coordination overhead.
At the pseudocode level, the difference can be simplified as:
# Element-wise adaptive: maintain two states per parameterm = beta1 * m + (1 - beta1) * gv = beta2 * v + (1 - beta2) * g * gw -= lr * m / (sqrt(v) + eps)# Matrix-level update: orthogonalize the whole matrix, then update uniformlym = beta * m + (1 - beta) * gu = orthogonalize(m) # orthogonalize the matrix as a wholew -= lr * u
3. Breaking Down the Specific Advantages
The first is memory and state overhead. Matrix-level methods usually need to maintain only one momentum buffer, roughly halving the state size, and the orthogonalization step can be performed locally after sharding, which is friendlier to parallel strategies. The memory saved can be converted directly into a larger batch size or a longer context.
The second is controllable update scale. After orthogonalization, the update matrix has nearly uniform scale across directions. This avoids the imbalance in element-wise adaptive methods where some dimensions take overly large steps while others barely move. As a result, the method is relatively less sensitive to the learning rate, and tuning costs go down.
The third is the number of steps to convergence. In controlled experiments on small and medium-sized models, matrix-level methods often show a steeper initial loss drop and clearly need fewer iterations to reach the same target. This is especially valuable in compute-constrained racing scenarios.
The fourth is hyperparameter transfer. Because the update direction is geometrically constrained, the optimal learning rate usually transfers more stably across different widths and depths, reducing the number of sweep rounds needed before large-scale training.
4. Questions and Boundaries That Must Be Taken Seriously
The original implementation was validated only on models at the hundred-million-parameter scale. So the most direct question is whether “effective at small scale” still holds at large scale. The analogy is that on a real battlefield, troops do not actually advance in formation. The reasonable response is not to avoid the question but to fill in the engineering details:
- Parameter partitioning: matrix-level updates are usually applied only to the two-dimensional weight matrices in hidden layers, while embedding layers, normalization layers, biases, and others keep the adaptive method, balancing stability and benefit.
- Distributed adaptation: orthogonalization requires an iterative solve, so tensor parallelism or local computation within shards should be used to reduce communication and avoid a global synchronization every step.
- Numerical stability: under low precision, the iterative solve may fail to converge, so an iteration cap and a fallback path need to be defined.
- Memory-compute trade-off: orthogonalization itself consumes extra computation, and whether it pays off depends on how tight memory is and how many iterations are saved.
5. Practical Recommendations
If you are planning large-scale pretraining, start with a small-scale controlled experiment that compares wall-clock time to reach the target loss under the same compute budget, then decide whether to switch. At the same time, bring optimizer state, gradients, and parameter sharding strategy into a unified memory budget table, and use logging services and monitoring alerts to watch the loss curve and memory usage. On platforms such as Baidu AI Cloud, you can use general capabilities like container platforms, object storage, and monitoring alerts to build a reproducible experiment pipeline, turning optimizer selection into a quantifiable and rollback-able engineering decision rather than a one-time bet.
