In 2021, fine-tuning a large model meant a cluster, a budget approval and a specialist. By 2023 students were doing it on a free cloud notebook. Nothing about the models got smaller. What changed was a technique with an unglamorous name — LoRA, Low-Rank Adaptation — and it is now the default way almost everyone fine-tunes.
The idea
Full fine-tuning updates every weight in the model. That means holding the weights, their gradients and optimizer state in GPU memory at once — several times the model's own size — and producing a complete new copy of the model at the end.
LoRA does something different. It freezes the original weights entirely and trains small matrices alongside them. At inference, the model computes as usual and the adapter contributes its learned adjustment on top.
The intuition behind why this works: the change you need for one specific task is far simpler than the model itself. You are not rebuilding general language ability — you are nudging behaviour. A small, low-capacity adjustment turns out to be enough to capture that nudge, and in practice well under 1% of parameters are trained, often a small fraction of a percent.
What it buys you
| Full fine-tuning | LoRA | |
|---|---|---|
| Parameters trained | all of them | typically well under 1% |
| GPU memory | several × model size | roughly model size + a little |
| Artefact per use case | a full model copy — tens of GB | an adapter file — megabytes |
| Catastrophic forgetting | higher risk — the base can be overwritten | bounded — the base is frozen |
| Serving 10 variants | 10 deployments | 1 base + 10 small adapters |
| Ceiling on how much can change | none | constrained by the adapter's capacity |
The serving trick
The last row of that table is the one with commercial weight, and it is worth understanding as its own point.
Because the base model is untouched, several adapters can share one copy of the base in GPU memory and be swapped per request. Ten fine-tuned variants — one per customer, or one per task — cost roughly one model's worth of memory instead of ten.
That turns per-customer customisation from a business nobody can afford into a feature. It is why "we fine-tune a variant for each enterprise client" is a sentence you now hear.
Rank — the one dial you'll be asked about
The adapter's rank (often written r) controls its size, and therefore how much it can learn.
| Rank | Effect | Suits |
|---|---|---|
| Low (4–16) | few parameters, a strong constraint, hard to overfit | style, tone, output format; small datasets |
| Medium (32–64) | more capacity, more overfitting risk | a genuine behaviour change with a few thousand examples |
| High (128+) | approaching full fine-tuning's flexibility and cost | large datasets, broad domain shifts |
A second parameter, lora_alpha, scales how strongly the adapter contributes; a common starting point is roughly twice the rank. And target_modules chooses which layers get adapters — starting with the attention projections and adding the MLP projections only if quality plateaus.
from peft import LoraConfig, get_peft_model
config = LoraConfig(
r=16, # rank — capacity dial
lora_alpha=32, # ~2x rank is a reasonable start
target_modules=["q_proj", "k_proj", "v_proj", "o_proj"],
lora_dropout=0.05, # cheap regularisation on small data
task_type="CAUSAL_LM",
)
model = get_peft_model(base_model, config)
model.print_trainable_parameters()trainable params: 8,388,608 || all params: 6,746,804,224
|| trainable%: 0.1243Eight million trainable parameters out of nearly seven billion. That number — roughly a tenth of a percent — is the whole story in one line.
💡 Don't copy a rank from a blog post. Start low (8–16), and only raise it if validation says the adapter is capacity-limited rather than data-limited. On a small dataset, a higher rank usually just buys faster overfitting.
QLoRA
Take LoRA one step further: quantize the frozen base model to 4-bit first, then train adapters on top of it. That is QLoRA, and it is the reason "I fine-tuned a large model on one consumer GPU" became an ordinary sentence.
The base is frozen anyway, so storing it at reduced precision costs much less than it would if those weights were being trained. The trade-off is that you are adapting a slightly degraded base, so the result can be a little weaker than LoRA on a full-precision base — which is a fine trade when the alternative is not being able to train at all. Lesson 5 covers quantization properly.
PEFT — the wider family
PEFT — Parameter-Efficient Fine-Tuning — is the umbrella term. LoRA is by far the most used member; you may also hear prefix tuning and prompt tuning, which learn small trainable vectors prepended to the input rather than modifying the model at all.
For placement purposes: know that PEFT is the category, LoRA is the technique that won, QLoRA is LoRA on a quantized base, and the shared idea is freeze most of the model and train a small addition.
🎯 Selection-round radar: "What is LoRA?" is now standard in GenAI rounds. Four beats: freeze the base and train small adapter matrices → well under 1% of parameters, so it trains on far smaller GPUs → the artefact is megabytes, so many adapters share one base in memory at serving time → and because the base is frozen, catastrophic forgetting is bounded. The serving point is the one most candidates miss and interviewers notice.
Wait — is full fine-tuning ever better?
Sometimes, and being able to say when is what separates a memorised answer from an understood one.
LoRA's constraint is also its ceiling. If you genuinely need the model's general behaviour substantially changed — adapting to a specialised domain with a very large dataset, not adjusting an output format — a low-rank adjustment may not have the capacity for it. With millions of examples and the compute to match, full fine-tuning can reach further.
But that is the exception. For the overwhelming majority of application work — style, format, one narrow task — LoRA matches full fine-tuning at a fraction of the cost, and it is the sensible default.
Common mistakes
- Copying a rank from a tutorial instead of tuning it on validation.
- Using a high rank on a small dataset, then blaming the technique for overfitting.
- Assuming LoRA eliminates catastrophic forgetting rather than bounding it.
- Forgetting that the adapter must be served with the exact base version it was trained on.
- Describing LoRA as "training a smaller model" — the model is the same size.
- Skipping evaluation because the run was cheap.
Quick recap
| Concept | One-liner |
|---|---|
| LoRA | freeze the base, train small adapter matrices beside it |
| Scale | typically well under 1% of parameters trained |
| Artefact | megabytes, not tens of gigabytes |
| Serving | many adapters share one base in GPU memory, swapped per request |
| Rank | the capacity dial; start low on small datasets |
| QLoRA | LoRA on a 4-bit quantized base — largest models, one GPU |
| PEFT | the umbrella term; LoRA is the member that won |
Practice Zone — PYQs from real selection rounds
Six MCQs, then two tasks: explain LoRA honestly with an analogy, and configure a real run.
What does LoRA do differently from full fine-tuning?
Asked in

