Skip to content

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.