Evolution of LLM Training Optimizers and Long-Context Technology Explained
As Large Language Models (LLMs) evolve towards million-token context windows and advanced agentic capabilities, the underlying training mechanisms remain crucial. This article explores the evolution of optimization algorithms in LLM training, from standard gradient descent and the Heavy Ball Method to adaptive learning rates and emerging orthogonal optimization techniques. It also examines how these advanced optimizers support extreme long-context processing and agent alignment, providing developers with essential insights into the foundational algorithms driving next-generation AI.
The latest generation of Large Language Models (LLMs) exhibits two prominent trends in technological evolution: the expansion of context windows to the million-token level, and the enhancement of agentic task orchestration capabilities. However, these breakthroughs in upper-level capabilities often overshadow the innovations in underlying training mechanisms. In fact, one of the core driving forces behind LLM training is the continuous evolution of optimization algorithms. This article delves into the critical role of optimizers in LLM training and how new optimization algorithms break through the physical limitations of traditional gradient descent.
I. The “Navigator” of LLM Training: The Core Role of Optimizers
In the training process of deep learning models, the optimizer acts as a crucial “navigator.” We can use a classic physical scenario to analogize model training: imagine a developer blindfolded and placed in a rolling mountain range, with the ultimate goal of finding the lowest valley. In this scenario, the loss function represents the current altitude, while the gradient (backpropagation) represents the slope of the ground detected by the developer’s feet, indicating the downhill direction. The optimizer is the strategic system in the brain that determines where to step next and how large the stride should be.
A mature optimizer must precisely control three core dimensions:
- Update Step Size (Learning Rate Control): When searching for the valley bottom, an overly large step might cause one to leap directly across the valley and up the opposite slope, leading to non-convergence and error oscillation. Conversely, an overly small step makes the training process extremely lengthy. Advanced optimizers need the capability to adaptively adjust the step size, accelerating in flat areas and decelerating near steep extreme points.
- Avoiding Local Optima: The mountains are filled with small depressions halfway up the slopes. If one blindly descends based solely on intuition, it is easy to get trapped in these local optimal solutions, mistakenly believing the true valley bottom has been reached.
- Maintaining Trajectory Smoothness: In complex non-convex loss terrains, reducing unnecessary oscillations and sudden directional changes is essential to ensure an efficient and stable convergence process.
II. From Standard Gradient Descent to the Physical Intuition of the “Heavy Ball Method”
Early optimizers primarily employed Stochastic Gradient Descent (SGD), a concept tracing back to mathematical optimization theories from the mid-19th century. However, standard gradient descent mathematically simulates a “massless particle” sliding on a complex surface—it can instantly accelerate to maximum speed and instantly stop, entirely violating classical physics.
This lack of inertia, when encountering a narrow “canyon” terrain, causes the particle to violently bounce back and forth between the canyon walls, resulting in extremely low convergence efficiency. In the 1960s, optimization theorists broke away from this premise. While studying optimization problems in complex terrains, they posed a question: what if this sliding particle were forcibly endowed with “mass” and “inertia”?
Based on this strong physical intuition, the renowned Heavy Ball Method emerged. This method scales and adds the update direction from the previous time step (i.e., momentum) to the current gradient, allowing the particle to accumulate speed as it descends. This improvement brought two significant advantages: first, the inertia helps the particle break out of shallow local minima. Second, in canyon terrains, lateral back-and-forth oscillations are weakened due to the positive and negative cancellation of momentum, while the longitudinal descending trend is enhanced by the accumulation of momentum, thereby greatly improving the model’s convergence efficiency on complex loss surfaces.
III. The Rise of Adaptive Learning Rates and Mainstream Optimizers
As deep learning network structures became increasingly complex, relying solely on momentum could no longer meet the training demands of massive parameter counts. The update frequency of different parameters within a model varies greatly; applying a uniform learning rate leads to oscillations in frequently updated parameters, while sparsely updated parameters fail to learn effectively.
To address this pain point, the industry proposed adaptive optimization algorithms that combine first-moment and second-moment estimates. These algorithms not only inherit the advantages of momentum but also adaptively adjust the learning rate in each dimension based on the parameter’s gradient history. For frequently updated parameters, the algorithm appropriately reduces their learning rate based on the second moment (the sum of squared historical gradients); for sparsely updated parameters, it maintains or increases the learning rate. This mechanism allows the model to move faster in flat regions and more cautiously in steep areas, becoming the cornerstone of the current LLM pre-training phase.
IV. Exploration and Breakthroughs of New Optimizers in LLM Training
Although existing adaptive optimizers are already quite powerful, they still face challenges such as unstable convergence, high sensitivity to hyperparameters, and a tendency to fall into sharp minima during pre-training at the scale of hundreds of billions of parameters. Consequently, the industry is actively exploring new optimization algorithms.
For example, a recently highlighted new orthogonal optimization algorithm introduces orthogonalization operations into the update matrix, changing the logic for calculating the update direction in traditional gradient descent. In traditional optimizers, the gradient update direction is often strongly influenced by the local curvature of the loss function, easily leading to minimal step sizes or incorrect directions in regions of ill-conditioned curvature. The new orthogonal optimizer processes the gradient matrix orthogonally, ensuring that the update direction remains orthogonal across all dimensions with a constant norm. This mathematical operation effectively eliminates the negative impact of an ill-conditioned Hessian matrix, allowing the optimizer to maintain stable convergence over a broader range of learning rates. This significantly reduces the difficulty of hyperparameter tuning in large-scale distributed training and is regarded as a major breakthrough in underlying LLM training technology.
V. Underlying Training Support for Long Contexts and Agentic Capabilities
The breakthroughs of LLMs in million-token long contexts and agentic capabilities are equally inseparable from the support of these underlying optimization technologies.
1. Technical Challenges of Long Contexts
Long contexts require the model to handle extreme long-range dependencies. This relies not only on improvements in attention mechanism architectures (such as sparse attention, sliding window mechanisms, and rotary position encoding extension) but also on the optimizer’s ability to find stable generalization solutions during the training phase across a massive data distribution with varying sequence lengths. Because long sequences cause more severe gradient vanishing or explosion, the optimizer’s adaptive scaling and momentum smoothing mechanisms become a critical line of defense against training collapse.
2. Alignment and Reinforcement of Agentic Capabilities
When models acquire agentic capabilities like tool calling and multi-turn logical reasoning, they typically undergo instruction fine-tuning and reinforcement learning alignment phases. In these stages, the optimizer must effectively handle complex issues such as sparse reward signals and policy oscillations. The optimizer needs not only to respond quickly to explicit reward signals but also to maintain the robustness of policy updates in complex multi-step reasoning tasks. A stable and efficient optimizer ensures that the direction of weight updates is accurate as the model evolves from a “base language model” to an “agent model.”
VI. Conclusion and Outlook
The leap in LLM capabilities is the resonance of compute power, data, and algorithms. At the algorithm level, innovations in upper-level architectures often attract the most attention, but the evolution of underlying optimizers is equally indispensable. From massless random walks to the inertia-endowed Heavy Ball Method, and then to adaptive regulation and new orthogonal optimization algorithms, each iteration of the optimizer paves a smoother path for the model to approximate the global optimal solution.
For developers and AI practitioners, a deep understanding of the underlying logic of optimizers not only aids in better model fine-tuning and business deployment but also provides a vital technical perspective for grasping the developmental trajectory of next-generation AI technologies. In the future, as model parameters and context lengths continue to expand, we look forward to seeing more novel algorithms emerge that fuse mathematical optimization theory with physical intuition, continuously pushing the boundaries of AI technology.
