LLM Training Memory: Choosing Between AdamW and Orthogonalizing Optimizers

    Muon-style orthogonalizing optimizers can reduce optimizer-state memory, but they add matrix computation and complicate distributed training. This article compares their memory requirements and update mechanics with AdamW, explains which parameters are suitable, and outlines evaluation, monitoring, and fallback checks before adoption.

    1. Understanding Adam’s Memory Footprint

    Adam stores two states for every parameter: a first moment, or momentum, and a second moment, an exponential moving average of squared gradients. Both are typically stored in FP32, requiring a total of 8 bytes per parameter.

    For a model with 1.6 trillion parameters:

    • Optimizer states: 1.6 × 10^12 × 2 states × 4 bytes = 12.8 TB
    • Model weights in FP16 or BF16: 1.6 × 10^12 × 2 bytes = approximately 3.2 TB
    • Combined: approximately 16 TB

    These figures do not cover the full training memory footprint. Gradients, activations, and communication buffers also consume GPU memory. If mixed-precision training retains FP32 master weights, those add approximately 6.4 TB.

    The 12.8 TB figure therefore represents optimizer states alone—not total training memory.

    2. Where Orthogonalizing Optimizers Come In

    One reported motivation for this approach came from a community speed-training competition. A developer applied orthogonalization to hidden-layer gradients and reported a substantial reduction in the number of training steps needed to reach a target loss.

    That result applied to a particular small model and loss target. Assessing its relevance requires details about the dataset, model size, hyperparameters, and comparison baseline. It is not sufficient evidence to assume the same benefit at trillion-parameter scale.

    3. How Orthogonalizing Optimizers Update Weights

    Conventional optimizers such as Adam operate element by element. Each weight has its own moment estimates, which determine its update.

    Orthogonalizing optimizers, represented here by Muon-style implementations, operate on matrices in three stages:

    1. Accumulate gradients into a momentum matrix.
    2. Orthogonalize that matrix, pushing its singular values toward 1 to produce an orthogonalized update.
    3. Apply the resulting matrix update to the weights.

    Rather than computing an exact singular value decomposition, implementations typically approximate orthogonalization with Newton–Schulz iterations. Only a few iterations are generally needed, but each includes matrix multiplications, making this more computationally expensive than elementwise operations.

    The memory advantage comes from maintaining fewer optimizer states. A Muon-style optimizer retains one momentum state and omits Adam’s second-moment state. It is therefore not stateless: with FP32 states, the saving is approximately 4 bytes per parameter to which it is applied. Actual savings must be measured for the chosen implementation and precision.

    4. AdamW vs. Muon-Style Optimizers

    Dimension Adam / AdamW Orthogonalizing optimizers, such as Muon
    Optimizer state per parameter Two states; approximately 8 bytes in FP32 One momentum state; approximately 4 bytes in FP32
    Per-step computation Relatively inexpensive elementwise operations Additional Newton–Schulz matrix iterations
    Distributed communication Relatively straightforward with parameter sharding Orthogonalization requires the complete matrix, so sharding needs additional gathering or a specialized implementation
    Hyperparameter tuning Learning rate, two moment coefficients, and weight decay Learning rate, momentum coefficient, iteration count, and weight decay; requires tuning separately from AdamW
    Parameter coverage Applicable to all parameters Typically used only for two-dimensional hidden-layer weights

    5. Which Parameters Should Use Orthogonalized Updates?

    A common approach is to apply orthogonalized updates only to two-dimensional hidden-layer weights, such as attention projection matrices and feed-forward network matrices. Embeddings, output layers, normalization parameters, and biases remain on AdamW.

    Embedding gradients can be highly sparse, and each row represents a separate token embedding. Treating the entire matrix as a single object for orthogonalization may therefore be unsuitable. For smaller output layers and normalization parameters, switching optimizers offers limited memory savings.

    Orthogonalization is not guaranteed to outperform elementwise optimization in every setting. Its effectiveness with extremely sparse gradients or particular tasks must be established experimentally.

    6. What to Check Before Adoption

    1. Parameter grouping: Verify that two-dimensional hidden-layer weights use the orthogonalizing optimizer, while other parameters remain on AdamW. Configure learning rates separately for the two groups.

    2. Controlled comparisons: On a smaller model, compare loss curves and wall-clock training time using the same data and token budget. Fix random seeds to improve comparability.

    3. Distributed correctness: Confirm that orthogonalization operates on complete matrices. When parameters are sharded, check that gathering is implemented correctly; otherwise, the resulting updates can differ from the intended computation.

    4. Independent hyperparameter tuning: Tune the learning rate, momentum coefficient, Newton–Schulz iteration count, and weight decay specifically for the orthogonalizing optimizer. Do not simply reuse AdamW settings.

    5. Training monitoring: Continuously record loss, gradient norms, per-step update magnitudes, and NaN counts.

    7. When and How to Fall Back to AdamW

    Define fallback criteria before starting the experiment. Switch back to AdamW if any of the following occurs:

    • Sustained loss increases: Set a task-specific threshold—for example, loss remaining above the lowest value reached early in training for several hundred consecutive steps.
    • Numerical instability: NaNs appear, or training fails to recover after a loss spike.
    • Unacceptable evaluation results: Downstream metrics fall below the AdamW baseline by more than a predefined tolerance.

    To fall back, restore the most recent usable checkpoint and continue with a validated AdamW configuration. Save both optimizer configurations before experimentation so that switching does not require changes to the data or model architecture.

    8. What Trillion-Parameter Training Still Requires

    Changing optimizers does not eliminate hardware constraints. The weights of a trillion-parameter model already exceed the memory capacity of a single GPU. Regardless of optimizer choice, training requires an appropriately sized GPU cluster and distributed strategies such as tensor parallelism, pipeline parallelism, or data parallelism.

    Reducing optimizer states addresses only one component of the memory budget.

    Infrastructure planning must also account for:

    • GPU memory capacity and interconnect bandwidth
    • Network communication overhead
    • Checkpoint read and write throughput
    • Failure recovery mechanisms

    Together, these factors determine whether training can run reliably to completion.

    9. Conclusion

    Orthogonalizing optimizers reduce optimizer-state memory, but introduce additional matrix computation per step and more demanding distributed implementation requirements. Their practical value depends on model architecture, parallelization strategy, and training stability.

    Before adopting one, run controlled comparisons on the target model and establish fallback criteria. Reported reductions in training steps from a specific benchmark should not be treated as evidence of universal improvements across models and tasks.