Instruction Tuning

The Problem Instruction Tuning Solves

A pretrained base model was optimized to predict the next token in web text. Users want something different: they want to give an instruction and receive a helpful, well-formatted response.

Pretrained base model

User types: "Summarize this article:"

Model output: continues the article with more text, or summarizes inconsistently

The model is doing what it was trained to do — predict likely next tokens. It was not trained to understand that "Summarize:" is a command.

Instruction-tuned model

User types: "Summarize this article:"

Model output: a concise, accurate summary in the appropriate format

The model has learned that instructions are commands and that the right behavior is to fulfill them helpfully.

The Mismatch

The pretraining task is "what text likely comes next?" The user task is "given my instruction, produce a helpful response." These are different. Instruction tuning bridges the gap by training the model on exactly the behavior users want.

How Instruction Tuning Works

01

Collect instruction data — build a dataset of diverse instructions paired with high-quality ideal responses

02

Fine-tune the pretrained model — train on this dataset using supervised learning, updating parameters to produce responses that match the examples

03

Evaluate across task types — measure performance across summarization, Q&A, code, translation, and other task types

04

Iterate on data quality — identify gaps and failure modes, create new examples to address them, and retrain

How Instruction Data Is Created

01

Human-written — contractors write diverse instructions and ideal responses from scratch. Expensive but highest quality. Used in the original InstructGPT paper behind ChatGPT

02

Templated conversion — existing NLP datasets (Q&A, summarization, translation) are reformatted as instruction-response pairs. Scales cheaply but produces less varied formats

03

Self-instruct (model-generated) — a capable model generates instruction-response pairs, filtered for quality. Bootstraps data at scale but inherits the generator's biases

04

Human + model hybrid — humans write seed instructions; a model drafts responses; humans verify and edit. Balances quality and cost

What Good Instruction Data Looks Like

Task diversity

Summarization, classification, code generation, explanation, translation, editing, question answering, creative writing, refusal of harmful requests — the model should see all of these.

A model trained only on Q&A will not summarize well. Diversity is what produces general instruction-following ability.

Response quality

Responses must be accurate, well-formatted, appropriately detailed, and written in the tone the model should adopt.

Mediocre training responses produce mediocre model behavior. The model learns to mimic what it sees.

The Scale of Instruction Data Needed

Key Research Finding

Early research (the InstructGPT paper) showed that as few as 13,000 high-quality examples can dramatically change model behavior. You do not need millions of examples if they are high quality and diverse. Quality dominates quantity in instruction tuning. This is the opposite of pretraining, where raw scale matters enormously.

Instruction Tuning vs. Standard Fine-Tuning

Standard fine-tuning

Adapts the model to a specific domain — medical, legal, code. Training examples may resemble pretraining data: raw domain text.

Goal: make the model more fluent and knowledgeable in one area.

Instruction tuning

Adapts the model to the meta-task of following instructions across many domains. Training examples are always instruction → ideal response pairs.

Goal: make the model respond helpfully to any instruction, not just in one domain.

Summary

Key Takeaways
  • Instruction tuning fine-tunes a model on instruction-response pairs to teach it to follow commands
  • Without it, pretrained models continue text rather than responding to user instructions
  • Instruction data is created through human writing, templating, model generation, or hybrids
  • Task diversity and response quality are the two most important properties of instruction data
  • As few as 13,000 high-quality examples can dramatically transform model behavior
  • Most commercial models receive instruction tuning followed by RLHF for further alignment

Need Help?

Ask the AI if you need help understanding instruction tuning, how it differs from standard fine-tuning, how instruction datasets are built, or why quality matters more than quantity in instruction data.