The Evolution of Optimizers in LLM Training: From SGD to Muon

    This article outlines the evolution of optimizers in deep learning and large language model (LLM) training. It traces the development from standard gradient descent to the Heavy Ball method, and through to adaptive learning rate approaches like Adam. The article details the Muon optimizer, which leverages matrix structure to improve training efficiency, and provides actionable advice for developers on selecting optimizers across different training scenarios.

    I. Optimizers: The “Navigator” of Deep Learning Training

    Throughout the lifecycle of large model training, data, model architecture, and computing power often receive the most attention. However, the true determinant of whether a model can converge efficiently is an often-overlooked component: the optimizer. Recently, a new optimizer named Muon, mentioned in the technical documentation of a leading open-source large language model, sparked widespread industry discussion. This provides a perfect opportunity to systematically review the evolution of optimizer technology.

    To understand optimizers, we can use the classic “blindfolded descent” metaphor: you are blindfolded in a rolling mountain range, aiming to reach the deepest valley. You have two tools:

    • Loss Function: Tells you your current altitude.
    • Gradient: Calculated via backpropagation, it acts like probing the ground with your feet to determine the slope, indicating which way is downhill.

    The optimizer is the decision-making strategy in your brain: which direction to step next and how large the step should be. It typically determines three things:

    1. Controlling the Step Size

    In deep learning, this is known as learning rate control. If the step is too large, you might overshoot the valley and land on the opposite slope, resulting in loss oscillation and failure to converge. If the step is too small, training becomes agonizingly slow. Advanced optimizers adaptively adjust the step size: moving faster in flat regions and slowing down when steep and near the valley bottom.

    2. Escaping Local Optima

    Real loss surfaces are filled with “pits on the hillside” (local optima). If you only follow the current slope downward, you can easily get trapped in a small pit, mistakenly believing you have reached the bottom. Optimizers must provide mechanisms to help parameters jump out of these traps.

    3. Improving Convergence Stability and Efficiency

    Faced with the reality of massive differences in parameter scales and anisotropic loss surfaces, naive methods often fail to balance competing demands. Optimizers must ensure that all parameter dimensions progress at a reasonable speed.

    II. From Cauchy to Polyak: Adding “Mass” to the Particle

    The concept of gradient descent dates back to the method of steepest descent proposed by French mathematician Cauchy in 1847. However, for over a century, standard gradient descent essentially simulated a “massless particle” sliding on a surface—it could instantly accelerate to maximum velocity and stop just as abruptly. This violates physical intuition and creates practical problems: in narrow “canyon” terrains, the gradient direction is almost perpendicular to the canyon’s path, causing the particle to bounce back and forth against the walls, making extremely slow progress along the canyon.

    Soviet mathematician Boris Polyak broke this paradigm. In 1964, while studying optimization theory, he proposed a highly intuitive physical idea: what if we forcibly add “mass” and “inertia” to this sliding particle?

    Thus, the famous Heavy Ball Method was born. Its core formulation is:

    1. v_t = β · v_{t-1} + ∇L(θ_t)
    2. θ_{t+1} = θ_t − η · v_t

    Where v is the velocity term, β is the momentum coefficient (typically around 0.9), and η is the learning rate. The physical picture is clear: a ball with mass rolls down a canyon. When it hits the walls, most of its lateral kinetic energy is dissipated, while its velocity along the canyon continues to accumulate, rushing quickly to the bottom. This concept later evolved into SGD with Momentum, the most commonly used momentum method in deep learning, and Nesterov Accelerated Gradient—the latter calculates the gradient after “predicting” a step forward, acting as a smarter momentum correction.

    III. The Adaptive Learning Rate Era: From AdaGrad to Adam

    While momentum solved the “directional oscillation” problem, the issue of different parameters requiring different learning rates remained. This gave rise to the adaptive learning rate family:

    • AdaGrad: Accumulates the square of historical gradients, automatically reducing the learning rate for frequently updated parameters. It suits sparse feature scenarios, but the monotonically increasing accumulation causes the learning rate to approach zero in later stages.
    • RMSProp: Replaces full accumulation with an exponential moving average, mitigating the problem of learning rate decaying too quickly.
    • Adam: Combines first-order momentum (mean) with second-order momentum (variance) and applies bias correction. It has long been considered the “default optimal solution.”

    Adam’s update logic can be summarized as:

    1. m_t = β1·m_{t-1} + (1−β1)·g_t # First-order moment: inertia of the gradient
    2. v_t = β2·v_{t-1} + (1−β2)·g_t² # Second-order moment: estimation of gradient scale
    3. θ ← θ − η · m̂_t / (√v̂_t + ε)

    It remembers both “where to go on average” (momentum) and “how much this direction has historically fluctuated” (adaptive scaling), making it ready-to-use for the vast majority of tasks. However, Adam comes with a cost: each parameter requires two additional state variables. In large model training with hundreds of billions of parameters, the memory overhead of optimizer states can exceed the model parameters themselves, serving as a primary motivation for subsequent research.

    IV. Muon: An Optimizer That Treats “Matrices” as Matrices

    Adam and its variants have an implicit assumption: flatten all parameters into one-dimensional vectors and scale them independently element by element. However, the vast majority of parameters in neural networks are naturally matrices (such as weights in attention and feedforward layers). Element-wise processing completely ignores the structural information of matrices.

    Muon (Momentum Orthogonalized by Newton-Schulz iteration) starts from this exact insight. Its workflow can be summarized in two steps:

    1. Compute Momentum: Consistent with the standard momentum method, it accumulates historical gradients to obtain the update direction M_t.
    2. Orthogonalization: Performs a Newton-Schulz iteration on this 2D update matrix to approximate its “semi-orthogonalized” result (similar to setting all singular values to 1 after Singular Value Decomposition), and uses this result to update the parameters.

    Intuitively, the singular value distribution of a standard gradient matrix is often highly skewed—a few directions have massive change magnitudes, while most are negligible. Updating directly according to the original matrix means training is hijacked by a few “dominant directions.” Orthogonalization normalizes all singular values, meaning every effective learning direction receives an equal amount of propulsion. This results in more balanced updates and indirectly provides a regularization effect similar to “spectral norm constraints,” which benefits training stability.

    In engineering practice, Muon is typically used in combination with Adam: 2D weight matrices in the network are handled by Muon, while 1D or special parameters like Embeddings, LayerNorm, and biases are still processed by Adam. Multiple public experiments show that this combination significantly reduces the training steps required to reach the target loss under equivalent compute power, directly saving substantial training costs. This is why it has attracted attention in large-scale model pre-training.

    V. Practical Recommendations and Conclusion

    For developers, choosing an optimizer can follow these guidelines:

    1. Small-to-medium scale training or fine-tuning: Adam/AdamW remains a robust first choice with low tuning costs.
    2. Large-scale pre-training pursuing ultimate efficiency: Evaluate matrix optimizers like Muon, paying attention to its co-tuning with learning rate schedules and weight decay strategies.
    3. Memory-constrained scenarios: Pay attention to optimizer state overhead. If necessary, use low-precision storage for optimizer states or distributed sharding schemes.
    4. Leverage platform capabilities: Utilize general cloud container platforms and monitoring/alerting capabilities to observe training loss curves and gradient norms in real-time. Promptly detecting oscillations or divergence is a necessary safeguard regardless of the optimizer chosen.

    From Cauchy’s steepest descent, to Polyak injecting inertia into the heavy ball, to Adam’s adaptive scaling and Muon’s structured updates, every step in the evolution of optimizers stems from a deeper understanding of the geometric properties of loss surfaces. Understanding these concepts is far more valuable than memorizing a specific hyperparameter value—because the next optimizer to change the training paradigm might already be on its way.