Unveiling Large Model Training: The Evolution from the Heavy Ball Method to Modern Optimizers

    This article explores the evolution of optimizers, the hidden engines behind large language model training. By examining the transition from early gradient descent and the Heavy Ball Method to modern adaptive algorithms and novel orthogonality-based approaches, we uncover how optimizers navigate complex loss landscapes, control learning rates, and escape local optima to achieve efficient model convergence.

    Introduction: The Hidden Engine Behind Large Model Training

    Recently, the release of documentation for a cutting-edge large model API has attracted significant industry attention. When discussing its technological breakthroughs, beyond the massive parameter scale and exceptional reasoning capabilities, the underlying algorithms used during training are equally worth examining. Among these, the optimizer acts as the “hidden engine” of large model training, directly determining whether a model can converge efficiently and achieve optimal performance. Taking this opportunity, we will delve into the core mechanisms of optimizers and explore their evolution from early gradient descent to modern, novel optimizers.

    Optimizers: The Navigation System of Deep Learning Training

    To intuitively understand the role of an optimizer, we can use the classic “descending a mountain” analogy. Imagine you are blindfolded, placed in a continuous mountain range, with the ultimate goal of reaching the deepest part of the valley. In this scenario, your tools correspond directly to concepts in deep learning:

    • Loss (Loss Function): Acts as an altimeter, telling you your current altitude.
    • Gradient (Gradient/Backpropagation): Acts as using your feet to test the slope of the surrounding ground, telling you which way is downhill and which way is uphill.

    The optimizer is the “strategic system” in your brain. Based on the information provided by the gradient, it determines which direction you should step next and how large that step should be. Typically, a comprehensive optimizer must solve two core problems: controlling the step size and escaping local optima.

    The First Major Task: The Balancing Art of Learning Rate Control

    The first thing an optimizer must determine is the size of the update step, known in deep learning as “learning rate control.” The setting of the learning rate is directly related to the success or failure of training:

    • Steps too large: If you take too large a step down the mountain, you might step directly over the valley bottom and rush up the opposite slope. In model training, this manifests as the loss function failing to converge, oscillating back and forth near the extreme point, or even causing gradient explosions.
    • Steps too small: If the steps are too small, although the direction is correct, it may take an extremely long time to reach the destination. In large model training involving hundreds of billions of parameters, this causes training costs to increase exponentially, making the goal unreachable.

    Therefore, an advanced optimizer must possess the ability to adaptively adjust steps. It needs to accelerate in flat terrain to improve efficiency and slow down in steep areas near the valley bottom to ensure it can stop precisely at the optimal point.

    The Second Major Task: The Physical Intuition of Escaping Local Optima

    The second core task of an optimizer is to avoid dead ends, i.e., escaping “local optima.” In multi-dimensional loss landscapes, there are many local optima resembling small pits halfway up the mountain. If one blindly walks downward relying solely on current gradient information, the model can easily fall into these pits and become trapped, mistakenly believing it has reached the true valley bottom.

    In the early days of deep learning, the industry primarily used SGD (Stochastic Gradient Descent). As the simplest descent method, its foundational idea dates back to the 1847 research of the French mathematician Cauchy. However, for more than a century afterward, the standard gradient descent algorithm actually simulated a “massless particle” sliding on a surface. Such a particle could start at maximum speed at any time and brake to a stop instantly, completely defying common physical sense in the real world.

    It was the Soviet mathematical genius Boris Polyak who broke this limitation.

    In 1964, while researching optimization theory, Polyak discovered that when facing narrow “canyon” terrains, standard gradient descent was highly inefficient due to bouncing back and forth against the canyon walls. Faced with these abstract mathematical formulas, he conceived a highly physical idea: what would happen if “mass” and “inertia” were forcibly added to this sliding particle?

    Based on this idea, he proposed the famous Heavy Ball Method (Momentum Method) in his paper. By introducing momentum, the optimizer considers not only the current gradient but also accumulates the direction of historical gradients. This is like a heavy iron ball rolling down a hillside; even if it encounters small pits halfway up, it can roll over them using its own inertia. This significantly improves the ability to escape local optima and the convergence speed in canyon terrains.

    Here is the schematic pseudocode for the Heavy Ball Method (Momentum Method):

    1. # Initialize the velocity variable
    2. velocity = 0
    3. momentum = 0.9 # Momentum coefficient, controls the size of inertia
    4. for t in range(epochs):
    5. # Compute current gradients
    6. grads = compute_gradients(params, data)
    7. # Update velocity: combine historical inertia with current gradient
    8. velocity = momentum * velocity - learning_rate * grads
    9. # Update parameters
    10. params = params + velocity

    The Evolution of Modern Optimizers and Novel Explorations

    Starting from the Heavy Ball Method, the deep learning field has derived a series of modern optimizers, such as Adam. The Adam algorithm combines the ideas of the momentum method and adaptive learning rates, becoming one of the most widely used optimizers in recent years. However, as large model parameters scale to hundreds of billions or even trillions, traditional optimizers have begun to reveal bottlenecks in matrix updates, memory consumption, and convergence stability.

    This is why the industry has recently placed high hopes on “novel optimizer” technologies. In the latest large model training practices, researchers have begun trying to introduce more advanced mathematical operations like matrix orthogonalization within optimizers. This novel optimization mechanism maintains the diversity and orthogonality of gradient update directions when updating high-dimensional parameter matrices, thereby avoiding the gradient alignment issues that traditional optimizers easily encounter in deep networks.

    This technological breakthrough means that when facing extremely complex loss landscapes, models can search for the global optimum in a more robust manner. This not only improves the final model accuracy but also shortens the training cycle to a certain extent.

    Conclusion and Engineering Practice

    The evolution of optimizers is essentially the process of humanity using mathematical language to continuously approximate the laws of the physical world. From massless instantaneous sliding to heavy balls with inertia, and now to novel optimizers with complex matrix processing capabilities, each step expands the boundaries of deep learning.

    For enterprises and developers, applying these cutting-edge optimization algorithms requires not only algorithmic accumulation but also strong underlying computing power and infrastructure support. Empowered by general computing platforms and AI infrastructures like Baidu AI Cloud, developers can focus more on optimizing strategy design and model architecture innovation without being distracted by computing power bottlenecks and the operational details of distributed training. In the future, with the continuous iteration of optimizer technology and the deep integration of cloud-native infrastructure, large model training will undoubtedly move towards higher efficiency and better performance.