g↗genai/ learner
How GenAI works / Lesson 04

From base model to assistant

A raw base model is trained to predict the next token on internet text, not to answer your questions. How does a predictor become a helpful assistant that follows instructions?

Concept + interactive labBeginner friendly

A predictor is not an assistant.

In previous lessons, we saw that language models predict the next likely token based on patterns learned during pretraining. When a model finishes pretraining on massive web archives, it is known as a raw base model (or foundation model).

Base models are capable pattern continuators, but they do not know they are chatbots. If you give a base model the prompt “Write three reasons why honey doesn’t spoil,” it might not answer you. Instead, it might generate:

Write three reasons why honey doesn't spoil.
Write three reasons why bread goes stale.
Write three reasons why milk curdles.

To the base model, your prompt looks like line 1 of a school study guide or a teacher’s quiz. Predicting more quiz questions is a statistically valid continuation of internet text. To turn a base model into a helpful tool, engineers must train it for a very different job: instruction following.

Key insight: A base model asks: “What text commonly follows this sequence online?” An assistant asks: “What is the most helpful answer to this user’s request?”
A diagram shows a base model trained to continue web text, instruction tuning updating weights with request-and-answer examples, and the resulting assistant answering a honey question.
Instruction tuning teaches the model to follow requests.

Guess which reply is base vs assistant.

Test your intuition with three realistic scenarios below. Each prompt was fed to both a raw base model and an instruction-tuned assistant. Inspect the completions, guess which one came from the assistant, and explore why each model responded the way it did.

Scenarios:
Prompt under testStep-by-step instruction

“Give me a simple recipe for scrambled eggs.”

Two models were given this prompt. One is a raw base model (trained only on web next-token prediction). The other is an instruction-tuned assistant. Which completion came from the assistant?

Option A
Give me a simple recipe for pancakes. Give me a simple recipe for French toast. Give me a simple recipe for breakfast burritos. Give me a simple recipe for waffles.
Option B
Here is a quick recipe for soft scrambled eggs: 1. Beat 2 eggs with a pinch of salt. 2. Melt 1 tbsp butter in a non-stick pan over low heat. 3. Pour in eggs, gently stirring until soft curds form. 4. Remove from heat immediately and serve.
Simulation disclosure: Sample completions, prompt wrapper outputs, and delimiter token traces are illustrative examples of typical raw base model patterns (list continuation, exam questions, document completion) versus instruction-tuned conversational models (SFT). Exact continuations vary across model checkpoints, prompting templates, temperature, and sampling seeds.

What instruction tuning changes.

The process that bridges the gap between a base model and an assistant is called Instruction Tuning, commonly implemented through Supervised Fine-Tuning (SFT).

Instead of reading raw web pages, the model is trained on tens of thousands of carefully authored demonstrations (for example, InstructGPT used ~13,000 demonstration pairs, while Llama 2 SFT used ~27,500) consisting of paired turns:

User: Explain photosynthesis in simple terms for a 10-year-old.
Assistant: Photosynthesis is how plants make their food using sunlight, water, and air...

During fine-tuning, backpropagation updates the model’s weights. The network learns:

  • Turn boundaries: Special delimiter tokens (such as Llama 3’s <|start_header_id|>user<|end_header_id|> or ChatML’s <|im_start|>user) teach the model when to stop listening and start answering.
  • Instruction following: The weights adjust so that imperative verbs (summarize, translate, compare) increase the probability of an answer fulfilling the task, rather than echoing the prompt.
  • Constraint handling: The model learns to respect length limits (“in one sentence”), format requirements (“as a JSON object”), and tone guidelines.

Later stages, such as Reinforcement Learning from Human Feedback (RLHF) or Direct Preference Optimization (DPO), further align the model by rewarding helpful, safe, and honest completions while penalizing harmful or evasive ones.

Why a prompt wrapper is not enough.

A common misconception is that an assistant is just a raw base model with a hidden system prompt prepended, such as:

"You are a helpful assistant. Please answer this query: " + user_input

This does not work reliably on a raw base model. Because the weights have not been instruction-tuned, the model treats the entire string—wrapper included—as arbitrary text to continue. It might generate another prompt wrapper, pretend to be a user asking another question, or complete a dialogue script from a screenplay.

The difference: A system prompt steers an assistant that already understands conversational roles. Instruction tuning creates the capability to follow roles in the first place.
✎ Try it yourselfKnowledge check · Practice only

Check your understanding.

Why can’t you turn a raw base model into a reliable assistant simply by prefixing every prompt with 'You are a helpful assistant'?
THE TAKEAWAY

Take this with you.

Pretraining builds the knowledge; instruction tuning builds the assistant.

A base model learns grammar, facts, and reasoning by predicting next tokens across the open web. Instruction tuning changes the model’s weights to treat user input as instructions to fulfill rather than patterns to continue. Prompting guides an assistant, but training makes one.

Next available lesson: see how the context window limits how much text a model can process at once.