ModelRefs / Few-Shot Prompting — AI Glossary
Few-Shot Prompting — AI Glossary
Providing a small number of example input-output pairs in the prompt to demonstrate the desired behavior to the model.
Overview
Few-shot prompting works because LLMs perform in-context learning. 3–8 examples is typical; more rarely helps and consumes context. Example selection matters — diverse, representative examples outperform random sampling.
Reference details
| Topic | prompting |
|---|---|
| Last reviewed | 2026-06-24 |
Related terms
Example: Examples teach the edge cases, not the task
For sentiment labelling, the useful examples are not three clear positives. They are the ones that pin down your conventions: sarcasm, mixed sentiment, and a review that is about delivery rather than the product. Examples are where you encode the decisions a definition cannot express.
Commonly confused with
In-context learning does not update the model. The examples influence one response and are gone; nothing is retained between calls. That is the difference from fine-tuning, and the reason few-shot costs tokens on every single request.
When to use it
Reach for it when:
- The desired output form is easier to show than to describe
- There are conventions and edge cases a definition would not capture
- You need behaviour changeable without retraining
Reach for something else when:
- Examples would consume context you need for actual content
- The pattern is stable and high-volume — fine-tuning amortises better
- Your examples are unrepresentative; the model will copy the skew faithfully
Referenced by
This term is used by the following ModelRefs references:
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Few-Shot Prompting — AI Glossary.
Frequently asked questions
What is Few-Shot Prompting?
Providing a small number of example input-output pairs in the prompt to demonstrate the desired behavior to the model.
What concepts are related to Few-Shot Prompting?
Closely related concepts include zero shot, prompt engineering, chain of thought.