Optimizer Evolution Behind Large Model API Upgrades
This article explains how optimizer technology shapes large model training, using a blindfolded descent analogy to cover three core responsibilities: learning rate control, escaping local minima, and per-parameter adaptation. It traces the progression from SGD to the Heavy Ball Method and adaptive methods, discusses matrix-based approaches, and offers practical guidance on selection and tuning.
1. From API Capability Upgrades to the “Invisible Infrastructure” on the Training Side
Whenever the industry sees a capability upgrade at the large model API level, the discussion usually focuses on call patterns, parameter shapes, context length, and inference-side engineering. But the API is only the tip of the iceberg. What actually determines a model’s capability ceiling is the training system beneath the surface, and the optimizer is the most overlooked yet most far-reaching part of that system.
You can think of training as a blindfolded descent: you are placed in a rolling mountain range with a single goal of reaching the deepest valley. You have only two tools:
- Loss: an altimeter that tells you how “high” or “low” your current position is.
- Gradient (computed via backpropagation): a way to probe the slope around you with your feet, telling you which side goes downhill.
The optimizer is the walking strategy in your head: it decides which direction to step next and how large that step should be. With a crude strategy, even with ample compute and clean data, you can get oscillation without convergence, long stagnation, or falling into shallow pits. So every leap in API capability is usually accompanied by parallel progress in training-side strategy and engineering.
2. Three Core Responsibilities of an Optimizer
2.1 Step Size Control: Dynamic Adjustment of the Learning Rate
The first responsibility is deciding the update magnitude, i.e., learning rate control. Too large a step can carry you straight over the valley and up the opposite slope, showing up as loss that oscillates back and forth or even diverges. Too small a step converges extremely slowly, wasting compute on ineffective movement. A good optimizer needs adaptive step sizes: faster in flat regions, slower in steep regions near the valley floor.
A common engineering practice is combining warmup and decay:
# Illustrative code: warmup + cosine decay learning rate scheduledef lr_at(step, base_lr, warmup_steps, total_steps):if step < warmup_steps:return base_lr * step / max(1, warmup_steps)progress = (step - warmup_steps) / max(1, total_steps - warmup_steps)return base_lr * 0.5 * (1 + math.cos(math.pi * progress))
Note that the learning rate schedule and the optimizer are complementary: the scheduler provides a global rhythm along the time dimension, while the optimizer handles local-scale adaptation in parameter space.
2.2 Escaping Local Optima: From a “Massless Particle” to an Inertial System
The second responsibility is avoiding dead ends, i.e., escaping local optima and saddle points. The mountain range contains many small pits halfway up, and descending only by the current slope makes it easy to fall into one and mistake it for the valley floor.
The early mainstream approach was stochastic gradient descent (SGD), whose idea traces back to Cauchy’s pioneering work on optimization in the mid-nineteenth century. But standard gradient descent implies a counterintuitive assumption: the particle has no mass, so it can start at top speed at any moment and brake instantly. In long, narrow canyon-like terrain, this makes the update direction bounce back and forth between the two walls, while the component that actually advances along the valley floor is small.
The one who broke this assumption was Soviet mathematician Boris Polyak. In 1964, while studying optimization theory, he proposed that if you give the particle “mass” and “inertia,” letting the current displacement partly inherit the previous direction, oscillation is suppressed and the effective forward component is amplified. This is the Heavy Ball Method, whose general form is:
$
vt = \mu v{t-1} + gt,\qquad \theta_t = \theta{t-1} - \eta v_t
$
where $\mu$ is the momentum coefficient and $g_t$ is the current gradient. The widely used momentum method is essentially an engineering continuation of this idea: the history of gradients is exponentially averaged, which is equivalent to introducing “inertia” into parameter updates.
2.3 Parameter Adaptation: Scaling the Step per Coordinate
The third responsibility is giving each parameter its own effective learning rate. Parameter scales in real models vary enormously: some directions have extremely high curvature, others are nearly flat. A uniform step size inevitably makes “some parameters run too fast while others barely move.”
The general approach of adaptive methods is to maintain second-order gradient statistics (such as a moving average of squared gradients) and scale each coordinate accordingly:
$
\thetat = \theta{t-1} - \eta \cdot \frac{\hat{m}_t}{\sqrt{\hat{v}_t} + \epsilon}
$
$\hat m_t$ is the bias-corrected first moment, $\hat v_t$ is the bias-corrected second moment, and $\epsilon$ is for numerical stability. These methods have clear advantages in sparse-gradient, high-noise scenarios, but bring two side effects: higher memory usage (extra statistics must be stored), and on some tasks, worse generalization than momentum SGD. So the hybrid form of “first-order momentum + second-order adaptation” has long been the mainstream compromise.
3. The Matrix View: Why Optimizers Started Caring About “Shape”
An important recent research direction is to treat parameters as matrices rather than flattening them into a one-dimensional vector. The reason is that weights in neural networks are naturally two-dimensional tensors, and if the update matrix is severely imbalanced across directions, it degrades the layer’s condition number and reduces training efficiency. This has led to ideas that orthogonalize the update matrix or constrain its spectral norm, making update magnitudes more balanced across singular directions.
Such methods usually bring more stable early training, but at the cost of extra matrix decomposition or iterative approximation, with higher engineering complexity and overhead. The current industry consensus is that this is a promising direction but cannot yet unconditionally replace mature adaptive methods; actual selection still depends on the task, model scale, and compute budget.
4. Practical Selection and Tuning Advice
- Ensure a reproducible baseline first: fix data order, random seeds, and mixed precision strategy before comparing optimizers, otherwise conclusions are unreliable.
- Choose by scenario: for dense tasks with stable gradients, try momentum-based methods first; for sparse features and high noise, prefer adaptive methods.
- Prioritize numerical stability: $\epsilon$, bias correction, and gradient clipping must be tuned together; when loss spikes appear, check these three first.
- Watch memory and throughput: extra statistics bring considerable overhead; large-scale training needs to evaluate general engineering measures such as sharding or low-rank approximation.
- Monitor metrics, not just loss: observing gradient norm, update norm, and per-layer activation distributions together helps detect “false convergence” earlier.
5. Conclusion
The evolution of API form is only the result; the continuous iteration of training-side foundational components like optimizers is the underlying driver of capability growth. Understanding the progression from vanilla gradient descent to the Heavy Ball Method, and then to adaptive and matrix-based methods, lets engineers make grounded judgments when facing non-convergence, oscillation, or stagnation, rather than blind trial and error. With the general training and monitoring capabilities of platforms like Baidu AI Cloud (such as log services, monitoring alerts, and container platforms), this methodology is easier to consolidate into reusable engineering standards.
