Why LoRA exists
Full fine-tuning of a 7B-parameter LLM means storing 7B updated parameters per task — 14GB just for the weights. LoRA (Low-Rank Adaptation, Hu et al. 2021) freezes the original weights and adds tiny trainable low-rank matrices alongside each linear layer. The fine-tuned 'update' for that layer is W' = W + (BA) where A: [d, r] and B: [r, d] with r << d.
The result: maybe 0.1% extra parameters trained, comparable accuracy to full fine-tuning, and you can swap LoRA adapters in and out without reloading the base model. This is the technology that made personal LLM fine-tuning feasible.
QLoRA — LoRA on a quantized base
QLoRA (Dettmers et al., 2023) keeps the frozen base model in 4-bit quantized form and trains the LoRA adapters in BF16. Result: a 70B model fine-tunes on a single 80GB H100 instead of needing eight. This is what makes serious LLM fine-tuning feasible for individuals and small teams.
The PEFT library
Hugging Face's peft library implements LoRA, QLoRA, prefix tuning, prompt tuning, IA3, and friends with a uniform API. Wrap any pretrained model with get_peft_model(model, lora_config), train normally, save the adapter (small file), load anywhere.