LoRA Learns Less and Forgets Less

Dan Biderman, Jacob Portes, Jose Javier Gonzalez Ortiz, Mansheej Paul, Philip Greengard +7 more
5/15/2024
cs.LGcs.AIcs.CL

No official code found. Best implementation: danbider/lora-tradeoffs (22 stars, last commit 2024-09-27). 2 more below.

Abstract

Low-Rank Adaptation (LoRA) is a widely-used parameter-efficient finetuning method for large language models. LoRA saves memory by training only low rank perturbations to selected weight matrices. In this work, we compare the performance of LoRA and full finetuning on two target domains, programming and mathematics. We consider both the instruction finetuning (approximately 100K prompt-response pairs) and continued pretraining (20B unstructured tokens) data regimes. Our results show that, in the standard low-rank settings, LoRA substantially underperforms full finetuning. Nevertheless, LoRA better maintains the base model's performance on tasks outside the target domain. We show that LoRA mitigates forgetting more than common regularization techniques such as weight decay and dropout; it also helps maintain more diverse generations. Finally, we show that full finetuning learns perturbations with a rank that is 10-100X greater than typical LoRA configurations, possibly explaining some of the reported gaps. We conclude by proposing best practices for finetuning with LoRA.

View on arXivView PDF

Code Implementations(3)

Information and artifacts for "LoRA Learns Less and Forgets Less" (TMLR, 2024)

221Aug 12, 20242 years ago
02Jupyter NotebookDec 28, 20241 years ago
00Jupyter NotebookMay 29, 20251 years ago

Cite this paper

@article{biderman2024lora,
  title  = {LoRA Learns Less and Forgets Less},
  author = {Dan Biderman and Jacob Portes and Jose Javier Gonzalez Ortiz and Mansheej Paul and Philip Greengard and Connor Jennings and Daniel King and Sam Havens and Vitaliy Chiley and Jonathan Frankle and Cody Blakeney and John P. Cunningham},
  year   = {2024},
  eprint = {2405.09673},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2405.09673v2}
}

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/2405.09673.svg)](https://codeofpaper.com/paper/2405.09673)

Discussion