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:

Citing this term

See Few-shot prompting (llmbestpractices.com/glossary/few-shot-prompting).