Innovating LLM Training Optimizers: From Adam to Matrix Orthogonalization

    Training ultra-large language models presents significant VRAM challenges, largely due to the state overhead of default optimizers like Adam. This article explores the paradigm shift from element-wise adaptive optimization to whole-matrix orthogonalization. We examine the memory crisis in large-scale training, the geometric intuition behind matrix orthogonalization, its practical benefits and limitations, and actionable strategies for integrating hybrid optimizers into cloud-based training workflows.

    1. The Starting Point: VRAM Crisis in Ultra-Large Scale Training

    While compute is the most visible cost in training models with hundreds of billions or trillions of parameters, VRAM ultimately dictates training feasibility. For a long time, the industry has defaulted to Adam and its variants due to their robust convergence via element-wise adaptive learning rates across various model architectures. However, this adaptability comes at a steep price.

    Adam maintains two state variables for every trainable parameter: the first moment estimate (momentum) and the second moment estimate (scaling). Under mixed-precision training frameworks, these states are typically stored in high precision, meaning optimizer states alone consume several times the memory of the parameters themselves. For a 1.6-trillion parameter model, these state variables can consume over a dozen terabytes of VRAM. This leads to two direct consequences:

    • Forced Batch Size Compression: With VRAM exhausted by optimizer states, little remains for activations and batch data. Smaller batch sizes reduce GPU utilization and communication efficiency, further slowing training.
    • Limited Context Length: Long-context training requires activation memory that scales with sequence length. The fixed overhead of optimizer states severely limits the scheduling space for long sequence training.

    Worse yet, to compensate for insufficient per-GPU VRAM, engineers must introduce complex sharding and offloading strategies. This incurs extra communication overhead and implementation complexity, causing training costs to skyrocket. This contradiction has driven the research community to rethink the fundamental design of optimizers.

    2. Paradigm Shift: From “Element-wise” to “Whole Matrix” Optimization

    To understand the value of this new approach, we must first examine how Adam works. Adam is a classic element-wise optimizer: it breaks a weight matrix into independent scalars, tracks historical gradient statistics for each element, and adjusts the update step accordingly. While precise, the state volume scales strictly proportionally to the number of elements, making memory overhead unavoidable.

    Recently, matrix orthogonalization optimizers have adopted a different worldview: a 1000×1000 weight matrix should not be treated as one million isolated scalars, but as an indivisible high-dimensional geometric object. The core workflow consists of three steps:

    1. Accumulate momentum on the gradient to obtain an “update direction matrix.”
    2. Use orthogonalization (e.g., applying an orthogonalizing transformation to the matrix) to “reshape” this direction matrix into an update volume with uniform scaling across all directions.
    3. Overlay the reshaped matrix onto the weight matrix as a whole.

    A conceptual pseudocode looks like this:

    1. # Conceptual: Update logic of a matrix orthogonalization optimizer
    2. g = grad # Current gradient
    3. m = momentum * m + g # Momentum accumulation
    4. o = orthogonalize(m) # Orthogonalize and reshape the update direction
    5. W = W - lr * o * scale # Update the entire weight matrix at once

    The key benefit is that the optimizer no longer needs to maintain two moment states per element. The state volume is drastically reduced, leading to significant memory savings. The freed VRAM can be directly converted into larger batch sizes, longer context windows, or fewer sharded replicas—each representing a tangible cost reduction for ultra-large model training.

    This idea was initially validated in a community hackathon where participants competed to train a mini-GPT to a target loss using minimal compute. While most tuned hyperparameters on traditional optimizers, one researcher applied gradient orthogonalization to hidden layers. The required training steps dropped precipitously, setting a new efficiency record at the time. Since then, this method has evolved from an experiment into an industrial-scale training practice, establishing a new route in optimizer design.

    3. Geometric Intuition: Skirmishers vs. The Macedonian Phalanx

    How can we intuitively understand the difference between these two paradigms? Consider the classic “iron ball rolling downhill” analogy.

    Adam deals with a group of independent iron balls: each has its own trajectory and adaptive step. The optimizer must dictate the next step for each ball individually. This is like skirmishers judging the terrain and making independent decisions—precise, but with high command costs, as each ball requires its own dedicated “communication and logging system” (i.e., moment states).

    Orthogonalization optimizers first form the iron balls into a phalanx: before updating, the entire gradient matrix is orthogonalized so that the force scales in all directions are normalized, and the matrix advances at a uniform pace. Like soldiers marching in formation—individuals surrender some freedom of movement in exchange for a neat formation and efficient command. The underlying principle is that maintaining a balanced step size across the singular directions of the weight matrix prevents some directions from drifting excessively while others stagnate. This results in a “straighter” path down the loss surface, reducing unnecessary oscillation.

    Importantly, this “uniformity” does not sacrifice precision. It leverages the inherent structure of high-dimensional matrix updates: orthogonalizing the direction is approximately equivalent to an optimal scale reallocation for the update, making each step geometrically closer to the direction of steepest descent.

    4. Doubts and Boundaries: The Phalanx in Real Combat?

    Any new paradigm faces legitimate skepticism, and orthogonalization optimizers are no exception. The most common rebuttal is: “In real combat, do you really charge in a phalanx? Eventually, you have to break into a skirmish line.” Mapped to technology, these doubts include:

    • Computational Overhead of Orthogonalization: Performing orthogonalization on large matrices requires extra matrix operations (e.g., approximate power iteration). On certain layers, this might offset the throughput gains from memory savings.
    • Handling Non-Matrix Parameters: 1D parameters like embeddings and classification heads lack a matrix structure. They typically fall back to traditional element-wise methods, creating a “hybrid optimizer” engineering model.
    • Hyperparameter and Scenario Sensitivity: The optimal strength of orthogonalization and the update scale coefficients may vary across different model architectures and training stages, lacking the battle-tested “default robust range” that Adam possesses.

    These challenges have led practitioners to a mature consensus: deep matrix weights use orthogonalized updates to gain memory and convergence efficiency, while embeddings and output layers retain element-wise adaptive updates for stability. The phalanx and the skirmish line are not mutually exclusive; each holds its ground.

    5. Practical Recommendations for Implementation

    For teams planning large-scale training on the cloud, consider the following path to evaluate and integrate these optimizers:

    1. Start with Small-Scale Validation: Under identical data and compute budgets, compare the loss curve and wall-clock time of an Adam baseline against the orthogonalization scheme. Focus on the product of per-step time and total steps.
    2. Monitor Memory Reallocation Benefits: Track where the memory saved by optimizer states goes—whether it translates into larger batch sizes or longer sequences—and quantify its contribution to throughput.
    3. Leverage Mature Cloud Training Facilities: Use container platforms for elastic scheduling, high-performance parallel file storage, and training monitoring/alerting to lower the cost of distributed modifications and troubleshooting.
    4. Prioritize Hybrid Strategies: Do not aggressively replace globally. Pilot the approach on intermediate hidden layers first, then gradually expand the scope.

    Conclusion

    The history of optimizer evolution is fundamentally about “how to drive larger models with fewer states and smarter geometric intuition.” The shift from element-wise adaptation to whole-matrix orthogonalization not only alleviates the VRAM crisis that plagues ultra-large-scale training but also suggests that the answers to many deep learning efficiency bottlenecks may lie not in piling on more hardware, but in rethinking the basic components we take for granted. For engineers, understanding the principles and boundaries of these two paradigms is now a mandatory course for building cost-effective training systems.