Overview
This page is the atomic definition. The deep-dive lives at few-shot.
Definition
Few-shot prompting is the practice of providing example input/output pairs in the prompt to steer model behavior. The model infers the pattern from the demonstrations and applies it to a new input. “Zero-shot” gives no examples; “one-shot” gives one; “few-shot” typically gives 2 to 10. Example diversity and ordering matter more than raw count: examples that span the input space help generalization, and the most recent example tends to anchor the output style. Few-shot prompting works best when the rule is hard to state in prose but easy to show.
When it applies
Use few-shot prompting for classification with custom labels, structured extraction with a specific schema, or any task where the desired format is easier to demonstrate than describe. Skip it when a clear system prompt already specifies the rule.
Example
Classify the support ticket priority.
Ticket: "Login broken for all users." Priority: P0
Ticket: "Typo in footer." Priority: P3
Ticket: "Slow page load on mobile." Priority: P2
Ticket: "Checkout fails on Safari." Priority:
Related concepts
- few-shot - the deep-dive on count, ordering, and diversity.
- examples-vs-rules - when to show examples vs. state the rule.
- prompt-design - the broader prompt-design discipline.
- chain-of-thought - few-shot examples often include CoT traces.
- system-prompt - few-shot examples sit alongside the system prompt.
Citing this term
See Few-shot prompting (llmbestpractices.com/glossary/few-shot-prompting).