Few-Shot Learning
Definition
Giving an AI model a few examples in the prompt to guide its output.
Why It Matters
When zero-shot output isn't quite right and you don't want to fine-tune, few-shot is the middle ground: give the model 2–5 worked examples in the prompt and it picks up the pattern in real time. No retraining cost, no extra latency beyond a slightly longer prompt.
Key Points
- 2–3 high-quality examples usually outperform 10+ noisy ones, example quality dominates example count.
- Include edge cases and non-obvious class members in your examples, not just the clearest prototypical cases.
- For classification: include at least one example per class, ideally balanced across all classes.
- Few-shot cost: each example adds to prompt token count. A 3-example few-shot prompt for a 50-token task can be 200–400 tokens vs. 50 for zero-shot.
- Example order can affect output, place the most representative example last, as models attend most strongly to the final examples.
Example
To format dates a specific way, include three input→output pairs in the prompt before the actual input. The model picks up "MM/DD/YY → 25 Mar 2026" style transformations from the examples without a separate training step.
Common Misconception
Few-shot learning does not teach the model new factual knowledge, it demonstrates a format and style. If the zero-shot answer is wrong because the model lacks the underlying knowledge, adding examples will not fix that gap. Few-shot helps with format and style alignment, not knowledge injection.
Related Terms
- Zero-Shot LearningAn AI model performing a task without any specific examples, just from its general training.
- PromptThe input text you give to an AI model. Better prompts lead to better outputs.
- Prompt EngineeringThe practice of crafting effective prompts to get the best results from AI models.
Few-Shot Learning on Rewind.ai
The advanced panel on most chat-style tools lets you set a system prompt, drop your few-shot examples there once and they apply to every turn.
Explore the ToolsQuick Facts
| Term | Few-Shot Learning |
| Related | Zero-Shot Learning, Prompt, Prompt Engineering |