Matrix-Based Optimization in Large Model Training: Why Muon Rethinks the Optimizer State

    This article explains a new class of optimizers that treat weight matrices as a whole, focusing on Muon’s approach: replacing Adam’s two state buffers with a single momentum buffer and orthogonalizing the update. It covers the memory footprint of Adam, the mechanics of Muon, when to use it, current debates, and a practical checklist for evaluation.

    The Hidden Cost of Adam’s State Buffers

    Adam maintains two per-parameter states: the first moment (mean of gradients) and the second moment (mean of squared gradients). This design enables adaptive step sizes for every parameter, but it costs extra memory. When stored as 32-bit floats, each parameter requires 8 bytes for the two states — separate from the parameters, gradients, and activations.

    For a 1.6-trillion-parameter model, a rough estimate:

    • Adam’s two state buffers: 1.6 × 10^12 × 8 bytes ≈ 12.8 TB
    • Keeping only one momentum buffer: 1.6 × 10^12 × 4 bytes ≈ 6.4 TB

    These numbers cover only the optimizer state itself. Real training also needs parameter copies, gradients, activations, and communication buffers, so the total footprint is larger. Still, the optimizer state accounts for a significant share of the memory budget, reducing the space available for batch size and context length, which directly affects throughput and cost.

    Muon’s Core Idea: Orthogonalize the Whole Update Matrix

    Adam computes updates element-wise, treating each parameter independently. Muon changes the unit of update: it treats a 2D weight matrix as a whole and applies an orthogonalization step to the update matrix.

    The update procedure roughly follows three steps:

    1. Accumulate momentum: Add the current gradient to the momentum buffer.
    2. Orthogonalize: Map the momentum matrix to an approximately orthogonal matrix. From an SVD perspective, this step preserves the directional structure while compressing all singular values toward 1.
    3. Apply the update: Subtract the orthogonalized matrix (scaled by the learning rate) from the weights.

    Pseudo-code that captures the data flow:

    1. # W: 2D hidden layer weight; G: current gradient; M: momentum buffer (the only optimizer state)
    2. M = beta * M + G
    3. O = newton_schulz_orthogonalize(M) # approximates U·V^T, singular values → 1
    4. W = W - lr * O

    Orthogonalization is typically done via Newton-Schulz iterations, which rely only on matrix multiplications and linear combinations — friendly for GPU execution and no explicit SVD required.

    Where the Memory Savings Actually Come From

    Some descriptions credit orthogonalization itself for the memory savings, but that is misleading. Muon’s primary memory advantage comes from reducing the number of state buffers: one momentum buffer instead of two. The orthogonalization step needs a small amount of temporary space and adds extra compute. So when evaluating Muon, both the state savings and the added computation should be considered together.

    When to Use Muon: Scope and Practical Configurations

    Muon is typically applied only to 2D weight matrices in hidden layers — for example, attention projection matrices and linear layers in feed‑forward networks. Embeddings, output heads, normalization parameters, and biases have different shapes and roles, so in practice they continue to use standard optimizers like AdamW.

    When mixing two types of optimizers, keep in mind:

    • Set separate learning rates and weight decay values for the two parameter groups; do not reuse the same hyperparameters.
    • The learning rate for Muon usually needs its own search; do not copy the Adam settings directly.
    • Verify that the update magnitudes of the two groups are balanced, so one group does not converge too fast or too slow relative to the other.

    Points of Debate

    Skepticism about Muon generally falls into three categories.

    1. Structural assumptions. Global orthogonalization implies that all directions in the weight matrix are roughly equally important. If some directions carry critical information, compressing all singular values to the same level may weaken those updates. Whether this assumption holds across different models and tasks is not yet settled.

    2. Compute and communication overhead. Orthogonalization requires multiple matrix multiplications per step, increasing per‑step time. In distributed training, parameters are sharded across devices, but orthogonalization needs either the full matrix or additional communication. Poorly implemented, the memory saved can be offset by higher communication and compute costs.

    3. Scale of validation. Early results often come from small models. Convergence speedups observed at small scale do not automatically transfer to larger models. Parameter count, data distribution, and hyperparameter choices can change the outcome, so validation must be done at increasing scale.

    A useful analogy: a neat queue is efficient on open ground, but whether it works in complex terrain needs real data.

    How to Evaluate This Optimizer for Your Own Training

    To decide whether to adopt Muon (or similar matrix‑based optimizers) in your own training tasks, consider the following steps:

    1. Hold everything else fixed, only swap the optimizer. Keep the data, model architecture, and random seed identical, and compare loss curves over the same number of training tokens.
    2. Track multiple metrics. Besides convergence steps, record peak memory, per‑step latency, and end‑to‑end wall‑clock time. Looking only at step counts can be misleading.
    3. Tune each optimizer separately. Search learning rate and weight decay for both Adam and Muon. Otherwise the comparison will favor the better‑tuned method.
    4. Scale up gradually. Start with a small model, confirm the trend at medium scale, then run stability tests at the target size, watching for loss spikes and numerical overflows.
    5. Check the distributed implementation. Ensure that parameter sharding is compatible with the orthogonalization step, and measure changes in communication volume.

    Summary

    Muon represents a different way of looking at optimization: treat the weight matrix as a single entity, replace two Adam state buffers with one momentum buffer to save memory, and use orthogonalization to unify the update scale. Its benefits depend on model structure, training scale, and engineering implementation; it is not simply a universal replacement for Adam. For developers, the most reliable approach is to run reproducible comparisons and judge whether this class of optimizers suits their specific training workload.