Few-Shot Prompting Cheat Sheet

How many examples, chosen how, placed where

Few-shot prompting is teaching by demonstration. The examples you pick matter far more than how many you use.

Beginner 1 min read 9 Entries Version 1.0 Sabir Updated 2
Download PDF Export Markdown Export HTML

When to use how many

Shots Use when Watch for
0 The task is common and the format is obvious Drifting format across a batch
1 The format is unusual but the task is simple The model copying the example content, not its shape
3–5 Classification, extraction, house style Cost — examples are in every request
8+ Rarely worth it; consider fine-tuning instead Diminishing returns and context pressure

Choosing examples

  • Cover the edge cases, not the easy middle The average case needs no demonstration
  • Include at least one negative or "none of these" case Otherwise the model never returns the empty answer
  • Keep every example in the exact output format you want Any inconsistency reads as permission to vary
  • Balance the classes Four positives and one negative teaches a prior, not a rule
  • Put the hardest example last Recency weighting works in your favour

Frequently asked questions

Do more examples always help?
No. Returns flatten after about five, and every example is paid for on every request. Beyond that point the money is usually better spent on fine-tuning or on better retrieval.
Why does the model keep copying my example content?
Your examples are too similar to each other, so their shared content reads as part of the instruction rather than as incidental. Vary the subject matter and keep only the FORMAT constant.

Was this cheat sheet useful?

Comments

No comments yet — be the first.

Keep going

More cheat sheets

Browse all
Need a different cheat sheet? Tell us what you would like to see and we will build it — free.
Request a cheat sheet