Optimizer Breakthroughs Behind LLM API Upgrades: From SGD to Matrix-Based Methods

    This article explains how optimizers have evolved in modern large model training and why matrix-based optimizers have become a research focus. Using an intuitive blindfolded-descent analogy, it walks through the progression from vanilla gradient descent to momentum, per-parameter adaptive learning rates, and matrix (second-order structure) optimizers, with code sketches for each stage. It also covers how to assess the technical substance behind an API upgrade, plus a practical checklist for optimizer selection, learning rate tuning, numerical stability, reproducibility, and cost control.

    Introduction: When an API Updates, Read the Training Side

    Whenever a class of LLM API capabilities gets a version update, community discussion tends to focus on parameter lists, invocation methods, and pricing. But if you want to judge how substantial an upgrade really is, what deserves attention is how the model was trained: data mixtures, parallelism strategies, numerical precision, and the most easily overlooked factor that determines convergence efficiency — the optimizer.

    This article is not about any specific product. Instead, it abstracts the topic into a general technical question: how have optimizers evolved in modern large model training, why have matrix-based optimizers become a research hotspot in recent years, and how should you, as a user and developer, understand these changes and apply them in your own engineering practice.

    1. The Intuitive Model: Training as Descending a Mountain Blindfolded

    The best way to understand optimizers is to build a physical intuition.

    Imagine you are blindfolded and placed in a rolling mountain range, with the goal of reaching the lowest valley floor. You have only two tools:

    • Loss value: tells you the altitude of your current position;
    • Gradient: you probe the slope of the ground with your feet, telling you which way is downhill.

    The optimizer is your internal “walking strategy”: it decides which direction to step and how large that step should be. It usually answers two questions.

    1. Step size: how the learning rate controls it

    A step that is too large may carry you across the valley floor and up the opposite slope, showing up as loss oscillation and non-convergence; a step that is too small converges extremely slowly and wastes a great deal of compute. The ideal strategy is adaptive: speed up on gentle terrain, slow down near a steep valley floor.

    2. Direction: how to escape local optima

    The range is dotted with small pits halfway up the slopes, corresponding to local minima on the loss surface. Following only “go wherever is lower” easily traps you in a small pit, mistaken for the valley floor. In high-dimensional spaces, the more common trouble is not local minima but saddle points and ill-conditioned curvature: some directions have extremely high curvature while others are nearly flat, causing the gradient to repeatedly hit walls in a long, narrow canyon.

    2. The Evolution: From a “Massless Particle” to Inertia and Adaptivity

    Stage 1: Vanilla gradient descent

    Its idea traces back to classical optimization theory from the mid-nineteenth century. Its implicit assumption is deeply counterintuitive: it treats parameter updates as a massless particle sliding along, able to reach top speed instantly and stop instantly. This is physically unrealistic, and it explains its poor efficiency in canyon terrain.

    Stage 2: Introducing inertia

    In 1964, the Soviet mathematician Boris Polyak proposed the heavy ball method while studying optimization theory: give the particle “mass” and “inertia” so the update direction accumulates historical information. The idea can be sketched as follows:

    1. # Sketch: the core idea of the heavy ball / momentum method
    2. v = momentum * v + grad # accumulate "inertia"
    3. param -= learning_rate * v # step along the accumulated direction

    The intuitive effect: in a canyon, the side-to-side oscillation cancels out because the directions oppose each other, while the effective descent along the length is preserved and accelerated. This idea later evolved into the momentum method widely used in deep learning and became a default component of nearly all modern training configurations.

    Stage 3: Per-parameter adaptivity

    The next key breakthrough was giving each parameter its own effective step size. The approach accumulates an online moving estimate of the squared gradient and uses it to normalize the learning rate:

    1. # Sketch: the core idea of adaptive learning rates
    2. cache = beta2 * cache + (1 - beta2) * grad * grad
    3. param -= lr * m_hat / (sqrt(cache) + eps)

    The value of these methods is that they are naturally friendly to sparse features and parameters of different scales, requiring almost no fine-grained manual tuning, which is why they became the “default option” for large model pretraining.

    Stage 4: Matrix-based (second-order structure) optimizers

    Recent research treats parameters as having matrix structure and uses orthogonalization/whitening of the gradient matrix to approximate second-order information, so that updates are more balanced in scale across directions. Its schematic form is very concise:

    1. # Sketch: the core steps of a matrix-based update
    2. G = momentum * G + grad # momentum accumulation
    3. U, _, V = svd(G) # orthogonalization, approximate whitening
    4. update = U @ V # update direction after scale balancing
    5. param -= lr * update

    The motivation is clear: first-order methods use only the gradient direction, while second-order methods (such as natural gradient and K-FAC-style approximations) can use curvature information but at high cost; matrix-based methods try to strike a compromise between the two — using one matrix decomposition to obtain an update geometry more reasonable than element-wise normalization. It should be emphasized that in engineering, these methods usually need to handle extra overhead, numerical stability, and decomposition errors under mixed precision, and whether they pay off depends on model scale and the task.

    3. How to Judge the Technical Substance Behind an “API Upgrade”

    As a user, you cannot see the training details, but you can make reasonable inferences and verification along these dimensions:

    1. Convergence and stability descriptions: whether stability on long-context and complex instruction tasks is emphasized;
    2. Context length and inference efficiency: often related to parallelism strategies and attention implementation optimizations;
    3. Fine-tuning friendliness: whether parameter-efficient fine-tuning is supported and whether clear hyperparameter guidance is provided;
    4. Observability: whether logging services, monitoring alerts, and call chain tracing capabilities are provided.

    When building your own training or fine-tuning pipeline, a common engineering combination is: a container platform hosting training jobs, object storage holding datasets and checkpoints, a message queue decoupling data preprocessing, and a logging and monitoring system responsible for anomaly detection. These all belong to general capability categories, independent of any specific vendor.

    4. Practical Advice: An Optimizer Selection and Tuning Checklist

    • Default baseline: adaptive learning rate + momentum + cosine or linear warmup; get it running first, then optimize;
    • Learning rate: start from the peak learning rate after warmup, and use gradient clipping (such as clipping by global norm) to suppress oscillation;
    • Matrix-based methods: more worth trying on medium-to-large models with obvious matrix structure; limited payoff on small-scale tasks;
    • Numerical stability: under mixed precision, watch epsilon, second moment initialization, and decomposition precision;
    • Reproducibility: fix random seeds, record the full configuration, and use checkpoints for A/B comparison;
    • Cost awareness: spend the compute budget on “effective steps” rather than blindly extending training.

    Conclusion

    The optimizer is the navigation system of deep learning. From Cauchy-era vanilla descent, to Polyak’s inertia idea, to per-parameter adaptivity and matrix-based updates, the essence of this evolutionary path is always the same question: under conditions of limited information and ill-conditioned terrain, how to decide the direction and step size of each step. Once you understand this thread, you can more quickly distinguish marketing language from the engineering progress that genuinely affects model capability whenever you read an API documentation update.