Optimizer Innovations and Engineering Practices in Large Language Model Training
As language models scale to hundreds of billions or even trillions of parameters, optimizer states have become a critical bottleneck, consuming massive amounts of VRAM and impacting training efficiency, scalability, and stability. This article explores the limitations of traditional element-wise adaptive optimizers and introduces matrix-level optimization, which leverages orthogonalization to align update directions and reduce state overhead. We delve into the engineering challenges of implementing matrix-level optimizers, including computational costs, layer-specific strategies, numerical stability in mixed precision, and distributed communication. Finally, we discuss how to scientifically evaluate these new methods and advocate for a hybrid optimization strategy that combines the strengths of both element-wise and matrix-level approaches to maximize training efficiency.
1. The Key Contradiction in Large Model Training: Parameter Scale vs. Training Efficiency
When the parameter scale of language models expands from tens of billions to hundreds of billions or even higher, the challenges facing training systems go beyond simply “needing more compute.” Storage, communication, optimization, parallelism, and stability all face simultaneous pressure.
Among these, optimizer states are often an overlooked yet extremely resource-intensive component. Taking common adaptive optimization methods as an example, in addition to saving model parameters and gradients, it is usually necessary to maintain first-order momentum and second-order statistics for each parameter. This means a single parameter might correspond to multiple extra states. When model parameters reach the trillion scale, even with mixed-precision storage, optimizer states can occupy several terabytes of VRAM or more.
This directly leads to three problems:
Decreased per-GPU parameter capacity
When more VRAM is consumed by optimizer states, the capacity left for model parameters, activations, and temporary computation space is reduced.Restricted batch size and context length
To support longer input sequences, the system needs to save more intermediate activations. If VRAM is heavily consumed by optimizer states, it becomes necessary to reduce batch sizes or adopt more aggressive recomputation strategies.Increased complexity in distributed communication
When optimizer states are sharded across multiple devices, parameter updates, state synchronization, and fault recovery all become more complex.
Therefore, for ultra-large models, the optimizer is no longer just an algorithmic component affecting convergence speed; it has become the infrastructure determining training costs and system scalability.
2. Advantages and Limitations of Traditional Adaptive Optimizers
The core idea of traditional adaptive optimization methods is to allocate different update step sizes to different parameters based on the historical gradient variations of each parameter.
This element-wise update mechanism has clear advantages:
- Strong adaptability to parameters of different scales;
- Relative robustness to tasks with sparse gradients and high noise;
- Mature engineering implementation and rich experience in hyperparameter tuning;
- Generally good out-of-the-box performance for small and medium-sized models.
However, its limitations are equally obvious.
First, it decomposes weight matrices into a large number of independent scalars, rarely utilizing the structural information of the matrix itself. For linear layers in neural networks, the weights are typically high-dimensional matrices with clear geometric meanings. The rows, columns, and different directions of the matrix are not entirely independent, and element-wise processing might ignore these correlations.
Second, adaptive statistics introduce additional memory overhead. The more parameters there are, the more state variables there are, making the training system more susceptible to VRAM capacity limits.
Finally, element-wise scaling can cause update magnitudes to vary too much across different directions. Some directions are amplified while others are compressed, which may ultimately cause parameter updates to deviate from a more favorable overall geometric direction.
This does not mean that traditional optimizers are obsolete. Rather, it indicates that when the model scale expands to a certain extent, relying solely on element-wise adaptive mechanisms may make it difficult to simultaneously satisfy the requirements for memory efficiency, training speed, and stability.
3. Matrix-Level Optimization: Shifting from “Individual Parameters” to “Structural Wholes”
The basic idea of matrix-level optimization is to treat the weights of a network layer as a whole, rather than processing each parameter in complete isolation.
For a linear layer, its weight can be represented as a matrix (W), and the corresponding gradient as (G). Matrix-level methods integrate the current gradient with historical momentum to produce an update matrix, and then normalize or orthogonalize it through some matrix transformation before applying the result to update the weights.
This can be simplified as follows:
[
Mt = \beta M{t-1} + (1-\beta)G_t
]
[
U_t = \text{Orth}(M_t)
]
[
W_{t+1}=W_t-\eta U_t
]
Where:
- (M_t) represents the momentum matrix after integrating historical information;
- (\text{Orth}(\cdot)) represents a matrix orthogonalization or approximate orthogonalization operation;
- (U_t) is the final matrix-level update direction;
- (\eta) is the learning rate.
The intuitive effect of orthogonalization is to prevent the update matrix from over-concentrating in certain directions, making the updates across different dimensions more balanced. It focuses no longer on how much each individual element should move, but rather on the overall direction in which the entire weight space should change.
The two types of methods can be analogized as follows:
- Element-wise optimization is like letting a large number of individuals independently decide their own movement direction and step size;
- Matrix-level optimization is like first identifying the overall formation and then advancing in a more coordinated manner.
The former is flexible, while the latter emphasizes structural and directional consistency.
4. Why Orthogonalization May Improve Training Efficiency
Orthogonalization is not simply about turning a matrix into a “neat shape”; it involves scale control and direction constraints in parameter space.
During deep network training, gradients typically exhibit strong anisotropy, meaning the magnitude of variation differs greatly across different directions. If raw gradients are used directly, a few directions may dominate the update volume, while other directions remain inadequately adjusted for long periods.
Matrix orthogonalization can alleviate this problem to a certain extent:
Reducing the skew of update directions
Ensuring that updates do not over-concentrate on a few singular directions.Improving matrix conditioning
For certain linear transformation layers, more balanced updates help prevent the weight matrix from becoming overly degenerate during training.Reducing unnecessary element-wise states
If the algorithm no longer relies on complete first- and second-order element-wise statistics, the extra memory footprint of the optimizer can theoretically be reduced.Increasing the effectiveness of each training step
When each step’s update covers more reasonable matrix directions, fewer iterations may be needed to achieve the same training objectives.
However, “fewer steps” does not necessarily mean “lower total cost.” Matrix orthogonalization itself requires computation, especially for large matrices. Orthogonal decomposition, singular value-related calculations, or iterative approximations all introduce extra overhead. Therefore, it must be evaluated comprehensively across multiple dimensions, including total training time, VRAM footprint, communication volume, and final performance.
5. Engineering Challenges in Implementing Matrix-Level Optimizers
1. Computational Cost of Orthogonalization
Exact matrix decomposition usually has high computational complexity and is not suitable for direct application to all layers. Practical systems often need to use approximate methods, such as matrix transformations based on polynomial iteration, or iterative processes with a fixed number of steps to approximate the orthogonal result.
Too few approximation iterations may result in insufficient orthogonalization; too many will offset the training time saved. Therefore, a balance must be struck between precision and efficiency.
2. Different Network Layers Cannot Be Treated Equally
Matrix-level optimization is more suitable for 2D weight matrices in hidden layers, but not all parameters are suitable for the same update method.
For example:
- Vocabulary mapping layers may have special statistical structures;
- Output projection layers may have extremely large parameter scales;
- Bias parameters are usually 1D vectors;
- Normalization layer parameters often only have scaling and shifting significance.
Therefore, actual training systems generally adopt a hybrid strategy: using matrix-level methods for weights suitable for matrix updates, and continuing to use mature element-wise methods for vector parameters or special parameters.
3. Numerical Stability Under Mixed Precision
Large model training typically uses low-precision computation to improve throughput, but matrix orthogonalization is sensitive to numerical errors. If the input matrix scale is too large or too small, it may lead to iterative instability, update direction deviation, or even numerical overflow.
Common engineering measures include:
- Using higher-precision accumulation in key matrix operations;
- Scale normalization for input matrices;
- Setting stability safeguards for the iteration process;
- Monitoring gradient norms, weight norms, and update norms;
- Falling back to more conservative update methods in abnormal situations.
4. Communication Issues in Distributed Training
In model and data parallel environments, a weight matrix may be sharded across multiple devices. Matrix-level optimization needs to clarify whether the orthogonalization operation is performed on local shards or after aggregating the full matrix.
Local computation involves less communication but may break the global matrix structure; global computation aligns better with the algorithm definition but incurs heavy communication and synchronization costs. Therefore, optimizer design must be planned in conjunction with parameter sharding strategies, communication topologies, and parallelism methods.
6. How to Scientifically Evaluate a New Optimization Method
You should not only look at the training loss curve; a multi-dimensional evaluation system should be established.
Convergence Efficiency
Compare the training steps, sample quantities, and actual wall-clock time required to reach the same validation loss. Simply reducing the number of steps while significantly increasing the computation per step may not be advantageous.
Resource Efficiency
Focus on:
- Peak VRAM usage;
- Optimizer state footprint;
- Per-step computation time;
- Inter-node communication volume;
- Checkpoint size;
- Failure recovery time.
Generalization Ability
Faster training loss decline does not necessarily mean better performance on downstream tasks. It is necessary to observe the model’s generalization across different types of tasks, varying input lengths, and different data distributions.
Scaling Transferability
A method being effective on small models does not mean it will be equally effective on ultra-large models. Testing should be done across different parameter scales, layer widths, context lengths, and parallel configurations.
Stability
Record whether issues such as loss spikes, gradient explosions, abnormal weight growth, or excessive sensitivity to learning rate changes occur during training.
7. A Pragmatic Hybrid Optimization Strategy
For large-scale training tasks, a more realistic solution is usually not to completely abandon traditional optimizers, but to adopt a layered, parameter-specific hybrid strategy:
- Use matrix-level updates for primary hidden layer matrices;
- Use lightweight element-wise updates for vector parameters;
- Retain proven, stable solutions for special layers;
- Dynamically adjust the optimizer combination based on the training phase;
- Use different configurations for pre-training, continual training, and fine-tuning stages.
The pre-training phase focuses more on throughput and overall convergence efficiency, where matrix-level methods may be more valuable; the fine-tuning phase involves smaller data volumes and larger task variance, requiring greater emphasis on stability and generalization.
8. Conclusion: Optimizers Are Becoming a Core Competency of Model Systems
As model scales continue to expand, optimizers have gradually evolved from “a configuration item in training code” to core components affecting model cost, efficiency, and scalability.
Element-wise adaptive methods still possess advantages such as maturity, robustness, and ease of use; matrix-level orthogonalization methods represent another development path: fully utilizing the structural information of weight matrices to improve training efficiency with lower state overhead and more coordinated update directions.
Future efficient training systems will likely not rely on a single optimizer, but rather be designed in combination based on parameter types, network structures, training phases, and hardware environments. Truly valuable technical solutions should not only focus on the performance of an algorithm in a single experiment, but should be collaboratively optimized across algorithms, compilation, parallelism, storage, and monitoring, ultimately forming a verifiable, scalable, and maintainable complete training system.
