How New-Generation Open-Source LLMs Solve the GPU Memory Bottleneck with a Matrix-Based Optimizer

    Training trillion-parameter open-source models demands rethinking every component of the training stack—including the optimizer. This article explains how new-generation open-source LLMs replace the long-dominant Adam-style adaptive optimizers with a matrix-based optimizer (Muon-type methods) that halves optimizer state memory, and why this seemingly simple change unlocks larger batch sizes, longer context windows, and lower overall training costs. Readers will learn where Adam's memory overhead comes from, how orthogonalized gradient updates work, and what engineering considerations matter when adopting this approach at industrial scale.

    How New-Generation Open-Source LLMs Solve the GPU Memory Bottleneck with a Matrix-Based Optimizer

    Background: The Training Challenge of the Trillion-Parameter Era

    In recent years, the open-source large language model community has produced increasingly heavyweight models with parameter counts approaching or exceeding the trillion scale. These models not only feature evolving architectures—such as Mixture-of-Experts and Multi-head Latent Attention—but also introduce training engineering decisions worth studying in depth. Among the most notable: large-scale adoption of a new matrix-based optimizer in industrial-scale training, replacing the traditional adaptive optimizers that have dominated deep learning for nearly a decade.

    This decision is far more than a gimmick—it directly targets the most critical pain point of large model training: GPU memory cost. To understand its value, we need to return to the root of the problem: where exactly does the memory cost of traditional optimizers come from?

    The Memory Dilemma of Traditional Adaptive Optimizers

    For a long time, Adam and its variants (such as AdamW) have been the de facto default for large model training. By maintaining a first-moment estimate (m_t, the exponential moving average of gradients) and a second-moment estimate (v_t, the exponential moving average of squared gradients), they provide adaptive per-parameter learning-rate scaling with fast convergence and strong robustness.

    But this “adaptivity” comes at a price. For a model with N parameters, the extra optimizer state that must be maintained during training is:

    1. Total optimizer state = first moment m_t (N) + second moment v_t (N) = 2N

    Let’s do the math for a 1.6-trillion (1.6T) parameter model:

    • In mixed-precision training, optimizer state is typically stored in FP32 (4 bytes);
    • Optimizer state alone requires 2 × 1.6T × 4B ≈ 12.8 TB of memory;
    • Add the FP32 master weights, FP16 model weights and gradients, activations, and more, and total memory demand easily exceeds dozens of terabytes.

    This means that even with thousands of high-end accelerator cards, the majority of GPU memory is consumed by optimizer state. The direct consequences are:

    1. Batch size is severely compressed, hurting throughput and convergence stability;
    2. Context length cannot be scaled up, as long-sequence training is crowded out of the memory budget;
    3. Total training cost rises non-linearly, since more communication and parallel partitioning are needed to distribute memory pressure, adding engineering complexity.

    In the trillion-parameter era, optimizer state has evolved from “an implementation detail” into a critical bottleneck that determines training feasibility.

    The Core Idea of the New Matrix-Based Optimizer

    Against this backdrop, the new matrix-based optimizer (often referred to as Muon-type methods) has entered industrial-scale use. Its core idea can be summarized in two aspects:

    1. Orthogonalizing the Gradient Matrix

    Unlike element-wise adaptive scaling, this type of optimizer treats each layer’s parameters as a two-dimensional matrix and applies approximate orthogonalization to the momentum-accumulated gradient matrix (typically via Newton-Schulz iteration), making the update directions more “well-conditioned” in matrix space. The pseudocode logic is as follows:

    1. def muon_update(param, grad, momentum_buf, lr):
    2. # 1. Momentum accumulation (only one state buffer needed)
    3. momentum_buf.mul_(beta).add_(grad)
    4. g = momentum_buf
    5. # 2. Approximate orthogonalization of the gradient matrix (Newton-Schulz iteration)
    6. g = newton_schulz_orthogonalize(g)
    7. # 3. Update parameters along the scaled orthogonalized direction
    8. param.add_(g, alpha=-lr * scale)

    2. Halving the Optimizer State

    This is the most critical engineering benefit: this type of optimizer only needs to maintain a single momentum buffer, eliminating the per-parameter second-moment statistics. In other words:

    1. Total optimizer state = momentum (N), instead of 2N

    For a 1.6T-parameter model, this alone saves more than roughly 6 TB of memory. The freed-up memory can be reinvested into:

    • Larger batch sizes, improving data-parallel efficiency and gradient estimation quality;
    • Longer context windows, supporting long-sequence capability training;
    • Less gradient checkpointing recomputation, reducing compute overhead.

    Key Engineering Considerations in Practice

    Applying the new optimizer to industrial-scale training is not as simple as swapping one line of code—it requires supporting engineering practices:

    1. Scoping its applicability: The optimizer is mainly suited to the 2D matrix parameters of hidden layers. For embedding layers, output layers, and scalar parameters (such as biases and normalization coefficients), a traditional adaptive optimizer is still used in a hybrid “dual-optimizer” strategy.
    2. Communication design under distributed parallelism: The orthogonalization iteration operates on complete matrices. Under tensor parallelism and pipeline parallelism, corresponding aggregation communication logic must be designed to prevent sharding from degrading iteration accuracy.
    3. Learning-rate scheduling and hyperparameter transfer: After orthogonalization, the update magnitude scale depends on parameter shape, so scaling must be adjusted by matrix dimensions. Hyperparameter values cannot simply be copied from traditional settings.
    4. Numerical stability validation: In large-scale, long-duration training runs, the quality of update orthogonality and the shape of loss curves must be continuously monitored to prevent divergence.

    From Memory Savings to Capability Gains: The Cascade of Benefits

    This optimizer change ultimately creates a positive feedback loop:

    • Memory savings → larger batches and longer sequences → more information per training step;
    • Lower communication and recomputation overhead → higher effective training throughput (MFU);
    • With the same compute budget, more tokens can be trained and longer-context capabilities explored → the model’s overall capability boundary expands.

    For teams looking to reproduce or fine-tune such large models, infrastructure support matters as well. General-purpose offerings such as container platforms, object storage, and monitoring and alerting services from cloud providers can support the orchestration of large-scale distributed training jobs, management of massive training datasets, and observation of cluster health—letting engineering teams focus on algorithms and training strategy rather than low-level operational details.

    Conclusion

    The new generation of open-source trillion-parameter models has drawn wide attention not only for its architecture and capabilities, but also for its demonstration value in training engineering: it proves that a matrix-based optimizer can reliably replace traditional solutions at industrial scale, and that the simple trick of “halving optimizer state” can drive systematic improvements in batch size, context length, and training cost. For LLM training engineers, optimizer selection is no longer a negligible default—it is a strategic decision worth re-examining before every large-scale training run.