Pretraining vs fine-tuning: two key differences in data and objective.
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Pretraining and fine-tuning both run the same underlying next-token loss on a transformer. So what actually distinguishes them? Name at least two key differences, one about the data, one about the training setup, and briefly explain why those differences exist.
Same next-token loss, totally different data and training setup. Pretraining: trillions of raw tokens, high LR, months. Fine-tuning: thousands of curated demos, low LR, hours.
Picture a person learning a language by reading every book and webpage they can get their hands on for a decade. They end up fluent but a bit unfocused. That is pretraining. Now picture the same person spending a single weekend with a tutor practising how to politely answer customer-support emails. The tutor does not teach them new vocabulary or grammar; the tutor teaches them style, tone, and which formats to use. That weekend is fine-tuning. The same brain, the same language, just a tiny bit of shaping on top. Same skill underneath, fresh manners on top. The decade builds the knowledge; the weekend installs the behaviour.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6 min: same loss but different worlds + data shape and volume gap + LR and duration gap + loss masking in SFT + catastrophic forgetting + when each is the right tool.
| Dimension | Pretraining | Fine-tuning |
|---|---|---|
| Data volume | Trillions of tokens | Thousands to low millions of examples |
| Data shape | Raw text, no labels | Structured demos, often chat-formatted |
| Learning rate | 1e-4 to 6e-4 | 1e-5 to 2e-5 full, 1e-4 LoRA |
| Duration and hardware | Months on thousands of GPUs | Hours to days on tens of GPUs |
| Loss masking | Every token contributes | Prompt masked, response only |
| What changes | World knowledge built from scratch | Behaviour, format, style |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Claiming pretraining and fine-tuning use different loss functions. They run the same next-token cross-entropy; what changes is the data, the learning rate, the duration, and which tokens contribute to the loss.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.