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.