Picture a naturalist who has never seen a zebra but is told: "it's a horse striped in black and white." The day one appears, they identify it without hesitation. Zero-shot learning rests on exactly this intuition: enabling a model to recognize or perform a task without any training examples for that specific task.
The principle: generalizing through description
Unlike classical learning, which demands thousands of labeled examples per category, zero-shot relies on a shared semantic representation. The model learns to link inputs (images, text) to a knowledge space — attributes, textual descriptions, semantic vectors. A never-seen class is then described within that same space, making prediction possible.
With large language models, zero-shot takes a familiar form: you phrase an instruction in natural language ("Classify this message as positive or negative") without supplying a single example. The model draws on knowledge acquired during its massive pre-training.
Zero-shot, one-shot, few-shot
| Approach | Examples provided |
|---|---|
| Zero-shot | 0 |
| One-shot | 1 |
| Few-shot | a handful (2 to ~10) |
Formally, the goal is to predict a class drawn from an unseen set $Y_{\text{unseen}}$ that is disjoint from the seen training classes $Y_{\text{seen}}$:
$$ Y_{\text{seen}} \cap Y_{\text{unseen}} = \varnothing $$
Strengths and limits
- Strength: immediate flexibility, with no costly relabeling or retraining.
- Limit: performance depends heavily on the quality of descriptions and the richness of pre-training; it often trails a dedicated, specialized model.
Zero-shot embodies a deep shift: we no longer program the machine through examples, but through meaning.