Scaling Instruction-Finetuned Language Models

Flan-T5-XL has 3 billion parameters and scores 52.4 on MMLU with no examples. The raw T5-XXL has 11 billion and scores 33.7. A short round of instruction tuning beat a model 3.7 times larger.

Pick a model, then ask it a question. Watch the raw model keep writing the document while the tuned one answers. Then we build, piece by piece, what Hyung Won Chung, Le Hou, Shayne Longpre and colleagues (Google Research, 2022) tuned on, how much, and why each ingredient matters.

You need what a language model is, fine-tuning basics and prompting. We build the rest from zero.

Ask the same question

Ready

Pick a model and ask. Compare what each one writes with its MMLU score.

MMLU zero-shot scores are the values in the Chapter 4 table (T5-XXL 33.7, Flan-T5-XL 52.4, Flan-T5-XXL 57.2). The replies are an illustration of the behaviour Chapter 0 describes, not recorded model output.

Chapter 0

The Instruction Gap

See why a model with all the knowledge still ignores your question, and what instruction tuning adds

You have pre-trained a massive language model: 540 billion parameters, trained on trillions of tokens. It can complete any text prompt with remarkable fluency. But ask it “What is the capital of France?” and instead of answering “Paris,” it might continue: “What is the capital of Germany? What is the capital of Italy?…” It writes more questions instead of an answer.

The problem is that pre-trained language models are text completers, not instruction followers. They learned to predict what text comes next. That differs from understanding what a human wants when they write a question. The pre-training data is mostly documents, articles and books, not question and answer pairs or task instructions.

The instruction gap: Pre-trained models have the knowledge to answer questions, translate languages and solve problems. All of it sits in their weights. But they lack the interface: the ability to see that “Translate this to French: Hello” means “produce a French translation” and not “continue this document about translation.” Instruction tuning bridges this gap.

Instruction tuning (also called instruction fine-tuning) is the process of fine-tuning a pre-trained model on a diverse mixture of tasks, each written as a natural language instruction. Task-specific fine-tuning builds one model per task. Instruction tuning teaches one model to follow instructions for any task.

Pre-trained vs instruction-tuned

The same prompt goes to a base model (a text completer) and an instruction-tuned model (an instruction follower). Press the button to cycle through three prompts.

The three exchanges are illustrations of the behaviour described in the text, not recorded outputs of a specific model.

Earlier work (FLAN, 2021; T0, 2021) had shown that instruction tuning works. But critical questions remained. How does performance scale with the number of tasks? Does it help to include chain-of-thought examples? What is the effect of model size? This paper answers all three, step by step.

Why do these questions matter in practice? Because the answers tell you how to spend your training budget. If more tasks always help, you should collect and format more tasks. If chain of thought helps, you should include reasoning traces. If larger models benefit more, you should save your instruction-tuning effort for your largest model. The paper gives data-driven answers to all of these allocation decisions.

The paper also introduces Flan-T5 and Flan-PaLM, the instruction-tuned versions of Google’s T5 and PaLM models. Flan-T5 in particular became one of the most widely used open-source models. It was the default instruction-following model for the research community until LLaMA-based models took over in mid-2023.

python
# The instruction tuning pipeline (simplified)
from transformers import T5ForConditionalGeneration

# 1. Start with pre-trained model
model = T5ForConditionalGeneration.from_pretrained("t5-xxl")

# 2. Prepare instruction data: (instruction + input) → output
#    1,836 tasks × multiple templates = millions of examples

# 3. Fine-tune with standard seq2seq loss
#    30K-40K steps, batch size 128, lr=1e-3
#    Result: T5-XXL → Flan-T5-XXL

# Key insight: only 30K-40K steps — about 1% of pre-training compute
# This tiny investment yields 20+ point improvements on benchmarks
Previous WorkTasksModelLimitation
FLAN (2021)62 tasks137BSmall task collection, no CoT
T0 (2021)35 datasets11BSmaller model, no scaling analysis
Flan-PaLM (this paper)1,836 tasks540BComprehensive scaling study

The road

  1. The Flan Task Collection: 1,836 tasks, many prompt templates, and how to mix them.
  2. Scaling Effects: more tasks and bigger models, and who gains most.
  3. Chain-of-Thought Fine-Tuning: one percent of reasoning data, and why the mix matters.
  4. Results: benchmarks, and a 3B model that beats an 11B one.
  5. Practical Guidelines: the five-step recipe and the forgetting cliff.
  6. Scaling Explorer: all three axes in one instrument.
  7. Connections: what it built on and what came after.
