Module 1 · Lesson 2 of 6
Writing a prompt that works
One technique at a time
Each prompt version adds one technique, and the same ten saved questions show what each addition fixed.
Scene 1 of 5 · The question alone
Sent with no instructions at all, the model answers 4 of the 10 saved questions well.
- Prompt version — healthy
- Language model — healthy
- Ten saved questions — healthy — 4 of 10 pass
| Prompt version | Passes |
|---|---|
| The question alone (highlighted) | 4 of 10 |
| Add clear instructions | 6 of 10 |
| Add two worked examples | 8 of 10 |
| Add a format and an "unsure" rule | 9 of 10 |
- The question alone. Sent with no instructions at all, the model answers 4 of the 10 saved questions well.
- Name the task. A role, the task and "use only the policy" lift it to 6 of 10.
- Show two examples. Two sample questions with ideal answers show the tone and depth wanted: 8 of 10.
- Say what to do. A reply format and a rule for gaps in the policy reach 9 of 10.
- Check every version. Each version runs on all the questions, since a change that fixes one answer can break another.
- Now you try. Pick a prompt version, and see how many saved questions it passes. For example: 6 of 10 pass. New passes: "Refund for worn shoes?", "Store credit after 45 days?" Naming the task and the source stops it guessing from general knowledge.
Scene 1 of 5: The question alone. Sent with no instructions at all, the model answers 4 of the 10 saved questions well.
Key points
- Name the role, the task and the material to answer from.
- Two worked examples often teach more than a long description.
- Name the reply format, and what to say when the source is silent.
- Keep a version only after it passes the full set of saved questions.
A good (Everything sent to a language model in one request: instructions, context and the question.) says three things plainly: who the model is, what the task is, and what material to use. "You answer for Rosa's Shoes, using only the policy below" does far better than a bare question.
Worked examples help: two sample questions with ideal answers often show the length, tone and detail you want better than a description does. This is called (Putting a few worked examples, each a sample input with its ideal output, in the prompt so the model copies their shape.).
Put outside text, such as a policy or an email, between clear markers, and name the reply format. Say what to do when the material is silent, such as "say the policy does not cover this".
Change one thing at a time, and run every version on the same saved questions. A change that fixes one answer can quietly break another.
In system design: Keep prompts in version control next to their saved questions, and review a prompt change the way you review a code change.