LLM Training Optimizer Evolution: From SGD to Momentum and Matrix Orthogonalization

    This article explains why optimizer design ultimately determines the quality of large language model training, using a blindfolded mountain-descent analogy to break down the three core responsibilities of optimizers: step-size control, escaping local minima and saddle points, and numerical stability. It traces the evolution from plain stochastic gradient descent to Polyak's Heavy Ball Method, then to per-coordinate adaptive methods such as Adam-style updates, and finally to matrix-based optimizers like Muon that treat each weight matrix as a whole and orthogonalize the update direction. Practical engineering considerations, limitations, and recommendations for developers evaluating new optimizers are also covered.

    1. Why Interface Upgrades Eventually Come Back to the Optimizer

    When people discuss the capability jumps of a new generation of LLM APIs and training systems, the attention usually goes to the visible layer: context length, invocation patterns, structured output. But what actually sets the ceiling on model capability is convergence quality during training, and one of the core variables behind convergence quality is the optimizer.

    Think of training as descending a mountain blindfolded. You are placed somewhere in a rolling range of peaks, and the goal is to reach the deepest valley.

    • The loss function is your altimeter: it tells you the current altitude.
    • The gradient (obtained via backpropagation) is your foot probing the slope: it tells you which side goes downhill.
    • The optimizer is the strategy in your head: it decides which direction to step and how large that step should be.

    The analogy is not crude. It maps precisely onto the three things an optimizer must solve: how the step size adapts, how to escape the small pits halfway up the slope (local optima), and how to stay numerically stable.

    2. The Three Core Responsibilities of an Optimizer

    2.1 Learning Rate Control: Step Size Decides Whether You Converge

    Too large a step and you leap straight over the valley onto the far slope, showing up as oscillating or even diverging loss. Too small a step and the training cycle stretches out indefinitely, driving compute cost sharply up. The ideal strategy is to accelerate on flat regions and slow down on steep regions and near the valley floor, which is the basic motivation behind all adaptive methods.

    2.2 Escaping Local Optima and Saddle Points

    Real loss surfaces contain plenty of local minima and saddle points. Descending along the instantaneous gradient direction alone easily gets you stuck in a small pit halfway up, mistaken for the global optimum. Introducing inertia, or a smoothed estimate built from direction history, are the two mainstream ways the field breaks out of this.

    2.3 Numerical Stability and Generalization

    In LLM training, gradient scales differ enormously across layers and across parameter matrices. If every layer uses the same effective step size, you get an imbalance where some layers update far too aggressively while others barely move, which hurts both stability and final generalization.

    3. From a Massless Particle to the Heavy Ball Method: The Physical Intuition of Momentum

    The plainest stochastic gradient descent idea traces back to mid-nineteenth-century mathematical work, but its implicit assumption is deeply counterintuitive: it simulates a particle with no mass, one that can instantly accelerate to top speed and instantly brake to a stop, which violates basic physics.

    In 1964, the Soviet mathematician Boris Polyak, studying optimization theory, noticed that on long, narrow canyon-like terrain, plain gradient descent repeatedly slams into both walls and is extremely inefficient. His proposal was to give the particle mass and inertia, known as the Heavy Ball Method. Its general form can be written as:

    1. v_t = beta * v_{t-1} + grad_t
    2. theta_t = theta_{t-1} - lr * v_t

    Here beta is the momentum coefficient, controlling how much of the gradient history is retained. The intuitive effect: sustained downhill motion in the same direction is accumulated and amplified, while side-to-side oscillation cancels out, so the trajectory automatically aligns itself with the long axis of the canyon.

    The more common engineering practice is to decouple the first-moment and second-moment estimates: first take an exponential moving average of the gradient, then normalize per coordinate using a moving average of the squared gradient, so that the effective step size of every parameter sits at a comparable magnitude. Pseudocode:

    1. m = beta1 * m + (1 - beta1) * g # first moment: direction smoothing
    2. v = beta2 * v + (1 - beta2) * g * g # second moment: scale normalization
    3. m_hat = m / (1 - beta1 ** t) # bias correction
    4. v_hat = v / (1 - beta2 ** t)
    5. theta -= lr * m_hat / (sqrt(v_hat) + eps)

    This per-element adaptive paradigm was the mainstream choice for a long time, but it carries a structural limitation: it treats a parameter matrix as a pile of unrelated scalars and completely ignores the structure of the matrix.

    4. The Key Breakthrough of the New Generation: Treating a Matrix as a Matrix

    The matrix-based optimizers that have drawn wide attention over the past two years center on one idea: treat each layer’s parameter matrix as a single object and impose an orthogonality constraint on its update, so that the scales of the update matrix across directions become balanced. The mathematical intuition:

    • Per-element adaptivity only guarantees a reasonable step size for each individual number.
    • Orthogonalization guarantees that the singular value distribution of the whole update matrix is uniform, avoiding update energy concentrating in a few directions.

    The direct payoff: weight matrices of different layers and different shapes get more comparable effective update scales, training curves become smoother, and hyperparameters (especially the learning rate) transfer better, lowering the cost of tuning across scales. A schematic expression:

    1. G = current gradient matrix
    2. M = update direction after momentum smoothing
    3. O = Orthogonalize(M) # makes the singular values of O approximately 1
    4. W = W - lr * O

    The orthogonalization itself is usually done through an iterative approximation of M^T M (for example, a few iterations of matrix multiplications), avoiding a costly exact decomposition. Key implementation points:

    1. Iterations versus precision: too few iterations means insufficient orthogonalization, too many slows down each step.
    2. Numerical safeguards under mixed precision: low-precision matrix multiplications accumulate more error, so critical steps need higher precision.
    3. Layered mixing with per-element adaptive methods: a common approach is matrix-based updates for two-dimensional weight matrices, while keeping the original adaptive method for one-dimensional or small-matrix parameters such as biases, normalization parameters, and embedding layers.
    4. Memory and communication overhead: how the momentum matrices are stored and sharded in a distributed setup must be co-designed with the parallelism strategy.

    It is worth stressing that these methods are not unconditionally better. On small models, short training runs, or limited data, the gains may be unnoticeable; only in very large-scale, long-cycle training do the improvements in stability and tuning cost become easier to observe.

    5. Practical Advice for Developers

    • Establish a baseline first: run a reproducible baseline with a mature per-element adaptive method, then evaluate the incremental gain of the new optimizer.
    • Watch the effective learning rate, not the nominal one: after switching optimizers you must retune the learning rate and warmup length.
    • Validate in small steps: compare convergence speed and stability on a small proxy task before scaling up to full training.
    • Improve observability: combine logging with monitoring and alerting to continuously track the loss curve, gradient norm, and update norm, and roll back promptly when something looks wrong.
    • Line up the resources: large-scale training typically relies on container platform scheduling and high-performance object storage to carry data and checkpoints, and the training framework and parallelism strategy must match the optimizer’s memory profile.

    6. Conclusion

    The optimizer is the most underrated navigation system in deep learning. From plain gradient descent, to the Heavy Ball Method with inertia, to per-coordinate adaptivity, and finally to orthogonalized updates that treat the parameter matrix as a whole, this line of evolution has always aimed at the same thing: a descent trajectory that is straighter, more stable, and cheaper in compute. Understanding this main thread is more valuable than memorizing any single name, and it helps developers grasp the real technical variables when evaluating new-generation model training and API capabilities.