Optimizers in Deep Learning: From Momentum to Muon and Orthogonalized Gradients

    This article explores the evolution of optimizers in deep learning training, from classic stochastic gradient descent and momentum methods to adaptive learning rates and the emerging Muon-style orthogonalization approach. It explains the mathematical intuition, practical trade-offs, and engineering considerations for using these advanced optimizers in large-scale model training, helping readers understand how modern optimizers accelerate convergence and improve training efficiency.

    Optimizers: The Navigation System of Deep Learning Training

    In deep learning, the optimizer plays a pivotal role. If the loss function tells the model “how poorly it is performing” and backpropagation tells it “which direction to adjust,” the optimizer decides “how far and how precisely to move in each step.”

    A classic analogy is the “descending a mountain in the dark” scenario: imagine a person blindfolded on a mountain range, tasked with finding the valley floor. The only information available is the current altitude (loss value) and the local slope (gradient) beneath their feet. The optimizer is the walking strategy in their mind, addressing three main challenges:

    1. Step size control: Steps that are too large overshoot the valley, causing oscillation and preventing convergence; steps that are too small slow training to a crawl. Advanced optimizers adaptively adjust step length, accelerating on flat terrain and slowing down near steep valleys.
    2. Escaping local minima: The mountain is dotted with shallow pits halfway down; relying solely on local gradient information can trap the model into mistaking a pit for the true bottom.
    3. Handling ill-conditioned terrain: Real loss surfaces often contain narrow “canyons”—directions that are extremely steep and others that are extremely flat. This poses a severe challenge to optimizer design.

    From SGD to Momentum: Giving Particles Inertia

    The most basic optimization method is stochastic gradient descent (SGD), whose roots trace back to the 19th-century mathematician Cauchy and his work on optimization. Standard gradient descent is mathematically equivalent to simulating a “massless particle” sliding on a surface—it can accelerate to maximum speed instantly and stop abruptly, which contradicts physical intuition.

    The breakthrough came in 1964, when Soviet mathematician Boris Polyak introduced the heavy ball method, which we now know as momentum. His physical insight was elegant: what if we forcibly add “mass” and “inertia” to the sliding particle?

    The update rule incorporates both the current gradient and a fraction of the historical update direction:

    1. v = beta * v + grad
    2. param = param - lr * v

    Momentum provides two key benefits:

    • Suppressing oscillation in canyon terrains: In steep directions, gradients alternate in sign and cancel out during momentum accumulation; in flat directions, gradients point consistently and accumulate, accelerating progress.
    • Helping escape shallow local minima: Even when the current gradient is zero, the historical velocity can push parameters over a shallow pit.

    Nesterov’s accelerated gradient method further improved this idea: it takes a “lookahead” step along the momentum direction, then computes the gradient at that projected point. This “look before you leap” strategy achieves better theoretical convergence rates and is now a component of many modern optimizers.

    Adaptive Learning Rates: Customized Step Sizes for Every Parameter

    Momentum addresses direction, but a global, uniform learning rate remains too coarse. In practice, gradient scales differ dramatically across parameters—embedding layers, attention weights, and output layers can have update magnitudes that vary by orders of magnitude. Adaptive methods (represented by AdaGrad, RMSProp, and Adam) share a core idea:

    • Maintain a per-parameter history of gradient second-order statistics (e.g., exponential moving average of squared gradients);
    • Use these statistics to normalize the first-order statistics, achieving per-parameter step-size scaling.

    Adam further combines momentum (first moment) with adaptive scaling (second moment), plus bias correction, and became the default choice for the past decade. However, it has shortcomings: the second moment used as a denominator can cause drastic fluctuations in effective step size under extreme gradient distributions, and Adam’s “sign-style” update means that the update direction is not highly sensitive to the precise magnitude of gradients.

    Muon-Style Optimizers: Orthogonalizing the Gradient Before Moving

    One of the most promising recent directions is an optimizer that orthogonalizes gradients (represented by the Muon family of methods). Its starting point is a matrix-based observation: parameters in neural networks are fundamentally matrices, and the effect of a gradient update is closely tied to the singular value spectrum of that matrix.

    The core procedure can be summarized as:

    1. For each weight matrix, approximate its gradient using Newton–Schulz iterations, “flattening” the singular values to produce a near-orthogonal matrix;
    2. Add momentum on top of the orthogonalized gradient;
    3. Maintain weight decay and other regularizations in a manner similar to AdamW, while the RMS statistics are handled on the parameter update side.
    1. # Pseudocode illustration (Newton–Schulz orthogonalization approximation)
    2. G = momentum_buffer
    3. for _ in range(ns_steps):
    4. A = G @ G.T @ G
    5. G = a * G + b * A + c * A @ G.T @ G
    6. param -= lr * G # approximately orthogonal update direction

    Why does orthogonalization work? Intuitively, the singular value distribution of a typical gradient matrix is highly unbalanced—a few directions account for most of the energy, causing updates to be dominated by those principal directions while other directions progress slowly. By equalizing the singular values of the update matrix, all “learnable directions” receive balanced driving force, significantly improving the information utilization of each step.

    From a geometric perspective, this can be seen as constraining changes in the spectral norm of the parameter matrix during updates, allowing the training trajectory to traverse the canyon regions of the loss surface more smoothly and avoiding excessive impacts from gradient explosion directions.

    Engineering Trade-offs and Implementation Recommendations

    Although novel optimizers show substantial acceleration in large-scale language model training (often manifesting as a significant reduction in compute needed to reach the same loss), practical engineering still requires attention to several points:

    1. Scope of application: Orthogonalization methods primarily target two-dimensional matrix parameters (e.g., linear layers, attention projections). One-dimensional parameters (biases, normalization gains) are usually left to AdamW-style methods, yielding a hybrid optimization strategy.
    2. Hyperparameter sensitivity: Momentum coefficients, learning rates, and NS iteration counts do not share default values with Adam; re-tuning is necessary when switching.
    3. Distributed overhead: Orthogonalization introduces additional matrix multiplications and communication (synchronization and aggregation required in sharded parallelism). Engineering implementations must weigh mathematical gains against system costs.
    4. Interaction with learning rate schedules: Techniques like warmup and cosine decay remain applicable, but the step size during the warmup phase needs more careful control.

    For small to medium-scale training tasks, AdamW remains a safe default. However, when compute budgets are huge and training cycles span weeks, adopting a Muon-style optimizer can result in significant compute savings.

    Summary

    The evolution of optimizers is essentially a history of injecting physical intuition and mathematical insight into the training process: momentum gives “inertia” to massless particles, adaptive methods customize step sizes per parameter, and orthogonalization optimizers redesign update directions from the matrix spectral perspective. Understanding the principles behind these methods not only helps us tackle convergence challenges in large-model training but also provides a clear framework for designing future optimizers—the better optimizer is always the one that more deeply understands the geometric structure of the loss surface.