---
title: "Few-shot prompting"
slug: "few-shot-prompting"
category: "glossary"
tags: ["glossary", "ai-agents", "few-shot", "prompts", "examples"]
status: "stable"
last_updated: 2026-05-14
summary: "Few-shot prompting provides example input/output pairs in the prompt to steer model behavior and teach the desired format by demonstration."
related:
  [
    "[[ai-agents/few-shot]]",
    "[[ai-agents/examples-vs-rules]]",
    "[[prompt-engineering/prompt-design]]",
    "[[glossary/chain-of-thought]]",
    "[[glossary/system-prompt]]",
    "[[ai-agents/system-prompts]]",
  ]
---

## Overview

This page is the atomic definition. The deep-dive lives at [[ai-agents/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:
```

## Related concepts

- [[ai-agents/few-shot]] - the deep-dive on count, ordering, and diversity.
- [[ai-agents/examples-vs-rules]] - when to show examples vs. state the rule.
- [[prompt-engineering/prompt-design]] - the broader prompt-design discipline.
- [[glossary/chain-of-thought]] - few-shot examples often include CoT traces.
- [[glossary/system-prompt]] - few-shot examples sit alongside the system prompt.

## Citing this term

> See [[glossary/few-shot-prompting|Few-shot prompting]] (llmbestpractices.com/glossary/few-shot-prompting).

## Related

- [[ai-agents/few-shot]]
- [[ai-agents/examples-vs-rules]]
- [[prompt-engineering/prompt-design]]
- [[glossary/chain-of-thought]]
- [[glossary/system-prompt]]
