How the Muon Optimizer Reduces GPU Memory Usage in LLM Training
Muon halves optimizer state memory by maintaining a single momentum buffer per 2D weight matrix instead of Adam's two states. This article explains how Muon's Newton-Schulz orthogonalization works, what the experimental evidence shows, which layers should use it, and the key engineering considerations for adoption.
Why Optimizer States Fill Up GPU Memory
Adam and its variants store two pieces of state per parameter: the first moment (an exponential moving average of gradients) and the second moment (an exponential moving average of squared gradients). For a dense model with 1.6 trillion parameters, if both states are stored in FP32 (4 bytes per value), the optimizer state alone is roughly 1.6×10^12 × 2 × 4 bytes, or about 12.8 TB. That figure excludes model weights, gradients, and activations, but it is already enough to squeeze the space available for batch size and context length.
In distributed training, ZeRO or FSDP can shard these states across multiple GPUs, reducing per-GPU usage—but the total state across the cluster remains unchanged. Reducing the amount of state itself is therefore the most direct way to cut memory usage.
How Muon Works
Muon (MomentUm Orthogonalized by Newton-Schulz) targets two-dimensional weight matrices in hidden layers and performs three steps at each update:
- Update the momentum: M = μ·M + G, where G is the current gradient and M has the same shape as the weight matrix.
- Approximate orthogonalization: Apply Newton-Schulz iterations to M to produce an approximately orthogonal matrix O. This approximates the UV^T from the SVD of M, pushing all singular values toward 1.
- Update the weights: W ← W − η·O, where η is the learning rate. Implementations typically also multiply by a scaling factor based on the matrix shape.
Compared with Adam, Muon maintains only one momentum matrix—of the same shape—per 2D weight, cutting optimizer state roughly in half. Note that this is not “storing a single scalar per matrix.” State still grows linearly with parameter count; what is saved is a constant factor, not an order of magnitude.
As for why orthogonalization helps: the orthogonalized update has roughly uniform magnitude across all directions rather than concentrating on a few singular directions. Whether this balance actually speeds up convergence is mainly supported by empirical results so far; the theoretical understanding is still developing.
The Evidence and Its Limits
Much of Muon’s attention comes from the NanoGPT speedrun, a public benchmark that trains a GPT-2-scale model of roughly 124 million parameters on 8 H100 GPUs until it reaches a FineWeb validation loss of 3.28. Since late 2024, several records have used Muon, with training times shorter than earlier AdamW-based records.
These results have clear limitations: the model is small, and the data, learning rate schedule, and training steps were all specially tuned. The conclusions cannot be directly extrapolated to arbitrary tasks.
On the large-model side, Moonshot’s 2025 technical report stated that after adding weight decay and matching update magnitudes, Muon achieved roughly 2x the compute efficiency of AdamW in training their MoE model. This figure comes from that team’s experimental setup; other teams need to reproduce it on their own data and scale.
Scope: Which Parameters Should Use Muon
Muon’s design assumes matrix-structured parameters, so it is typically applied only to the following:
- Suitable: Two-dimensional weight matrices in hidden layers, such as attention Q, K, V, and output projections, plus linear layer weights in MLPs.
- Usually still AdamW: Embedding layers, the output layer (LM head), bias terms, and the scale parameters of LayerNorm or RMSNorm.
In practice, filter parameters by name and dimension first, then pass the resulting groups to the two optimizers. Feeding 1D parameters to Muon by mistake makes orthogonalization undefined, causing errors or meaningless updates.
Engineering Considerations
Newton-Schulz iteration count. Community implementations commonly use about 5 iterations. More iterations mean more accurate orthogonalization but higher compute cost. Treat the step count as a hyperparameter and tune it on small models first.
Learning rate and scaling. The magnitude of the orthogonalized update depends on matrix shape, and scaling rules differ across implementations. Directly reusing the AdamW learning rate is usually inappropriate. Follow the documentation of your chosen implementation for the scaling factor, then run a learning rate sweep.
Momentum and weight decay. Momentum is often set near 0.95, but verify empirically. Moonshot’s report indicates weight decay matters for stability in large-scale training, so set it explicitly rather than leaving it disabled by default.
Mixed precision. Community implementations often run the Newton-Schulz iterations in bf16 for speed. If loss becomes NaN or oscillates severely, check whether the iterations overflow, switch the orthogonalization to FP32, and apply the result to the weights in training precision.
Distributed sharding. Newton-Schulz requires the full matrix to compute. If FSDP or ZeRO shards weights across GPUs, you need to gather the matrices first or use an implementation that supports distributed orthogonalization. This adds communication overhead, so stress-test on your target cluster before adopting it.
Regularization effects. Some argue that orthogonalization itself mitigates overfitting, but there is no reliable evidence for this. Any generalization benefit must be confirmed on your own task via a validation set.
Implementation Checklist
- Enumerate all 2D hidden-layer weights in the model and list their parameter names.
- Assign the remaining parameters (embeddings, output layer, biases, normalization parameters) to AdamW.
- Run an A/B comparison on a small model: same data, same token count, comparing loss curves and per-step time.
- Record optimizer state memory usage—for example, by comparing allocated memory before and after optimizer creation.
- Once small-scale results are stable, gradually scale up model size and cluster size.
FAQ
What is the core difference between Muon and Adam?
Adam computes per-parameter adaptive step sizes and maintains two states. Muon applies an orthogonalized update to each 2D weight matrix as a whole and maintains only one momentum state.
Which layers are suitable for Muon?
Two-dimensional weights in hidden layers. Embeddings, the output layer, biases, and normalization parameters usually remain on AdamW.
What if training errors out or loss becomes NaN?
First check whether non-2D parameters were passed to Muon. Then lower the learning rate, check whether the bf16 iterations overflow, and if necessary run the orthogonalization in FP32.
Can Muon fully replace Adam?
Public evidence does not yet support a full replacement. The safer approach is to use both optimizers together and rely on validation results on your own task.
How much memory can be saved?
For optimizer state, roughly half compared with Adam’s two states. Total memory also includes weights, gradients, and activations, so the overall savings ratio will be smaller than the savings on optimizer state alone.
