Abstract
Training Large Language Models (LLMs) is constrained by a "memory wall," primarily due to the massive optimizer states required by algorithms like Adam. This paper establishes a formal mathematical duality between two prominent memory-efficient training paradigms: gradient projection methods (e.g., GaLore) and adapter-based methods (e.g., LoRA). By proving that applying a linear transformation to a gradient is equivalent to reparameterizing the model with a linear adapter, the authors unify these approaches. This theoretical insight leads to the discovery that computationally expensive Singular Value Decomposition (SVD) can be replaced by simple random sketching without loss in performance, and suggests new strategies for distributed training.
Introduction
The memory requirements for training LLMs often exceed the capacity of modern hardware. Beyond model weights, optimizer states can consume up to four times the memory of the model itself. To mitigate this, researchers have historically pursued two distinct paths:
- Adapters (e.g., LoRA): Injecting small, trainable low-rank matrices into a frozen base model.
- Gradient Compression (e.g., GaLore): Projecting high-dimensional gradients into a lower-dimensional subspace to reduce the size of optimizer states.
This work demonstrates that these two strategies are not just related but mathematically equivalent under certain conditions.
The Gradient-Adapter Duality
The core contribution of this paper is a formal proof showing that the optimization trajectory of a model trained with projected gradients is identical to that of a model where a linear adapter is added and trained exclusively. Specifically, the authors extend this to matrix-level operations using Kronecker factoring, showing that GaLore is essentially a "one-sided" version of LoRA where one of the adapter matrices is derived from the gradient's subspace and kept frozen.
Experimental Setup
The researchers validated their theoretical findings using the Llama Transformer architecture on the SlimPajama dataset. They evaluated two scales:
- 200M Parameter Model: Trained on 5 billion tokens.
- 1.3B Parameter Model: Trained on 10 billion tokens. Performance was measured using perplexity (PPL) on a disjoint validation set.
Key Insights and Results
Random Sketching vs. SVD
A significant finding is that the periodic SVD used in GaLore to find the optimal projection subspace is often unnecessary. The authors demonstrate that random sketching—using Gaussian or Rademacher matrices—achieves comparable performance. This significantly reduces the computational overhead of gradient compression.
Performance and Memory Efficiency
As shown in the results table, "Random Semi-orthogonal" projections achieved a perplexity of 13.71 on the 1.3B model, nearly matching the 13.62 achieved by SVD-based GaLore. Furthermore, by leveraging the adapter view and applying INT8 or NF4 quantization to the base weights, memory usage for the 1.3B model was halved (from 8.04 GB to ~4.06 GB) with minimal impact on perplexity.
Distributed Training
In distributed settings, the authors found that performance is maximized when each worker uses a different, orthogonal projection matrix ("Distributed Random"). This ensures that workers explore diverse subspaces of the parameter space, leading to a perplexity of 19.81 at the 200M scale, compared to 21.51 when using identical projections.
Limitations and Future Work
While the duality is robust for standard SGD and Adam, it is slightly altered when using AdamW due to the way weight decay is applied. The authors provide a theoretical adjustment but note that the interaction between weight decay and projections warrants further study. Additionally, while the 1.3B scale is informative, future work should validate these findings on 7B+ parameter models and explore non-linear extensions of the duality.
Summary updated