---
title: 'Few-shot prompting'
description: 'Supplying a small set of worked examples in context to steer task behavior without updating model weights.'
canonical_url: 'https://darkfactory.dev/glossary/few-shot-prompting'
markdown_url: 'https://darkfactory.dev/glossary/few-shot-prompting.md'
collection: glossary
date_published: '2026-08-03T00:00:00-04:00'
date_modified: '2026-08-26T00:00:00-04:00'
---

# Few-shot prompting


## Definition

Few-shot prompting places a small set of demonstrations in the model's current context. Each example shows some combination of input, expected output, format, or reasoning pattern. The model then conditions its response to a new input on those demonstrations without updating its parameters.

The GPT-3 paper *Language Models are Few-Shot Learners* made this usage prominent in 2020 by evaluating tasks described through text instructions and examples alone. "Few" is relative to the context and task rather than a universal number. One carefully chosen boundary example can be more informative than several nearly identical examples.

## Example design

Examples are part of the input, so selection, order, labels, and repeated patterns can all influence the result. A useful set covers the distinctions the model must make and uses outputs that actually meet the acceptance criteria. It should not quietly teach shortcuts that fail outside the examples.

Yichao "Peak" Ji reported a related production failure in Manus: long runs containing repetitive action and observation patterns could push an agent into repeating the same behavior after it stopped being useful. That is one system's operational account, not a universal law, but it shows why examples and accumulated traces need evaluation as context.

## Distinguish it from nearby terms

- Zero-shot prompting provides no worked example. One-shot prompting provides one.
- In-context learning is the broader observed ability to adapt within the supplied context. Few-shot prompting is one way to elicit it.
- Fine-tuning changes model parameters and can persist across future requests. Few-shot prompting does neither by itself.

## Check your understanding

A classifier prompt contains eight examples of the common class and one example of every other class. Identify what you would test before treating its output distribution as evidence about the underlying data.

## Related terms

- [One-shot prompting](https://darkfactory.dev/glossary/one-shot-prompting)
- [In-context learning](https://darkfactory.dev/glossary/in-context-learning)
- [Zero-shot learning](https://darkfactory.dev/glossary/zero-shot-learning)

## Evidence and further reading

- [Google Machine Learning Glossary](https://developers.google.com/machine-learning/glossary/)
- [Language Models are Few-Shot Learners](https://arxiv.org/abs/2005.14165)
- [Context Engineering for AI Agents: Lessons from Building Manus](https://manus.im/blog/Context-Engineering-for-AI-Agents-Lessons-from-Building-Manus)
