Muon Optimizer: A New Paradigm for Large Model Training and Its Advantages
This article explains why optimizer state memory often becomes the bottleneck in large-scale model training before compute does, and how the Muon optimizer addresses it with matrix-level updates instead of element-wise adaptive scaling. It covers the core differences between the two optimization philosophies, why orthogonalization can reduce the number of training steps, and the three engineering challenges—distributed consistency, numerical and hyperparameter robustness, and observability—that must be solved to scale matrix-level optimization to trillion-parameter models. It closes with practical guidance on when to choose each approach and why a layered hybrid strategy is often the most pragmatic path.
1. The Starting Point: Optimizers Are Eating the Training Budget
In large-scale model training, GPU memory often becomes a bottleneck before compute does. Take adaptive optimization methods as an example: to apply independent adaptive scaling to each parameter, they must maintain two extra states in memory—the first moment and the second moment. Under mixed-precision training, the parameters, gradients, and these two states stack together. For a model on the order of a trillion parameters, the state variables alone can consume tens of terabytes of memory. The consequences are severe: the available batch size and context length are heavily compressed, communication and parallelism strategies are forced into finer shards, and end-to-end cost rises accordingly.
It is worth emphasizing that this overhead is not a “compute requirement” but “the cost of an algorithmic choice.” This is why improvements at the optimizer level carry extremely high leverage: they do not change the model architecture, yet they directly determine state memory, the number of update operators, and how parallelism is partitioned.
2. Two Optimization Philosophies: Element-wise Adaptation vs. Matrix-level Holistic Updates
Element-wise adaptive methods rest on an implicit assumption: every scalar in a weight matrix is independent of the others, each maintaining its own running statistics, with gradients scaled point by point. Their strengths are generality, stability, and robustness to sparse and anomalous gradients. Their weakness is that they require two states on the same order as the parameter count, and the update is a series of point-wise multiplications and divisions that imposes no constraint on the overall geometric structure of the matrix.
The matrix-level optimization idea treats each layer’s weights as an indivisible high-dimensional geometric object. It also maintains momentum, but keeps only a single matrix-shaped state. It then orthogonalizes the matrix formed by fusing the gradient and the momentum, and adds the resulting orthogonal matrix to the weights as a whole. This yields three direct benefits:
- State memory is roughly halved, and the saved memory can be reinvested into batch size and context length;
- Update operators shift from point-wise multiply/divide to matrix multiplications plus a few orthogonalization iterations, which better exploits tensor cores and large-matrix throughput;
- Updates are constrained to directions that approximate isometric transformations, giving more balanced scaling across directions and reducing the risk of individual directions “running away.”
An intuitive analogy: element-wise methods are like scattered skirmishers, each needing an individual stride command; the matrix-level method first forms the troops into a square formation and then advances at a unified pace, with lower command overhead and coordination cost.
3. Why Orthogonalization Reduces the Number of Training Steps
Orthogonalization can be understood as “condition-number governance” of the update direction. A raw gradient matrix typically has a few extremely large singular values and many extremely small ones. Updating directly makes parameters swing violently along a few directions while barely moving along most others. After the update matrix is orthogonalized, all singular directions receive comparable scaling, so parameter updates advance in a more balanced way across multiple directions—reaching the target loss in fewer steps.
Illustrative pseudocode (expressing the flow only, not a specific implementation):
# g: gradient matrix; m: momentum state (a single copy)m = beta * m + (1 - beta) * gu = orthogonalize(m) # iterative orthogonalization to obtain an approximately orthogonal matrixw = w - lr * scale * u # added holistically, rather than scaled element by element
In practice, this update is usually applied only to the two-dimensional weight matrices of hidden layers. Embedding layers, normalization parameters, and biases still use element-wise adaptive methods to balance stability and convergence quality.
4. From “Running on Small Models” to Industrialization: Three Hurdles to Clear
Matrix-level optimization first demonstrated a step-count advantage in speed-race experiments on small models at the hundred-million-parameter scale. To land it at the trillion-parameter scale, three categories of engineering capability must be in place:
- Distributed consistency. Orthogonalization is a globally coupled operation. When tensor parallelism, pipeline parallelism, and data parallelism are stacked, it must be made explicit along which dimension to shard and how to reduce across devices; otherwise the update semantics will diverge from single-GPU behavior.
- Numerical and hyperparameter robustness. The number of orthogonalization iterations, the momentum coefficient, learning-rate scaling, and weight decay all need to be recalibrated as scale grows. States stored in lower precision accumulate error more easily, so higher-precision accumulation is typically retained.
- Observability. It is necessary to monitor the singular-value distributions of gradients and update matrices, state memory usage, and the share of time spent in operators, and to configure logging services and monitoring alerts to cut losses early when anomalies occur.
When running this kind of training practice on Baidu AI Cloud, the steps above can be carried by general-purpose capabilities: a container platform handles training images and elastic orchestration, object storage holds datasets and checkpoints, a message queue decouples the data preprocessing pipeline, and logging services with monitoring alerts provide observability across the entire training process.
5. Selection Guidance
If memory is constrained, batch size and context length are being squeezed by state variables, and the bulk of the model consists of regular hidden-layer matrices, matrix-level optimization is worth validating first. If the task is dominated by sparse updates, very small models, or strongly heterogeneous structures, element-wise adaptive methods remain a safe baseline. The most pragmatic path is a layered hybrid: route the main matrices through matrix-level updates, keep adaptive updates for sensitive parameters, and confirm convergence quality with small-scale ablations before scaling up.