What is the “instruction gap” in pre-trained language models?

Chapter 1

The Flan Task Collection

Build a mix of 1,836 tasks from four sources and learn how to sample it fairly

The paper’s first contribution is a massive instruction tuning dataset: 1,836 tasks collected from four sources, each written with multiple prompt templates.

SourceTasksDescription
Flan 202162Original FLAN tasks: NLI, QA, sentiment, translation, etc.
P3 (T0)35 datasets (~270 prompts)PromptSource community templates with diverse prompt formats
Super-Natural Instructions757Crowdsourced tasks with detailed instructions and definitions
Chain-of-Thought collection9 datasetsTasks requiring step-by-step reasoning (math, logic, commonsense)

Explore the task collection

Each bar is one source, and its height is the number of tasks. Choose a source to light it up and read its share.

Bar heights are the headline counts in the table above. They do not sum to the paper’s 1,836 total, so the chart shows the relative size of the sources, not the whole collection.

Each task has up to 10 different prompt templates (instructions phrased in different ways). For example, a sentiment analysis task might have:

prompt templates
# Template 1:
"Classify the sentiment of the following review: {review}\nSentiment:"

# Template 2:
"Is the following review positive or negative?\n{review}\nAnswer:"

# Template 3:
"Read the review and determine if the author liked the product.\nReview: {review}\nLiked:"

# Template 4:
"What is the sentiment (positive/negative) of this text?\n{review}"
Why multiple templates matter: If all sentiment tasks use the same template, the model might learn a shallow pattern (“when I see ‘classify the sentiment,’ output positive or negative”) and not the task itself. Many different templates force the model to understand the meaning of instructions, not just match one phrasing.

Task mixing

The 1,836 tasks differ hugely in size. Some have 100 examples, others have millions. How do you mix them? The paper uses temperature-based sampling:

p(taski)
How likely a training example is to come from task i. The sign ∝ means “proportional to”: rescale all the weights so they add up to 1.
ni
The number of examples in task i.
K
A cap. No task counts as larger than K, so a huge task cannot dominate.
1/T
The temperature. T = 1 samples in proportion to size. A higher T flattens the odds, and T → ∞ gives uniform sampling across tasks.

Worked number, with K = 3,000 and T = 3. Take a task with 100 examples and a task with 3,000 or more. Their weights are 1001/3 ≈ 4.6 and 3,0001/3 ≈ 14.4. The big task is sampled about 3.1 times as often. At T = 1 it would be 30 times as often.

Turn the sampling temperature

Four tasks of very different size, capped at K = 3,000. The bar is each task’s share of the mix. The tick shows the share it would get from raw size with no cap. Drag T and watch the small tasks come back.

3

Illustrative task sizes: 100, 1,000, 20,000 and 1,000,000 examples. The formula and the cap K = 3,000 are the ones in the code below.

Input and output format

Each training example is an (instruction, input, output) triple, formatted as a text-to-text problem:

example
# Input to model:
"Classify the sentiment of the following movie review.\n"
"Review: This movie was absolutely terrible. The acting was wooden,\n"
"the plot made no sense, and I wanted to leave after 20 minutes.\n"
"Sentiment:"

# Target output:
"Negative"

The model is trained with the standard language modeling loss on the target output, conditioned on the instruction and input. This is the same as supervised fine-tuning (SFT). The only difference is the diversity of tasks.

Let’s be precise about the training loss. For encoder-decoder models (T5/PaLM), the input (instruction plus input text) is encoded, and the model generates the output one token at a time. The loss is computed only on the output tokens, not the input:

L
The loss. Training pushes it down.
∑t=1T
Add up the term for each of the T output tokens.
p(yt | …)
The probability the model gives to the correct output token yt, given the correct tokens before it. The log makes a confident wrong answer cost a lot.
x
The encoded instruction and input. It is context only. It has no loss term of its own.

The model is not penalized for generating the wrong instruction. It is only penalized for generating the wrong response. The instruction serves as conditioning context.

python
# Task sampling with temperature
import numpy as np

