
Few-shot prompting: teaching by example inside the prompt
In short: Few-shot prompting puts a few worked examples in the prompt so the model copies the pattern, which is often the fastest fix for a wrong format or tone.
Few-shot prompting is a technique where you include a small number of worked input-output examples in the prompt so the model infers the pattern and applies it to a new input. Zero-shot means no examples and one-shot means one. The GPT-3 paper from May 2020 showed a model with 175 billion parameters picking up tasks from such demonstrations, without gradient updates or fine-tuning.
Few-shot prompting in plain words
Instead of explaining your filing system in a paragraph, you file three documents in front of someone and say "now do this one".
How it works
The examples show format, tone, level of detail and edge-case handling more precisely than description can. The model continues the pattern.
Anthropic's prompting guide, read in November 2026, recommends 3 to 5 examples that are relevant to the real use case, diverse enough to cover edge cases, and wrapped in tags so the model can tell them apart from instructions.
Example
Classify support tickets as BILLING, BUG or HOWTO.
Ticket: "Charged twice this month" → BILLING
Ticket: "Export button does nothing on Safari" → BUG
Ticket: "How do I add a teammate?" → HOWTO
Ticket: "Invoice shows wrong GST number" →
The model answers BILLING, in the same format.
Where you'll meet it
- Classification, extraction and formatting tasks
- Style matching for writing assistants
- Evaluation prompts that show graded examples to an LLM judge
- Teaching models a house format before fine-tuning is justified
What it changes for you
Few-shot examples are often the fastest fix when a model gets the format or tone wrong. For developers, examples are test fixtures in disguise: keep them in version control. For teams, a well-chosen set of examples can postpone or replace a fine-tuning project.
Few-shot prompting vs fine-tuning
Few-shot puts examples in each request and costs tokens every time. Fine-tuning bakes the pattern into the model's weights once.
Common mistake
My view: using examples that are all similar. The model then copies surface features, such as length or a particular phrase, instead of the rule. Anthropic's guide gives the same warning about unintended patterns. Vary the examples on purpose and include at least one edge case.
Related terms
Prompt engineering · Fine-tuning · Chain-of-thought · LLM-as-a-judge
From the archive: Choose prompts, RAG, tools or fine-tuning
Vary your examples on purpose and include an edge case, so the model learns the rule and not the surface.


