Skip to main content

How to Pick Few-Shot Examples

Guide · about 6 min · refs checked 2026-11-03 (reference links and dates only)

Dropping a few input→output examples into the prompt changes performance noticeably — but bad examples steer the model the wrong way. Five criteria for picking them.

How to
Cover the edge cases you actually need, not just the easy ones: the model imitates the distribution of your examples. Keep the format identical to real inputs: field names, punctuation, and line breaks in the examples get copied verbatim. Start with two or three examples; marginal returns drop fast, and too many crowd the context and raise cost. Make examples differ from each other: three near-identical ones are worth one, and they teach the model it can only do that one thing. When outputs go off the rails, first check whether an example is steering them — a wrong example is worse than no example.

Example and interpretation

A teaching scenario, not a measured or executed site test.

For sentiment classification, include a mixed review such as “Good item, late delivery” alongside clear positives and negatives, with a labeling rule. Examples explain boundaries; copying test items into them does not demonstrate generalization.

How to check your practice

Explain the example in your own words, inspect input constraints, then verify against the source. Revisit concepts if you cannot explain why; supply missing dates, fields or permissions; withdraw unsupported conclusions.

For this topic, start with concept confusion · See all six scenarios and their reasoning

Sources
  • Brown et al., Language Models are Few-Shot Learners (GPT-3) ↗
  • Wei et al., Finetuned Language Models Are Zero-Shot Learners (FLAN) ↗
  • Wang et al., Self-Instruct ↗