Instruction following

Instruction following is a language model's ability to do what a request actually asks, including explicit constraints on format, length, content and style, rather than simply continuing the text it was given.

A model fresh from pre-training predicts plausible continuations of text. Given "Write three tips for a job interview", it might carry on with more questions in the same style instead of writing the tips. Instruction following is the learned behaviour of treating the input as a request and meeting it, including the conditions attached: under 100 words, in a table, in French, without mentioning prices.

The behaviour is taught after pre-training. In September 2021, Jason Wei and colleagues described FLAN, a 137 billion parameter model fine-tuned on more than 60 language tasks phrased as instructions; on 20 of 25 tasks it beat the much larger GPT-3 in zero-shot tests. In March 2022, Long Ouyang and colleagues described InstructGPT, fine-tuned first on demonstrations written by human labellers and then with reinforcement learning from human feedback. Human evaluators preferred the outputs of the 1.3 billion parameter InstructGPT to those of the 175 billion parameter GPT-3, despite it having about 100 times fewer parameters. That recipe underlies today's chat assistants.

Measuring the skill is awkward, because judging whether an answer did what was asked is often subjective. IFEval, introduced by Jeffrey Zhou and colleagues in November 2023, avoids that with instructions a program can check, such as writing more than 400 words or mentioning a keyword at least three times. It covers 25 types of instruction across around 500 prompts, and its scores appear in model documentation such as Meta's Llama 3.1 model cards.

A high IFEval score shows a model obeys constraints that code can verify. It does not show that the substance of an answer was what the user wanted, or how a model handles long, layered or conflicting instructions. When instructions conflict, for example between a system prompt and a user, which one wins is governed by a separate design choice known as the instruction hierarchy.

In practice, instruction following decides whether a model's output can be fed straight into another system. Businesses should test models on their own instructions rather than relying on a benchmark number. Where an exact format matters, many providers offer structured output features that enforce a schema rather than leaving it to the model to comply.

Common questions

What is IFEval?

IFEval is a benchmark that tests whether language models follow instructions that can be checked automatically, such as word limits, required keywords or formatting rules. It was introduced in November 2023 with 25 instruction types across around 500 prompts, and its scores do not depend on a human or AI judge.

How do language models learn to follow instructions?

Mainly through post-training. Instruction tuning fine-tunes a pre-trained model on many tasks written as instructions with good responses, and reinforcement learning from human feedback then rewards the outputs people prefer. FLAN and InstructGPT were early landmark examples of each.

What is the difference between a base model and an instruct model?

A base model has only been pre-trained, so it continues text rather than answering requests. An instruct model has been further trained to treat input as instructions and respond helpfully. Most chatbots and APIs use instruct or chat versions.

Why does a model sometimes ignore my instructions?

Instructions can be vague, compete with each other, or conflict with the system prompt or the model's training. Making each constraint explicit and checkable helps, and so does testing a prompt on several examples. For strict formats, use the provider's structured output feature where one exists.

Finding more

Search for "instruction following benchmark", "IFEval", "instruction tuning" or "InstructGPT" to see how the skill is trained and measured. The original papers on arXiv are the best sources on methods and results, and model cards or technical reports list the benchmark scores companies claim. Treat a single benchmark number as one data point and compare it with your own tests.

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.