Fira: Can We Achieve Full-rank Training of LLMs Under Low-rank Constraint?

Xi Chen, Kaituo Feng, Changsheng Li, Xunhao Lai, Xiangyu Yue +2 more
10/2/2024
cs.LGcs.AI

No official code found. Best implementation: xichen-fy/Fira (120 stars, Apache-2.0, last commit 2024-10-21).

Abstract

Low-rank training has emerged as a promising approach for reducing memory usage in training Large Language Models (LLMs). Previous methods either rely on decomposing weight matrices (e.g., LoRA), or seek to decompose gradient matrices (e.g., GaLore) to ensure reduced memory consumption. However, both of them constrain the training in a low-rank subspace, thus inevitably leading to sub-optimal performance. This raises a question: whether it is possible to consistently preserve the low-rank constraint for memory efficiency, while achieving full-rank training (i.e., training with full-rank gradients of full-rank weights) to avoid inferior outcomes? In this paper, we propose a new plug-and-play training framework for LLMs called Fira, as the first attempt to achieve this goal. First, we observe an interesting phenomenon during LLM training: the scaling impact of adaptive optimizers (e.g., Adam) on the gradient norm remains similar from low-rank to full-rank training. Based on this observation, we propose a norm-based scaling method, which utilizes the scaling impact of low-rank optimizers as substitutes for that of original full-rank optimizers to enable full-rank training. In this way, we can preserve the low-rank constraint in the optimizer while achieving full-rank training for better performance. Moreover, we find that there are sudden gradient rises during the optimization process, potentially causing loss spikes. To address this, we further put forward a norm-growth limiter to smooth the gradient via regulating the relative increase of gradient norms. Extensive experiments on the pre-training and fine-tuning of LLMs show that Fira outperforms both LoRA and GaLore, achieving performance that is comparable to or even better than full-rank training.

View on arXivView PDF

Code Implementations(1)

xichen-fy/FiraCommunity100%
Apache-2.0

Fira: Can We Achieve Full-rank Training of LLMs Under Low-rank Constraint?

1204Shell, PythonOct 2, 20242 years agoApache-2.0

Similar Papers

Cite this paper

@article{chen2024fira,
  title  = {Fira: Can We Achieve Full-rank Training of LLMs Under Low-rank Constraint?},
  author = {Xi Chen and Kaituo Feng and Changsheng Li and Xunhao Lai and Xiangyu Yue and Ye Yuan and Guoren Wang},
  year   = {2024},
  eprint = {2410.01623},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.01623v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.01623.svg)](https://codeofpaper.com/paper/2410.01623)

Discussion