ModelRefs / Few-Shot Prompting — Prompt Pattern
Few-Shot Prompting — Prompt Pattern
Show 2–8 input/output examples so the model mimics the pattern. Anchor format and style with worked examples before the real input.
Overview
Anchor format and style with worked examples before the real input. Often outperforms verbose instructions.
When to use it: Format or style is hard to describe but easy to demonstrate.
Pattern details
| Pattern class | role |
|---|---|
| Difficulty | beginner |
| Also known as | in-context learning, exemplars |
| Last reviewed | 2026-06-07 |
Known failure modes
- Example bias — Model copies a property of examples too literally. Mitigation: Diversify examples; mix edge cases.
When not to use it
- Using few-shot on tasks that JSON-mode + schema would solve.
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 — Prompt Pattern.
Frequently asked questions
When should I use the Few-Shot Prompting prompt pattern?
Format or style is hard to describe but easy to demonstrate.
What are common failure modes of Few-Shot Prompting?
Example bias
Does Few-Shot Prompting work across models?
Yes when the anatomy is preserved — see model compatibility matrix on the pattern page.