def sample_tasks(task_sizes, K=3000, T=3.0):
    """Temperature-based task sampling to balance task sizes"""
    capped = np.minimum(task_sizes, K)   # cap at K examples
    weights = capped ** (1.0 / T)         # temperature smoothing
    probs = weights / weights.sum()       # normalize to probabilities
    return probs
    # T=1: proportional to size (big tasks dominate)
    # T=3: smoothed (standard choice — balanced)
    # T=∞: uniform (all tasks equally likely)
Why does the Flan collection use multiple prompt templates per task instead of one?

Chapter 2

Scaling Effects

Add tasks and parameters, and see which models gain the most

The paper’s central question: does performance keep improving as you add more instruction-tuning tasks? The answer is a resounding yes, and the scaling curve has not saturated at 1,836 tasks.

Scaling the number of tasks

The authors ran a systematic ablation: start with a subset of tasks, add more step by step, and measure performance on held-out benchmarks. The key point is that they evaluate on held-out tasks, tasks NOT in the instruction tuning mixture. This tests generalization. Does the model learn to follow novel instructions, or does it just memorize the tasks it trained on?

The results show a clear log-linear relationship:

The key finding: Performance improves roughly linearly with the log of the number of tasks. Going from 282 → 1,836 tasks improves zero-shot performance by 2-5% across benchmarks. And the curve has not flattened, which suggests that adding even more tasks would continue to help. This is a scaling law for instruction tuning, like the scaling laws for pre-training.

Add tasks, climb the curve

The x-axis is log-scaled. Drag the slider to add more tasks and watch the point ride the curve.

1,836

Illustrative curve: score = 55 + 8 × log10(tasks), drawn to show the log-linear shape the paper reports. It is not the paper’s measured line.

Scaling model size

Instruction tuning was applied to PaLM at three scales (8B, 62B, 540B) and T5 at four scales (250M, 780M, 3B, 11B). The results show an interaction between model size and instruction tuning:

ModelBefore ITAfter ITGain
PaLM 8B52.159.3+7.2
PaLM 62B68.473.8+5.4
PaLM 540B78.381.4+3.1
T5 11B33.757.2+23.5

Three patterns emerge:

1. Instruction tuning helps all sizes. Even the 540B model improves meaningfully (+3.1 on average). This was not obvious. You might expect a 540B model to be so capable that instruction tuning is redundant. That it still helps shows that even the largest models do not learn to follow instructions from pre-training alone.

2. Relative improvement is larger for smaller models. T5-11B gains 23.5 points. Instruction tuning can partly make up for limited model capacity. The smaller model has the knowledge but needs more “steering” to use it well.

3. Absolute improvement is larger for larger models on hard tasks. Relative improvement falls with size, but the absolute gap on difficult reasoning tasks is larger for bigger models. This makes sense: reasoning ability grows with model size, and instruction tuning “unlocks” whatever reasoning capability the model already has.

python
# The scaling interaction: model size × instruction tuning
# Think of it as: Knowledge × Interface = Performance
#
# PaLM 8B:   Limited knowledge × Great interface → Moderate performance
#            52.1 × IT → 59.3 (relative gain: +14%)
#
# PaLM 540B: Vast knowledge × Great interface → Excellent performance
#            78.3 × IT → 81.4 (relative gain: +4%)
#
# The interface improvement is similar in both cases.
# But the smaller model benefits more because its knowledge/interface
# ratio was more imbalanced — it "knew" more than it could express.
Practical implication: If you cannot afford a 540B model, instruction tuning a smaller model gets you surprisingly far. Flan-T5 11B (instruction-tuned) outperforms the raw PaLM 62B (not instruction-tuned) on many benchmarks. A model six times smaller beats one six times larger when properly tuned. This is one of the most cost-effective interventions in LLM training.

Why does instruction tuning help smaller models more in relative terms? Smith and Ivison’s later “Camels” paper gives an answer: instruction tuning is mostly a “style transfer” step that teaches the model how to present its knowledge, not what to know. Smaller models have a larger gap between their latent knowledge and their ability to express it in instruction-following form. Tuning closes this gap more for smaller models because their “interface deficit” is larger.

The paper also runs an important ablation on the number of prompt templates per task. Using 10 templates per task (instead of 1) improves performance by 2-3 points on held-out benchmarks. Each extra template gives a slightly different phrasing of the same task. It teaches the model that one instruction can be written many ways, a crucial skill for following novel instructions that use unfamiliar phrasings.

