---
title: 'One-shot prompting'
description: 'Supplying one worked example in context to demonstrate the desired task or output pattern.'
canonical_url: 'https://darkfactory.dev/glossary/one-shot-prompting'
markdown_url: 'https://darkfactory.dev/glossary/one-shot-prompting.md'
collection: glossary
date_published: '2026-08-03T00:00:00-04:00'
date_modified: '2026-08-26T00:00:00-04:00'
---

# One-shot prompting


## Definition

One-shot prompting supplies exactly one worked example in the model's context before asking it to handle a new case. The example can demonstrate the task, output shape, tone, labels, or decision boundary. The model uses that demonstration at inference time; the technique does not, by itself, update model weights.

For example, a classification prompt might show one support ticket paired with the label `billing`, then ask the model to label a new ticket. A data-extraction prompt might show one paragraph and the exact JSON object expected from it.

## Origin and usage

The underlying machine-learning phrase predates modern chat models. Brown and colleagues' 2020 GPT-3 paper codified and popularized the current zero-shot, one-shot, and few-shot comparison for language-model prompting. In that setup, one-shot meant one in-context demonstration with no gradient update. The paper should not be read as a claim that the authors invented learning from a single example.

## Operational significance

One strong example can communicate a format more efficiently than a paragraph of instructions. One example can also teach an accidental pattern. A model may copy an unimportant field order, infer the wrong rule from a special case, or fail on cases the example did not cover. Use representative examples, state the rule in words when it matters, and evaluate beyond the demonstrated case.

## Distinguish it from nearby terms

- Zero-shot prompting supplies instructions or a task without a worked example.
- Few-shot prompting supplies several demonstrations and can show variation that one example cannot.
- Fine-tuning changes model parameters through training. One-shot prompting conditions a single inference context.

## Check your understanding

A one-shot extractor produces valid output for the demonstrated invoice layout but fails on credit notes. Identify what the single example established and what it left untested.

## Related terms

- [Zero-shot learning](https://darkfactory.dev/glossary/zero-shot-learning)
- [Few-shot prompting](https://darkfactory.dev/glossary/few-shot-prompting)
- [In-context learning](https://darkfactory.dev/glossary/in-context-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)
