Optimizer Memory Overhead in Large-Scale Model Training: A Practical Guide to Muon

    \Optimizer state is a long-underestimated cost in large-scale training. This article breaks down why adaptive optimizers consume so much GPU memory at the trillion-parameter scale, how matrix-level orthogonalized updates such as Muon reduce that overhead, what the orthogonalization step actually does, and how to validate and tune the approach before running it in production. It also includes an engineering checklist covering parameter scope, re-tuning, memory budgeting, monitoring, and rollback.

    1. Where the Problem Starts: Optimizers Are Eating Your Memory Budget

    In large-scale pre-training, GPU memory is never a question of “is it enough” but of “how do we allocate it.” Take mainstream adaptive optimization methods as an example: to give every parameter its own adaptive step size, they must maintain two extra state tensors in memory with the same shape as the parameters — the first-moment estimate and the second-moment estimate. Under mixed-precision training, parameters, gradients, and the two state tensors stack up, and once activation values and communication buffers are added, memory usage balloons quickly.

    A rough order-of-magnitude estimate: if the model reaches the trillion-parameter scale, the two optimizer states alone can occupy memory on the order of ten terabytes. The knock-on effects are severe:

    • Batch size gets squeezed, gradient noise increases, and convergence stability drops;
    • Context length is capped, making long-text capabilities hard to train;
    • The number of parallelism dimensions is forced up, communication takes a larger share, and compute utilization falls;
    • Total training cost rises non-linearly and experiment iteration slows down.

    In other words, optimizer states are not just “using a bit of memory” — they are compressing the feasible region of the entire training system.

    2. The Shift in Thinking: From Element-wise Adaptivity to Matrix-level Updates

    The worldview of a traditional adaptive optimizer is “element-wise”: it flattens a weight matrix into a pile of unrelated scalars, estimates the first- and second-order statistics of the gradient for each scalar separately, and then decides individually how far to step. Its strengths are generality and robustness, and it handles sparse gradients and parameters at different scales well. The drawback is equally clear — state overhead scales linearly with parameter count, and the structure of the weight matrix itself is completely ignored.

    A matrix-level approach takes a different view: a 1000×1000 weight matrix is not a million isolated numbers but a single object in a high-dimensional geometric space. The update should therefore happen as a whole — first fuse the gradient and momentum into an update matrix, then orthogonalize that matrix, and finally add it to the weights in one shot.

    The direct benefit: there is no longer a need to store two same-shaped state tensors per parameter, optimizer memory overhead drops substantially, and the space saved can be given back to batch size and context length.

    An intuitive analogy: element-wise optimization is like a group of soldiers each fighting on their own, where the commander has to issue a step-size order to every individual; matrix-level optimization first forms the soldiers into a square, then issues a single order to advance. The command chain is shorter and coordination cost is lower. Of course, the analogy immediately invites a challenge: a real battlefield is a line of scattered skirmishers — does a neat square only look good in small-scale demos?

    3. How It Works: What Orthogonalization Actually Does

    The key step of a matrix-level update can be abstracted into the following flow (illustrative pseudocode, not a specific implementation):

    1. # Pseudocode: core flow of a matrix-level orthogonalized update
    2. buf = momentum * buf + grad # 1. Momentum accumulation
    3. upd = orth(buf) # 2. Orthogonalize the update matrix
    4. W = W - lr * upd # 3. Add it to the weights as a whole

    Here orth(·) maps an input matrix to one whose columns (or rows) are approximately mutually orthogonal. A common general approach is to approximate the orthogonalization factor with an iterative method, avoiding a full matrix decomposition that would be far more expensive.

    Orthogonalization produces two explainable effects:

    1. Balanced update scale: the singular values of the orthogonal matrix are flattened, so the update has roughly equal strength in every direction, avoiding oscillation caused by a few directions “stepping too far.”
    2. Direction decorrelation: redundancy inside the update matrix is reduced, which amounts to a geometric whitening of the momentum and makes the effective learning rate more controllable.

    It is worth stressing that this kind of method usually applies only to the two-dimensional weight matrices of hidden layers; the embedding layer, output head, normalization parameters, and biases keep their existing optimization strategy. The reason is practical: those parameters either have extremely sparse gradients or are not matrix-structured to begin with, so forcing orthogonalization on them has unclear benefits and higher risk.

    4. From Toy Scale to Trillion Parameters: Doubts and a Validation Path

    This class of optimization idea was initially validated only on small models in the hundreds-of-millions parameter range, which makes “does it scale” the central controversy. Answering that question usually requires a reusable validation ladder:

    1. Equivalence validation: on small models, confirm that the convergence curve and loss descent are genuinely better than the baseline rather than random fluctuation.
    2. Scale extrapolation validation: increase parameter count and data volume step by step, and observe whether the gains decay with scale.
    3. Stability validation: check the frequency of loss spikes, the distribution of gradient norms, and whether more conservative learning rates and warmup schedules are needed.
    4. System-level validation: measure throughput, peak memory, and fault-recovery cost in a real parallel environment.

    The most common pitfalls when scaling up include: too few orthogonalization iterations, which distorts the update approximation; interactions with weight decay and gradient clipping that were not re-tuned; degraded numerical stability under low-precision training; and different parallelism schemes breaking matrix integrity, which requires redesigning the update granularity along the sharding dimensions.

    5. Engineering Deployment Checklist

    • Define the scope clearly: enable it on hidden-layer matrix parameters first, and keep the regular strategy for everything else.
    • Re-tune: learning rate, warmup steps, and weight decay must be matched to the new update scale; old configurations cannot be copied over.
    • Account for memory: explicitly reallocate the saved optimizer state memory to batch size or context length, otherwise the benefit cannot be quantified.
    • Monitor thoroughly: combine logging services with monitoring and alerting to track gradient norms, update norms, loss spikes, and related metrics.
    • Design for rollback: keep the baseline optimizer configuration so you can switch back quickly when something goes wrong.
    • Elastic resources: use container platforms and elastic compute scheduling to bring the cost of the validation ladder into an acceptable range.

    6. Conclusion

    Optimizer memory overhead is a long-underestimated cost item in large-scale training. The value of matrix-level orthogonalized updates does not lie in a specific number improving, but in changing how updates are organized: from individual adaptivity to holistic geometric constraints, trading fewer states for more balanced update directions. For teams aiming at larger parameter counts and longer contexts, this route is worth including in the technical selection evaluation — but it must come with a complete scale-extrapolation validation and re-tuning process, rather than going straight to production after seeing a nice curve on a small model.