Few-shot examples
Concrete input-output pairs included in a prompt to show the model how to do a task by example.
Think of it like
Showing someone how to tie a shoe with a demo before they try.
Example
Prompt: "Classify as positive or negative:\nExample 1: 'I love this!' → Positive\nExample 2: 'Terrible experience.' → Negative\nNow classify: 'It's OK.' →"
How it actually works
Few-shot learning (in-context learning) is one of LLMs' superpowers. A model can learn task patterns from just 1–5 examples without retraining. Quality of examples matters: diverse, balanced, and representative examples work best. Too many examples waste token budget; too few leave the model confused.
For product teams
Quick way to adapt a model to new tasks. No retraining needed.
For engineers
Curate examples carefully. Test with different numbers and orders of examples. Monitor sensitivity.
Related
- In-context learning — Part of in-context learning.
- Exemplar selection — Exemplar selection optimizes choice.
Read anything AI without the jargon
Look up any term in plain English, or save terms as you read with the free Chrome extension.
Open DecoderAdd to Chrome