# Few-Shot Prompting

> Few-shot prompting includes worked examples in the prompt so the model learns the task's pattern from demonstrations instead of instructions alone.

**Few-shot prompting is teaching a model the task by example: the prompt includes a handful of input→output demonstrations, and the model infers the pattern — format, style, decision boundary — from them.**

It exploits in-context learning, the emergent ability of LLMs to pick up a task from demonstrations without any weight updates. Its sweet spot is everything that's easier to show than to describe: an exact JSON shape, the house convention for a route handler, where the line falls between "bug" and "feature request." One canonical example carries error handling, naming, and structure that would take a paragraph of brittle adjectives to specify — which is why it's a core [prompt pattern for coding agents](/guides/prompting/prompt-patterns).

The craft is selection: short, varied examples that mark the task's boundaries, including the edge case the model fumbles. Contrast [zero-shot](/glossary/zero-shot-prompting) (instructions only — the modern default for capable models on clear tasks) and see [Few-Shot vs Chain-of-Thought vs Structured Prompting](/guides/prompting/prompting-techniques-2026) for when each technique earns its tokens.

---

_Source: https://agentscamp.com/glossary/few-shot-prompting — Term on AgentsCamp._
