Techniques

What is Few-Shot Learning?

Providing a few examples in your prompt to teach the AI the pattern you want.

Definition

Few-shot learning is a prompt engineering technique where you include a small number of example input-output pairs in your prompt before the actual task. This teaches the AI the pattern, format, or style you want without any model training. Zero-shot means no examples, one-shot means one example, and few-shot typically means 2-5 examples.

๐Ÿ’ก Example

Prompt: "Classify the sentiment: 'Great product!' โ†’ Positive. 'Terrible service' โ†’ Negative. 'It arrived on time' โ†’ Neutral. Now classify: 'The quality exceeded my expectations' โ†’" The AI learns from the examples to respond "Positive."

Related concepts

Prompt Engineering

The practice of crafting effective instructions to get better results from AI models.

โ†’
Chain-of-Thought (CoT)

A prompting technique that asks AI to show its reasoning step by step.

โ†’

Explore AI tools

Find tools that use few-shot learning in practice.

Browse all tools โ†’ Back to glossary
What is Few-Shot Learning?

Few-shot learning is a prompt engineering technique where you include a small number of example input-output pairs in your prompt before the actual task. This teaches the AI the pattern, format, or style you want without any model training. Zero-shot means no examples, one-shot means one example, and few-shot typically means 2-5 examples.

How does Few-Shot Learning work in practice?

Prompt: "Classify the sentiment: 'Great product!' โ†’ Positive. 'Terrible service' โ†’ Negative. 'It arrived on time' โ†’ Neutral. Now classify: 'The quality exceeded my expectations' โ†’" The AI learns from the examples to respond "Positive."