Instruction Following › Worked Example: Creating Instruction Examples
Language AI HandbookAll chapters Instruction Following › Worked Example: Creating Instruction ExamplesOne section · Sections in this chapter7 / 12 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Let's create a few instruction examples to illustrate format and quality considerations. We'll develop examples for a summarization task, showing how different format choices affect the training signal. By examining these examples closely, you can see how small variations in instruction phrasing lead to different expected outputs.
Step 1: Basic format with no constraints. The simplest instruction format provides the task and input with minimal structure:
Instruction: Summarize the following paragraph.
Input: The James Webb Space Telescope, launched in December 2021, represents
the largest and most powerful space telescope ever built. Its primary mirror,
composed of 18 hexagonal gold-plated beryllium segments, spans 6.5 meters in
diameter. Operating primarily in the infrared spectrum, JWST can observe
objects too old, distant, or faint for its predecessor, the Hubble Space
Telescope. The telescope orbits the Sun at the second Lagrange point,
approximately 1.5 million kilometers from Earth.
Response: The James Webb Space Telescope is the largest space telescope ever
built, featuring a 6.5-meter segmented mirror. Launched in 2021, it observes
in infrared from a position 1.5 million kilometers from Earth, enabling
detection of objects beyond Hubble's capabilities.This example teaches the model the basic summarization pattern. The response is shorter than the input, preserves the key facts, and doesn't add any new information. Training on many such examples helps the model understand what "summarize" means in terms of expected output structure.
Step 2: Constrained format with explicit requirements. Adding explicit constraints tests a different aspect of instruction following:
Instruction: Summarize the following paragraph in exactly two sentences.
Focus on the telescope's key capabilities.
Input: [same paragraph]
Response: The James Webb Space Telescope features a 6.5-meter gold-plated
mirror that enables infrared observations of objects too distant or faint
for previous telescopes. Operating from the L2 Lagrange point, it represents
humanity's most powerful tool for deep space observation.Notice how the response now strictly adheres to the two-sentence constraint and focuses specifically on capabilities rather than construction details. This example teaches the model to honor explicit constraints, a more sophisticated skill than basic summarization.
Step 3: Informal phrasing with stylistically matched response.
Instruction: What's the gist of this?
Input: [same paragraph]
Response: It's about the James Webb Space Telescope, which is basically the
biggest and most powerful space telescope we've ever made. It launched in
late 2021 and can see much farther into space than Hubble could, using
infrared detection from its position way out past Earth's orbit.Notice how the response style matches the instruction style. Formal instructions receive formal responses; casual questions get conversational answers. This stylistic alignment teaches models to adapt their output to your preferences. The model learns the content to provide and the register and tone to use for your request. Training all three variants teaches the model that "summarize," "focus on key capabilities," and "what's the gist of this" are related requests that share an underlying intent but require different output styles.
Step 4: Evaluating the examples against quality criteria.
Looking back at these three examples through the lens of the quality criteria we discussed:
Accuracy: All three responses correctly represent the source material without introducing false claims. The key facts (infrared detection, 6.5-meter mirror, L2 orbit, Hubble comparison) appear accurately in appropriate forms across all responses.
Completeness: Each response fully addresses the instruction. The constrained example provides exactly two sentences, not one or three. The informal example covers the key aspects without being truncated.
Clarity: Each instruction clearly specifies what's needed. The second instruction is the clearest because it explicitly states both the format constraint (two sentences) and the content focus (key capabilities).
Naturalness: The informal example feels like a natural human question. The constrained example sounds like a precise specification that a careful user might write. Both represent how people communicate.