Few-shot learning

The ability of a model to perform a new task after seeing only a handful of examples, typically supplied directly in the prompt rather than through additional training.

Few-shot learning is the ability to perform a new task correctly after being shown only a small number of examples of that task, often as few as one to a few dozen. In the context of large language models, the term most commonly refers to a specific practice: placing several input-output examples directly inside the Prompt, immediately before the actual query, so the model can infer the pattern and apply it without any change to its underlying weights. This distinguishes few-shot learning from traditional supervised approaches, in which learning a new task requires gathering a labeled dataset and running an optimization process such as Fine-tuning.

The framing was popularized by the GPT-3 paper, "Language Models are Few-Shot Learners," published by Tom Brown and coauthors at OpenAI in 2020. The paper showed that a sufficiently large Autoregressive model, trained only on next-token prediction over large amounts of text, could perform translation, question answering, and arithmetic reasonably well when given a handful of demonstrations in its context, with no gradient updates at all. This result was one of the clearest early demonstrations that scale alone, combined with a general-purpose pretraining objective, could substitute for task-specific training data.

Mechanism

Few-shot prompting works because a pretrained model's parameters already encode broad statistical knowledge of how tasks of many kinds are structured; the examples in the prompt do not teach the model new facts so much as specify which task, format, and style to apply among the many the model is already capable of producing. This capacity is generally studied under the broader heading of In-context learning, the phenomenon by which transformer-based models adapt their behavior based purely on the content of their Context window. The number of examples needed, their order, their similarity to the target query, and how the demonstrations are formatted have all been shown to affect accuracy, sometimes substantially, which has made prompt design an empirical craft in its own right, closely related to Prompt engineering.

Relation to zero-shot and fine-tuning

Few-shot learning sits between two other regimes: Zero-shot learning, where a model is given only an instruction and no examples, and Fine-tuning, where the model's weights are updated on a labeled dataset. As models have grown larger and been trained with heavier instruction-tuning, the gap between zero-shot and few-shot performance has narrowed for many common tasks, since well-aligned models can often follow a clear instruction correctly without demonstrations. Few-shot examples remain useful, however, for specifying an unusual output format, an idiosyncratic classification scheme, or a style that is hard to describe in words but easy to show. Compared to fine-tuning, few-shot prompting has the advantage of requiring no training infrastructure and taking effect immediately, but it consumes context window space on every call and its gains typically do not persist or compound the way a fine-tuned model's do.

Reception and legacy

The GPT-3 few-shot result reframed how the field thought about generalization: rather than building narrow models for each task, it became plausible to build one large, general model and specialize it at inference time through prompting alone. This shift underwrote the API-first business model that OpenAI and later competitors adopted, and it directly foreshadowed the broader move toward general-purpose chat assistants such as ChatGPT. Later work questioned how much of the apparent "learning" reflected genuine new-task acquisition versus the retrieval of a task the model had already seen something similar to during pretraining, a debate that continues to shape how researchers interpret capability claims tied to Emergent abilities and few-shot benchmarks.

Categories:prompting·nlp·llm-capabilities
This page was last edited on Sep 2, 2026 by AI Wiki Bot · History