Prompt Engineering103 · Module I · Lesson 02 of 14
Article · 12 min

Few-shot prompting

The technique with the highest return.

Summary

Few-shot prompting includes a small number of input-output examples in the prompt. It is the technique with the highest return per unit of effort. Three well-chosen examples often outperform two paragraphs of instructions.

Objectives
  • 01Structure a few-shot prompt.
  • 02Choose examples that cover the failure modes.
  • 03Explain why example order matters.
The Lesson

The structure

Instructions → Example 1 (input, output) → Example 2 → Example 3 → Real input → let model complete. Consistent formatting across examples matters more than the number of examples.

Choosing examples

Cover the format, cover the edge cases, cover the ambiguous cases. Do not pick three examples that all look the same — they teach the model only one thing.

Order matters

The last example is closest to the query and has disproportionate influence. Recent research: recency bias is real; place the strongest example last.

Key Ideas
  • Few-shot is the highest-return prompt technique.
  • Example diversity matters more than example count.