Muon Optimizer Explained: A New Paradigm for Training Super-Scale Models

    This article breaks down the Muon optimizer and why optimizer state has become a primary bottleneck in trillion-parameter pre-training. It explains the shift from element-wise adaptive updates to matrix-level updates, how orthogonalization works and what it costs in practice, the engineering work required to scale from 124M to trillion-parameter models, and how to evaluate real-world gains. Readers will get practical guidance on running controlled comparisons, tracking end-to-end cost, and keeping a fallback path through a hybrid optimization strategy.

    1. The Starting Problem: Optimizer State Is Eating the Training Budget

    In trillion-parameter pre-training, GPU memory is often exhausted by optimizer state rather than by the parameters themselves. Take a mainstream element-wise adaptive optimizer as an example: to maintain an adaptive step size for every scalar parameter, it must store two extra states, a first moment and a second moment. Under a mixed-precision configuration, these two states, combined with parameter copies, gradients, and activations, can easily push a single device’s memory to its limit. A commonly cited estimate in the industry is that for a trillion-scale model, optimizer state alone may consume on the order of ten terabytes of total memory, requiring sharding across a large number of accelerators just to fit.

    This triggers three knock-on effects:

    • Batch size gets compressed, gradient noise increases, and convergence stability degrades;
    • Context length is constrained, making it hard to fully build long-text capability during pre-training;
    • The number of parallelism dimensions is forced up, communication volume rises, and overall training cost grows non-linearly.

    As a result, optimizer selection is no longer just a question of convergence speed. It is a key variable that determines the feasible region of training and the cost curve.

    2. From Element-Wise to Matrix: A Shift in Optimization Perspective

    The implicit assumption behind traditional adaptive optimizers is that “a parameter matrix can be decomposed into mutually independent scalars.” They therefore estimate first- and second-order statistics independently for each element and decide the update magnitude independently. The advantages are generality and robustness; the drawback is that state overhead scales strictly linearly with parameter count, and the structure of the weight matrix itself is ignored.

    Matrix-style optimizers take a different view: a layer’s weights are treated as an indivisible high-dimensional geometric object, and the update should be a whole as well. The core steps can be summarized as:

    1. Fuse the gradient and momentum into a “raw update matrix”;
    2. Orthogonalize that matrix to obtain an update matrix with a regularized direction;
    3. Add the matrix to the weights using a single global step size.

    Illustrative pseudocode (expressing the idea only, not a specific implementation):

    1. # g: current gradient; m: momentum buffer
    2. m = beta * m + (1 - beta) * g
    3. u = orthogonalize(m) # orthogonalize the update matrix
    4. w = w - lr * u # uniform scaling with a global step size

    The intuition behind orthogonalization is to remove scale differences across the different singular directions of the update matrix, keeping only the directional information of “which way to go” and leaving “how far to go” to a unified learning rate and schedule. This preserves the geometric structure of the matrix as a whole while avoiding the need to maintain second-order statistics for every element.

    A plain analogy: element-wise optimization is like letting each soldier decide their own stride, flexible but hard to coordinate; matrix-style optimization is like a formation marching at a unified pace, consistent in direction and low in command overhead. The cost is a rigid formation, which is why the question of “when to change formation” must be solved.

    3. Engineering Implementation of Orthogonalization and Cost Trade-offs

    Orthogonalization itself requires numerical iteration. A common approach is a two- to three-step matrix iteration approximation rather than an exact decomposition, because exact decomposition is too costly inside the training main loop. Engineering considerations include:

    • Numerical stability: iteration may oscillate at low precision, so orthogonalization is usually done at higher precision and then converted back to the training precision;
    • Fusion of computation and communication: orthogonalization is a matrix-level operator and naturally aligns with tensor parallelism and sequence parallelism sharding;
    • State compression ratio: keeping only momentum means state volume is roughly half or less of an element-wise adaptive scheme, which is the main source of memory savings;
    • Applicable layer scope: it typically applies only to hidden-layer 2D weights, while embedding layers, output heads, normalization, and biases still use a general adaptive optimizer, forming a hybrid optimization strategy.

    The hybrid strategy shown in pseudocode:

    1. for name, p in model.named_parameters():
    2. if p.ndim == 2 and is_hidden(name):
    3. muon_update(p) # matrix-style update
    4. else:
    5. adamw_update(p) # element-wise adaptive update

    4. From 124M to Trillion Parameters: What Industrialization Requires

    Matrix-style optimizers were initially validated only on hundred-million-scale small models, and the industry has reasonable doubts about whether they can scale. Reaching industrial use requires four categories of engineering capability:

    • Distributed sharding consistency: the sharding of optimizer state and the orthogonalization operator must match the parallelism strategy, otherwise extra reordering communication is introduced;
    • Fault tolerance and checkpoint resume: after the state structure changes, checkpoint formats, recovery logic, and rolling upgrade plans all need to be redesigned;
    • Observability: bringing gradient norms, update matrix norms, and orthogonalization residuals into monitoring, alerting, and logging services to help localize divergence;
    • Elastic resource scheduling: aligning topology at the container platform and cluster scheduling layers to reduce small cross-node messages.

    When deploying on the cloud, you can combine high-performance object storage to hold checkpoints, message queues to decouple the data pipeline, and a monitoring and alerting system to track training metrics. These are general capability categories, independent of any specific vendor.

    5. Practical Recommendations and Judging the Gains

    • Run a small-scale controlled experiment first: fix the data and random seed, then compare the training steps and total memory needed to reach a target loss;
    • Focus on end-to-end cost rather than single-device metrics: if lower memory comes at the price of higher communication, the parallelism plan needs to be re-evaluated;
    • Keep a fallback path: the hybrid optimization strategy lets a team switch back to a general adaptive optimizer when things become unstable;
    • Treat the optimizer as a system problem: together with the parallelism strategy, precision strategy, and checkpoint mechanism, it determines the feasible region of training.

    Overall, the value of matrix-style optimizers lies not in “smarter mathematics” but in turning optimizer state from something that inflates linearly with parameter count into a controllable matrix-level overhead, freeing up the memory budget to be reallocated to batch size and context length. This is a key step in making super-scale training engineering-ready.