Skip to content

Evidence-first authority page

What Is Few-Shot Learning (and Zero-Shot)?

The difference between zero-shot and few-shot prompting, and when providing examples actually improves output quality.

Direct answer

Zero-shot prompting asks a model to perform a task with no examples, relying entirely on the instruction; few-shot prompting includes a small number of example input-output pairs in the prompt to demonstrate the desired pattern — few-shot generally improves consistency for tasks with a specific format or style the model wouldn't otherwise infer correctly from instructions alone.

Last reviewed 2026-08-29

This page remains noindex while its page-level source receipts are completed and verified. It is available for review, not presented as publication-ready authority.

When examples help more than instructions

Some output formats or stylistic conventions are hard to fully specify in words but easy to demonstrate — a specific tone, an unusual output structure, or a domain-specific convention. In these cases, two or three well-chosen examples in the prompt often produce more consistent results than an equivalently long written instruction trying to describe the same pattern.

Trade-offs of adding examples

  • Examples consume context tokens on every call, adding cost — weigh this against the consistency gain for your specific task.
  • Poorly chosen or unrepresentative examples can bias the model toward an unwanted pattern more than they help — the examples should genuinely represent the range of expected inputs, not just one easy case.
  • For simple, well-specified tasks, zero-shot with a clear instruction is often just as reliable and cheaper.

A practical rule of thumb

Start zero-shot with a clear instruction. If output is inconsistent in format or style across multiple test runs, add 2-3 representative few-shot examples specifically targeting the inconsistency you observed, rather than adding examples preemptively before confirming they're actually needed.

Continue researching