Abstract
Fine-tuning large foundation models presents significant memory challenges due to stateful optimizers like AdamW, often requiring several times more GPU memory than inference. While memory-efficient methods like parameter-efficient fine-tuning (e.g., LoRA) and optimizer state compression exist, recent approaches like GaLore bridge these by using low-rank gradient projections and subspace moment accumulation. However, such methods may struggle with fixed subspaces or computationally costly offline resampling (e.g., requiring full-matrix SVDs). We propose Momentum Factorized SGD (MoFaSGD), which maintains a dynamically updated low-rank SVD representation of the first-order momentum, closely approximating its full-rank counterpart throughout training. This factorization enables a memory-efficient fine-tuning method that adaptively updates the optimization subspace at each iteration. Crucially, MoFaSGD leverages the computed low-rank momentum factors to perform efficient spectrally normalized updates, offering an alternative to subspace moment accumulation. We establish theoretical convergence guarantees for MoFaSGD, proving it achieves an optimal rate for non-convex stochastic optimization under standard assumptions. Empirically, we demonstrate MoFaSGD's effectiveness on large language model alignment benchmarks, achieving a competitive trade-off between memory reduction (comparable to LoRA) and performance compared to state-of-the-art low-rank optimization methods.
Introduction
Training and fine-tuning Large Language Models (LLMs) is notoriously memory-intensive. A significant portion of this "memory tax" stems from stateful optimizers like AdamW, which must store momentum terms for every parameter. Existing solutions like Parameter-Efficient Fine-Tuning (PEFT/LoRA) reduce memory by training fewer parameters, but can limit learning capacity. Subspace optimization methods like GaLore offer full-parameter updates in a low-rank space but often rely on infrequent, costly full-SVD updates that lead to "stale" optimization states and training instability.
MoFaSGD (Momentum Factorized SGD) addresses these challenges by updating the optimization subspace at every iteration without the massive computational overhead of a full SVD, effectively acting as a memory-efficient version of high-performance optimizers like Muon.
Methodology
MoFaSGD maintains a dynamic low-rank SVD representation ($U, \Sigma, V$) of the first-order momentum ($M_t$). Instead of periodic full-SVDs, it utilizes a tangent space projection to update these factors at every step. This mathematical approach allows the optimizer to track the most important directions of gradient flow with a computational cost of only $O((m+n)r^2)$, which is negligible compared to the overall training step.
Inspired by the Muon optimizer, MoFaSGD performs spectrally normalized updates ($W \leftarrow W - \eta UV^\top$), providing a form of "gradient whitening" that accelerates convergence. To maximize memory savings, the implementation uses fused backward hooks to project and clear gradients immediately during backpropagation, preventing the GPU from storing full-rank gradient buffers.
Experiments and Results
The researchers evaluated MoFaSGD across three regimes: NanoGPT pre-training on FineWeb, RoBERTa-Base fine-tuning on GLUE, and LLaMA-3.1 8B instruction tuning on Tulu3-SFT.
- Memory Efficiency: For LLaMA-3.1 8B, MoFaSGD required only 29.4 GB of GPU memory, compared to 70.8 GB for AdamW and 33.6 GB for LoRA. This efficiency is achieved by eliminating second-moment buffers and adapter overhead.
- Superior Convergence: In pre-training tasks, MoFaSGD consistently achieved lower validation perplexity than GaLore across various ranks.
- Instruction Tuning: On the Tulu3 benchmark, MoFaSGD outperformed both GaLore (+0.8% average) and LoRA (+2.3% average) across major evaluation metrics like MMLU and GSM8K.
- Throughput: Despite per-step SVD updates, MoFaSGD reached 4206 tokens/sec, significantly outperforming non-fused GaLore (3214 tokens/sec) and approaching LoRA's speed.
Key Insights and Discussion
Empirical analysis shows that momentum in LLMs is naturally low-rank; for LLaMA-3.1 8B, the top-32 singular values capture approximately 80% of the momentum's energy. MoFaSGD avoids the "staleness trap" of infrequent subspace updates by maintaining a more accurate trajectory through iteration-wise updates. Effectively, MoFaSGD bridges the gap between the high-performance update rules of Muon and the minimal memory footprint of LoRA.
Limitations and Future Work
While MoFaSGD outperforms other low-rank methods, a small performance gap (-4.2% on Tulu3) remains compared to full-rank AdamW, likely due to the loss of subtle, high-rank parameter updates. Future research directions include adaptive rank selection to allocate more capacity to critical layers and further empirical validation of the underlying theoretical assumptions, such as nuclear-norm smoothness.
Summary updated