TL;DR
Training Large Language Models (LLMs) is notoriously memory-intensive, largely due to the massive footprint of optimizer states. This paper introduces Online Subspace Descent (OSD), a novel method that replaces expensive Singular Value Decomposition (SVD) with continuous online PCA to project gradients into low-rank subspaces. OSD not only provides the first theoretical convergence guarantees for this class of optimizers but also outperforms state-of-the-art methods like GaLore in both training speed and final model performance.
The Memory Bottleneck in LLM Training
When training an LLM with standard optimizers like Adam, the "optimizer states" (the moving averages of gradients and their squares) can consume significantly more memory than the model weights themselves. To solve this, researchers have increasingly turned to subspace descent: projecting these states into a lower-dimensional (low-rank) space to save memory.
Current state-of-the-art methods, such as GaLore, rely on periodic SVD to find these low-rank subspaces. However, SVD is a "stop-the-world" operation that becomes a massive computational bottleneck as models scale. Furthermore, there has been a lack of rigorous theoretical proof that these moving-subspace methods actually converge on the complex, non-convex landscapes of neural networks.
A Two-Pronged Solution: Theory and Online PCA
The authors propose a comprehensive solution featuring a new theoretical framework and a highly efficient algorithm.
- The Hamiltonian + Descent Framework: The authors use a continuous-time ODE approach to prove convergence. They show that if an optimizer can be viewed through the lens of "Hamiltonian Descent" (which includes Adam, LION, and Momentum), it will converge even if the projection matrix is updated using arbitrary rules. This is possible because of the adjoint property of projection matrices, which cancels out complex interactions between the changing subspace and the optimizer's internal "inertia" (momentum).
- Online Subspace Descent (OSD): Instead of pausing training to compute an exact SVD, OSD updates the projection matrix continuously using online PCA. In every training step, a single optimization step is performed on a PCA objective function. This allows the subspace to evolve smoothly alongside the model weights.
Key Insights and Results
The researchers evaluated OSD by pretraining LLaMA models ranging from 60M to 7B parameters on the C4 (Common Crawl) dataset, measuring perplexity and downstream performance on the GLUE benchmark.
Superior Model Performance
Because SVD only looks at a single mini-batch every $T$ steps, it acts as a delayed snapshot. Online PCA, however, incorporates gradient information from every step, allowing the subspace to adapt more accurately to the "gradient landscape" as training progresses.
On a LLaMA 1B model, OSD achieved a perplexity of 31.30, significantly lower than GaLore's 35.52, successfully narrowing the gap with full-rank training (29.40).
Massive Computational Speedup
Because the online PCA update is just another gradient-based step, it can be executed in parallel with the main weight updates. This makes the "projection" cost almost zero in terms of wall-clock time.
Online PCA proved to be up to 142x faster than torch.svd for the matrix sizes typical in 7B-parameter models. For 7B model pretraining overall, OSD was 1.3x faster than GaLore (7.14 hours vs. 9.74 hours for 10k steps) while achieving better perplexity.
Furthermore, OSD outperformed GaLore on the GLUE benchmark average (0.4951 vs 0.4862), demonstrating that these aggressive memory and compute savings do not come at the cost of general reasoning capabilities.
Limitations and Future Work
While highly effective, OSD introduces a new hyperparameter $\alpha$ (the relative learning rate of the projection matrix). The authors suggest $\alpha=5$ as a strong heuristic, but optimal values might vary for different architectures. Additionally, while weight decay was added as a practical heuristic, its formal impact on the convergence of Dynamic Subspace Descent warrants further theoretical study.
Future research could explore if OSD's memory-efficient framework translates well to other domains like computer vision or more complex architectures like Mixture-of-Experts (MoE).
Summary updated