LLM Training Optimizers Explained: From Gradient Descent and Momentum to Matrix Orthogonalization
When an organization releases a next-generation large model and shares part of its training details, the community usually discusses the optimizer rather than the architecture. This article traces how training optimizers evolved: the intuition behind what an optimizer does, Polyak's heavy-ball momentum, adaptive methods such as Adam and AdamW, and the newer direction of orthogonalizing gradient matrices for Transformers. It also covers the practical checklist for evaluating a new optimizer in your own pipeline: small-scale controlled experiments, hyperparameter sensitivity sweeps, stability monitoring, hybrid update rules per parameter type, numerical precision and memory overhead, and gradual adoption. Readers will gain a clear picture of why optimizer-level improvements still deliver systematic gains when data and compute are converging.
1. Background: Why Optimizers Are the Focus of LLM Training
When an organization releases a next-generation large model and publishes some of its training details, the community usually talks less about the model architecture and more about the training optimizer. The reason is simple: at a scale of hundreds of billions of parameters and trillions of tokens, the choice of optimizer directly determines three things:
- Convergence speed: training cost is roughly linear in the number of convergence steps, so even a small efficiency gain in the optimizer gets amplified by scale.
- Training stability: large model training is prone to loss spikes, gradient explosions, and parameter drift, and the optimizer is the first line of defense.
- Final performance: with the same data and architecture, different optimizers can produce a noticeable accuracy difference.
Understanding optimizer evolution therefore means understanding one of the main threads of large-scale training engineering.
2. What an Optimizer Actually Does: A Classic Intuition
A useful mental model is descending a mountain blindfolded: the loss function is the altitude, the gradient is the slope under your feet, and the optimizer is the decision policy in your head that determines which way to go and how far to step. It typically answers three questions:
- How to control step size (learning rate scheduling): too large a step can overshoot the valley and cause oscillation, too small a step makes training slow. Advanced optimizers adapt the stride to the terrain — speeding up on flat regions and slowing down near the minimum.
- How to avoid dead ends (escaping local minima and saddle points): a mountain has plenty of small pits halfway up, and relying only on the local slope makes it easy to get stuck. The essence of momentum is to give the “descender” inertia so it can carry through shallow pits.
- How to correct direction (second-order information and geometric structure): in high-dimensional spaces the loss surface is often a long, curved canyon with vastly different curvature along different directions, and using only first-order gradients makes you bounce back and forth between the canyon walls.
3. From Cauchy to Polyak: The Birth of Momentum
Standard gradient descent traces back to Cauchy’s work in 1847. It models a massless particle: one that can start at maximum speed at any moment and stop instantly — physically unnatural, and inefficient for optimization.
In 1964, the Soviet mathematician Boris Polyak offered the key insight: in a long, narrow canyon, plain gradient descent bounces back and forth because of the steep gradients on both walls. He proposed forcibly giving the particle mass and inertia, the well-known Heavy Ball method. Its update rule can be abstracted as:
v_t = β · v_{t-1} - η · ∇L(θ_{t-1})θ_t = θ_{t-1} + v_t
Here β is the momentum coefficient (for example 0.9) and v is the velocity. Intuitively, historical gradient directions are accumulated: they reinforce each other when aligned and cancel out when oscillating — the mathematical expression of inertia. Nesterov momentum later improved on this by computing the gradient at a “look-ahead” position, tightening the convergence bound.
4. Adaptive Methods: A Step Size Per Parameter
Momentum solves directional inertia, but all parameters still share one global learning rate. For deep networks with enormous parameter counts and vastly different gradient magnitudes across layers, that is clearly suboptimal. Adaptive optimizers, represented by Adam, introduce exponential moving averages of the first and second moments of the gradient:
m_t = β1·m_{t-1} + (1-β1)·g_tv_t = β2·v_{t-1} + (1-β2)·g_t²m̂_t, v̂_t = bias correctionθ_t = θ_{t-1} - η · m̂_t / (√v̂_t + ε)
The effect: parameters whose gradients have been consistently small get a larger effective step, while parameters with violent gradients are automatically suppressed. For architectures like the Transformer, adaptive methods markedly improved early-training stability, which is why they remained the mainstream choice for a long time. Later refinements include decoupled weight decay (AdamW), corrections to the second-moment estimate (such as the AdaBelief line of thinking), and learnable or layer-wise scheduled learning rate strategies.
5. Matrix Orthogonalization: A New Direction for Transformers
In the past couple of years, optimizer research for large model training has produced an important direction: applying orthogonalization or spectral-norm constraints to gradient matrices. The motivation comes from an observation — in a Transformer, the parameters of each module can be viewed as matrices, and if updates concentrate too heavily along certain singular directions, the distribution of hidden states becomes unbalanced and training becomes unstable.
One representative approach approximately orthogonalizes the reshaped 2D gradient matrix after momentum aggregation (commonly implemented with Newton-Schulz iterations to avoid the cost of an explicit SVD), so that the energy of the update is more evenly spread across row and column space. The pseudocode looks like this:
# Conceptual illustration, not any specific implementationfor p in model.parameters():g = p.grad.view(out_dim, -1)m = beta * state[p] + (1 - beta) * gu = newton_schulz_orthogonalize(m) # approximate orthogonalizationp.data -= lr * u.view_as(p)
This family of methods is not mutually exclusive with Adam-style updates. A common practical combination is to use orthogonalized updates for some parameters (such as hidden-layer weight matrices) while keeping AdamW-style adaptive updates for embeddings, normalization layers, and scalar parameters, together with careful weight decay and gradient clipping. When public reports mention such new optimizers, the benefits they usually emphasize are: lower loss at the same number of training steps, reduced sensitivity to learning rate and weight decay, and more stable training.
6. Engineering Practice
If you want to evaluate or adopt a new optimizer in your own training pipeline, work through the following checklist:
- Small-scale controlled experiments: with fixed data, a fixed model, and a fixed number of training steps, compare the new optimizer against an AdamW baseline in terms of loss curves, gradient norm curves, and downstream metrics.
- Hyperparameter sensitivity sweeps: focus on learning rate, momentum coefficient, and weight decay, and watch whether the “trainable range” widens — that is often where the real value of a new optimizer lies.
- Stability monitoring: log gradient norms, update norms, parameter norms, and the number of loss spikes; ideally the update-to-parameter norm ratio stays in a moderate range.
- Hybrid strategies: not every parameter type suits the same update rule; embeddings and scalar parameters generally keep the traditional adaptive methods.
- Numerical precision and memory: extra momentum state and orthogonalization iterations increase memory and compute cost, so assess whether the throughput loss is acceptable.
- Gradual adoption: validate on small and medium models first, then scale to large training runs, avoiding the irreversible risk of a full switch.
7. Conclusion
The history of optimizer evolution is a path from a “massless particle” to a “descender with inertia, adaptivity, and geometric awareness”: Cauchy supplied the direction, Polyak supplied the inertia, adaptive methods supplied personalized step sizes, and matrix orthogonalization has begun to exploit the geometric structure of parameters. Next-generation large models choose to innovate on the optimizer precisely because, with data and compute converging, improvements at the level of training dynamics are among the few remaining levers that still deliver systematic gains. For developers, understanding these principles not only helps in reading technical reports but also guides tuning and stability governance in everyday training work.
