How Orthogonalized Matrix Optimizers Cut Memory Overhead in Large-Model Training
This article explains why Adam-style optimizer states become a memory bottleneck in large-model training, how matrix-level orthogonalized updates can reduce optimizer-state storage by about half, and how Newton-Schulz iteration makes the approach practical on GPUs. It also covers parameter grouping, learning-rate tuning, distributed communication, compute trade-offs, common concerns, and an evaluation checklist for adoption.
1. Background: Why Optimizer States Become a Memory Bottleneck
Training large models typically requires GPU memory for three categories of data: model parameters, gradients, and optimizer states. Adam-style optimizers maintain two state values for every parameter: the first moment $m_t$ (a moving average of gradients) and the second moment $v_t$ (a moving average of squared gradients). These values are used to compute an adaptive step size for each parameter.
In mixed-precision training, optimizer states are usually stored in FP32, so each parameter consumes 2 × 4 = 8 bytes. For a 1.6T-parameter model (1.6 trillion parameters):
Optimizer state memory ≈ 1.6 × 10^12 parameters × 8 bytes ≈ 12.8 TB
This overhead does not include the parameters themselves or the gradients. It directly consumes memory that could otherwise be used for a larger batch size or longer context. When a single GPU cannot hold the required state, more devices must be used for parameter sharding, which increases communication and scheduling costs and raises the total training cost.
Therefore, reducing optimizer states without significantly hurting convergence can directly free up training resources. This is the starting point for re-examining optimizer design.
2. From Element-Wise Updates to Matrix-Level Updates
Adam performs updates element by element. For every scalar in a matrix, it computes an independent step size based on that scalar’s gradient history. This approach is flexible, but the cost is that every element needs its own state record.
Another approach treats a weight matrix as a single object. Most hidden layers in neural networks are two-dimensional weight matrices, and their update directions have geometric structure. Matrix-level methods focus on the following question: in which directions should this update proceed, and how should strength be allocated across those directions?
From this perspective, a momentum matrix often has a few singular values that are much larger than the others. If the momentum matrix is used directly to update parameters, the training signal concentrates in those dominant directions while updates in other directions are suppressed. Orthogonalization pulls all singular values close to 1, making update strength more balanced across directions while preserving the directional information in the gradient.
This design has two direct consequences:
- Each matrix only needs to store one momentum, rather than two states, cutting memory overhead by about half.
- Updates are performed at the matrix level, resulting in a more regular computational form that can be implemented efficiently with matrix multiplication.
It is important to note that orthogonalization is not necessarily better than Adam. It changes the geometry of the update, and its effectiveness depends on model structure, data, learning rate, and training scale.
3. Algorithm Principles and Mathematical Form
The following is a simplified form of this class of methods. Let the gradient at step $t$ be $G_t$, the momentum be $M_t$, the learning rate be $\eta$, and the momentum coefficient be $\beta$.
Step 1: Update momentum
$Mt = \beta M{t-1} + G_t$
Step 2: Orthogonalize
Compute the singular value decomposition of $M_t$: $M_t = U\Sigma V^\top$. Its orthogonal factor is $UV^\top$. The goal of orthogonalization is to obtain $O_t = UV^\top$, which preserves the left and right singular vectors of $M_t$ and replaces all non-zero singular values with 1.
Step 3: Update parameters
$Wt = W{t-1} - \eta\, O_t$
In practice, performing SVD directly on the matrix is expensive. Implementations commonly use Newton-Schulz iteration to approximate the orthogonal factor. This iteration requires only matrix multiplication and is suitable for execution on GPUs.
Newton-Schulz Iteration Example
The following code demonstrates the basic flow for approximating orthogonalization. The coefficients come from common implementations of this class of methods; the number of iterations and numerical precision can be adjusted as needed.
import torchdef newton_schulz(G: torch.Tensor, steps: int = 5, eps: float = 1e-7) -> torch.Tensor:"""Approximate the orthogonal factor UV^T of a matrix using Newton-Schulz iteration."""a, b, c = 3.4445, -4.7750, 2.0315X = G / (G.norm() + eps) # Normalize so singular values fall within the convergence rangetransposed = X.size(0) > X.size(1)if transposed:X = X.T # Standardize to a form where rows do not exceed columnsfor _ in range(steps):A = X @ X.TB = b * A + c * (A @ A)X = a * X + B @ Xif transposed:X = X.Treturn X
Single-Matrix Update Example
@torch.no_grad()def orthogonal_step(weight: torch.Tensor,grad: torch.Tensor,momentum: torch.Tensor,lr: float = 0.02,beta: float = 0.95) -> None:momentum.mul_(beta).add_(grad) # Maintain only one stateupdate = newton_schulz(momentum) # Matrix-level orthogonalizationweight.add_(update, alpha=-lr) # Update the entire matrix at once
Comparison of state usage between the two approaches:
| Item | Adam-style method | Orthogonalized matrix method |
|---|---|---|
| States per parameter | 2 (first moment, second moment) | 1 (momentum) |
| State bytes per parameter (FP32) | 8 | 4 |
| Additional computation | Element-wise operations | Multiple matrix multiplications (Newton-Schulz) |
| Applicable parameters | All parameters | Usually only 2D hidden-layer weights |
4. Key Engineering Considerations
4.1 Parameter Grouping
Orthogonalization relies on matrix structure, so it is only suitable for two-dimensional weights. Parameters in embedding layers, output heads, bias terms, and normalization layers usually still use Adam-style methods. In practice, parameters need to be grouped by shape and purpose, with separate optimizer and learning-rate configurations.
matrix_params = [p for n, p in model.named_parameters()if p.ndim == 2 and "embed" not in n and "head" not in n]other_params = [p for n, p in model.named_parameters()if not (p.ndim == 2 and "embed" not in n and "head" not in n)]
Grouping rules need to be determined based on the specific model structure; the example above is illustrative only.
4.2 Learning Rate and Hyperparameters
The update scale after orthogonalization differs from Adam, so existing learning rates usually cannot be reused directly. It is advisable to treat the learning rate as an independent hyperparameter and search for it again, while monitoring both the loss curve and gradient norms to confirm training stability.
4.3 Communication Overhead in Distributed Training
Orthogonalization requires the complete matrix for computation. If weights are sharded across multiple devices, additional aggregation or distributed iteration steps are needed, which introduces extra communication. When designing the system, it is necessary to evaluate where orthogonalization should be executed and whether distributed approximation should be performed after sharding, based on communication bandwidth and parallelism strategy.
4.4 Computational Overhead
Newton-Schulz iteration performs several matrix multiplications at every training step. This increases per-step computation, but the memory saved may allow a larger batch size, which can offset part of the cost. The final effect must be measured using actual throughput and total training time, rather than per-step latency alone.
5. How to View Concerns About This Approach
Since this class of methods appeared, people have asked: “Does forcing update directions into a more uniform form lose useful information?” This concern has a real basis and should not be dismissed lightly.
The concerns mainly focus on three points:
- Early validation was at a smaller scale. The method was initially validated on smaller models, and whether it maintains its advantages in large-scale training needs to be tested separately.
- The theoretical explanation is incomplete. Understanding of why orthogonalization works is still developing, and most conclusions come from experimental observations.
- Results depend on configuration. Model structure, learning-rate schedule, batch size, and parameter grouping all affect the outcome, so conclusions from other settings cannot be applied blindly.
A reasonable attitude is therefore to treat it as a validated optional approach and run controlled experiments on your own task, rather than replacing the existing optimizer by default.
6. Evaluation Checklist Before Adoption
Before adopting it in production, consider the following steps:
- Run small-scale ablation experiments. Fix the data, model, and random seeds, replace only the optimizer, and compare how loss changes with training steps.
- Record peak memory at the same time. Observe the memory saved by optimizer states and confirm whether it can be translated into a larger batch size or context length.
- Compare wall-clock time. Measure per-step latency, communication time, and total training duration together to calculate the real cost-benefit trade-off.
- Test stability. Repeat experiments under multiple random seeds and learning rates, and watch for gradient explosion or loss oscillation.
- Scale up gradually. Validate at medium scale first, then move to the target scale, comparing against the baseline at every step.
7. Summary
The memory overhead of Adam-style optimizers comes from maintaining two states per parameter, which becomes a clear resource pressure in very large models. Orthogonalized methods that update a matrix as a whole require only one momentum per matrix and use matrix-level operations to adjust update directions. Their benefit comes from memory savings and a changed update structure; the cost is additional computation, grouping configuration, and distributed communication complexity.
Whether to adopt the approach should be based on controlled experiments with your own model structure and training scale, using data such as loss, memory usage, throughput, and total training time.
