# Few-Shot Prompting

> You put a few solved examples in the prompt. The model copies their pattern.

**Field:** Artificial Intelligence  
**Category:** Working with AI  
**Also known as:** Few-Shot, In-Context Learning

## Think of it like

Think of it like you show a friend two filled-in forms. Then they fill in the next one the same way.

## Definition

Few-shot prompting means putting a few worked examples in the prompt before the real task. Each example shows an input and the answer you want. The model copies the pattern: the format, the length and the style. Two to five examples are often enough. The model does not learn for good. The examples only work while they sit in the prompt.

## Example

Emma wants product tags in one style. She shows two products with their tags, then a third with none. The model fills in tags in the same style.

## Example code

```text
Tag each product.
Product: Red rain jacket -> tags: outdoor, rain, red
Product: Wool winter hat -> tags: winter, wool, warm
Product: Blue running shoes -> tags:
```

Two solved examples, then one left open. The model fills in the last line in the same style.

## Why it matters

It is often the quickest fix when a model gets the format or style wrong.

## Common mistake

Thinking the examples train the model. They only steer this one request, and they cost tokens each time.

## Three principles

- **Show, then ask.** Examples before the task.
- **Copies the pattern.** Format, length, style.
- **Only for this request.** Nothing is learned for good.

## Related terms

- [Zero-Shot Prompting](https://learn.benibix.com/term/ai/zero-shot-prompting)
- [Fine-Tuning](https://learn.benibix.com/term/ai/fine-tuning)
- [Prompt (AI)](https://learn.benibix.com/term/ai/prompt)
- [Prompt Template](https://learn.benibix.com/term/ai/prompt-template)
- [One-Shot Prompting](https://learn.benibix.com/term/ai/one-shot-prompting)

## Told apart from

- [Few-Shot Prompting vs Fine-Tuning](https://learn.benibix.com/compare/few-shot-prompting-vs-fine-tuning): People often think that examples in a prompt train the model. Few-shot prompting only steers one request. The examples must be sent again each time. Fine-tuning changes the model's weights with many examples, so the skill stays. Few-shot is free to try in a minute. Fine-tuning takes data, time and money.

## Taught in

- [Zero-Shot and Few-Shot Prompts](https://learn.benibix.com/learn/ai-working-with-ai/zero-shot-and-few-shot-prompts): Prompt Engineering, 5/16

![Two prompts side by side. The zero-shot prompt holds only the task. The few-shot prompt holds two solved examples above the same task.](https://learn.benibix.com/diagrams/pr-zero-few-shot.svg)

---

Source: https://learn.benibix.com/term/ai/few-shot-prompting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