How does the benefit of instruction tuning change with model size?

Chapter 3

Chain-of-Thought Fine-Tuning

Mix in one percent of worked reasoning and watch reasoning scores jump without hurting the rest

Perhaps the most impactful finding in the paper: including chain-of-thought (CoT) examples in the instruction tuning mixture sharply improves reasoning on held-out tasks.

Chain-of-thought prompting (Wei et al. 2022) asks the model to show its work, to write intermediate reasoning steps before the final answer. For example:

without CoT
"Q: Roger has 5 tennis balls. He buys 2 more cans of 3. How many does he have?"
"A: 11"

with CoT
"Q: Roger has 5 tennis balls. He buys 2 more cans of 3. How many does he have?"
"A: Roger starts with 5 balls. He buys 2 cans of 3 balls each."
"That's 2 × 3 = 6 new balls. Total = 5 + 6 = 11. The answer is 11."

The paper puts 9 CoT datasets (math, commonsense, logic) in the instruction tuning mix. They are only ~1% of total examples. Despite this tiny share, the impact is dramatic:

ConfigCoT benchmarksNon-CoT benchmarks
No CoT in tuning56.173.5
CoT only in tuning70.266.8
Mix (non-CoT + CoT)73.873.0
The surprise: Including CoT examples does not just improve reasoning tasks. It also keeps (or slightly improves) non-reasoning tasks. And CoT fine-tuning is far more effective than CoT prompting alone. When the model has been fine-tuned on CoT examples, it takes in the “show your work” pattern and applies it to novel tasks, even tasks not seen during training.

Change the tuning mix

Pick what goes in the instruction tuning mixture. The purple bar is reasoning (CoT) benchmarks and the teal bar is standard benchmarks. The mixed approach scores best on both.

The six scores are the values in the table above.

Why mixing helps

Using CoT data alone hurts non-reasoning tasks (73.5 → 66.8). This makes sense: if you only train on step-by-step reasoning, the model may try to “reason” when a simple direct answer is needed. The mixed approach teaches the model when to reason step by step and when to answer directly.

The mechanism is subtle. With CoT-only training, the model learns a “default mode” of long step-by-step reasoning. Asked “What is the capital of France?”, it might reply: “Let me think step by step. France is a country in Western Europe. Countries have capital cities. The capital of France is Paris. The answer is Paris.” This is correct but needlessly long. The mixed approach teaches the model that simple factual questions deserve direct answers (“Paris”), while complex reasoning questions deserve step-by-step solutions.

python
# CoT mixing: the key is teaching WHEN to reason

# Standard task (99% of mix):
# Q: "What is the capital of France?"
# A: "Paris"  ← direct answer

# CoT task (1% of mix):
# Q: "If John has 3 apples and buys 2 bags of 4, how many?"
# A: "John starts with 3 apples. He buys 2 bags with 4 each.
#     That's 2 × 4 = 8 new apples. Total = 3 + 8 = 11."

# After mixed training, the model learns:
# - Simple questions → direct answer
# - Multi-step reasoning → show work
# This is implicit mode selection from the training distribution
CoT fine-tuning vs CoT prompting: CoT prompting (Wei et al., 2022) adds “Let’s think step by step” to the prompt at inference time. CoT fine-tuning puts step-by-step examples in the training data. The paper shows that fine-tuning is far more effective: it builds in the reasoning pattern and does not rely on a prompt trigger. After CoT fine-tuning, the model writes chain-of-thought reasoning even without being asked to.
Why is the “mixed” CoT approach (both CoT and non-CoT examples) better than CoT-only fine-tuning?

Chapter 4

Results

Compare base and tuned models on four benchmarks and find the biggest surprise

Flan-PaLM 540B (PaLM instruction-tuned with the Flan collection) reaches state-of-the-art results on a broad range of benchmarks:

BenchmarkPaLM 540BFlan-PaLM 540BGPT-3.5 (text-davinci-002)
MMLU (5-shot)69.373.668.0
BBH (CoT)62.066.364.3
TyDiQA55.272.6—
MGSM (multilingual math)45.972.0—
The most impressive result is on multilingual tasks. Flan-PaLM improves TyDiQA from 55.2 → 72.6 (+17.4!) and MGSM from 45.9 → 72.0 (+26.1!). This suggests that instruction tuning does not just teach the model to follow instructions. It also improves how well the model carries knowledge across languages, likely because the instruction tuning data covers diverse languages and tasks.

