← AI Terminology
One-Shot Learning
One-shot learning is a machine learning approach where a model learns to recognise a new class or perform a new task from just one (or very few) training examples — by leveraging prior knowledge, metric learning, or meta-learning rather than training from scratch.
It is a key capability for practical AI deployment where labelled data is scarce.
It is a key capability for practical AI deployment where labelled data is scarce.
Why It Matters in AI
Standard deep learning needs thousands of examples per class. One-shot learning addresses scenarios where that data simply doesn't exist — identifying a rare disease from one scan, authenticating a new user from one face photo, or recognising a new product from one image. FaceID on iPhones uses one-shot face verification; few-shot classifiers power rapid product cataloguing in retail. LLMs perform one-shot learning via in-context examples without any weight updates.
Key Points
| Aspect | Description |
|---|---|
| Zero-shot | Generalise with zero examples — CLIP, GPT-4 — further extension of this capability spectrum |
| In-context | LLMs: "Here is one example: [X]. Now do the same for [Y]" — zero weight updates, in-context |
| vs Few-shot | One-shot = exactly 1 example per class; few-shot = typically 5–20 examples per class |
| Meta-learning | "Learning to learn" — train on many N-way K-shot tasks so the model adapts quickly at test time |
| Siamese networks | Two identical networks learn embedding similarity — classify new examples by distance to one known example |
| Prototypical nets | Compute a class prototype (mean embedding) from one example; classify by distance |
Simple Analogy
A customs officer who has been shown one photo of a suspect and must spot them in a crowd of thousands: they can't retrain their brain, but their prior experience of thousands of other people lets them extract and match the key features from a single reference image.
Common Usage Examples
- FaceID: Apple's on-device one-shot face verification — enrol with ~10 images, authenticate forever
- Siamese network:
cos_sim(encoder(query), encoder(support))> threshold → same class - Prototypical networks:
ProtoNet(n_way=5, k_shot=1)— standard few-shot benchmark model learn2learnlibrary:l2l.algorithms.MAML(model, lr=0.01)— meta-learning framework- LLM one-shot:
"Translate to French. Example: 'Hello' → 'Bonjour'. Now translate: 'Goodbye'"
Summary
In short: One-shot learning enables models to recognise new categories from a single example — using prior knowledge and metric learning to generalise where labelled data is scarce, from face verification to few-shot classification.