Optimizer Evolution Behind Large Model API Upgrades
This article traces the evolution of optimizers in deep learning, from plain SGD and Polyak's heavy ball method to adaptive moment estimation and matrix-based orthogonalized approaches. It explains what an optimizer does through the loss-and-gradient navigation analogy, covers step size control, escaping local minima and saddle points, and update stability, then offers practical guidance on baselines, state memory overhead, learning rate schedules, monitoring metrics, and reproducibility.
Introduction: Behind API Capabilities Is the Continuous Evolution of Training
Whenever a new generation of large models exposes its capabilities through a new API surface, outside observers tend to focus on parameter counts, context length, or how the model is called. From an engineering perspective, however, the stability, response characteristics, and generation quality visible on the API side are ultimately determined by the optimization process during training. This article discusses no specific product. Instead, it shifts attention back to the training layer and centers on a long-undervalued component: the optimizer. It explains how optimizers affect convergence efficiency and final model quality, and outlines their technical evolution.
1. What an Optimizer Is: The Navigation System of Deep Learning
A classic analogy helps make the training process concrete. Imagine you are blindfolded and placed in a rolling mountain range, with the goal of reaching the lowest valley floor. You have only two kinds of information:
- Loss: tells you the altitude you are currently at.
- Gradient (computed via backpropagation): equivalent to probing the slope around you with your feet, indicating which direction leads downhill.
The optimizer is the “walking strategy” in your head. It decides which direction to step next and how large that step should be. It typically has to solve three problems at once.
1.1 Step Size Control (Learning Rate)
Too large a step can carry you straight across the valley floor and up the opposite slope, showing up as oscillating loss and failure to converge. Too small a step stretches the training cycle indefinitely and drives compute costs sharply upward. The ideal strategy is adaptive: move faster in flat regions and slow down on steep terrain or near the valley floor.
1.2 Escaping Local Minima and Saddle Points
The range is dotted with small pits halfway up the slopes, corresponding to local minima on the loss surface. In high-dimensional spaces, saddle points are even more common: downhill in some directions, uphill in others. A greedy strategy of simply “go wherever it is lower” is easily trapped and can mistake a local point for the global minimum. Optimizers need additional mechanisms (momentum, randomness, direction accumulation) to help parameters escape these regions.
1.3 Stability and Efficiency of Parameter Updates
In real training, gradients come from mini-batch sampling and carry inherent noise, while gradient scales across different parameter dimensions can differ by several orders of magnitude. The optimizer must normalize and smooth the update so that parameters in every layer advance at a comparable “effective speed,” preventing individual dimensions from dominating the training process.
2. Evolution: From a Massless Particle to the Heavy Ball Method
The plainest form of stochastic gradient descent (SGD) traces back to early nineteenth-century research on optimization problems. Its physical picture is a massless particle sliding on a surface: it can reach maximum speed instantly and stop instantly, which clearly defies intuition.
The Soviet mathematician Boris Polyak broke with that setup. In 1964, while studying optimization theory, he observed that on narrow canyon-like terrain, standard gradient descent repeatedly slams into both walls and makes very slow effective progress along the valley floor. His heavy ball method effectively gives the particle mass and inertia. The update idea can be abstracted as:
v_t = μ * v_{t-1} - lr * g_tθ_t = θ_{t-1} + v_t
where μ is the momentum coefficient and g_t is the gradient of the current batch. The intuitive effect is that side-to-side oscillations cancel out across successive updates, while the continuous downhill progress along the valley floor keeps accumulating, so the particle “goes faster the more it collides,” markedly improving convergence on canyon-shaped surfaces. The key significance of this step is that the optimizer acquired “memory” for the first time.
3. The Adaptive Era: Giving Each Parameter Its Own Step Size
The heavy ball method solved direction accumulation, but all parameters still shared a single learning rate. Later adaptive methods introduced second-order statistics (a moving sum of squared gradients) and scale the step size separately for each dimension. The general form is:
m_t = β1 * m_{t-1} + (1 - β1) * g_t # first moment, directionv_t = β2 * v_{t-1} + (1 - β2) * g_t^2 # second moment, scaleθ_t = θ_t - lr * m_t / (sqrt(v_t) + eps) # per-dimension normalized update
The value of this family of methods (commonly grouped as adaptive moment estimation optimizers) lies in the following:
- They are more robust for sparse parameters or parameters whose gradient scales differ widely.
- Their default hyperparameters perform reliably across a large number of tasks, lowering the barrier to tuning.
- They work well alongside scheduling strategies such as learning rate warmup and cosine decay.
Engineering practice also requires attention to their cost: an extra first- and second-order state must be stored for every parameter, so memory overhead is several times the parameter count. On some tasks, their generalization may fall short of SGD tuned with momentum and weight decay. There is therefore no universal answer to “which optimizer is better”; small-scale controlled experiments are needed, factoring in dataset size, model architecture, and compute budget.
4. Matrix-Based Optimizers: Treating the Update as a Whole Transformation
A class of matrix-based (orthogonalized) optimizer ideas has drawn considerable attention in recent training practice. Its fundamental difference from traditional per-dimension methods is that it no longer treats each parameter as an independent scalar. Instead, it views the weight matrix as a whole, orthogonalizes the momentum matrix first (for example, via an iterative approximate solve), and then uses it for the update.
The motivation can be understood from two angles:
- Per-dimension normalization only equalizes the scale of each coordinate; it cannot constrain the overall “direction distribution” of the parameter matrix. Orthogonalization balances the energy of the update across singular directions and prevents a few dominant directions from being over-amplified.
- Matrix multiplication is the primary compute bottleneck in large models, so converting part of the optimizer’s work into matrix operations helps it cooperate with parallelism strategies and hardware accelerators.
It should be emphasized that such methods typically require precise learning rate scaling rules and decoupled weight decay handling. Hyperparameter sensitivity and compatibility with mixed-precision training are all aspects that must be validated before deployment. The industry is still evaluating the boundary of their benefits across different scales and tasks, and it would be premature to claim a wholesale replacement.
5. Practical Advice for Developers
- Establish a baseline first: get a small-scale baseline running with SGD plus momentum and weight decay, or a mature adaptive method, then assess the marginal benefit of a new optimizer.
- Watch state overhead: optimizer states significantly increase memory usage and must be budgeted together with batch size and parallel sharding strategy.
- Prioritize the learning rate schedule: warmup plus decay often delivers more reliable gains than swapping the optimizer.
- Monitor a full set of metrics: beyond the loss curve, track gradient norms, update norms, and per-layer weight distributions to detect oscillation or stagnation.
- Ensure reproducibility: fix random seeds and record data ordering and mixed-precision settings, so random fluctuation is not mistaken for optimizer quality.
Conclusion
From plain gradient descent to the heavy ball method, then to per-dimension adaptive methods and matrix-based approaches, the main thread of optimizer evolution has stayed clear: introduce memory into parameter updates, introduce scale awareness, and introduce whole-structure constraints. When outsiders discuss the parameters and capabilities of a new generation of model APIs, what actually determines whether those capabilities can be trained stably are these seemingly simple mathematical tools. Understanding them is what makes it possible to make rational technical choices under a limited compute budget.