The biggest practical advantage of LoRA is:
Asked in

What is QLoRA?
Asked in

What does the LoRA 'rank' hyperparameter control?
Asked in

Why does LoRA reduce catastrophic forgetting compared with full fine-tuning?
Asked in

When would full fine-tuning still be preferred over LoRA?
Asked in

Hands-on tasks:
Explain LoRA to a teammate who understands programming but not ML, in a way that is technically honest. Then state the one thing your analogy gets wrong.
Asked in

You have 800 examples for a customer-support tone fine-tune, and one 24GB GPU. Choose an approach and hyperparameters, and justify each choice.
Asked in

FAQ
Can a LoRA adapter be merged into the base model?
Yes — merging folds the adapter's effect into the weights and produces a single standalone model. That removes any per-request adapter overhead, at the cost of the swapping trick: a merged model is a full-size artefact again, so you lose the "many variants, one base" benefit.
Does LoRA make inference slower?
Slightly, if the adapter is applied at runtime — the extra computation is small but not zero. Merged adapters have no overhead at all. In practice the difference rarely matters next to the memory savings.
Can I combine several LoRA adapters at once?
Techniques exist for it, but results are inconsistent — adapters trained separately can interfere in ways nobody can inspect, since an adapter isn't human-readable. If you need one model that does two things, training a single adapter on a combined dataset is the more predictable route.
Next lesson: the other half of making big models fit on small hardware — Lesson 5: Quantization Explained →


