AI GLOSSARY · AI CONCEPTS
One-shot learning
Definition
One-shot learning is a machine learning setup for recognising a new category from one labelled example per class. It is the K=1 case of few-shot learning, which covers adaptation from small support sets.
Also called: one shot learning, one-shot classification, one shot classification, learning from one example.
In plain language
Image classifiers usually need many labelled pictures before they recognise a new category. One-shot learning asks for much less: show the system one labelled example, such as a single photo of a new kind of tool, and it has to pick out that kind of tool in later photos. People do this naturally with objects they have never met before. For machines it is hard, because one example cannot show how much a category varies.
Technical definition
The setup is usually posed as classification from a support set holding one labelled example per class. Matching Networks (Vinyals et al., arXiv 2016) map a small labelled support set and an unlabelled example to a label without fine-tuning for the new classes, and test the idea on Omniglot and ImageNet and on language tasks. IBM describes the case K=1 in few-shot learning as one-shot learning. The Matching Networks abstract describes this as a framework designed so that new classes need no fine-tuning.
Worked examples in this catalogue
Catalogue examples point at a skill, guide or coding tool listed on this site, with what to run and what you see. An example marked illustrative describes the item from its own documentation; it was not executed for this page. Platform Scores are our assessment under a published method, not a safety guarantee.
Guide · Illustrative, not executed
Prompt Engineering for Agents vs Chat Models
- What you see
- A guide on how prompting an agent differs from prompting a chat model, including what the prompt must define.
- Why it exercises the concept
- Giving a language model one worked example inside a prompt is called one-shot prompting. This is an input-demonstration setup. Absence of new weight updates does not distinguish it from every one-shot method: Matching Networks also adapt to new classes without fine-tuning, using a labelled support set and a query. The guide is adjacent, not a one-shot learning tutorial.
Skill by Skill Almanac · Illustrative, not executed
prompt-writing 57/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- The skill is described as writing and linting LLM prompts with a fixed structure, injection rules and a numeric test plan.
- Why it exercises the concept
- It is an illustrative place to prepare a single-example prompt. That prompt-level workflow is not the support-set/query classifier studied by Matching Networks; it does not train or run one.
Skill by Skill Almanac · Illustrative, not executed
llm-eval-test-sets 57/100 · Provisional, not yet measuredScored · Method v0.2 · How we score
- What you see
- The skill is described as building and validating an eval dataset for any LLM feature, with a checker for duplicates, missing graders, imbalance and leakage.
- Why it exercises the concept
- A one-shot result rests on very few examples, so a careful test set matters. The skill's checks for duplicates and leakage illustrate how an evaluation can be inflated.
How it shows up when you use agents
You are unlikely to train a one-shot classifier while using Claude Code, Codex or Cursor. The phrase turns up in two other places. One is machine learning papers on recognising categories from one example. The other is prompting, where "one-shot" often means a single worked example placed in the prompt. Specify the setup: an example embedded in a language-model prompt differs from the labelled support-set/query classifier in Matching Networks. Neither setup necessarily fine-tunes weights for each new class.
Mixing them up causes two mistakes. You may expect a prompt example to teach the model something lasting, when it only affects that request. Or you may read a one-shot result in a paper as proof that a model needs no data, when the method may rely on a model built beforehand; read the paper's setup to see what was trained and on what.
A sensible habit is to ask how the example is used: as a support item for a classifier, as a prompt demonstration, or in a parameter update. Weight updates alone do not define the distinction. If you are checking an agent that classifies things from one example, test it on several different inputs, not just the example it was shown. The llm-eval-test-sets skill helps build such a set. See also few-shot learning, zero-shot learning and few-shot prompting.
Common confusions
- One-shot versus few-shot. IBM describes one-shot learning as a challenging variant of few-shot learning, where K=1. Few-shot includes this one-example case as well as other small support sets.
- One-shot versus zero-shot. Zero-shot gives no examples of the new class. One-shot gives exactly one.
- One-shot learning versus one-shot prompting. The first names a few-example task setting, often with a support set and queries. The second places one demonstration in a prompt. Some support-set methods also require no new-class weight update, so inspect the adaptation mechanism.
- Myth. "One-shot learning means the model learned from one example." The Matching Networks abstract describes a framework that maps a small labelled support set and an unlabelled example to a label without fine-tuning for new classes. The model is built before the single example arrives.
Related terms
Terms that mention One-shot learning
1 terms mention this one
More in AI concepts
Sources
- Matching Networks for One Shot Learning (Vinyals et al.), arXiv (accessed 2026-11-24)
- What is few-shot learning?, IBM (accessed 2026-11-24)
- One-shot learning (computer vision), Wikipedia (accessed 2026-11-24)
Definitions are written by Skill Almanac from these sources and were checked against them on 2026-11-25. Wikipedia is never the only source.
Review record
Last verified
Drafted by Claude (original draft); OpenAI Codex (bounded factual repairs); sources and example targets checked by Independent automated source review (OpenAI Codex); not human peer review on 2026-11-25. Last verified .
Change log (5)
- : Independent automated factual/example review completed. Cached US query estimate aligned to receipt; no traffic promise. Final technical gate recorded separately; publication disabled.
- : First version.
- : Verifier pass: applied verifier corrections to unsupported claims and aliases.
- : Bounded source repairs: Included K=1 within few-shot; distinguished prompt demonstrations from support-set/query adaptation without treating weight updates as the discriminator. Pending independent re-review.
- : Automated review completed; approved for the staged public release. Search indexing is controlled by the release configuration.