What Is Fine-tuning? Retraining a Pre-trained Model for One Task
40 labels took it from 63.8% to 85.9%, and it forgot half its fill-in-the-blank skill on the way
Short version: fine-tuning means taking a model that's already trained and training its weights a little more on your own data. I tried it on DistilBERT. With just 40 labels, a 4-way news classifier went from 63.8% (TF-IDF) to 85.9%. The catch: the model's original skill, filling in blanks, fell from 37.6% to 23.2%. After reading this you'll know what fine-tuning actually changes, how to pick a learning rate, and whether to start with prompting, RAG, LoRA or fine-tuning.
In one line
You start with a model that already knows language roughly, thanks to pre-training. You show it input-answer pairs like "this post is about baseball" or "this one is about space," and nudge its weights. It isn't learning from zero, so a small dataset is enough. That's called transfer learning.
Prompting and RAG only change what you feed the model. Fine-tuning changes the model itself, its weights. That's the whole difference, and it's why fine-tuning has both bigger effects and side effects.
I tried it — 4-way news classification on DistilBERT
I took 4 groups from 20 Newsgroups, which you can download through scikit-learn: baseball, space, computer graphics and gun politics. For training I used only 10 posts per group (40 total) or 50 per group (200). The test set was 100 per group, 400 posts. The model was distilbert-base-uncased (about 66M parameters), on torch 2.8.0 and transformers 4.56.2, on a Mac CPU. One training run took 30 to 90 seconds. Every number is the mean of 3 seeds.
TF-IDF + logistic regression: the old way, counting words. No neural network.
Frozen body + head: leave DistilBERT as is and train only a small classifier on top of its output vectors.
Full fine-tuning: train every DistilBERT weight too, at three learning rates: 2e-5, 5e-5 and 5e-4.
4-way accuracy 40 labels 200 labels
TF-IDF 63.8% 81.3%
frozen body + head 80.4% 85.5%
full FT lr 2e-5 85.9% 89.3%
full FT lr 5e-5 85.0% 86.9%
full FT lr 5e-4 66.8% 81.2%
The fewer labels, the bigger the gap. At 40 it's 22 points over TF-IDF. Pre-training already taught the model things like "pitcher and inning live in the same neighborhood." The proof is that freezing the whole body and training only the head still gets 80%.
The price — it forgets what it used to do
DistilBERT started life as a fill-in-the-blank model. After teaching it to classify, I made it fill in blanks again. I took 200 posts from other newsgroups (autos, for-sale, medicine), masked 15% of the tokens (3,236 of them) and had it guess. I didn't train the fill-in-the-blank output layer. Classification training only touched the body.
after 40 labels 4-way fill-in-the-blank
original model — 37.6%
frozen body + head 80.4% 37.6%
full FT lr 2e-5 85.9% 23.2%
full FT lr 5e-5 85.0% 11.2%
full FT lr 5e-4 66.8% 1.8%
Fifty training steps, and it lost more than a third of its fill-in-the-blank accuracy. This is called catastrophic forgetting.
Honestly, the 2e-5 vs 5e-5 result is what surprised me. Almost the same classification score, twice the forgetting. Both values sit inside the range the BERT paper recommends (5e-5, 3e-5, 2e-5). If I'd only looked at my task's score, I'd never have seen it.
5e-4 just broke the model. For all 8 test sentences it answered "," or ".". Classification dropped to 66.8%, about the same as TF-IDF. This is what people mean by "use a much lower learning rate than pre-training."
If all you need is a classifier, forgetting doesn't matter. But if you're teaching an LLM your company's tone and it gets worse at general knowledge or other languages, that's a problem. Then it's safer to keep the original weights frozen. The "frozen body" row is the extreme version. LoRA sits in between.
How I'd set the learning rate
Start at 2e-5. After training, don't just look at your task's score. Run a few things the model used to do (some general questions, a few sentences in other languages) side by side with the model before you touched it. As above, the score can be identical while the forgetting doubles. One test score won't show it.
Prompting, RAG, LoRA, fine-tuning — when to use which
The model needs facts it doesn't have (internal docs, recent info): RAG. If you bake facts in with fine-tuning, you retrain every time the docs change, and you can't say which document an answer came from.
You want a fixed format, tone or classification rule: first try a few examples in the prompt. If it still wobbles, fine-tune.
You've decided to fine-tune an LLM: start with LoRA. It freezes the original weights and trains a small adapter, so removing the adapter gives you the original model back. It also needs far less GPU memory.
One classifier on a BERT-sized model: full fine-tuning is cheap, as above. A minute or so on a Mac CPU.
How this differs from just using someone else's model is in inference vs fine-tuning.
If you want to automate inquiry or document classification with AI and aren't sure whether prompting is enough or you need fine-tuning, feel free to ask negabaro. We can start by measuring how far a few dozen of your existing examples get you.
Key Concepts
First see whether a few examples in the prompt, or RAG, is enough — not touching the weights is cheaper and easy to undo
Set baselines — something simple like TF-IDF, and a frozen body with only a head trained (40 labels: 63.8% and 80.4%)
Start at learning rate 2e-5 — at 5e-4 the model broke (1.8% fill-in-the-blank)
Measure the model's old skills next to the untouched model, not just your task score (2e-5 and 5e-5 scored the same, with twice the forgetting)
LoRA first for an LLM; full fine-tuning for a single classifier on a BERT-sized model
Pros
- ✓ Works with few labels — 22 points over TF-IDF with 40
- ✓ Cheap on small models — 30 to 90 seconds per DistilBERT run on a Mac CPU
- ✓ Shorter prompts — the format lives in the weights, so you stop pasting examples every time
Cons
- ✗ It forgets — fill-in-the-blank went from 37.6% to 23.2% in 50 steps
- ✗ Sensitive to learning rate — twice the forgetting even inside the recommended range (2e-5 vs 5e-5), and 5e-4 broke it
- ✗ Not for adding facts — retrain when the docs change, and no sources (use RAG for that)
Use Cases
References
- BERT: Pre-training of Deep Bidirectional Transformers (Appendix A.3 — fine-tuning hyperparameters)
- DistilBERT, a distilled version of BERT
- Universal Language Model Fine-tuning for Text Classification (ULMFiT)
- Overcoming catastrophic forgetting in neural networks
- scikit-learn — The 20 newsgroups text dataset