Instruction tuning
Instruction tuning is fine-tuning a pre-trained language model on many examples of instructions paired with good responses, so that it follows requests instead of merely continuing text.
A freshly pre-trained language model is a text predictor. Ask it a question and it may continue with more questions, because that is what often follows a question on the web. Instruction tuning fixes this. The model is fine-tuned on a collection of prompts written as instructions, each paired with a good response, covering many different tasks. Google's machine learning glossary describes the result as a model that tends to give useful responses to zero-shot prompts, meaning requests it gets without worked examples, across a variety of tasks.
A training example might be the instruction Summarise this email in one sentence, followed by an email and a one-sentence summary. Thousands or millions of such pairs teach the model the general habit of doing what it is asked: answering, translating, listing, rewriting, refusing where appropriate.
Its value was shown in the FLAN paper, Finetuned Language Models Are Zero-Shot Learners, posted in September 2021 by Jason Wei and colleagues. They took a 137 billion parameter pre-trained model and fine-tuned it on more than 60 language tasks, each rephrased through natural-language instruction templates. The tuned model beat the zero-shot performance of the 175 billion parameter GPT-3 on 20 of 25 tasks. The number of tasks, the size of the model and the use of instructions all turned out to matter.
OpenAI's InstructGPT paper, posted in March 2022, combined the approach with human feedback. It fine-tuned GPT-3 on demonstrations written by human labellers and then refined it with reinforcement learning from human feedback; people preferred answers from the 1.3 billion parameter InstructGPT to those of the 175 billion parameter GPT-3. In March 2023 Stanford's Alpaca project showed how cheap the first step could be, instruction-tuning Meta's 7 billion parameter LLaMA on 52,000 demonstrations generated with an OpenAI model for under $600.
Quality matters more than sheer quantity. Meta's Llama 2 team reported in 2023 that tens of thousands of high-quality examples were enough, and stopped after collecting 27,540. Many open models are released in two versions, a base model and an instruction-tuned one often labelled instruct or chat; Meta released Llama 2 alongside Llama 2-Chat, for example.
Instruction tuning is a kind of fine-tuning. Fine-tuning means any further training of a pre-trained model on a narrower dataset; instruction tuning specifically uses many different tasks written as instructions with good responses, to make the model follow requests in general rather than do one job. Instruction tuning trains the model to copy good example responses. RLHF, which usually comes afterwards, trains the model on human judgements of which of its own answers are better. InstructGPT used both: supervised training on demonstrations first, then RLHF. It is a version of a language model that has been instruction-tuned so it follows requests. Developers often release both a base model, which simply continues text, and an instruct or chat version built from it. Less than pre-training by many orders of magnitude. Stanford's Alpaca used 52,000 examples, and Meta reported for Llama 2 that tens of thousands of high-quality examples were enough, stopping at 27,540.Common questions
What is the difference between instruction tuning and fine-tuning?
How is instruction tuning different from RLHF?
What is an instruct model?
How much data does instruction tuning need?
Search for "instruction tuning", "FLAN instruction tuning", "InstructGPT" or "supervised fine-tuning LLM" to follow the development of the method. The original papers on arXiv and model developers' technical reports describe what was done; Google's machine learning glossary gives a clear definition. Be cautious with claims that a small instruction-tuned model matches a large commercial one, since such comparisons often test a narrow set of tasks.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.