Techniques & methods

Few-Shot Learning

Few-shot learning is a machine learning paradigm in which a model adapts to a new task using only a small number of labeled examples—typically between one and twenty—rather than the large labeled datasets required by conventional supervised learning.

Few-shot learning is a machine learning paradigm in which a model generalizes to new tasks or categories using only a very small number of labeled training examples—typically between one (one-shot) and around twenty—as opposed to the thousands or millions of examples required by conventional supervised learning. The core challenge is learning representations general enough that a handful of examples are sufficient to guide accurate predictions on unseen inputs.

In classical machine learning, few-shot learning was addressed through meta-learning approaches: algorithms such as MAML (Model-Agnostic Meta-Learning, Finn et al. 2017) and Prototypical Networks (Snell et al. 2017) train a model across many distinct tasks so it can rapidly adapt to new ones via a small number of gradient steps or nearest-neighbor comparisons in embedding space. For large language models, few-shot learning primarily takes the form of in-context learning: a few labeled examples are formatted as demonstrations directly in the prompt, and the model produces predictions for new inputs without any weight updates. GPT-3 (Brown et al. 2020) established that this approach scales across a wide range of tasks.

Few-shot learning is important because labeled data is scarce, expensive to produce, or unavailable for niche and rapidly evolving tasks. Healthcare applications involving rare conditions, low-resource language processing, novel event classification, and enterprise-specific categorization tasks all benefit from few-shot adaptation. In product development, it enables rapid prototyping: a developer can test a new extraction or classification task by writing a few annotated examples into a prompt before committing to a fine-tuning workflow.

As of 2026, frontier models including GPT-4o, Claude 3.7 Sonnet, and Gemini 2.0 Flash demonstrate strong few-shot performance across reasoning, coding, and structured output tasks with as few as three to five prompt examples. Research has shifted toward understanding the mechanisms behind in-context learning and toward parameter-efficient fine-tuning methods such as LoRA and QLoRA, which provide a practical middle ground between zero-shot prompting and full fine-tuning when modest labeled data is available.

Example

A developer adds three annotated examples of customer complaint tickets labeled by urgency tier to a GPT-4o prompt; the model immediately classifies new complaints into the same tiers without any fine-tuning or additional training data.

Related terms

← Glossary