Trillion-Parameter Open-Source LLMs: The Unique Advantages of Orthogonal Optimizers

    As large language models scale to trillions of parameters, traditional adaptive optimizers like Adam have become a primary bottleneck in GPU memory budgets. This article explores the matrix-level orthogonal optimization method, detailing its core principles, memory savings, trade-offs, and key engineering challenges for industrial-scale deployment. By reducing optimizer states and balancing the spectral properties of weight updates, this approach offers a compelling alternative for memory-constrained, large-scale model training.

    1. When Optimizers Become the Primary Training Cost

    For a long time, the choice of optimizer for training large models was almost a single answer: Adaptive Moment Estimation (commonly known as Adam and its variants). With its element-wise adaptive capabilities, it delivers relatively stable performance for sparse gradients, parameters of different scales, and varying layer sensitivities. In terms of engineering, it is “ready to use out of the box.”

    However, when parameter scales cross into the hundreds of billions and trillions, the role of the optimizer changes. It is no longer just a numerical update rule; it becomes one of the largest fixed expenditure items on the memory budget. A recent team that open-sourced a trillion-parameter ultra-large model switched the optimizer from Adaptive Moment Estimation to a matrix-level orthogonalization method, directly reflecting this shift.

    2. The Memory Ledger: Why Adaptive Moment Estimation is Expensive

    The core cost of Adaptive Moment Estimation comes from its “states.” To maintain the first and second moments for each parameter, mixed-precision training typically requires:

    Item Precision Bytes per parameter Estimation for 1.6T params
    Weights (compute copy) bf16 2 ≈3.2 TB
    Gradients bf16 2 ≈3.2 TB
    Master weight copy fp32 4 ≈6.4 TB
    First moment (m) fp32 4 ≈6.4 TB
    Second moment (v) fp32 4 ≈6.4 TB

    Just the two moment states consume about 12.8 TB of memory, not counting activations, communication buffers, and fragmentation. The consequences are cascading:

    • Batch size compression: Global batch size cannot scale up, leading to larger gradient noise and jittery convergence curves.
    • Context length limitations: Activations grow with sequence length, competing for the same memory budget as the optimizer states.
    • Passive increase in parallelism: To fit the states, the model must be partitioned into more pieces, increasing communication overhead and lowering Model Flops Utilization (MFU).
    • Non-linear cost amplification: Adding more GPUs brings not only linear costs but also synchronization and fault recovery overhead.

    This is the motivation for matrix-level optimizers: rather than making adaptive methods cheaper, it switches to an update paradigm with “fewer states.”

    3. Principle: From Element-wise to Global Matrix Optimization

    The worldview of Adaptive Moment Estimation is element-wise—each scalar in the matrix independently estimates its own gradient scale and steps independently. The worldview of the matrix-level orthogonalization method is geometric: an m×n weight matrix is an indivisible high-dimensional linear mapping that should be updated as a whole.

    The process involves three steps:

    1. Maintain only a single momentum matrix (instead of two moments).
    2. Perform approximate orthogonalization on the momentum matrix so that all its singular values approach the same magnitude.
    3. Apply the orthogonalized matrix to the weights at once using a unified learning rate.
    1. # Pseudocode: Matrix-level orthogonalization update (Newton-Schulz approximation iteration)
    2. function orthogonalize(G, steps = 5):
    3. X = G / (frobenius_norm(G) + eps) # Normalize to ensure iteration falls within convergence domain
    4. for i in 1..steps:
    5. A = X * transpose(X)
    6. B = A * A
    7. X = a*X + b*(A*X) + c*(B*X) # Quintic polynomial, odd powers preserve signs
    8. return X
    9. function step(W, G, state):
    10. M = beta * state.M + (1 - beta) * G # Only one momentum state
    11. U = orthogonalize(M)
    12. W = W - lr * (U + weight_decay * W)
    13. state.M = M

    Geometrically, orthogonalization “flattens” the spectrum of the update matrix. Originally, some directions received almost no updates due to extremely small singular values, while others were over-amplified. After orthogonalization, all directions receive displacements of consistent magnitude, significantly improving the condition number of the matrix. This is why it can reach the target loss in fewer steps.

    A rough but useful analogy: element-wise adaptation is like letting each soldier judge the road conditions and decide their own step length—flexible but chaotic in formation. The matrix-level method aligns the formation first and then advances with a unified pace, resulting in lower command overhead and consistent direction. The analogy is only for building intuition; the real differences lie in spectral properties and state overhead.

    4. Calculating Benefits and Costs Together

    Benefits

    • Optimizer states are reduced from two to one, nearly halving memory usage.
    • The spectral norm of the update is controlled, making the learning rate insensitive to the gradient scale, resulting in more stable hyperparameter tuning and transfer.
    • The number of steps required to reach the same target loss decreases, potentially resulting in shorter end-to-end wall-clock time.

    Costs

    • Orthogonalization iterations introduce additional matrix multiplications, which is a trade-off of “using compute for memory and steps.”
    • Requires fp32/bf16 mixing and numerical stability handling; normalization and the number of iteration steps are sensitive parameters.
    • Not applicable to all weights; a parameter grouping strategy is required.

    5. Key Engineering Challenges for Industrial Deployment

    Early methods of this kind were only validated on small models at the 120-million parameter level. Therefore, there is a gap between “lab feasibility” and “trillion-parameter usability” involving several engineering hurdles:

    1. Parameter grouping: Orthogonalization is typically applied only to 2D weight matrices in hidden layers. Embedding layers, output heads, normalization layers, and biases are still handled by Adaptive Moment Estimation methods, forming a hybrid optimizer.
    2. Distributed partitioning: After matrices are split by tensor parallelism or pipeline parallelism, orthogonalization requires a full matrix view, involving additional aggregation and redistribution. Communication scheduling must overlap with computation.
    3. Precision strategy: Matrix multiplication during iterations is sensitive to precision. A common practice is to use low precision for computation and high precision for accumulation and states.
    4. Hyperparameter consistency: Learning rate, momentum coefficient, weight decay, and iteration steps need joint tuning and scaling validation with batch size and sequence length.
    5. Observability: Gradient spectrum, update spectral norm, and state memory usage must be monitored to distinguish between “method ineffectiveness” and “implementation bugs.”

    Deployment checklist:

    • Is orthogonalization enabled only for 2D hidden layer weights, with other parameters going through the adaptive path?
    • Has the additional compute overhead per step been factored into the MFU baseline?
    • Have the orthogonalization iteration steps and normalization passed numerical stability tests?
    • Is the communication volume under parallel partitioning masked by computation?
    • Has loss curve alignment been validated at small-to-medium scales before scaling up?
    • Have the memory savings truly translated into larger batch sizes or longer context lengths?

    6. Cloud Engineering Infrastructure

    Regardless of the optimizer used, large-scale training requires a supporting engineering foundation: container platforms to host elastic training clusters with self-healing capabilities, object storage to save checkpoints and datasets, logging services to consolidate training logs, and monitoring/alerting to track memory, throughput, and loss anomalies. Baidu AI Cloud provides standardized products in these general capability categories, allowing teams to focus their efforts on optimizers and parallelization strategies rather than infrastructure maintenance.

    7. Conclusion

    The value of the matrix-level orthogonalization optimizer lies not in “smarter adaptation,” but in two quantifiable structural changes: the memory dividend from halved states, and the step reduction from spectral balancing. It is not a universally applicable replacement; the additional compute overhead, parameter grouping, and distributed implementation complexity are real costs. For large-scale training tasks currently bottlenecked by memory budgets restricting batch size and context length, it is worth adding to the candidate list for small-scale alignment validation. For small and medium-sized models, the benefits are usually insufficient to cover the engineering complexity.