← AI Terminology

Zero-Shot Learning

Zero-shot learning is the ability of a model to perform a task or recognise a class it has never been explicitly trained on — by leveraging semantic descriptions, attribute vectors, or general knowledge to bridge the gap between seen and unseen categories.

In LLMs, zero-shot refers to prompting with no examples; in classical ML, it refers to generalising to novel visual classes.
Why It Matters in AI
Labelling data for every possible class or task is impossible at scale. Zero-shot learning solves this: a model trained on a subset of classes can classify novel ones using shared semantic structure (e.g., "a zebra is a striped horse"). In LLMs, zero-shot prompting exploits general pre-training to answer questions, translate, summarise, and reason without task-specific examples. CLIP achieves zero-shot ImageNet accuracy comparable to supervised ResNets by aligning images and text descriptions. This generalisation is why frontier models are useful out-of-the-box.
Key Points
Aspect Description
Few-shot 1–32 in-context examples; zero-shot is the extreme where that number is zero
Classical ZSL Seen classes + attribute/semantic vectors → classify unseen classes at test time
LLM zero-shot Prompt with task description only — no examples; works because pre-training encodes world knowledge
CLIP zero-shot Encode image + encode text label → compare cosine similarity — no fine-tuning needed
Attribute space Describe classes by properties ("has stripes", "is aquatic") — bridge seen/unseen gap
Generalised ZSL Harder setting: test on both seen and unseen classes — unseen classes often underperform
Simple Analogy
A well-read naturalist who has never seen a platypus but, given a description ("duck bill, beaver tail, lays eggs, venomous spur"), can correctly identify one in the wild. Their broad biological knowledge (pre-training) plus the semantic description (class attribute) substitutes for direct experience — that is zero-shot generalisation.
Common Usage Examples
  • LLM: "Classify this review as positive or negative:\nReview: ..." — no examples in prompt
  • CLIP zero-shot: clip.encode_text(["a cat", "a dog"]) vs clip.encode_image(img) → highest cosine = class
  • pipeline("zero-shot-classification", model="facebook/bart-large-mnli")("text", ["sports", "politics"])
  • SentenceTransformer + cosine similarity — zero-shot semantic search without task fine-tuning
  • AutoModelForSeq2SeqLM with T5/FLAN-T5 — generalised zero-shot on unseen instructions
Summary
In short: Zero-shot learning enables models to handle tasks and categories they were never explicitly trained on — by exploiting semantic descriptions or broad pre-training knowledge, and is the property that makes general-purpose LLMs and CLIP useful without task-specific fine-tuning.