From Element-Wise Adaptation to Matrix Orthogonalization: The Evolution of Optimizers for Memory-Efficient LLM Training
As large language models scale toward trillions of parameters, optimizer states can consume terabytes of memory and limit batch size, context length, and overall training efficiency. This article explains why Adam-style optimizers create a memory bottleneck, how matrix orthogonalization reduces optimizer-state overhead, where the approach works best, and why hybrid strategies remain the most practical choice for large-scale training.
1. The Optimizer Memory Crisis in the Trillion-Parameter Era
Optimizer states are often an underestimated part of the cost of training large language models. For years, Adam-style element-wise adaptive optimizers have been the default choice. Their adaptive learning rates are highly effective, but they come with a significant cost: every trainable parameter requires two additional states in memory—a first moment, or momentum term (m), and a second moment, or exponential moving average of squared gradients (v).
Consider a 1.6-trillion-parameter model trained with a typical mixed-precision setup, using FP16 or BF16 for computation and FP32 master weights:
- FP32 master weights: 1.6T × 4 bytes ≈ 6.4 TB
- Adam first moment (m): 1.6T × 4 bytes ≈ 6.4 TB
- Adam second moment (v): 1.6T × 4 bytes ≈ 6.4 TB
- FP32 gradients, if kept in memory: approximately another 6.4 TB
The optimizer states alone can consume 12–13 TB of memory, without accounting for activations. This overhead directly limits two factors that are critical to training quality:
- Batch size: Smaller batches produce noisier gradients, reduce training stability, and lower throughput.
- Context length: Long-context training already requires substantial activation memory. When optimizer states consume much of the available memory, teams are forced to rely on gradient checkpointing, offloading, and other techniques that trade memory for additional compute or communication overhead.
In other words, optimizer states act like an “invisible rent” on the training cluster. The larger the model becomes, the harder this fixed cost is to absorb. This is the fundamental reason researchers are revisiting optimizer design:
Can an optimizer achieve comparable—or even better—convergence with substantially less state?
2. Where Orthogonalization Came From: A Product of Compute-Constrained Optimization
Interestingly, progress in this area did not originate from a massive training run. It emerged from a small-scale community challenge: training a miniature language model as efficiently as possible. Participants were given a fixed compute and time budget and competed to train a small GPT-style model to a target loss. Under such tight constraints, even a minor improvement in training efficiency could produce a major ranking advantage.
In that environment, one developer proposed a counterintuitive idea: instead of updating parameters element by element, orthogonalize the gradients of hidden-layer weight matrices before applying the update. Experiments showed a dramatic reduction in the number of steps required to reach the same loss, setting a new benchmark in the challenge. The approach was later described as a matrix-orthogonalization optimizer and was gradually evaluated on models ranging from billions of parameters to substantially larger scales.
The broader engineering lesson is clear:
Optimizer design is not limited to adding more state in exchange for finer adaptation. The geometric structure of the update rule can also be redesigned.
3. The Core Principle: Updating a Weight Matrix as a Whole
3.1 Adam: An Element-Wise Update Strategy
Adam updates each element independently. For every element in a weight matrix (W), it uses that element’s historical gradient statistics, (m) and (v), to calculate an individual update step:
# Adam-style update (pseudocode)m = beta1 * m + (1 - beta1) * gv = beta2 * v + (1 - beta2) * g * gW -= lr * m / (sqrt(v) + eps)
This approach is effective because every parameter receives its own adaptive step size. It is robust to sparse gradients and parameters with different magnitudes. However, it also has two major drawbacks:
- The state size scales directly with the number of parameters, requiring two additional states for each parameter.
- Each element is treated independently, which ignores the global geometric structure of the matrix.
3.2 Matrix Orthogonalization: Coordinated Matrix-Level Updates
Matrix orthogonalization starts from a different assumption: a 1,000 × 1,000 weight matrix is not merely a collection of independent scalar parameters. It is a geometric object in a high-dimensional space, and its update direction should be considered as a whole.
The process can be summarized in three steps:
- Accumulate momentum: As in conventional optimizers, accumulate gradient momentum to obtain an update matrix (G).
- Orthogonalize the update: Apply an orthogonalization procedure, such as a Newton–Schulz iteration that approximates the polar decomposition, so that the singular values of the update are brought closer to a common scale.
- Apply the matrix update: Add the orthogonalized update to the weight matrix in a single coordinated operation.
# Matrix-orthogonalization optimizer update (illustrative pseudocode)buf = beta * buf + g # Momentum bufferu = newton_schulz_orthogonalize(buf) # Approximate orthogonalizationW -= lr * u * scale # Apply the coordinated update
A useful intuition is to compare the two approaches to military formations. Adam behaves like a dispersed line: every soldier advances at an individually determined pace. Orthogonalized updates behave more like a phalanx: the group first forms a coordinated structure and then moves forward together.
The matrix-level approach sacrifices some fine-grained individual adaptation in exchange for more coordinated and predictable progress. This can be especially useful during the early and middle stages of training, when gradient signal-to-noise ratios are low. Suppressing noisy singular directions in the update can significantly improve convergence speed.
3.3 Where the Memory Savings Come From
The key point is that orthogonalization applies a matrix-level transformation to a momentum buffer. It does not require a separate second-moment estimate for every parameter. As a result, the per-parameter optimizer state decreases from approximately two copies—(m) and (v)—to roughly one copy, represented by the momentum buffer.
The memory footprint can be reduced further through engineering choices such as:
- Storing the momentum buffer in BF16, which can cut its memory usage by half;
- Performing the orthogonalization iterations with a few matrix multiplications in lower precision, without introducing additional persistent state.
As a rough estimate, compared with Adam-style optimizers, these methods can reduce optimizer-state memory by half or even more. For trillion-parameter models, that can free up multiple terabytes of memory. The recovered capacity can be used directly for larger batch sizes or longer training contexts—an especially valuable trade-off for models designed to handle long-form text.
4. Limitations and Open Questions: A Phalanx Is Not Always the Best Formation
New methods inevitably face practical challenges. A rigid formation may look efficient, but is it suitable for complex terrain? In technical terms, the main questions are:
- The initial validation scale was limited: The approach was first demonstrated on models with roughly 100 million parameters. Whether its convergence improvements transfer to models with hundreds of billions or trillions of parameters requires rigorous scaling experiments.
- Its applicability varies by layer: In practice, orthogonalized updates are better suited to two-dimensional weight matrices in hidden layers. Embedding layers, output heads, and other parameters with unusual shapes or substantially different gradient distributions may still perform more reliably with element-wise adaptive methods. A common engineering compromise is a hybrid strategy: use orthogonalized updates for hidden layers and retain Adam-style updates for other components.
- Hyperparameter sensitivity: Orthogonalized updates have a different scale from the original gradients. Learning rates and scaling factors therefore need to be recalibrated. Reusing Adam’s hyperparameters without adjustment often produces poor results.
5. Engineering Recommendations
Teams planning large-scale training can consider the following selection guidelines:
- Small and medium-scale models, below 10B parameters: Optimizer-state memory is generally less restrictive. Adam-style methods remain a safe default because of their mature ecosystem and extensive tuning experience.
- Very large models or long-context training: When memory is the primary bottleneck, matrix orthogonalization is worth evaluating. A hybrid configuration—orthogonalized updates for hidden layers and Adam-style updates elsewhere—can reduce the risk of a complete transition.
- Combine multiple memory-saving techniques: Regardless of the optimizer, teams should consider combining it with ZeRO-style sharding, 8-bit state quantization, activation offloading, and similar techniques. Modern deep learning frameworks and cloud training platforms commonly provide support for these approaches.
- Validate at small scale before expanding: Run an A/B comparison on a fixed data subset and measure both the number of steps required to reach the target loss and the wall-clock training time. Use those results to determine whether the method is suitable for a larger run.
6. Conclusion
The shift from element-wise adaptation to matrix orthogonalization reflects a straightforward engineering principle:
When resource constraints become tighter, optimizing the mathematical structure of the update rule can be more cost-effective than simply adding more hardware.
By coordinating updates across an entire matrix, orthogonalization methods can improve both convergence efficiency and memory usage. This creates new possibilities for training very large models. However, these methods are not universal replacements for Adam. Understanding their boundaries and combining them by layer is currently the more practical approach.
As more large-scale training results become available, matrix-orthogonalization optimizers will continue to be an important area for exploration.
