Module 3 · Efficient fine-tuning
Full fine-tuning vs PEFT
5 min read
Should you modify all of the model's weights, or only a small part? Full fine-tuning updates every parameter; PEFT methods (Parameter-Efficient Fine-Tuning) freeze the model and only train a few million added parameters. This lesson compares the two approaches on Forge — memory, duration, quality, storage — and gives the selection criteria.
Two philosophies
| Full fine-tuning | PEFT (LoRA and derivatives) | |
|---|---|---|
| Trained parameters | All | 0.1 to 5% (added matrices) |
| Memory | Weights + gradients + optimizer for the whole model | Essentially the frozen weights |
| Typical learning rate | ~1e-5 | ~1e-4 to 2e-4 |
| Saved result | A complete model | An adapter of a few dozen MB |
| Forgetting risk | Higher: everything can move | Lower: the base model is intact |
| Learning capacity | Maximal | Limited by the adapter's rank |
The choice of learning rate illustrates the difference: modifying the whole model requires tiny steps, at the risk of destroying what it knows; adapters starting from zero tolerate steps ten to twenty times larger. Forge applies these defaults:
peft = None if method == "full" else lora_config(r=r, dora=method == "dora")
# Taux d'apprentissage : ~1e-5 pour tout le modèle, ~1e-4 à 2e-4 pour des adaptateurs LoRA
lr = learning_rate or (1e-5 if method == "full" else 2e-4)
The measured comparison
Same data (1,179 cleaned examples), same GPU (GTX 1060, fp32), batch of 8:
| Model and method | Trained parameters | Duration | Peak memory | Validation | Test |
|---|---|---|---|---|---|
| Qwen2.5-0.5B, LoRA r=16, 2 epochs | 8.8 M (1.75%) | 10.2 min | 2.87 GB | 1.00 | 0.65 |
| Qwen2.5-0.5B, full, 1 epoch | 494 M (100%) | 7.2 min | 8.41 GB* | 1.00 | 0.67 |
| SmolLM2-135M, LoRA r=16, 2 epochs | 4.9 M (3.5%) | 5.5 min | 1.00 GB | 0.79 | 0.38 |
| SmolLM2-135M, full, 2 epochs | 135 M (100%) | 4.9 min | 2.32 GB | 0.87 | 0.42 |
* More than the card's 6 GB: the Windows driver spilled into system memory (lesson 1.3).
Four findings:
- At comparable quality, full fine-tuning needs three times more memory on Qwen2.5-0.5B. On an 8 B, the gap becomes 107 GB versus 19 GB (lesson 1.3): that is where PEFT changes everything.
- Full fine-tuning is not slower on a small model: LoRA adds multiplications, and gradient checkpointing recomputes activations. PEFT saves memory, not necessarily time.
- The base model matters more than the method: SmolLM2-135M plateaus at 0.38–0.42 on the test set, Qwen2.5-0.5B at 0.65–0.67, whatever the method.
- Both methods suffer from the same flaw: 100% on known templates, two thirds on new ones. Neither full fine-tuning nor LoRA fixes a lack of data diversity.
Storage and deployment
| Result | Size on disk |
|---|---|
| LoRA r=16 adapter (Qwen2.5-0.5B, fp32) | 35 MB |
| Complete model after full fine-tuning | 1.9 GB |
For an 8 B, that is a few dozen MB versus 16 GB. With PEFT, you keep one base model and as many adapters as tasks or customers; some inference servers (vLLM in particular) load several LoRA adapters at once on the same base model, and pick the adapter per request. With full fine-tuning, each variant is a complete model to store and serve.
The PEFT landscape
LoRA dominates, but other methods exist:
| Method | Principle | Status |
|---|---|---|
| LoRA | Two small rank-r matrices added to each linear layer | De facto standard |
| QLoRA | LoRA on a base model quantized to 4 bits | Standard for large models on small hardware |
| DoRA | LoRA that separates the magnitude and direction of weights | Modest gains, slower (lesson 3.2) |
| Prompt / prefix tuning | Learned vectors added to the input of each layer | Less effective on complex tasks |
| Adapters (inserted layers) | Small MLPs inserted in each block | LoRA's ancestor; adds latency |
| (IA)³ | Vectors that rescale activations | Very few parameters, less expressive |
When to choose full fine-tuning
- You have a lot of data (hundreds of thousands of examples or more) and a large gap with what the model knows: new language, deep new domain, new format.
- You are continuing pretraining on a domain corpus (continued pretraining).
- The model is small and memory is not a constraint.
- You have measured that LoRA, even with a high rank, plateaus below your criteria.
In other cases — that is, most enterprise projects — start with LoRA: more economical, safer, simpler to deploy, and often just as good.
Key takeaways
- Full fine-tuning modifies the whole model; PEFT only trains small additions, with a learning rate ten to twenty times larger.
- On Forge, comparable quality (0.65 versus 0.67), but three times more memory for full fine-tuning.
- PEFT saves memory and storage (35 MB versus 1.9 GB), not necessarily time.
- The base model weighs more than the method, and no method compensates for poorly varied data.
- Start with LoRA; move to full fine-tuning with a lot of data or a measured ceiling.
Practice
- Run
examples/03_sft_lora.py lora --tinythenfull --tinyand compare memory, duration and exact match. - With
full, try a learning rate of 2e-4: what happens to the loss and the test score? - Compute the size of a LoRA r=16 adapter for an 8 B model from its dimensions.