Fine-tuning
Teaching New Tricks
Difficulty
Intermediate
Duration
12-15 min
Prerequisites
Pre-training
Step
1/ 7
Why Pre-training Isn't Enough
A pre-trained LLM like GPT or LLaMA has learned language from trillions of tokens scraped from the internet. It can predict the next token brilliantly. But it has a fundamental problem: it doesn't know what you want it to do.
Ask a pre-trained model "What is the capital of France?" and it might continue with:
- •"What is the capital of Germany? What is the capital of..." (it sees a pattern of questions)
- •"...a question often asked by geography students" (it describes the question)
- •"Paris" (what you actually wanted — but only sometimes)
The model is a text completion engine, not an assistant. It hasn't learned to:
- •Follow instructions ("Summarize this article in 3 bullet points")
- •Stay on topic (instead of generating tangentially related text)
- •Refuse harmful requests ("How to build a bomb" → should decline)
- •Match a specific tone, format, or domain
Fine-tuning bridges this gap: you take the pre-trained model and continue training it on a curated dataset that teaches the specific behavior you want. The model keeps its broad language knowledge but learns new skills on top.
Pre-trained vs Fine-tuned Model
| Capability | Pre-trained Model | Fine-tuned Model |
|---|---|---|
| Language understanding | Excellent | Excellent (retained) |
| Following instructions | Poor — just completes text | Good — trained on instruction-response pairs |
| Specific domain knowledge | General only | Deep (if fine-tuned on domain data) |
| Output format control | Unpredictable | Consistent (JSON, markdown, etc.) |
| Safety / alignment | None — will generate anything | Trained to refuse harmful requests |
| Tone / personality | Mimics training data mix | Matches desired persona |
Pre-training vs Fine-tuning Analogies
| Analogy | Pre-training | Fine-tuning |
|---|---|---|
| Education | General education (K-12) | Medical school specialization |
| Cooking | Learning all cuisines | Mastering French pastry |
| Music | Learning to play instruments | Rehearsing for a specific concert |
| Language | Learning vocabulary and grammar | Learning legal or medical writing |