# Pretraining vs Fine-Tuning vs Instruction Tuning, Explained

> The three training steps behind a chat model, what each one changes and when to use it, explained simply for your AI interview.

**In short:** Pretraining teaches a model general language from a huge amount of text. Fine-tuning trains that model further on a smaller, chosen dataset, and instruction tuning is the kind of fine-tuning that teaches it to follow requests.

AI and LLM interview question Q016, LLM fundamentals. Beginner, very common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/pretraining-vs-fine-tuning-vs-instruction-tuning

## Say it in 30 seconds

Pretraining is the big first step. The model reads a huge amount of text and learns to predict the next token, which is a small piece of text. Fine-tuning trains it further on a smaller, chosen dataset. Instruction tuning is one kind of fine-tuning, using requests paired with good answers, so the model learns to follow instructions. For a real product I try a better prompt first, and I fine-tune only when a gap is left.

## Say it in 2 minutes

Think of a chat model's training in layers. Pretraining is the first and biggest. The model reads a huge pile of text from books, code and web pages, and each time it guesses the next token. That takes most of the data and compute. What comes out is a base model. It is strong at language, but it only continues text, so asking it a question may get you more of the same text.

Fine-tuning is the second layer. You keep training the same model, but on a smaller dataset chosen for one purpose. Instruction tuning is a kind of fine-tuning. Its examples are requests paired with good answers, so the model learns to follow instructions and hold a conversation. Prompts change no weights, so they are the quickest tool to try. Fine-tuning does change the weights.

Many chat models add a third step. People rank pairs of answers, and the model learns which replies people prefer. This is reinforcement learning from human feedback, or RLHF. The InstructGPT study from 2022 ran the steps in this order, and its human raters preferred the tuned model's answers over those of a much larger GPT-3 on the paper's own prompts.

In an interview, I would start with a better prompt and a set of test cases called evals. I fine-tune when the change is about behaviour or format, such as a fixed reply layout. Facts that change, like this month's fee table, belong in documents the app fetches at answer time, because tuned weights keep what they learned until you train them again.

## What are pretraining, fine-tuning and instruction tuning, in plain words?

Training a chat model happens in layers, a bit like a new analyst at a bank. First they spend years learning to read and write in general. Then the bank trains them on mortgage rules. Then on how to talk to a worried customer. Each stage uses the same person, but a different kind of study.

For an AI model the layers are the same. Pretraining is the broad first stage. Fine-tuning is more training on a narrower dataset. Instruction tuning is one kind of fine-tuning. A model that has finished pretraining but no tuning is called a base model.

- **Pretraining:** The first and biggest training run. The model reads huge amounts of unlabelled text and learns to predict the next token, a small piece of text such as a word or part of one.
- **Base model:** What pretraining leaves behind. Strong at language, but not yet trained to take requests.
- **Fine-tuning:** More training on a smaller, chosen dataset. It changes the weights, the numbers inside the model.
- **Instruction tuning:** Fine-tuning on pairs of a request and a good answer, so the model follows instructions.
- **RLHF:** Reinforcement learning from human feedback. People rank answers, and the model learns their preferences.

## How is pretraining different from fine-tuning?

Both steps change the model's weights, so both are training. The difference is the data and the goal. Pretraining uses a huge, broad pile of text with no labels, and its goal is general language skill. Fine-tuning uses a smaller, chosen set of examples, and its goal is one behaviour or one job.

The GPT-3 paper from 2020 describes the older two-step recipe as "pre-training on a large corpus of text followed by fine-tuning on a specific task". The same paper warns that this approach still needs task-specific datasets of thousands or tens of thousands of examples. So a team usually starts from a base model that someone else pretrained.

- **Pretraining: Broad and expensive.** A huge pile of unlabelled text with one goal: predict the next token. Few teams run it themselves, since it needs huge data and compute.
- **Fine-tuning: Narrow and cheaper.** A smaller set of examples, chosen for one job. It changes the weights of a model you already have.
- **Instruction tuning: Requests and good answers.** A kind of fine-tuning. Each example is a request paired with an answer a person would call good.

## What does instruction tuning add, and what is RLHF?

A base model only continues text. Give it a request such as "Summarise this claim for the adjuster" and it may write more of a claim form, because a base model is trained to continue text, not to answer it.

The FLAN paper defines instruction tuning as "finetuning language models on a collection of tasks described via instructions". Its result was that this training makes a model better at tasks it never saw during training.

> "Making language models bigger does not inherently make them better at following a user's intent." (InstructGPT paper (OpenAI, 2022))
>
> "Instruction tuning teaches a base language model to follow user instructions and engage in conversations." (Hugging Face, TRL documentation)

Anthropic's glossary says Claude is built on a model that has been fine-tuned and trained using RLHF. The InstructGPT paper ran the steps in order. First came supervised fine-tuning on human-written demonstrations. Then people ranked outputs, and the model learned from those rankings with reinforcement learning.

On the paper's own prompts, the human raters preferred a 1.3 billion parameter tuned model over the 175 billion parameter GPT-3. In that test, the training method mattered more than size.

## Where does each step fit in the pipeline?

Prompting sits outside this pipeline. The GPT-3 paper describes its few-shot use as "without any gradient updates or fine-tuning", with examples given in the prompt itself.

