NOLA: Compressing LoRA using Linear Combination of Random Basis

Soroush Abbasi Koohpayegani, Navaneet K L, Parsa Nooralinejad, Soheil Kolouri, Hamed Pirsiavash

Introduction

Fine-tuning Large Language Models (LLMs) for specific downstream tasks is a standard practice in modern machine learning. However, storing a full set of weights for every task is prohibitively expensive; for instance, a single GPT-3 checkpoint requires approximately 350GB of storage.

LoRA (Low-Rank Adaptation) addressed a significant portion of this challenge by freezing the pre-trained model weights and injecting trainable rank decomposition matrices into each layer of the Transformer architecture. By only training two small, low-rank matrices ($A$ and $B$) that represent the weight change ($\Delta W = A \times B$), LoRA drastically reduces the storage footprint of task-specific models.

The Parameter Floor of LoRA

Despite its success, LoRA has a fundamental "parameter floor." The number of trainable parameters is strictly tied to the model's hidden dimensions and the chosen rank ($r$). Even at the absolute minimum rank ($r=1$), adapting a massive model like LLaMA-2 70B still requires millions of parameters. This lower bound makes it difficult to store thousands of task-specific "experts" in limited GPU memory or edge devices.

NOLA (NOte on Low-rank Adaptation) pushes parameter-efficient fine-tuning to its extreme by re-parameterizing LoRA's low-rank matrices. This approach decouples the number of trainable parameters from both the model's architecture and the chosen rank, achieving up to 20x more compression than the most compact LoRA models without sacrificing accuracy.

Methodology: Breaking the Floor with NOLA

NOLA introduces a second layer of re-parameterization to break LoRA's parameter floor.

  1. Standard LoRA: The weight update is defined as $\Delta W = A \times B$, where $A$ and $B$ are learned matrices.
  2. NOLA's Twist: Instead of learning the individual entries of $A$ and $B$, NOLA treats them as a linear combination of fixed, randomly generated "basis" matrices.
  3. $A = \sum \alpha_i A_i$
  4. $B = \sum \beta_j B_j$
  5. The "Recipe": The basis matrices ($A_i, B_j$) are generated using a pseudo-random number generator from a single scalar seed. These matrices remain frozen throughout training.
  6. Trainable Parameters: Only the linear mixture coefficients ($\alpha$ and $\beta$) are optimized during training.
NOLA Architecture

Because you only need to store the random seed and the small vectors of coefficients, the storage requirement becomes entirely independent of the matrix dimensions. To further compress the model, the authors apply quantization to the $\alpha$ and $\beta$ coefficients (down to 2-4 bits) during or after training.

Experimental Setup

The authors evaluated NOLA across diverse domains to ensure its robustness:

  • Natural Language Generation (NLG): E2E, DART, and WebNLG datasets using GPT-2 (Medium and Large).
  • Instruction Fine-tuning: Alpaca dataset for LLaMA-2 (7B, 13B, and 70B), evaluated on the MMLU benchmark.
  • Computer Vision: ImageNet-21k/1k for pre-training, with downstream evaluation on CIFAR-10/100, CUB-200, Caltech-101, Aircraft, Food101, Pets, and SUN397 using Vision Transformers (ViT).

Key Insights and Results

NOLA demonstrates that the "optimal" weight change for a task lives in a very low-dimensional subspace, and finding the right coordinates in a random subspace is sufficient for high performance.

  • Extreme Compression: On LLaMA-2 70B, NOLA achieved a 95% reduction in parameters compared to rank-1 LoRA (0.57M vs 12.94M parameters) while maintaining nearly identical performance on MMLU.
  • Parity with LoRA: In GPT-2 experiments, NOLA with only ~36K parameters performed on par with rank-4 LoRA which used ~770K parameters—a 20x improvement in compactness.
Performance comparison on GPT-2
  • Decoupling Rank from Parameters: In standard LoRA, increasing the rank (which usually improves performance) forces you to accept more parameters. NOLA allows you to use a high rank (e.g., $r=16$) while keeping the number of trainable coefficients extremely low.
  • GPU-Native Efficiency: While generating random matrices sounds slow, modern GPUs can generate these "on-the-fly" extremely quickly. This means NOLA can reconstruct the weights during inference without needing to store the large basis matrices in RAM or VRAM.
  • Quantization Robustness: NOLA is remarkably robust to coefficient quantization. In Quantization-Aware Training (QAT), NOLA with 2-bit coefficients lost only ~1.5 BLEU points, whereas standard LoRA's performance collapsed under similar constraints.

Limitations and Future Work

While basis matrices can be generated on the fly, doing so during every training iteration adds a small computational overhead. Furthermore, while NOLA decouples parameter count from rank, the choice of rank ($r$) still affects the model's expressivity. The relationship between rank, the number of basis matrices, and overall performance requires more rigorous theoretical study.

Finally, most tests were conducted on Transformer architectures. While the authors touched on ResNets in their appendix, future work is needed to explore how NOLA handles diverse architectures like Graph Neural Networks (GNNs) or State Space Models.

Summary updated

BibTeX
@inproceedings{koohpayegani2024nola,
  author = {Soroush Abbasi Koohpayegani and Navaneet K L and Parsa Nooralinejad and Soheil Kolouri and Hamed Pirsiavash},
  title = {{NOLA: Compressing LoRA using Linear Combination of Random Basis}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=TjfXcDgvzk},
}
Figure