Few-Shot Prompting
Also called Few-shot learning, In-context examples, One-shot prompting
Including a handful of worked examples in a prompt so the AI model can copy the pattern, format and tone you want.
What is few-shot prompting?
Few-shot prompting means showing an AI model a few examples of the task before asking it to do the real one. Instead of only describing what you want, you include two to five input-and-answer pairs in the prompt, then add your new input. The model picks up the pattern and follows it.
With one example it's called one-shot prompting; with none, it's zero-shot prompting.
How does it work?
A large language model predicts what text should come next. When the prompt contains several examples in the same shape, the most likely continuation is another answer in that shape. For example:
- Review: "Arrived broken." → Sentiment: negative
- Review: "Does the job, nothing special." → Sentiment: neutral
- Review: "Best purchase this year." → Sentiment:
The model completes the last line as "positive", in exactly the format of the others. Nothing about the model changes; the examples only live in that one request.
What is it commonly confused with?
- Fine-tuning. Fine-tuning trains the model on examples and changes its weights permanently. Few-shot examples are read once and forgotten after the request.
- Learning new facts. The "learning" here is temporary pattern-following inside the context window, not new knowledge.
Why does it matter?
Examples are often the single biggest improvement you can make to a prompt, especially for strict formats, classification, tone of voice and extraction. Pick examples that are varied and correct: the model copies mistakes and quirks as faithfully as good habits. Each example also adds tokens, so long examples make every request cost more. See What is prompt engineering? for more techniques.

