AI Model Wiki

    Skip to main content
    Back to Glossary

    Few-Shot Learning

    Few-Shot Learning (as a prompting and generalisation technique for large language models) describes the ability to perform a new task after seeing only a small number of demonstrations, either in the prompt context or as labelled fine-tuning examples. In the prompting context it is synonymous with few-shot prompting: you supply the model with K input-output pairs that illustrate the target behaviour, and the model extrapolates to a held-out input without any weight updates. The critical distinction from traditional machine learning is that no gradient step is taken — the "learning" happens entirely through in-context pattern matching.

    Think of it like giving a chess prodigy three annotated games in an unfamiliar opening variation and watching them play the fourth game correctly, adapting their general chess understanding to the new pattern without needing a hundred example games.

    In practice, three examples of a classification task embedded in a prompt often achieve performance close to a fine-tuned specialist model on simple tasks. For instance, providing an LLM with three examples of classifying customer emails as "complaint", "inquiry", or "compliment" before presenting a fourth email allows the model to reliably apply the label scheme, even though it was never explicitly trained on that taxonomy.

    Few-Shot Learning is positioned between Zero-Shot (no examples) and Fine-tuning (many examples with weight updates). It depends on a large Pretraining corpus giving the model sufficient world knowledge, and on the model's Context Window being large enough to accommodate the demonstration examples alongside the real query. Prompt Engineering is the discipline of crafting those demonstrations effectively.

    You will encounter few-shot learning in research benchmarks (SuperGLUE, BIG-Bench), in API documentation for major LLM providers that show how to structure prompts with examples, and in production classification or extraction pipelines where fine-tuning would be prohibitively slow or expensive.

    AI Terminology
    Glossary