What is Few-Shot Learning?
Also known as: Few-Shot
Few-shot learning (in prompting) is a technique where a language model is given a handful of input-output examples directly in the prompt to guide it on a new task.
Instead of updating model weights, few-shot prompting relies on in-context learning: the examples demonstrate the desired pattern, format, or reasoning style so the model can generalize to a fresh query.
Performance typically improves as more high-quality examples are added (often 2–10), though too many can exceed context limits or introduce noise.
It sits between zero-shot (no examples) and fine-tuning (parameter updates), offering a fast, training-free way to adapt large models.
Example
To classify movie reviews, the prompt might show three reviews labeled 'positive' or 'negative', then ask the model to label a fourth unseen review using the same style.
Why it matters
Few-shot prompting lets users quickly customize powerful foundation models for new tasks without expensive retraining, making advanced AI far more accessible and practical.
Frequently asked questions
Usually anywhere from 1 to about 10 examples; the exact number depends on task complexity and context-window size.
Related terms
Zero-shot learning (or zero-shot prompting) is when an AI model completes a task it has never seen examples of during training, relying only on a natural language description of what to do.
Prompt engineering is the practice of designing and refining text inputs (prompts) to guide AI models like large language models toward producing accurate, relevant, or creative outputs.
Fine-tuning is the process of taking a pre-trained AI model and continuing its training on a smaller, task-specific dataset to adapt it for a particular use case.
Chain-of-Thought (CoT) is a prompting technique that asks an AI model to generate intermediate reasoning steps before giving a final answer, helping it solve complex problems more reliably.
A prompt is the input text, question, or instruction given to an AI model (especially a large language model) to guide what it should generate or how it should respond.
A system prompt is the initial set of instructions given to an AI model that defines its overall behavior, role, rules, and tone for the conversation.