Large Model Training Optimization: Memory Costs and Matrix Update Strategies

    This article examines how optimizer state affects memory cost in very large model training and how matrix-orthogonalized momentum differs from element-wise adaptive methods. It covers optimizer state storage estimates, sharding trade-offs, SVD-based update intuition, mixed optimization, distributed and numerical constraints, and a practical evaluation process based on target quality, total cost, peak memory, and reliability.

    Large Model Training Optimization: Memory Costs and Matrix Update Strategies

    1. Why Large Model Advantages Start with Training System Costs

    A large model’s technical advantage cannot be judged only by parameter scale, whether weights are open, or which algorithm is used in one training stage. The more valuable question is whether, under the same resource constraints, the system can reach target quality at lower cost while remaining stable, reproducible, and maintainable.

    The optimizer is an important part of this problem. It determines how parameters are updated from gradients, directly affecting convergence speed. It also consumes memory, introduces compute overhead, and couples with the distributed training architecture.

    For very large models, even a few extra bytes of state per parameter can aggregate into trillions of bytes of storage demand. Optimizer improvements therefore have strong engineering value. However, “fewer states,” “more complex update rules,” and “cheaper training” are three different claims and must be verified separately.

    This article focuses on two general directions: element-wise adaptive moment estimation methods that adjust scale per element, and methods that approximately orthogonalize the momentum matrix of two-dimensional weights. The latter offers an update perspective different from element-wise scaling, but it does not mean the former has lost its value.

    2. Why Adaptive Optimizers Consume Large Amounts of Memory

    2.1 Beyond Parameters: Historical Statistics Must Also Be Stored

    Common adaptive moment estimation methods maintain two types of state for each parameter: the first moment of gradients and the second moment of squared gradients. A simplified form can be written as:

    mt = β₁m{t-1} + (1 - β₁)g_t

    vt = β₂v{t-1} + (1 - β₂)g_t²

    Here, g_t is the current gradient, m_t smooths the gradient direction, and v_t estimates gradient scale at different parameter positions. Practical updates also usually include bias correction, a numerical stability term, and weight decay handling chosen by the specific implementation.

    The advantage of this mechanism is broad applicability and the ability to apply different effective update magnitudes at different parameter positions. The cost is that, in addition to parameters and gradients, two states close to the parameter scale must be stored.

    2.2 Mixed Precision Does Not Mean All States Are Low Precision

    Mixed-precision training usually uses lower precision for some computations and tensors, but optimizer states may still use higher precision to reduce numerical errors from long-term accumulation. Some implementations also keep a high-precision master copy of parameters.

    Assume the total number of parameters is P, and both optimizer states use 4-byte floating-point numbers. The state storage is approximately:

    optimizer state bytes ≈ P × 2 × 4

    For a hypothetical model with one trillion parameters, the two states total about eight trillion bytes, or about 8 TB in decimal units. This is only optimizer state. It does not include weights, gradients, activations, communication buffers, or temporary compute space.

    Such estimates are useful for understanding magnitude, not for treating as the actual memory requirement of a specific model. Real usage also depends on parameter sharding, state precision, memory offloading, and training framework implementation.

    2.3 Cluster Totals and Per-Device Usage Are Different Questions

    Optimizer state can usually be sharded across many devices. Therefore, “how much storage the cluster needs in total” and “whether a single device can hold it” are not the same question.

    Sharding does not eliminate cost; it redistributes cost. It may introduce additional communication, parameter aggregation, and scheduling overhead. Moving state to host memory or another storage tier is also limited by bandwidth and data movement latency.

    At the same time, memory pressure should not be described simply as training cost necessarily growing exponentially. A more accurate statement is that when memory demand crosses device capacity or system bandwidth thresholds, the training plan may be forced to use more recomputation, communication, and offloading, causing a clear efficiency drop.

    3. What Matrix-Orthogonalized Momentum Changes

    3.1 From Element-Wise Scaling to Matrix-Structure Processing

    In neural networks, many linear-layer weights are naturally two-dimensional matrices. For such parameters, observing gradients only element by element may not fully exploit the overall structural information of the matrix.

    Matrix-orthogonalized momentum methods usually first smooth gradients with momentum to obtain an update matrix, then adjust its singular-value structure through matrix transformations to form a new update direction.

    The idea is not to turn the parameters themselves into orthogonal matrices, nor to make all parameters update by the same value. Instead, it applies structured processing to the update matrix so that some directions no longer derive update strength only from the original singular-value magnitudes.

    3.2 Understanding Update Directions with Singular Value Decomposition

    Let the momentum matrix be M. Its singular value decomposition can be written as:

    M = UΣVᵀ

    An idealized orthogonalized update direction can be expressed as:

    Q = UVᵀ

    Intuitively, this step preserves relevant direction information while adjusting singular-value scale. For rectangular matrices, usually only one side, either rows or columns, can satisfy the orthogonality property. It should not be loosely called an “orthogonal matrix” with both sides orthogonal at the same time.

    Practical training generally does not perform a full singular value decomposition at every step, because the cost may be too high. Engineering implementations can use iterative approximations, trading matrix multiplications for acceptable approximate results.

    Therefore, this direction is not “compute-free.” It replaces part of the element-wise statistics and scaling with matrix-level transformations. Its efficiency depends on matrix shape, iteration count, computational precision, and hardware execution efficiency.

    3.3 Memory Savings Come from State Configuration, Not the Matrix Form Itself

    One misunderstanding to clarify is that updating the whole matrix together will naturally reduce memory.

    In practice, both element-wise updates and matrix updates can usually be completed through parallel tensor operations. Whether memory is saved mainly depends on which long-term states the algorithm needs to store.

    If a matrix update scheme stores only one momentum state, while a comparison scheme stores first and second moments, the former may reduce part of the persistent state storage. However, matrix transformations also use temporary workspace, and some parameters may still need to be handled by other optimizers.

    Therefore, both the optimizer’s persistent state size and the training process’s peak memory should be reported. Final benefits cannot be inferred from the number of states alone.

    4. Potential Advantages of These Methods

    4.1 Freeing Space for Capacity-Constrained Training Systems

    After reducing persistent optimizer state, the freed space may be used to increase micro-batch size, increase sequence length, or reduce dependence on offloading and recomputation.

    However, the benefit depends on the original bottleneck. If training is mainly limited by long-sequence activations rather than optimizer state, reducing state may not significantly lower peak memory.

    4.2 Improving Update Behavior for Some Matrix Parameters

    Processing the singular-value structure of the update matrix may improve how some parameters learn across different directions. For weights with clear matrix structure, this provides an optimization direction different from element-wise adaptivity.

    However, this is an effect that requires experimental validation. It cannot directly lead to claims that “all models converge faster” or “training steps will necessarily decrease.” Model architecture, data distribution, training stage, and hyperparameters all affect the result.

    4.3 Creating a New Compute-Storage Trade-Off

    When devices are good at matrix operations but available memory is tight, exchanging additional matrix computation for fewer persistent states may be attractive.

    Conversely, if the computation and communication added by matrix transformations offset convergence gains, step time becomes longer and the total time to reach target quality may still increase.

    The metric that truly matters is “total cost required to reach target quality,” not isolated throughput per second or training step count.

    5. What Must Be Addressed When Moving from Small Experiments to Industrial Training

    5.1 Parameter Types Are Not Uniform

    Large models contain not only two-dimensional linear-layer weights, but also embedding parameters, normalization parameters, biases, and other tensors of different shapes.

    Therefore, a more reasonable engineering path is often mixed optimization: use structured updates for weights suitable for matrix transformations, and keep mature update strategies for other parameters.

    Parameter grouping should be based on mathematical structure and experimental results, not simply on names or sizes.

    5.2 Sharding Layout Affects Matrix Transformations

    When a complete weight matrix is split across multiple devices, matrix-level processing faces new questions: should computation be performed on local shards, or should more complete matrix information be gathered first?

    The two approaches have different communication costs and may also have different mathematical meanings. In general, independent transformations on shards are not equivalent to transformations on the complete matrix.

    Therefore, an industrial implementation must clarify how the matrix is sharded, what communication the computation requires, and whether the original update rule is changed.

    5.3 Numerical Stability Requires Dedicated Design

    Approximate orthogonalization computations may involve matrix normalization, a limited number of iterations, and low-precision multiplication. Input scale, matrix conditioning, iteration error, and other factors can all affect update quality.

    Engineering practice should monitor gradient norms, update norms, abnormal values, and loss spikes, and apply gradient clipping, higher precision for critical computations, or adjusted iteration strategies when necessary.

    These measures should be determined experimentally rather than by applying unverified fixed configurations.

    6. How to Build a Credible Evaluation Process

    First, establish a mature baseline. Fix the model architecture, training data, effective batch size, sequence length, and training budget, and record data loading and communication overhead.

    Second, profile memory composition. Measure parameters, gradients, optimizer states, activations, and temporary buffers separately to confirm where the main bottleneck is.

    Third, perform small-scale hyperparameter search. Compare learning rate, momentum, weight decay, and matrix transformation settings, and avoid drawing conclusions from only one configuration. Different optimizers should not be forced to share exactly the same hyperparameters.

    Fourth, compare the cost of reaching the same quality. Record validation loss, task performance, step time, peak memory, and cumulative compute resource consumption together. Fewer steps with slower step time may not be cheaper.

    Fifth, scale up experiments progressively. As scale increases, recheck communication ratios, numerical stability, and convergence trends. Results on small models cannot be directly extrapolated to very large models.

    Sixth, verify operational reliability. Check checkpoint saving, state restoration, long-running operation, and exception handling. An optimizer must not only be efficient on the normal path, but also support reliable recovery.

    7. Conclusion: Optimizer Advantages Must Be Reflected in System Metrics

    Matrix-orthogonalized momentum represents a structured update direction worth studying: it does not focus only on individual parameter positions, but attempts to use the overall geometric information of two-dimensional weights. Under suitable parameter types and system configurations, such methods may reduce optimizer state overhead and improve training efficiency.

    However, “matrix updates” cannot be directly equated with “lower memory usage,” nor should convergence gains in small-scale experiments be treated as an inevitable result in industrial training. Final performance is determined jointly by model architecture, state precision, distributed layout, temporary space, and communication efficiency.

    For developers and enterprise teams, the most reliable path is to first locate the bottleneck, then perform parameter grouping and mixed optimization, and finally judge by target quality, total training time, peak memory, and operational reliability. Only when these metrics improve together does an algorithmic innovation truly become a sustainable engineering advantage.