LoRA (Low-Rank Adaptation) is a fine-tuning method that freezes the pretrained weights and trains only the product of two small matrices (a low-rank matrix) added to each layer. It was proposed in 2021 by Hu, Shen, et al. at Microsoft.
When a large language model is fine-tuned for each use case, all of its weights are retrained, so there is a full copy of the model for every use case. For GPT-3 175B, a single copy is 350GB. Training also requires a large amount of GPU memory to hold the gradients and optimizer states (moving averages for Adam) for all weights.
LoRA assumes that "the change in weights during fine-tuning, , can be represented with a low rank," and trains by replacing it with the product of two thin matrices. On GPT-3 175B, the paper showed the following effects.
- About 10,000 times fewer trainable parameters: the saved checkpoint shrank from 350GB to about 35MB (with , applied only to the query and value weights).
- About one-third of the GPU memory during training: reduced from 1.2TB to 350GB.
- No slowdown at inference: the trained can be added to the original weights and merged into a single matrix, so inference costs the same as an ordinary model.
- Accuracy equal to or better than training all weights: verified on RoBERTa, DeBERTa, GPT-2, and GPT-3.
Although "compression" is not in its name, it is widely used as a way to reduce the cost of training and storage, together with QLoRA, which combines it with quantization.

