PEFT
Parameter-efficient fine-tuning — adapt large models on a single GPU by freezing the base weights and training a small delta.
Overview
Fine-tuning adjusts the parameters of a pretrained network to minimise a task loss . For a model with parameters, full fine-tuning optimises all of them via Gradient Descent. PEFT (Parameter-Efficient Fine-Tuning) instead freezes and learns a much smaller set with , so the update is . This collapses the memory cost of training a 7B model from ~112GB to a few GB.
Why It Works
A pretrained model already encodes language, reasoning, and world knowledge. Specialising it to a task is a small adjustment, not a rewrite — empirically the useful update lives in a low-dimensional subspace. So you don’t need to move all parameters; a tiny trainable set can express the adjustment, often matching full fine-tuning quality while training under 1% of the weights.
Memory Savings
The weights are the small cost; the optimiser state around them dominates. With Adam in full precision, each trainable scalar carries the weight, its gradient, and two moment estimates. Total training memory (in bytes) scales as
The key term is , the number of trainable parameters. A frozen weight contributes to neither the gradient nor the moments — only its forward-pass storage.
PEFT saves incredible amounts of memory by driving , where oftentimes , which practically zeroes the dominant term and the per-step optimiser cost.
The PEFT Family
| Method | Mechanism | |
|---|---|---|
| LoRA | additive low-rank | |
| Prefix/Prompt tuning | learn virtual tokens prepended to input; weights frozen | embeddings only |
| Adapters (2019) | bottleneck layers inserted between frozen blocks | small, not mergeable |
| IA³ | learned vectors rescaling activations | one vector per target |
| DoRA (2024) | decompose , LoRA the direction | LoRA + magnitude |
All share the PEFT invariant: freeze the base, learn a small . They differ only in the parametrisation of that delta.
LoRA, in Brief
LoRA (Low-Rank Adaptation) is the dominant PEFT method. It freezes each weight matrix and learns a low-rank update alongside it, where hold a fraction of the parameters. The resulting adapter is tiny (megabytes), swappable across tasks on one base model, and mergeable back into for zero added inference cost. The full low-rank derivation is a future post.
QLoRA, in Brief
QLoRA (Quantized LoRA) goes further: store the frozen base in 4-bit, train fp16 LoRA adapters on top. Quantization shrinks the base ~8×; LoRA keeps the optimiser overhead near zero. Together they put 65B-scale fine-tuning on a single GPU — trading some speed (on-the-fly dequantization) for the ability to run at all. NF4, double quantization, and paged optimizers are a future post.
Choosing a Method
| Situation | Use |
|---|---|
| fp16 base fits the GPU | LoRA — no dequant tax |
| base too big for 16-bit | QLoRA — 4-bit makes it fit at all |
| max quality, spare compute | DoRA |
| many cheap swappable tasks | prompt/prefix tuning |
2026 default: LoRA if it fits, QLoRA if it doesn’t. Start , target attention + MLP projections, escalate only if the task demands it.
Limitations
- A small caps how far you can move the model; tasks needing deep behavioural change may still favour full fine-tuning.
- Adapter capacity and placement are a tuning burden: too little underfits, too much overfits small datasets.
- A caveat rather than a limitation: PEFT cuts only the training memory, not the base model’s inference footprint — you still load all weights to serve it.
Related Topics
PEFT adapts the affine projections inside Transformers and the Neural Networks beneath them, training the small delta with Gradient Descent. The low-rank factorisation behind LoRA echoes the surrogate-modelling intuition of Linear Regression and the implicit feature maps of Support Vector Machines.
Learning Path
What should I learn before PEFT?
Start with neural-networks, transformers, gradient-descent before studying PEFT.
How does PEFT connect to other AI topics?
PEFT belongs to Generative and connects to llm, fine-tuning, quantization, peft, lora, qlora, low-rank-adaptation, quantization, optimisation.
Further Reading
- LoRA: Low-Rank Adaptation of Large Language Models — Hu et al. (2021)
- QLoRA: Efficient Finetuning of Quantized LLMs — Dettmers et al. (2023)
- DoRA: Weight-Decomposed Low-Rank Adaptation — Liu et al. (2024)
- Parameter-Efficient Transfer Learning for NLP — Houlsby et al. (2019)
- Few-Shot Parameter-Efficient Fine-Tuning is Better and Cheaper than In-Context Learning (IA³) — Liu et al. (2022)