Few-shot prompting
Definition
Few-shot prompting is giving an AI model a few examples of the input and output you want, right inside the prompt, so it follows the pattern. The model picks up the format and style from the examples on the spot, with no retraining.
By Ronan Liedmeier, fractional head of growth and course author · Published 17 October 2026 · Last updated 17 October 2026
Also called: few-shot
Two or three examples of the tone or structure you're after get closer than a paragraph of instructions trying to explain it.
How it works
The 2020 GPT-3 paper by Brown and colleagues, titled "Language Models are Few-Shot Learners", showed a large model handling new tasks from a handful of examples placed in its input, with no change to the model itself. Zero-shot means no examples; few-shot means several.
Models weigh examples heavily, in many cases more than the written instructions. A good set varies, so the model learns the pattern instead of copying one example's length or wording. A labeled bad example with a short reason helps too.
Start without examples. Add them when the output is close but the format or tone keeps drifting.
Example
A customer success lead wants support tickets tagged as billing, bug, feature request or how-to. Instructions alone give inconsistent tags. She adds four real tickets with their correct tags, including a tricky one where a billing complaint mentions a bug. The tags become consistent enough to feed the team's weekly dashboard.
Common mistake
Requirements change and the examples stay behind. A prompt whose examples show last quarter's format keeps producing last quarter's format even after the instructions are rewritten. Update the examples every time you update the rules.
Learn it in AI Academy
- Prompt Engineering at Production QualityExpert · 8 min
- Prompting That Actually WorksBeginner · 12 minFree
Related terms
- Prompt
- A prompt is the instruction or question you give an AI model to tell it what you want. It can be one line or a full brief with background, examples and the format you need back, and the answer is shaped by everything in it.
- Prompt engineering
- Prompt engineering is the practice of writing and testing the instructions you give an AI model so it produces reliable, useful output. For everyday users it means writing clear briefs; for teams running AI in production it means treating prompts like versioned, tested code.
- Chain-of-thought prompting
- Chain-of-thought prompting is asking an AI model to work through a problem step by step before giving its final answer. Writing out the steps improves accuracy on multi-step tasks like math and logic problems, and shows the working so you can check it.