⚡ One-shot learning is the ability to recognise or classify something from just one example — no retraining, no large dataset. When you set up Face ID by scanning your face once, that is one-shot learning. The system has rich prior knowledge of faces from pretraining; one new example is enough to learn yours specifically. It powers face verification, rare defect detection, and in-context LLM adaptation.
Category: Machine Learning · Difficulty: Intermediate · Last updated: 15 May 2026 · 4 min read
One-Shot Learning — How AI Learns to Recognise Something New from a Single Example
What is One-Shot Learning?
A child sees a platypus once in a zoo. They can recognise a platypus in a book, in a different photo, drawn as a cartoon, seen from a different angle — all from that single encounter. They generalise because they already have a rich model of animals: they know what fur looks like, what a bill looks like, what a tail looks like. One example was enough to add “platypus” to their existing animal knowledge.
One-shot learning works the same way. The model has been trained on thousands of categories and has developed a rich representational space — it understands what makes things similar or different. When given one example of a new category, it can place that category correctly in its representational space and classify new instances by comparing their similarity to the single stored example.
The key insight: the challenge is not “learn to classify platypi” — it is “learn to learn new categories quickly.” This meta-learning perspective — training models to be good at learning from few examples — is what makes one-shot learning possible.
How One-Shot Learning works
Siamese networks: two identical networks process two inputs. The network is trained to output a similarity score — are these the same class? At one-shot time, store the embedding of the single example. Classify new inputs by computing similarity to the stored embedding.
Prototypical networks: for each class, compute the average embedding of its examples (the “prototype”). Classify new inputs by finding the nearest prototype. With one example, the prototype is that single example’s embedding.
Meta-learning: train the model explicitly to generalise from few examples by simulating one-shot scenarios during training. The model learns the skill of learning quickly, not just specific categories.
Real-world examples
Not theory — what real teams actually shipped using this technique.
- Apple Face ID — enrols a new face from a 3D scan taken in about 10 seconds (roughly one “example”). Using a neural network pretrained on millions of faces, it generalises from this single enrolment to recognise the user reliably in all lighting conditions and as their face changes gradually over time.
- Industrial quality control — a factory introduces a new product. One example of a new defect type is photographed. A one-shot learning defect detector, pretrained on manufacturing images, can immediately detect instances of that defect without retraining.
- Drug discovery — given one confirmed active compound, one-shot molecular similarity search finds structurally similar candidates that might share the pharmacological activity — starting a new drug discovery programme from a single hit.
Common pitfalls
- One-shot does not mean reliable — with only one example, there is no way to know if that example is representative of the class. An uncharacteristic example leads to poor generalisation. More examples almost always help.
- Requires rich pretraining — one-shot learning only works because the model already has extensive prior knowledge. Without strong pretraining on related categories, one example is genuinely not enough.
- Domain specificity — a model pretrained on natural images may do one-shot learning on new animals but fail at one-shot learning on medical imagery or satellite images. The pretraining domain must overlap with the one-shot domain.
- Confusion between one-shot and in-context learning — LLMs doing one-shot prompting are not updating their weights. They are pattern-completing from context. True one-shot learning updates a representation from one example.
Frequently asked questions
QUESTION 1 What is one-shot learning in simple terms?
ANSWER 1 Recognising something new from a single example — like Face ID learning your face from one scan. Works because rich prior knowledge from pretraining enables generalisation from very little new information.
QUESTION 2 How does one-shot learning work technically?
ANSWER 2 Metric learning — train to produce embeddings where similar things are close. At one-shot time, embed the single example and classify new inputs by embedding distance to that stored example.
QUESTION 3 What is the difference between one-shot, few-shot, and zero-shot?
ANSWER 3 Zero-shot: no examples, description only. One-shot: exactly one example. Few-shot: 2-20 examples. All leverage rich pretraining to generalise from limited new information.
QUESTION 4 Where is one-shot learning used?
ANSWER 4 Face verification, rare medical imaging, industrial defect detection, drug discovery molecular search, and personalised AI adaptation.
📬 Get one concept + one use case every Tuesday. Join the newsletter →