Flan-T5: the practical winner

Flan-PaLM 540B is impressive, but it is impractical for most users. Flan-T5 is the practical variant: instruction tuning applied to Google’s T5 models. The results are remarkable:

ModelParamsMMLU (0-shot)BBH (CoT)
T5-XL (no IT)3B28.324.1
Flan-T5-XL3B52.443.6
T5-XXL (no IT)11B33.728.5
Flan-T5-XXL11B57.249.0

Flan-T5-XL (3B) with instruction tuning beats the raw T5-XXL (11B) on both benchmarks. Instruction tuning is worth more than a 3.7 times increase in model size.

This result has large practical consequences. Running a 3B model is about 4 times cheaper than running an 11B model, in both memory and compute. If instruction tuning a 3B model beats running an 11B model without it, then instruction tuning is by far the most cost-effective step available. It costs less than buying bigger hardware, less than collecting more pre-training data, and less than any architecture change.

The “Flan tax” is tiny: Instruction tuning PaLM 540B takes about 0.2% of the pre-training compute. For T5-11B it is about 0.5%. So you get a 20+ point improvement on zero-shot benchmarks for under 1% extra compute. No other single step in ML has a cost-benefit ratio this good.

The paper also compares against GPT-3.5 (text-davinci-002), the strongest publicly available model at the time. Flan-PaLM 540B beats GPT-3.5 on MMLU (73.6 vs 68.0) and is competitive on BBH (66.3 vs 64.3). It was the first time an openly described instruction-tuning recipe produced a model competitive with OpenAI’s best, a significant milestone for open research.

Compare base against tuned

Grey bars are the base model. Teal bars are the instruction-tuned one. Switch between the PaLM and the T5 family.

All bars are the numbers in the two tables above.

Zero-shot vs few-shot

A particularly interesting finding: instruction tuning sharply improves zero-shot performance (no examples in the prompt) while keeping or slightly improving few-shot performance. This matters because zero-shot is the most user-friendly mode. You just ask a question without giving examples. Before instruction tuning, zero-shot performance was much worse than few-shot. After instruction tuning, the gap narrows or disappears.

python
# Zero-shot vs few-shot improvement
# PaLM 540B on MMLU:
#   0-shot: 69.3 → 73.6 (Flan) = +4.3
#   5-shot: 73.5 → 74.1 (Flan) = +0.6

# Zero-shot gains >> few-shot gains
# Why? Few-shot examples already provide an "interface" —
# they show the model what format to use.
# Instruction tuning provides this interface permanently,
# making the few-shot examples redundant.
What is the most surprising finding from the Flan benchmark results?

Chapter 5

Practical Guidelines

Follow the five-step recipe and find the point where more training starts to hurt

The paper boils its findings down to concrete guidelines for practitioners who want to instruction-tune their own models. These guidelines have proven remarkably durable.

Recipe

1. Maximize task diversity
More diverse tasks (from different datasets, with different prompt templates) consistently improve results. The curve has not saturated at 1,836 tasks.
↓
2. Include chain-of-thought
Mix ~1% CoT data with 99% standard data. This is the single most impactful addition. It unlocks reasoning at near-zero cost.
↓
3. Use input inversion
For classification tasks, randomly swap input and output roles: “What sentiment does ‘great movie’ have?” → “Give an example of a positive review.”
↓
4. Balance task sizes
Use temperature sampling to stop large tasks from dominating. T=3 works well as a default.
↓
5. Short fine-tuning
Only 30K-40K gradient steps. Over-training on instructions degrades pre-trained capabilities (catastrophic forgetting).
Input inversion is an underappreciated trick. When you ask a model “classify the sentiment of X,” it learns to classify. But when you also ask “generate a text with positive sentiment,” it learns to produce that category. This two-way understanding makes the model more robust. It learns what a category is, not just how to label it.
python
# Input inversion examples

# Original task:
# Input:  "Classify: 'This movie is great' → ?"
# Output: "Positive"

# Inverted task:
# Input:  "Generate a positive movie review."
# Output: "This movie is great, with excellent acting."

# Why this helps: the model learns BOTH directions of the mapping
# Original: text → label (recognition)
# Inverted: label → text (generation)
# Together: deep understanding of what "positive" means

