Randomized Gradient Subspaces for Efficient Large Language Model Training

Sahar Rajabi, Nayeema Nonta, Samanvay Vajpayee, Sirisha Rambhatla · DOI

Abstract

Training Large Language Models (LLMs) is notoriously memory-intensive, primarily due to the massive size of optimizer states. This paper introduces GrassWalk and GrassJump, two randomized algorithms that project gradients into low-dimensional subspaces to slash memory costs while actually improving training performance on LLaMA-1B and 7B models.

Introduction

The "memory wall" in LLM training isn't just about the model weights; it’s about the optimizer. For a standard Adam optimizer, the "moments" (running averages of gradients) can take up twice as much memory as the model itself. Recent "low-rank" training methods like GaLore try to solve this by projecting gradients into a smaller subspace, allowing the optimizer to work with much smaller matrices. However, these methods often rely on Singular Value Decomposition (SVD), which is computationally expensive and can be sensitive to noise. Furthermore, existing methods don't fully account for the fact that the "ideal" subspace for gradients changes over time and across different layers of the model.

Methodology

The authors propose a suite of randomized algorithms based on the geometry of the Grassmannian manifold—the mathematical space of all possible $r$-dimensional subspaces.

  1. GrassWalk: Instead of calculating a perfect new subspace via SVD, this method takes a "random walk" on the Grassmannian manifold. It uses an exponential map to move the current subspace in a random direction, exploring the landscape efficiently.
  2. GrassJump: This is a more aggressive version that periodically "jumps" to an entirely new, randomly sampled orthonormal basis.
  3. Adaptive Optimizer (AO): When the subspace changes, the old optimizer moments become "misaligned." The authors use a rotation technique to map the old moments onto the new basis, ensuring the optimizer's history remains useful.
  4. Recovery Scaling (RS): Since projecting gradients into a low-rank space loses some information, the authors implement a rescaling trick. They use the ratio between the optimizer's output and the low-rank gradient to "re-inject" some of the lost signal from the residual gradient bulk without needing to store the full-rank matrices.
Evaluation loss comparison across different subspace update methods and components (AO and RS).

Experimental Setup

The researchers evaluated their methods by pretraining two versions of the LLaMA architecture: LLaMA-1B (24 decoder layers) and LLaMA-7B. Both models were trained using the C4 (Colossal Clean Crawled Corpus) dataset, a standard benchmark for large-scale language model pretraining.

Key Insights

  • The "Core" Subspace Shrinks: The authors found that while a low-rank subspace captures most of the gradient "energy" early in training, its dominance fades over time. This is especially true in deeper layers, suggesting that later stages of learning require more diverse gradient information.
  • Flat Curvature: By analyzing the derivatives of subspace estimation errors, the authors discovered that the gradient subspace evolves in an "almost flat" curvature. In optimization, flatness often means that random steps are actually beneficial—they help the model escape sharp local minima and act as a form of regularization.
  • Randomness is a Feature: Unlike previous views that saw random projections as a "cheap substitute" for SVD, this paper argues that randomization is a principled tool for better exploration of the parameter space.

Key Results

The proposed methods achieved state-of-the-art results in both efficiency and final model quality:

  • Superior Accuracy: On LLaMA-1B pretraining, GrassWalk achieved an evaluation loss of 3.86, significantly outperforming the popular GaLore (6.17) and even edging out the previous state-of-the-art, SubTrack++ (3.89).
  • Scaling Up: On the larger LLaMA-7B model, GrassJump achieved the best evaluation loss (4.27) compared to 4.37 for other competitive low-rank methods.
  • Memory Efficiency: Both methods maintained peak memory usage comparable to GaLore (approx. 32GB for 1B and 49GB for 7B), making it possible to train these models on consumer-grade or mid-range enterprise GPUs.
Pre-training loss curves for LLaMA-7B comparing GrassWalk and GrassJump against baselines.

Limitations and Future Work

While the results are impressive, the paper notes a few areas for further exploration. The performance of GrassWalk and GrassJump depends on the subspace update interval ($T$) and the chosen rank ($r$), which currently requires manual tuning. Additionally, while the study focused on LLaMA (Transformer) architectures, future work is needed to see how these randomized subspace methods perform on alternative architectures like Mamba or MoE (Mixture of Experts), and at even larger scales (70B+ parameters).

Summary updated

BibTeX
@misc{rajabi2025randomized,
  author = {Sahar Rajabi and Nayeema Nonta and Samanvay Vajpayee and Sirisha Rambhatla},
  title = {{Randomized Gradient Subspaces for Efficient Large Language Model Training}},
  year = {2025},
  eprint = {2510.01878},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.01878},
}
Figure