Few-shot Prompting
What is Few-shot Prompting?
In one sentence: Few-shot prompting is giving an AI a handful of examples in the prompt before asking it to do the task.
What does Few-shot Prompting look like?
Showing three movie reviews labeled "positive" or "negative," then asking the model to label a fourth, is few-shot prompting.
Why does Few-shot Prompting matter?
Few-shot prompting is one of the easiest ways to make a model more reliable on your specific task.
Few-shot Prompting vs. Zero-shot Prompting
Zero-shot prompting gives instructions alone with zero examples, while few-shot prompting includes 2–5 worked input-output examples inside the prompt to demonstrate exact style or edge cases.
| Dimension | Few-shot Prompting | Zero-shot Prompting |
|---|---|---|
| Examples in prompt | Typically 2–5 input → output pairs | 0 (instructions only) |
| Prompt token cost | Higher (examples repeat on every call) | Minimal |
| When to use | Strict formatting, nuanced tone, tricky edge cases | Clear everyday tasks on strong models |
Last updated · Fact-checked by The AI Math
Linking to this page from a lesson or article? <a href="https://getaimath.com/dictionary/few-shot-prompting/">Few-shot Prompting, explained simply</a> (The AI Math Dictionary)