Training duration: the forgetting cliff

The advice of 30K-40K gradient steps comes from a careful look at the training curve. Performance on instruction-tuning tasks improves steadily throughout training. But performance on held-out tasks (tasks not seen during instruction tuning) peaks around 30K-40K steps and then starts to fall. This is catastrophic forgetting: the model overwrites its pre-trained knowledge with instruction-specific patterns.

Performance(steps)
Held-out score after a given number of instruction-tuning steps.
Knowledgepre-train
What the model knew before tuning started.
e−λ · steps
A decay factor. Each step shrinks the pre-trained knowledge a little, at rate λ.
Instruction(steps)
The instruction-following ability, which grows with the steps.

The first term is pre-trained knowledge, which decays exponentially with instruction-tuning steps. The second term is growing instruction-following ability. The best number of steps balances the two. Too few steps and instruction-following is weak. Too many and the pre-trained knowledge is lost. This is a sketch of the trade-off, not a formula the paper fits.

What NOT to do

MistakeWhy it hurts
Too few tasksModel overfits to seen instruction patterns, fails on novel ones
Only one template per taskModel learns template matching, not instruction understanding
Too much trainingPre-trained knowledge is overwritten (catastrophic forgetting)
Only CoT dataModel tries to reason on simple factual questions
Uniform task samplingTiny tasks get drowned by massive ones

Switch recipe parts on and off

Turn each ingredient on or off and read the predicted score. Each part adds its own share.

Illustrative additive model: a base of 55, plus 12 for diverse tasks, 8 for CoT data and 3 for input inversion. These weights are a teaching toy, not measurements from the paper.

Why does the paper recommend only 30K-40K gradient steps for instruction tuning, not more?

Chapter 6

Scaling Explorer

Turn all three scaling axes at once and see that each adds its own share

Let’s bring the paper’s three scaling dimensions together in one instrument. You can vary the number of tasks, the model size and the presence of CoT data on their own, and see how each affects performance.

Three-axis scaling explorer

Adjust the number of tasks, the model size and CoT inclusion. Each bar is the share one axis adds. Notice that each axis contributes on its own.

1,836
540B

Illustrative formula from the code below: score = 50 + 8 × log10(tasks) − 8 + a size bonus (0, 8, 16 or 22) + 8 for CoT, capped at 95. It shows the additive-in-log shape, not the paper’s measured scores.

The three scaling laws of instruction tuning

AxisScaling BehaviorSaturation?
Number of tasksLog-linear improvement: 2x tasks ≈ +1-2% accuracyNot observed at 1,836
Model sizePower-law improvement: 10x params ≈ +5-10% accuracyNot observed at 540B
CoT inclusionStep function: including ANY CoT gives +5-15% on reasoningMostly saturated at ~1% mix
The multiplicative benefit: The three axes interact multiplicatively. More tasks helps, bigger models help, and CoT helps. But combining all three gives results far better than any single axis alone. This is why Flan-PaLM 540B (large model + many tasks + CoT) is so dominant. It gains from all three scaling dimensions at once.

The paper gives evidence for this by running a full factorial experiment: every combination of (few tasks / many tasks) × (small model / large model) × (with CoT / without CoT). The gains from each axis are roughly additive in log-space, which means they are multiplicative in raw performance. This matters because it tells practitioners to invest in all three axes. Skipping any one of them leaves significant performance on the table.

python
# The three scaling dimensions — approximate formula
# Performance ≈ Base + log(tasks)*8 + log(params)*3 + CoT*8

# Worst case: 20 tasks, 250M params, no CoT
# ≈ 50 + 10.4 + 0 + 0 = 60.4%

# Best case: 1836 tasks, 540B params, with CoT
# ≈ 50 + 26.1 + 22 + 8 = 106.1% (capped at ~95%)

# Marginal value of each axis at best settings:
# Adding tasks (20→1836):   +15.7 points
# Adding scale (250M→540B): +22.0 points
# Adding CoT:               +8.0 points
Which of the three scaling axes (tasks, model size, CoT) shows the most “step function” behavior, giving most of its benefit at minimal inclusion?

Chapter 7

Connections

Place the paper in the field: what it built on, what came after, and what to carry away

This paper sits where two major trends meet: instruction tuning and scaling laws. It showed that both trends hold for the post-training phase, not just pre-training. More importantly, it gave the first comprehensive recipe for instruction tuning, a recipe the community followed for over a year.

