Paper commentary
Scaling Instruction-Finetuned Language Models
- Problem Instruction finetuning is known to help language models on unseen tasks, but prior studies usually varied only one factor, such as the number of templates, the number of tasks or the model size, and often left out chain-of-thought data. Their combined effect on held-out performance was unclear.
- Method The study finetunes PaLM, U-PaLM and T5 models on a 1,836-task collection with instruction templates, optional exemplars and chain-of-thought annotations, using Adafactor and packing, and then evaluates on held-out benchmarks.
- Results Flan-PaLM 540B improves the normalized average over PaLM 540B by 9.4%, while finetuning uses 0.2% of the pretraining compute.

Figure1 : Wefinetunevariouslanguagemodelson1.8Ktasksphrasedasinstructions,andevaluatethemonunseentasks. We finetune both with and without exemplars (i.e., zero-shot and few-shot) and with and without chain-of-thought, enabling generalization across a range of evaluation scenarios.
Original paper · CC BY 4.0 · Extracted the figure area from page 1 of the original PDF.What the study adds to instruction finetuning
Pretrained language models can carry out a task when it is described in natural language, and finetuning them on many tasks phrased as instructions makes them follow such descriptions more reliably with fewer demonstrations in the prompt. Prior studies typically varied one of these factors, such as the number of templates, the number of tasks or the model size, rather than all of them together.
The study varies three things together: the number of finetuning tasks, the size of the model, and whether chain-of-thought data is part of the mixture.
Earlier instruction finetuning without chain-of-thought data was observed to weaken chain-of-thought evaluations, so the study tests adding such data directly. Adding nine chain-of-thought datasets to the mixture is reported to improve performance on all evaluations. The resulting main model, Flan-PaLM, is a 540B-parameter PaLM finetuned on 1.8K tasks with chain-of-thought data.
How the finetuning collection is built
The finetuning collection merges four mixtures from earlier work, Muffin, T0-SF, NIV2 and CoT, into 1,836 tasks. T0-SF contributes 193 tasks from T0 that do not overlap with Muffin, and NIV2 contributes 1554 tasks. The authors removed 44 tasks related to MMLU from the NIV2 side, because MMLU is used for evaluation. Figure 2 summarizes the whole collection as 473 datasets across 146 task categories.
The CoT mixture is built from nine datasets for which human raters wrote chain-of-thought annotations. These nine datasets cover arithmetic reasoning, multi-hop reasoning and natural language inference, and ten instruction templates are written for each task.
Each example can be written with or without exemplars and with or without chain-of-thought, which gives four formats. Few-shot templates use delimiters such as 'Q:' and 'A:', and these are applied at the example level. Templates for Muffin, T0-SF and NIV2 are the instruction templates supplied by the creators of those mixtures.
Held-out evaluation uses MMLU, BBH with 27 tasks, TyDiQA in 8 languages and MGSM in 10 languages. These held-out tasks are not part of the finetuning data.
Finetuning recipe and its compute cost
The same training procedure is applied to T5, PaLM and U-PaLM models, from Flan-T5-small at 80M parameters up to 540B-parameter models. Only the learning rate, batch size, dropout and number of finetuning steps change between models, and their values are listed in Appendix E. Training uses a constant learning rate schedule and the Adafactor optimizer.
Packing concatenates several training examples into one sequence with an end-of-sequence token between inputs and targets, and masking stops attention from crossing into another example.
Each model is represented by one checkpoint for all evaluations. That checkpoint is the step chosen from periodic evaluations on the held-out tasks, run every 2k to 10k steps depending on model size. For Flan-PaLM 540B, finetuning uses about 512 v4 TPU chips for 37 hours, which is 0.2% of the pretraining compute. The JAX-based T5X framework runs the training.
Table 2 shows that finetuning remains a small share of total compute across models: 1.6% for Flan-T5-Small, 0.4% for the 8B and 62B Flan-PaLM models, and 0.2% for Flan-PaLM and Flan-U-PaLM at 540B. Compared with pretraining, the finetuning cost is therefore modest for each of these models.
Held-out accuracy and chain-of-thought effects
The normalized average over evaluation benchmarks is the summary used to compare models with and without finetuning. Flan-PaLM 540B improves this average by 9.4% over PaLM 540B. For the 8B model, instruction finetuning raises the normalized average by 15.5%. The authors also compute relative error reduction, which is 18.4% at 540B and 16.6% at 8B, because the no-finetuning baseline is also higher at 540B.
On five-shot MMLU, Flan-PaLM with chain-of-thought and self-consistency reaches 75.2%. Table 1 sets this against Flan-PaLM with direct five-shot prompting at 72.2, PaLM at 69.3 and the average human expert at 89.8. In the per-task appendix averages, chain-of-thought does not raise MMLU for Flan-PaLM 540B: direct prompting gives 73.5 and chain-of-thought gives 70.9.
The authors attribute this to MMLU consisting mostly of knowledge recall tasks.
On BBH, among the models the text groups as instruction-finetuned, chain-of-thought helps only Flan-PaLM 540B, Flan-cont-PaLM 62B and U-PaLM 540B. The authors connect this to chain-of-thought being an emergent ability of scaling language models.
On one-shot TyDiQA, Flan-PaLM improves on PaLM by 14.9% absolute. On arithmetic reasoning in under-represented languages, it improves by 8.1%.
Finetuning on non-CoT tasks alone was found to degrade performance on CoT tasks. Joint finetuning on non-CoT and CoT data keeps non-CoT performance while improving CoT performance, which is why the study uses it. Flan-U-PaLM, which combines the procedure with UL2R, is the strongest model trained in this work.
Zero-shot usability and toxicity
Without exemplars, PaLM often continues related text instead of answering, repeats the input with small changes, and does not know when to stop generating. Figure 9 shows zero-shot prompts answered by PaLM and by Flan-PaLM, where PaLM repeats the input or keeps generating. Human raters also rated Flan-PaLM outputs above PaLM outputs on a set of open-ended questions.
Toxicity is measured on RealToxicityPrompts by sampling 10k prompts uniformly and generating 25 continuations per prompt with top-k sampling at k = 40 and temperature 1.0. Continuations are scored with the Perspective API, and the toxicity probability is the chance that at least one of the 25 continuations scores 0.5 or higher. For non-toxic prompts, the 540B model's probability falls from 0.44 with PaLM to 0.18 with Flan-PaLM.
For toxic prompts, the same 540B comparison falls from 0.80 to 0.52. The 8B and 62B models move in the same direction on non-toxic prompts, from 0.44 to 0.14 and from 0.44 to 0.17.
Scaling tasks, size and model families
The authors plot scaling curves for the number of finetuning tasks and for model size. Returns from adding tasks are diminishing but still positive, and the margin of improvement over unfinetuned models does not appear to shrink as the model grows. The authors expect both scaling directions to keep improving performance.
The procedure was applied to T5 with span corruption, to decoder-only PaLM with a causal LM objective, and to U-PaLM with a prefix LM plus span corruption objective. This is consistent with earlier studies that found instruction finetuning effective on T5 models and on decoder-only language models.
Limits of the reported comparisons
Checkpoints are chosen by periodic evaluation on the held-out tasks that are later reported, so those scores also carry that selection. The no-finetuning baseline also improves with scale, so absolute gains alone do not settle how the effect changes with size. The authors did not evaluate how instruction-finetuned models perform when finetuned on a single task.
The toxicity comparison scores only the first complete sentence for PaLM but the entire continuation for Flan models, so the two protocols are not identical. The qualitative examples in Figures 10 and 11 are cherry-picked by the authors, so they illustrate behaviour and do not measure it. Whether chain-of-thought helps depends on the task, and on MMLU direct prompting is not worse.
Paper info
- Authors
- Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Yunxuan Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane Gu, Zhuyun Dai, Mirac Suzgun, Xinyun Chen, Aakanksha Chowdhery, Alex Castro-Ros, Marie Pellat, Kevin Robinson, Dasha Valter, Sharan Narang, Gaurav Mishra, Adams Yu, Vincent Zhao, Yanping Huang, Andrew Dai, Hongkun Yu, Slav Petrov, Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, Jason Wei
- Venue
- arXiv · Preprint
- First published
- 2022-10-20
- Added
- 2026-10-20
- Updated
- 2022-12-6
- Version
- v5
- arXiv
- 2210.11416
- Category
- cs.LG · cs.CL
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Finetuning language models on a collection of datasets phrased as instructions has been shown to improve model performance and generalization to unseen tasks. In this paper we explore instruction finetuning with a particular focus on (1) scaling the number of tasks, (2) scaling the model size, and (3) finetuning on chain-of-thought data. We find that instruction finetuning with the above aspects dramatically improves performance on a variety of model classes (PaLM, T5, U-PaLM), prompting setups (zero-shot, few-shot, CoT), and evaluation benchmarks (MMLU, BBH, TyDiQA, MGSM, open-ended generation). For instance, Flan-PaLM 540B instruction-finetuned on 1.8K tasks outperforms PALM 540B by a large margin (+9.4% on average). Flan-PaLM 540B achieves state-of-the-art performance on several benchmarks, such as 75.2% on five-shot MMLU. We also publicly release Flan-T5 checkpoints, which achieve strong few-shot performance even compared to much larger models, such as PaLM 62B. Overall, instruction finetuning is a general method for improving the performance and usability of pretrained language models.
Quote from the paper
Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Yunxuan Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane Gu, Zhuyun Dai, Mirac Suzgun, Xinyun Chen, Aakanksha Chowdhery, Alex Castro-Ros, Marie Pellat, Kevin Robinson, Dasha Valter et al. (2022). Scaling Instruction-Finetuned Language Models. arXiv:2210.11416v5. https://arxiv.org/abs/2210.11416v5
BibTeX
@misc{chung2022scaling,
title = {{Scaling Instruction-Finetuned Language Models}},
author = {Hyung Won Chung and Le Hou and Shayne Longpre and Barret Zoph and Yi Tay and William Fedus and Yunxuan Li and Xuezhi Wang and Mostafa Dehghani and Siddhartha Brahma and Albert Webson and Shixiang Shane Gu and Zhuyun Dai and Mirac Suzgun and Xinyun Chen and Aakanksha Chowdhery and Alex Castro-Ros and Marie Pellat and Kevin Robinson and Dasha Valter and Sharan Narang and Gaurav Mishra and Adams Yu and Vincent Zhao and Yanping Huang and Andrew Dai and Hongkun Yu and Slav Petrov and Ed H. Chi and Jeff Dean and Jacob Devlin and Adam Roberts and Denny Zhou and Quoc V. Le and Jason Wei},
year = {2022},
eprint = {2210.11416},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2210.11416v5}
}