LoRA (Low-Rank Adaptation) makes fine-tuning large models practical by training only small low-rank matrices.
Core idea: instead of updating the full weight matrix , freeze and add a low-rank update:
where , , and .
Connection to Singular Value Decomposition (SVD) : the update has rank at most . SVD tells us that weight updates during fine-tuning tend to be low-rank — most of the change lives in a low-dimensional subspace. LoRA exploits this by parameterizing the update in that subspace directly.
Parameter savings:
- Full fine-tuning: parameters per layer
- LoRA: parameters per layer
- With and : vs — 100x fewer trainable parameters
Training:
- initialized with random Gaussian, initialized to zero (so at start)
- Only and are updated; base model stays frozen
- At inference: merge — no additional latency
Practical use:
- Supervised Fine-Tuning and Direct Preference Optimization with LoRA via PEFT + TRL libraries
- Multiple LoRA adapters can be swapped on the same base model
- QLoRA: combine with quantization (4-bit base model) for even cheaper fine-tuning
See also: Singular Value Decomposition (SVD) , Supervised Fine-Tuning