Few-Shot Prompting
Including a small number of worked examples in a prompt so the model imitates the pattern.
Reviewed May 7, 2026
What it is
Few-shot prompting supplies two or three input-output examples before the real request. The examples show the expected format, level of detail and decision boundary more concretely than a description alone. Zero-shot prompting gives instructions without examples; one-shot gives a single example.
When it helps
Examples are useful for classification, extraction and formatting tasks where the rule is easier to demonstrate than to explain. They also help when output must match a house style or a strict schema. Keep examples short, correct and representative of the cases the system will actually see.
Limitations
Examples consume context and can bias the model toward their surface details. A set of easy examples may hide failures on edge cases. If examples conflict with written instructions, the model may follow either one. For classification, include examples near decision boundaries and label them consistently.
A practical method
Start with clear instructions and no examples. Add examples only when the output format or judgement is inconsistent. Test with held-out inputs, rotate the order of examples, and remove examples that do not change behaviour.
Keep learning
Concepts are easier to remember when you apply them. The foundations path connects this term to practical exercises.
AI foundations path →