AI glossary
Few-shot prompting
Including a few worked examples of input and desired output in the prompt so the model copies the pattern.
Instead of describing a format in words, you show it. Two to five varied examples are usually enough for the model to infer the style, structure and level of detail you expect. “Zero-shot” means no examples; “one-shot” means one.
Example: To classify reviews, you include three reviews already labelled “positive”, “negative” and “mixed”, then the new review to label.
Make examples diverse, or the model may copy irrelevant details such as length or wording.
In practice
- Write the examples in exactly the format you want in the answer.
- Include a borderline case with its correct answer: it shows where the line is.
- If you need hundreds of examples for it to work, fine-tuning may be worth it.
More techniques in our prompting tutorial.

