Optimizer Evolution: From Gradient Descent to Matrix-Structured Optimization
This article traces the evolution of optimizers for training large neural networks—from basic gradient descent and momentum methods to adaptive moment estimation (Adam) and emerging matrix-structured approaches. It explains the core challenges optimizers address (learning rate control, saddle points, noise, and direction correction) and how each generation of methods solves specific problems while introducing new trade-offs.
Why Optimizers Deserve Serious Attention
When training a neural network, the loss function provides the “elevation” at each point, backpropagation gives the slope of the surrounding surface, and the optimizer decides where to move next and how far. It is the decision-making module of the entire training process.
As model sizes grew from millions to hundreds of billions of parameters, the impact of the optimizer became significantly more pronounced in three ways:
- Convergence: An improperly set learning rate can cause loss to oscillate or diverge.
- Efficiency: Slow convergence means more compute and longer training cycles.
- Final quality: If parameters settle into a poor region, model quality suffers.
In recent years, public training reports from multiple teams have shown that optimizer changes can yield substantial gains, prompting renewed interest in optimizer design. This article traces this evolution along a timeline, explaining what problem each step solves and what cost it introduces.
Three Core Problems Optimizers Address
1. Step-Size Control: Learning Rate
Consider descending a hill. A step too large may overshoot the valley and climb the opposite slope, causing error oscillation; a step too small makes descent painfully slow.
In practice, three techniques are commonly used:
- Learning-rate warmup: Start with a small learning rate in early training to avoid violent oscillation from initial gradient noise.
- Learning-rate decay: Gradually reduce the step size using a cosine or linear schedule, allowing finer adjustments in later stages.
- Per-parameter adaptive scaling: Assign a different effective step size to each parameter based on its historical gradient statistics.
2. Saddle Points and Mini-Batch Noise
High-dimensional parameter spaces contain many saddle points and many flat, shallow basins. The most basic stochastic gradient descent (SGD) traces back to Cauchy’s steepest descent method from the 19th century. It relies only on the current gradient and advances slowly once it enters a flat region.
Mini-batch sampling introduces gradient noise. Sometimes that noise helps parameters escape shallow basins—one reason SGD still works well in large-scale training.
3. Direction Correction: Using Historical Information
Looking only at the current gradient makes the update vulnerable to noise from a single batch. How to use historical gradients to produce a more robust update direction is a central problem in modern optimizers, and it leads directly to the momentum mechanism.
Momentum Method: Adding Inertia to Parameters
Standard gradient descent behaves like a massless particle sliding on a surface. It can instantly accelerate from rest to maximum speed and instantly stop—a physical intuition mismatch.
On a narrow, elongated “canyon” loss surface, curvature differs greatly across directions. Naive gradient descent bounces back and forth between canyon walls: the component perpendicular to the valley floor oscillates, while progress along the valley is slow.
In 1964, Soviet mathematician Boris Polyak proposed the heavy-ball method—the momentum method. It adds historical velocity to the update, giving parameters inertia:
v = beta * v + lr * gradienttheta = theta - v
Inertia has two effects:
- In oscillating directions, updates with opposite signs cancel out, reducing back-and-forth collisions.
- In consistent directions, historical velocity accumulates, creating acceleration.
Later, Nesterov introduced “look-ahead” momentum. It first takes a small step along the inertial direction, then computes the gradient at that predicted position. This allows the optimizer to sense curvature changes early, reducing overshoot and improving convergence properties.
Adaptive Moment Estimation: Custom Step Sizes per Parameter
Momentum solves the direction problem but not the need for different step sizes across parameters. In large models, the gradient scales of embedding layers, attention matrices, and feed-forward layers can differ greatly, and a single learning rate struggles to accommodate all of them.
Adaptive Moment Estimation (Adam) maintains both the first moment (mean) and the second moment (uncentered variance) of gradients:
m = beta1 * m + (1 - beta1) * g # first moment: direction information, also acts as momentumv = beta2 * v + (1 - beta2) * g ** 2 # second moment: gradient scale for each parameterm_hat = m / (1 - beta1 ** t) # bias correctionv_hat = v / (1 - beta2 ** t)theta -= lr * m_hat / (sqrt(v_hat) + eps)
The second moment can be understood as an estimate of each parameter’s local terrain roughness. Parameters with consistently large gradients get smaller effective steps; parameters with consistently small gradients get larger ones. As a result, training becomes significantly less sensitive to the global learning rate, and Adam and its variants have been the mainstream choice for large-model training over the past decade.
Adam also has costs. Each parameter requires two additional state variables, and mixed-precision training still needs a high-precision master weight copy. For a 7-billion-parameter model, two fp32 state variables occupy about 56GB of GPU memory, not counting weights and gradients themselves. Additionally, the denominator normalization can suppress the natural growth of weight magnitudes in later training stages, which can affect the final quality for certain architectures.
Matrix-Structured Optimization: From Vector View to Matrix View
A newer line of thinking has emerged: instead of treating parameters as a long list of independent scalars, respect their matrix structure.
The observation is straightforward. Most weights in neural networks participate in computations as matrices—linear transformations and attention projections, for example. Traditional optimizers flatten matrices into vectors and process them element-wise, ignoring the relationships between rows and columns.
Representative methods include Shampoo and Muon, and their common practices are:
- Orthogonalization of the momentum matrix, often approximated with a Newton–Schulz iteration, to balance the update strength across different singular directions and prevent a few directions from dominating.
- Norm constraint on the update, ensuring the step size for the whole matrix remains controlled—a global constraint on the update rather than element-wise clipping.
- Hybrid use with adaptive methods: matrix parameters use structured updates, while embedding layers and normalization parameters retain element-wise adaptive methods.
From a geometric perspective, orthogonalization makes the parameter explore each principal direction with comparable intensity, alleviating oscillation caused by ill-conditioned curvature. This is in the same spirit as the earlier “canyon collision” solution—but instead of adding inertia to the update, it reshapes the update itself.
Some publicly reported language model pretraining experiments have evaluated these methods under comparable compute budgets, showing continued interest in this direction.
