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

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Chen, Xi, Feng, Kaituo, Li, Changsheng, Lai, Xunhao, Yue, Xiangyu, Yuan, Ye, Wang, Guoren
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866912711139393536
author Chen, Xi
Feng, Kaituo
Li, Changsheng
Lai, Xunhao
Yue, Xiangyu
Yuan, Ye
Wang, Guoren
author_facet Chen, Xi
Feng, Kaituo
Li, Changsheng
Lai, Xunhao
Yue, Xiangyu
Yuan, Ye
Wang, Guoren
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2410_01623
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Fira: Can We Achieve Full-rank Training of LLMs Under Low-rank Constraint?
Chen, Xi
Feng, Kaituo
Li, Changsheng
Lai, Xunhao
Yue, Xiangyu
Yuan, Ye
Wang, Guoren
Machine Learning
Artificial Intelligence
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.
title Fira: Can We Achieve Full-rank Training of LLMs Under Low-rank Constraint?
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2410.01623