Training Optimizer Evolution: What Model API Documentation Can and Cannot Reveal
Model API documentation explains how to use a service, but it rarely establishes how the underlying model was trained. This article traces optimizer development from gradient descent and momentum to adaptive scaling and matrix-level updates, explaining their mechanisms, engineering constraints, and the controlled experiments needed to verify real training benefits.
1. What API Documentation Can—and Cannot—Tell Us
When new documentation for a large language model API appears, developers typically ask two questions: Is the model easier or more effective to use, and what produced those improvements?
The first question concerns invocation methods, input and output constraints, response behavior, error handling, and service reliability. API documentation and practical testing can help answer it.
The second concerns training data, model architecture, optimization algorithms, and compute allocation. API documentation alone generally cannot provide a complete answer.
Any analysis of technical improvements should therefore distinguish three layers:
- API layer: The interaction contract between callers and the service.
- Model layer: Output quality and behavior on specific tasks.
- Training layer: How data and algorithms update model parameters.
Training optimizers belong to the third layer. Even if API documentation demonstrates better task performance, that does not establish that training used a particular new optimizer. Connecting the two requires training disclosures, controlled experiments, or other reliable evidence.
Nevertheless, optimizers are an important starting point for understanding large-model training. They do not directly handle application requests, but they can affect training efficiency, convergence trajectories, and final model quality.
2. What Does an Optimizer Do?
Model training repeatedly adjusts parameters to reduce loss on training data.
Let the model parameters be θ and the loss function be L(θ). The gradient at step t is:
gₜ = ∇L(θₜ)
The simplest parameter update is:
θₜ₊₁ = θₜ − ηₜgₜ
Here, ηₜ is the learning rate, which controls the scale of the update.
A useful analogy treats the loss function as a landscape. The loss describes the height at the current position, the gradient points in the direction of the steepest local ascent, and the optimizer determines how to move using that information.
Real training differs from this analogy in two important ways.
First, parameter spaces are usually high-dimensional, not easily visualized two-dimensional slopes. Second, training commonly estimates gradients from mini-batches. These estimates provide noisy local information rather than an exact direction computed over the entire training set.
An optimizer therefore has three main responsibilities:
- Combine current gradients with historical information to determine an update direction.
- Adjust update scales for different parameters or parameter groups.
- Balance computational cost, numerical stability, and convergence speed.
Learning-rate scheduling is related to optimization, but it is not the same thing. Warmup and decay schedules can be configured separately. Adaptive optimizers additionally use internal statistics to modify the effective update scale of individual coordinates.
3. Why Basic Gradient Descent Struggles
In locally flat regions, small gradients can make progress slow. In directions with high curvature, even a moderately large learning rate can cause substantial oscillation.
A narrow valley illustrates the problem. The direction along the valley is relatively flat, while the direction across it is steep. A single learning rate must accommodate both scales.
If the learning rate is too large, parameters oscillate between the valley’s sides. If it is too small, oscillation decreases, but progress along the valley also slows.
These difficulties should not be reduced to “the model gets stuck in a local optimum.” In high-dimensional, nonconvex optimization, saddle points, flat regions, gradient noise, and uneven curvature also matter.
Mini-batch randomness can sometimes help training leave stalled regions. It does not, however, guarantee that stochastic updates will find a global optimum. For large-model training, the more practical goal is to achieve stable, reproducible results with good generalization within a finite budget.
4. Momentum: Giving Update Directions Continuity
Basic gradient descent uses only the current gradient. Momentum retains information from previous directions, so each update does not have to start from scratch.
One common formulation is:
mₜ = βmₜ₋₁ + (1 − β)gₜθₜ₊₁ = θₜ − ηₜmₜ
Here, mₜ is an exponential moving average of gradients, and β controls how much historical information is retained.
Momentum has two useful effects.
When successive batches produce gradients pointing in similar directions, their contributions accumulate into a more consistent direction of progress. When gradients repeatedly change sign along a particular direction, historical averaging reduces some of the back-and-forth oscillation.
This is the mathematical basis of the “inertia” analogy: updates no longer follow every instantaneous change in the current batch.
Inertia also has costs. Retaining too much history can make updates slow to respond to new directions or carry parameters past a favorable region. Momentum does not guarantee escape from local optima, nor does it replace learning-rate adjustment, gradient checks, or training monitoring.
5. Adaptive Moment Estimation: Scaling Individual Coordinates
Momentum alone does not address every difference in parameter scale. Some parameters consistently have large gradients, while others have small gradients. A uniform update scale may not suit both.
Adaptive moment estimation typically maintains two sets of statistics:
mₜ = β₁mₜ₋₁ + (1 − β₁)gₜvₜ = β₂vₜ₋₁ + (1 − β₂)gₜ²
The square is applied elementwise. The first statistic tracks the historical direction of gradients; the second tracks their historical squared magnitude.
Because both states are usually initialized to zero, their early estimates are biased. Bias correction is therefore commonly applied:
m̂ₜ = mₜ / (1 − β₁ᵗ)v̂ₜ = vₜ / (1 − β₂ᵗ)
Parameters are then updated as follows:
θₜ₊₁ = θₜ − ηₜ · m̂ₜ / (√v̂ₜ + ε)
The term ε prevents an excessively small denominator and improves numerical stability.
The key idea is not that the optimizer “automatically knows the best learning rate.” Instead, it uses historical gradient scales to redistribute effective step sizes across parameter coordinates. A suitable base learning rate and schedule are still necessary.
Why Weight Decay Needs Separate Treatment
Weight decay constrains parameter magnitude. With adaptive updates, adding a parameter penalty directly to the gradient is not always equivalent to applying parameter decay independently.
A decoupled formulation can be written as:
θₜ₊₁ = (1 − ηₜλ)θₜ − ηₜuₜ
Here, uₜ is the update direction computed by the optimizer, and λ is the decay coefficient.
Training configurations must explicitly define whether decay applies to biases, normalization parameters, and other special parameter groups. These choices affect results and the fairness of comparisons between optimizers.
6. Matrix-Orthogonalized Updates: From Elementwise Scaling to Directional Structure
Elementwise processing is not the only option for two-dimensional weights in large models.
A weight matrix typically connects two feature spaces. Its gradient contains not only individual element magnitudes, but also relationships between input and output directions.
The basic idea of matrix-orthogonalized optimization is to first construct a momentum-based matrix update, then transform the matrix as a whole to reduce the extent to which a few strong directions dominate it.
Let M be the momentum matrix, with singular value decomposition:
M = UΣVᵀ
The matrix Σ describes the strength of each singular direction. An idealized orthogonalizing transformation is:
Q = UVᵀ
Compared with M, Q no longer preserves the original magnitude differences among nonzero singular values. Instead, it emphasizes the overall directional structure.
For rectangular matrices, “orthogonalization” generally refers to a semi-orthogonal property in the appropriate subspace. It does not mean that all rows and all columns can simultaneously be orthogonal. For rank-deficient matrices, the treatment of zero-singular-value directions must also be specified; the simplified formula alone does not determine the implementation.
Why This Approach Matters
Elementwise adaptive updates primarily use the historical scale of each coordinate. Matrix orthogonalization instead treats a two-dimensional parameter as a structured whole, changing update geometry through its singular directions.
If a few high-magnitude directions consistently dominate updates, this transformation may allow other directions to receive more substantial updates. It therefore offers an optimization approach distinct from coordinatewise scaling.
However, a potentially better update structure does not guarantee better model performance. Orthogonalization also changes magnitude information in the original gradient. Whether that helps depends on architecture, training stage, data distribution, and hyperparameters.
It is not a second-order method that directly computes loss curvature, and it should not be presented as a complete solution to uneven curvature.
Why Implementations Often Use Approximations
Repeatedly computing exact singular value decompositions for every matrix can be expensive at training scale. Implementations may therefore use iterative matrix operations to approximate the target transformation.
These implementations must consider:
- How to scale matrices before iteration to meet numerical requirements.
- How iteration count affects approximation accuracy and execution time.
- How matrix shape affects multiplication cost.
- Whether low-precision arithmetic accumulates errors.
- Whether distributed sharding preserves access to the required matrix structure.
A new optimizer’s value depends not just on its update formula, but also on whether that formula can run efficiently and reliably on the intended hardware and training system.
7. Why Different Parameters May Need Different Update Strategies
Not every model parameter is a two-dimensional matrix. Biases and normalization scale parameters are usually one-dimensional, while other parameters may have specialized statistical or semantic structure.
Matrix-orthogonalized updates should not be applied indiscriminately. A more appropriate practice is to define clear parameter-grouping rules:
- Evaluate matrix-level updates for two-dimensional weights whose structure suits the method.
- Use other update strategies for one-dimensional parameters or parameters unsuitable for the transformation.
- Ensure shared parameters receive only one logical update.
- Check learning-rate and weight-decay settings separately for special parameter groups.
Parameter grouping must be auditable. Rules based only on name matching can omit or misclassify parameters after architectural changes. Before training starts, verify every trainable parameter’s group assignment, state initialization, and update path.
This also highlights a broader point: successful adoption of a new optimizer often means using suitable methods for suitable parameter types, rather than replacing the old algorithm everywhere.
8. How to Verify That an Optimizer Delivers Real Benefits
A common mistake in optimizer experiments is to compare only training loss or training steps.
A method that reduces training loss in fewer steps may still be less efficient if each step takes substantially longer. Conversely, a method with shorter steps may require more total computation to reach the same quality.
At least two kinds of comparison are useful:
- Equal training budget: Compare final validation results with similar training data, compute budgets, and other key conditions.
- Equal quality target: Compare the time, computation, and GPU memory required to reach the same validation target.
Metrics should cover four dimensions:
- Optimization performance: Training loss, validation loss, and convergence speed.
- System cost: Step time, throughput, GPU memory, communication, and optimizer-state storage.
- Stability: Gradient anomalies, loss spikes, non-finite values, and recovery after interruption.
- Task quality: Accuracy on target tasks, output consistency, and generalization.
Experiments should keep data order, batch size, initialization, precision policies, and scheduling conditions consistent wherever possible.
Methods can differ in hyperparameter sensitivity, so tuning budgets must be reasonable and transparent. Fully tuning one method while leaving another poorly configured does not provide a fair comparison.
These controls distinguish an interesting algorithmic mechanism from a demonstrated training benefit.
9. Engineering Safeguards for Optimizer Integration
An optimizer is not an isolated function. It is a stateful component of the training system.
1. Define the Gradient-Clipping Order
Gradient clipping can limit anomalous gradients, but clipping raw gradients is not equivalent to clipping the final update. The processing order can significantly affect results, especially when a matrix transformation redistributes directional magnitudes.
Record where clipping occurs. Keep that order consistent across controlled experiments, or explicitly explain any differences.
2. Mixed Precision Does Not Mean Low Precision Everywhere
Weights, gradients, momentum, and intermediate values in matrix iterations may require different precisions. Memory savings should not come at the expense of numerical stability.
Use small-scale experiments to inspect state ranges, anomalies, and accumulated errors before deciding which components can use lower precision.
3. Distributed Sharding Changes Matrix Transformations
Elementwise updates are generally straightforward to perform on shards. Whole-matrix transformations may require more complete matrix information.
Orthogonalizing each shard independently is generally not equivalent to orthogonalizing the full matrix. Parameter partitioning, communication strategies, and update definitions must therefore be designed together. A single-device implementation cannot simply be transferred unchanged to distributed training.
4. Checkpoints Must Include Optimizer State
Saving only model weights generally cannot reproduce the training trajectory after a restart. Momentum, second-moment statistics, step counts, scheduler state, and random state can all affect subsequent updates.
Before adopting a new optimizer, run a short interruption-and-resume test to verify that the necessary state can be saved and restored completely.
10. Returning to API Documentation: How to Assess Technical Claims
Changes to training optimizers have practical value only when they translate into verifiable model quality or training efficiency.
For API users, the priority is whether documentation clearly specifies input constraints, output structures, streaming behavior, error types, version changes, and compatibility boundaries. Capabilities should be established through published information and testing—not inferred from the name of a training algorithm.
For training teams, the priorities are different: Does the new update method produce better quality under the same budget? Does it add implementation or operational complexity? Do its benefits persist across tasks and model scales?
From basic gradient descent to momentum, elementwise adaptive scaling, and matrix-level directional transformations, optimizer development shares a common goal: using gradient information more effectively.
The meaningful technical advance is not the algorithm’s name. It is whether the update mechanism is sound, engineering costs are manageable, experimental evidence is reliable, and the delivered model capabilities stand up to verification.
