Introduction
The scaling of Large Language Models (LLMs) has consistently outpaced the growth of available GPU memory, creating a "memory wall" that restricts full-parameter training to high-end industrial clusters. While model weights themselves are substantial, the primary memory consumers during training are the optimizer states (e.g., in Adam) and the gradients, which can collectively require three to four times more memory than the weights.
GRASS (GRAdient Structured Sparsification) is a novel optimization framework designed to break this bottleneck. By utilizing structured sparse projection matrices, GRASS enables full-parameter training with a fraction of the traditional memory and compute overhead, allowing researchers to train models as large as 13B parameters on a single 40GB A100 GPU.
The Problem: The Materialization Bottleneck
Existing approaches to memory-efficient training generally fall into two categories, each with distinct trade-offs:
- Parameter-Efficient Finetuning (PEFT): Methods like LoRA use low-rank adapters to reduce the number of trainable parameters. While effective for finetuning, they often underperform compared to full-rank training and are difficult to apply to pretraining from scratch.
- Subspace Optimizers: Recent advancements like GaLore project high-dimensional gradients into a lower-dimensional subspace. However, these methods rely on dense projection matrices. This requires the system to materialize the full gradient in memory before the projection can occur, creating a significant computational and memory bottleneck during the backward pass.
GRASS addresses the fundamental flaw in subspace optimizers: the requirement to build the massive $m \times n$ weight gradient matrix in RAM.
The GRASS Framework
GRASS belongs to the family of Memory-efficient Subspace Optimizers (MeSO) but introduces a structured sparse projection matrix ($P$). This matrix is composed of a selection matrix ($B$) and a diagonal scaling matrix ($\rho$).
The Associative Property Trick
The core innovation of GRASS lies in how it computes the projected gradient. By leveraging the chain rule ($\nabla W = (\nabla_y L)^\top X$) and the associative property of matrix multiplication, GRASS computes the update as:
$$\text{Projected Gradient} = \rho(B \nabla_y L^\top)X$$
This mathematical rearrangement ensures that the full-parameter gradient is never fully materialized. Instead, the system performs row indexing (via the selection matrix $B$) and scaling, which are computationally "free" compared to dense matrix multiplications. This reduces the memory footprint from $O(mn)$ to $O(rn)$, where $r$ is the reduced rank.
Sampling and Stability
To maintain the quality of the gradient approximation, the authors explored two primary sampling strategies for choosing which rows to project:
- Top-r: A deterministic approach selecting rows with the largest norms.
- Multinomial-Norm: A stochastic approach sampling rows based on their relative importance (leverage scores).
Because the subspace is updated periodically (every $K$ steps), the framework resets the optimizer states to zero and employs a brief learning rate warmup to ensure training stability and prevent divergence during subspace transitions.
Experimental Results
The researchers evaluated GRASS across a suite of benchmarks, including pretraining on the C4 subset of Dolma and instruction tuning on Alpaca and FLAN v2.
Hardware and Throughput Breakthroughs
GRASS achieved a significant hardware milestone by enabling the pretraining of a 13B parameter LLaMA model on a single 40GB A100 GPU using BF16 precision. Under standard Adam optimization, this would typically require over 100GB of VRAM. Furthermore, in distributed settings (DDP), GRASS reduced communication volume from $O(mn)$ to $O(rn)$, resulting in a 2× throughput improvement over both full-rank training and GaLore on 8-GPU systems.
Performance Parity
Critically, the memory savings do not come at the cost of model quality. On a 1B LLaMA model, GRASS demonstrated a perplexity gap of less than 0.1 compared to full-rank training. At the 13B scale, GRASS utilized 70% less memory than full-rank training and 45% less than GaLore while maintaining competitive performance on MMLU benchmarks.
Limitations and Future Work
While GRASS offers a path toward more accessible LLM training, it introduces some implementation complexity. Unlike "drop-in" optimizers, it requires modifications to the Transformer architecture's linear layers to handle sparsification during the backward pass.
Additionally, as gradient memory is minimized, activation memory (storing intermediate values for backpropagation) becomes the new dominant bottleneck. Future iterations of GRASS may benefit from integration with advanced activation checkpointing. The authors also intend to explore more diverse structured sparsity patterns and dynamic rank adjustments to further optimize hardware utilization.
Summary updated