*Diagram, From raw text to a chat model: Pretraining gives a base model. Instruction tuning and RLHF then turn it into a chat model, and your own reviewed cases tune it once more for one job.*
1. The model reads a huge pile of text and guesses each next token.
2. The base model then learns from request and answer pairs.
3. People rank its answers, and it learns which ones they like.
4. The result is a chat model that follows requests.
5. Your own reviewed cases tune it once more for one job.

Take a hospital's discharge-note helper. The chat model already writes fluent English, so it can draft a note. What it gets wrong is the hospital's layout. Tuning it on 2,000 signed-off notes in that layout fixes the layout. The medicine list stays out of the tuned weights and comes from the patient record when the helper runs, so a dose change needs no retraining.

### How would you decide whether a bank's assistant needs fine-tuning?

A card bank runs a support assistant. Its dispute replies must follow a fixed format, and its fee answers must match a fee table that changes every month.

OpenAI's guide sets the order plainly: "Only invest in fine-tuning after setting up evals." So the team scores its current assistant before it spends any effort on training.

1. **Measure first:** Score 200 past chats for format and accuracy. That is the baseline every change must beat.
2. **Try a better prompt:** Add clearer rules and a few examples. Suppose 4 in every 100 dispute replies still break the format.
3. **Fine-tune for the format:** Tune on 2,000 reviewed chats that show the right layout, if your vendor still offers fine-tuning. Fine-tuning can help a model format replies the same way every time.
4. **Fetch the fees:** Keep fees out of the training data. The app pulls the current table when it answers, so a fee change needs no retraining.
5. **Re-run the same evals:** Score the tuned model on the same 200 chats, and again after each fee change.

> **Tip:** Check the vendor's current docs before you plan a fine-tune. OpenAI says it is winding down its fine-tuning platform. It is no longer open to new users, and existing users can create training jobs for the coming months.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] Pretraining: a huge general text pile and next-token prediction, which gives a base model.
- [ ] Fine-tuning: more training on a smaller, chosen dataset, which changes the weights.
- [ ] Instruction tuning: a kind of fine-tuning on request and good answer pairs.
- [ ] RLHF: a later step where people rank answers. Many chat models use it.
- [ ] Order of choice: a better prompt, then evals, then fine-tuning for behaviour and format.
- [ ] Facts that change belong in retrieved documents, not in tuned weights.

**Common traps**

- Trap: "Fine-tuning is how you teach the model new facts." Better: It mostly shapes behaviour and format. Facts that change go in documents the app fetches.
- Trap: "Instruction tuning is a different thing from fine-tuning." Better: It is a kind of fine-tuning. Its data is request and good answer pairs.
- Trap: "Fine-tuning always beats a good prompt." Better: Only when evals show a gap that a better prompt cannot close.

## Can you spot the wrong step?

**Spot the wrong step:** A claims team plans an assistant for triage. Which line in the plan is wrong?

A. Test the current chat model on 300 past claims before tuning anything.
B. Tune on 5,000 reviewed claim notes so the summary layout matches the claims system.
C. Fine-tune every week so the model knows this week's policy wording.
D. Keep the policy limits in a document the agent searches when it answers.

**Answer:** C. Policy wording changes often. Tuned weights keep what they learned until you train again, so changing facts belong in retrieved documents. Tune only for format and behaviour.

**Quick check:** An insurer wants its claims assistant to reply in a fixed format, and it already uses a chat model. Which step fits?

A. Pretraining a new model from scratch
B. Fine-tuning on reviewed examples of the format
C. Retraining from scratch on the whole company archive
D. Turning the temperature up

**Answer:** B. The chat model already follows instructions, so a small set of reviewed examples can teach the format. Pretraining from scratch costs far more, and temperature only changes how random replies are.

## Can you answer these from memory?

**Flash cards**

- **What is pretraining?** The big first run: learning to predict the next token from a huge, general text pile.
- **What is a base model?** A pretrained model that has not yet been tuned to follow requests.
- **What is fine-tuning?** More training on a smaller, chosen dataset, which changes the model's weights.
- **What is instruction tuning?** Fine-tuning on request and good answer pairs, so the model follows instructions.
- **What is RLHF?** Reinforcement learning from human feedback: learning from people's rankings of answers.
- **Where do facts that change go?** In retrieved documents, not in the weights you tune.

## Likely follow-up questions

- Q017 Base model vs chat/instruct model? https://designervenkat.online/interview/ai/base-model-vs-chat-instruct-model
- Q110 Where is the line between prompting and fine-tuning? https://designervenkat.online/interview/ai/where-is-the-line-between-prompting-and-fine-tuning
- Q281 Fine-tune vs RAG vs prompting: when to use which? https://designervenkat.online/interview/ai/fine-tuning-vs-rag-vs-prompting
- Q282 What is full fine-tuning? https://designervenkat.online/interview/ai/what-is-full-fine-tuning
- Q288 What is RLHF? https://designervenkat.online/interview/ai/what-is-rlhf
- Q296 What is catastrophic forgetting? https://designervenkat.online/interview/ai/what-is-catastrophic-forgetting

## Learn it in depth

- [Fine-tuning](https://designervenkat.online/learn/ai-engineering/fine-tuning)
- [RAG vs Fine-tuning](https://designervenkat.online/learn/ai-engineering/rag-vs-fine-tuning)