The paper’s timing was critical. It came out in late 2022, just weeks before ChatGPT’s release. ChatGPT showed the public the power of instruction tuning plus RLHF. The Flan paper gave the research community the scientific base it needed to replicate and extend those results. Without this paper’s systematic analysis of what makes instruction tuning work, the open-source response to ChatGPT (Alpaca, Vicuna and others) would have been much more haphazard.

What this paper built on

FoundationContribution
FLAN (Wei 2021)Original instruction tuning on 62 tasks, which showed the concept works
T0/P3 (Sanh 2021)Community prompt templates + zero-shot generalization study
Super-Natural InstructionsLarge crowdsourced task collection with detailed definitions
CoT Prompting (Wei 2022)Chain-of-thought prompting at inference time
PaLM (Chowdhery 2022)The 540B base model that Flan-PaLM is built on

What came after

SuccessorAdvance
AlpacaFarmSimulated human feedback for faster instruction tuning research
Camels (Tülu)Systematic comparison of open instruction-tuning datasets
AlpacaSelf-instruct: generate instruction data from GPT-3.5, tune LLaMA
OrcaExplanation tuning: include GPT-4’s reasoning traces in the fine-tuning data
Llama 3Scaled instruction tuning + DPO to 405B parameters
This paper’s lasting impact:
1. More tasks always help. This became a design principle for instruction-tuning datasets.
2. CoT in fine-tuning. It is now standard practice. Every major model includes reasoning traces in its training data.
3. Flan-T5. It stayed the go-to open instruction-tuned model for over a year, until Llama-based models replaced it.
4. The recipe. The practical guidelines (temperature sampling, input inversion, short training) are still followed in 2024.

The CoT finding deserves special emphasis. Before this paper, chain-of-thought was purely an inference-time technique: you added “Let’s think step by step” to your prompt and hoped the model would reason better. This paper showed that putting CoT in the training data is far more effective. That insight directly shaped every later instruction-tuning effort. Llama 2 Chat, Mistral Instruct and Claude all include reasoning traces in their fine-tuning data.

The Flan-T5 model family (small, base, large, xl, xxl) also deserves credit for its practical impact. For over a year (late 2022 to mid-2023), Flan-T5 was the default instruction-following model for the research community. It was used in hundreds of papers, thousands of projects and countless applications. Its encoder-decoder design made it especially good at structured tasks (classification, extraction, translation) where the output format is well defined.

The paper in numbers

QuantityValue
Tasks in the Flan collection1,836
Prompt templates per taskup to 10
CoT share of the mix~1% (9 datasets)
Tuning length30K-40K steps
Tuning cost0.2% of pre-training compute (PaLM 540B), ~0.5% (T5-11B)
Flan-T5-XL (3B) vs T5-XXL (11B), MMLU 0-shot52.4 vs 33.7
Flan-PaLM 540B vs PaLM 540B, MGSM72.0 vs 45.9

The core of the paper, as code you can run:

python
# Using Flan-T5 — the most practical output of this paper
from transformers import T5ForConditionalGeneration, T5Tokenizer

model = T5ForConditionalGeneration.from_pretrained("google/flan-t5-xl")
tokenizer = T5Tokenizer.from_pretrained("google/flan-t5-xl")

# Zero-shot — no examples needed!
prompt = "Classify the sentiment: 'This movie was incredible'\nSentiment:"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=10)
print(tokenizer.decode(output[0], skip_special_tokens=True))
# → "positive"

# CoT reasoning — also works zero-shot after Flan tuning
prompt2 = "Q: If a train travels 60mph for 2.5 hours, how far does it go?"
# → "The train travels 60 miles per hour for 2.5 hours.
#    Distance = speed × time = 60 × 2.5 = 150 miles."

“Instruction tuning is a simple method that, across many settings, substantially improves the performance of pretrained language models.”
Chung et al., 2022

The takeaway: Tune on many diverse tasks, with many templates each. Add a little chain of thought. Sample with a temperature. Stop early. A small tuned model can beat a much larger raw one.
What is the most important practical takeaway from the Flan scaling paper?

Open Present to explain the recipe out loud, or Teach to draw it on the whiteboard. Then go back to the three models and ask the question again.

Scaling Instruction-Finetuned Language Models
Read the paper · Back to Veanors