Optimizer Innovation Behind Open-Source Large-Scale Models

    This article explains why optimizer state memory becomes the primary bottleneck when training trillion-parameter models, and how matrix-level optimizers address it. It compares element-wise adaptive methods with matrix-level orthogonalized updates, outlines the engineering practices needed to scale them—parameter grouping, precision isolation, and parallelism compatibility—and shows how to reinvest the saved memory into larger batches, longer contexts, and lower parallelism. A practical tuning checklist and a clear statement of limitations are included.

    1. Where the Problem Starts: Optimizers Are Eating Your Memory Budget

    Once model size crosses into the trillion-parameter range, the training bottleneck is often no longer “do we have enough compute” but “who is consuming the GPU memory.” The adaptive optimizers that have long been the industry default maintain two extra states per parameter in order to give every parameter its own adaptive step size: a first moment (momentum) and a second moment (a moving average of squared gradients). Under mixed-precision training, parameters and gradients are usually kept in half precision, while optimizer states are kept in single precision for numerical stability, so the effective overhead is roughly 8 bytes per parameter.

    A rough calculation: a 1.6T-parameter dense model needs about 12.8 TB of GPU memory for the two optimizer states alone. Add parameters, gradients, activations, and communication buffers, and cluster memory is drained fast. The consequences cascade: the shard that fits on a single GPU shrinks, tensor and pipeline parallelism must be split more aggressively, and the communication share rises. The headroom for larger batches and longer contexts is squeezed, sample throughput stalls at the level needed for convergence, and both training time and total cost climb.

    That is the practical motivation for matrix-level optimization: rather than chasing a “smarter update rule,” first solve the engineering constraints of states that do not fit and shards that are cut too finely.

    2. Two Technical Routes: Element-Wise Adaptation vs. Matrix-Level Updates

    The element-wise adaptive route treats a weight matrix as N independent scalars, estimates first- and second-order gradient statistics for each one, and decides a step size for each. Its strengths are strong anisotropic adaptation and robustness to sparsity and noise; its weakness is that state overhead scales linearly with parameter count, and the update is “shape-less” with respect to matrix structure.

    The matrix-level update route treats a layer’s weights as a single, indivisible high-dimensional geometric object. It first combines momentum and the current gradient into an “update matrix,” then orthogonalizes that matrix (in practice an iterative orthogonalization approximation is used, avoiding an expensive direct decomposition), and finally adds the resulting orthogonal matrix to the weights as a whole. Intuitively, it turns the update from “a pile of iron balls each fighting its own battle” into “a formation marching in step.”

    Orthogonalization delivers two key benefits:

    1. Lower state cost: no second moment needs to be stored per parameter—mainly one momentum buffer is kept—so optimizer state overhead is roughly halved or better, depending on whether the implementation keeps extra buffers.
    2. A more “shaped” update: orthogonalization drives the singular values of the update matrix toward uniformity, which is equivalent to spreading update energy evenly across directions and prevents a few directions from taking oversized steps and destabilizing training, significantly reducing the number of steps needed to reach the same target loss.

    Illustrative pseudocode (structure only, not a specific implementation):

    1. # g: current gradient; m: momentum buffer
    2. m = beta * m + (1 - beta) * g
    3. u = orthogonalize(m) # iterative orthogonalization approximation, outputs an approximately orthogonal matrix
    4. w = w - lr * u # added as a whole, not scaled element-wise

    3. From Toy Scale to Industrial Scale: Objections and Responses

    Methods of this kind were initially validated only on hundred-million-parameter models, and the objections were sharp: does working at small scale just mean the scale was too small to expose the problem? Is matrix orthogonalization only suited to “well-shaped” hidden layers, and does it break down on attention projections, token embeddings, and normalization parameters?

    The industrial response usually follows three lines:

    • Parameter grouping: apply matrix-level updates only to 2D hidden-layer weight matrices; keep the mature element-wise adaptive scheme for 1D parameters (biases, normalization scales), embeddings, and the output head. This controls risk and avoids forcing the method onto structures it does not fit.
    • Numerical and precision isolation: orthogonalization iterations lose orthogonality easily in low precision, so in practice that step runs in single precision while the remaining tensors stay in low precision, balancing stability and bandwidth.
    • Parallelism compatibility: orthogonalization is a local operation on a single shard matrix, so it naturally coexists with tensor, pipeline, and data parallelism; the extra care needed is momentum consistency at shard boundaries and the order of gradient reduction.

    4. The Memory Ledger: What to Do With the Space You Save

    Dropping optimizer state from two copies to one frees memory that should not sit idle but be reallocated by benefit priority:

    1. Increase micro batch size to raise per-GPU compute density and operator efficiency;
    2. Extend the context window so long samples are no longer truncated or forced to be split;
    3. Reduce parallelism degree to cut cross-GPU communication and bubbles and raise overall throughput;
    4. Raise the activation recomputation threshold, trading less recomputation for more effective compute.

    A workable evaluation order: measure baseline throughput and peak memory first, then relax the knobs above one at a time, changing a single variable each round and recording the (throughput, memory, convergence steps) triple, so that changing several variables at once does not make attribution difficult.

    5. Deployment Tuning Checklist

    • Learning rate and warmup: the effective step-size scale of matrix-level updates differs from element-wise adaptation, so redo the learning rate sweep and use longer warmup; do not reuse the old configuration.
    • Momentum coefficient: orthogonalization is more sensitive to momentum noise, so start from a conservative value and increase it.
    • Weight decay and update coupling: decay acts on the weights rather than the update matrix, so watch the ordering relative to the orthogonalization step.
    • Monitoring metrics: beyond loss and gradient norm, add “update matrix orthogonality residual” and “per-layer update norm distribution” to catch numerical degradation early.
    • Rollback mechanism: keep a switch back to the element-wise adaptive scheme, run small-scale controlled experiments early in training, and compare the steps needed to reach the target loss under the same data budget.

    6. Engineering Gains and Boundaries

    The gains are clear: lower optimizer state usage, higher batch and context limits, and fewer steps to reach the same loss—together these compress the training cycle directly. The boundaries need stating just as plainly: it is not optimal for every layer, and embeddings and the output layer are usually still dominated by the element-wise scheme; orthogonalization adds extra operators and may not pay off on small models; for extremely sparse gradients, adaptive methods still hold an advantage in robustness.

    In cloud practice, you can orchestrate training jobs with a container platform, hold checkpoints and datasets in object storage, and track throughput and memory curves with monitoring, alerting, and logging services, turning the tuning process above into a reproducible experiment pipeline. For teams that want a lower barrier to entry, Baidu AI Cloud provides general capabilities in heterogeneous compute scheduling and training observability, making it easier to bring optimizer selection into a standardized experiment comparison framework and decide with data rather than intuition.