Muon Optimizer for LLM Training: Advantages, Trade-offs, and Engineering Practices

    This article explains why optimizer state has become a major memory bottleneck in large-scale model training and how matrix-based optimization, represented by Muon, addresses it. It contrasts element-wise adaptive methods with matrix-level updates, breaks down the practical benefits in memory footprint, update stability, and hyperparameter transferability, and outlines the applicability limits of the approach. Engineers will find concrete guidance on memory budgeting, hybrid optimizer design, orthogonalization iteration tuning, and numerical stability checks.

    1. The Starting Point: Optimizers Are Becoming a Memory Bottleneck in LLM Training

    In ultra-large-scale model training, compute is often not the first wall you hit. Memory is. Take a trillion-parameter dense model under mixed-precision training: parameters, gradients, and optimizer states alone can consume the vast majority of device memory.

    The adaptive optimization methods that have long been the industry default maintain separate first-order and second-order statistics for every parameter. This requires storing two extra floating-point tensors per weight, each the same shape as the parameter itself. By that estimate, the statistics for a trillion-scale model quickly balloon into the ten-terabyte range, and that is before accounting for activations, communication buffers, and temporary workspaces.

    The consequences are direct. The room left for larger batch sizes and longer contexts is severely compressed. Teams are forced into more aggressive parallel partitioning, more frequent activation recomputation, and smaller micro-batches to make things fit. End-to-end throughput drops, and training cycles and costs scale up accordingly. Reducing optimizer state overhead is therefore not a micro-optimization. It is a key variable that determines whether training is feasible at all.

    2. Two Optimization Philosophies and Their Core Differences

    The traditional adaptive approach is element-wise by design. It treats a weight matrix as a large collection of independent scalars, estimates a first-order and second-order moment for each scalar, and uses those estimates to decide how far to step. Its strength is strong per-element adaptivity, which makes it tolerant of sparse gradients and parameters at very different scales. The cost is that state overhead scales linearly with parameter count, and the update direction lacks any global geometric constraint.

    Matrix-based optimization (commonly represented by methods such as Muon) takes a different view. It treats a hidden-layer weight matrix as a single, indivisible high-dimensional linear operator, and the update should be determined within the overall geometric structure of that matrix. The typical flow is to accumulate gradients with momentum, orthogonalize the resulting matrix (Newton–Schulz iterations are commonly used as an approximation to fit the compute structure of accelerators), and then add it to the weights at a single unified learning rate.

    1. # Illustrative: core steps of a matrix-based update (not tied to a specific framework)
    2. def matrix_update(W, G, buf, lr, mu):
    3. buf.mul_(mu).add_(G) # momentum accumulation
    4. O = newton_schulz_approx(buf) # approximate orthogonalization, configurable iterations
    5. W.add_(O, alpha=-lr) # unified-scale update
    6. return W

    The key difference is that after orthogonalization, the update matrix has roughly consistent scale across directions. This prevents a few large singular-value directions from dominating the update, and makes the effective learning rate more predictable.

    3. Breaking Down the Distinct Advantages

    1. Significantly lower state overhead. Matrix-based methods typically maintain only one momentum buffer. Second-order statistics are no longer stored per element, so optimizer state drops from two parameter-sized tensors to one. On trillion-scale models, the memory freed up is often enough to support longer contexts or larger micro-batches.

    2. More stable update directions. Element-wise adaptivity tends to amplify directional noise in deep networks. Orthogonalization effectively projects the update onto a set of approximately orthogonal directions, reducing mutual cancellation and internal friction between directions.

    3. Better hyperparameter transferability. Because the update scale is normalized, the learning rate is less likely to become mismatched across different widths and parallel configurations. Configurations found through small-scale grid search transfer to large models with a higher success rate, which is extremely valuable for teams with limited budgets.

    4. Controllable fit with parallelism strategies. Orthogonalization operates on two-dimensional matrices, which naturally fits the block structure used in tensor parallelism. However, it requires extra communication at partition boundaries or a local approximation. In engineering terms, this is a benefit with a clearly defined cost.

    5. Fewer steps to converge. Public small-scale racing experiments generally show that, under the same compute budget, matrix-based methods reach the target loss in fewer steps, which means a shorter iteration feedback loop.

    4. Applicability Boundaries You Must Face

    Matrix-based methods are not a wholesale replacement. First, they mainly target the two-dimensional weight matrices of hidden layers. Embedding layers, output heads, normalization, and biases, which are one-dimensional or sparse structures, are usually still handled by adaptive methods. Real training runs use a hybrid optimizer.

    Second, the orthogonalization iterations themselves consume extra compute. If the model is small and the bottleneck is not memory, the benefit is offset.

    Third, distributed implementations are more complex. You need to handle the approximation error of block-wise orthogonalization and the associated communication overhead.

    Fourth, compatibility with some low-rank training and quantized training schemes still needs to be validated per implementation and should not be assumed in advance.

    5. Engineering Recommendations

    • Build a memory budget table first. Quantify parameters, gradients, optimizer states, activations, and communication buffers separately, and confirm the bottleneck really is optimizer state.
    • Use a hybrid strategy. Apply matrix-based updates to two-dimensional hidden-layer weights, keep adaptive updates for the remaining parameters, and set separate learning rates and warmup schedules.
    • Start with a small number of orthogonalization iterations (for example, 3–5), then observe the loss curve and update norms before adjusting, to avoid overpaying for precision.
    • Watch numerical stability. Momentum coefficients, gradient clipping, and overflow handling under mixed precision all need to be validated separately.
    • If you use cloud container platforms and distributed training frameworks, prefer general-purpose infrastructure that supports custom optimizer injection and provides logging, monitoring, and alerting. This makes comparative experiments and bottleneck identification easier.