Unit 7 ·

Few-shot, done right

Read this first. Every question after it comes from these cards.

Learn · 1/4

Examples are copied closely

Why does every answer start with "Great question!"?

The model copies the length, tone and quirks of your examples, not just their topic.

If every answer starts with 'Great question!', one of your examples probably does too.

Fix the example and the habit goes away.

The whole lesson as text

Cards and key takeaways

Examples teach more than descriptions.

Key takeaways

  • Examples are copied closely, quirks included.
  • Same format, varied content; one labelled example per category.
  • Task, varied examples with an edge case, then the real input.

Examples are copied closely

Why does every answer start with "Great question!"?

The model copies the length, tone and quirks of your examples, not just their topic.

If every answer starts with 'Great question!', one of your examples probably does too.

Fix the example and the habit goes away.

Remember: Examples are copied closely, quirks included.

Vary content, keep the pattern

Good examples look alike in form and differ in content.

Use different examples in the same format and tone, so the model learns the pattern, not the specifics.

For classification, one labelled example per category shows the borders and the output shape.

Labelled examples

'I was charged twice' → billing 'The app crashes on login' → bug 'Do you have a newsletter?' → other

Remember: Same format, varied content; one labelled example per category.

Build it in order

A few-shot prompt has a recipe. Here it is.

State the task in one sentence, add 2–3 varied examples in the same format, make one a tricky edge case, then add the real input, labelled the same way.

Labels like 'Input:' and 'Output:' mark where examples end.

Remember: Task, varied examples with an edge case, then the real input.

Teaching by example

Examples teach faster than descriptions, but the model copies them closely. Here's how to use that.

  1. Examples teach a model faster than a description. But it copies them closely.
  2. One to three good examples lock in a style better than a paragraph of description.
  3. The model copies the length, tone and quirks of your examples, not just their topic. Fix the example and the habit goes away.
  4. Vary the content, keep the pattern. One labelled example per category shows the borders.
  5. State the task, add two or three varied examples with one tricky edge case, then the real input, labelled the same way.
  6. Labels like Input and Output mark where the examples end.

Try it now

Paste this into any AI assistant (ChatGPT, Claude, Gemini, Copilot). Fill in the parts in square brackets.

Turn notes into task titles. Example: "need to call supplier re late invoice" -> "Call supplier about late invoice". Example: "update slides for monday" -> "Update Monday slides". Now these: [5 of your own notes]

What to check in the answer: The output should follow the examples' pattern: verb first, short, no filler. If it drifts, add a third example.

Want to go deeper?

This unit continues in a full course: AI-Powered Web & App Development (Vibe Coding). One of its lessons is free to try: “Writing effective code prompts”.