Specialty Digest

Global English editionLearners’ Study Dashboard — in development
The Knowledge Library for All

Zero-Shot Learning

nounMachine Learningalso ZSL, zero-shot prompting, zero-shot classification

In one line

Zero-shot learning is a machine learning approach in which a model recognizes categories or performs tasks it was never given labeled examples for, using descriptions or related knowledge.

Zero-shot learning is a machine learning approach in which a model recognizes categories, or performs tasks, that it was never given labeled examples for. Instead of learning from examples of the new category, the model relies on some description of it, such as a list of attributes or a sentence in plain language, and links that description to knowledge gained from other categories. If a person who has never seen a zebra is told that it looks like a horse with black and white stripes, they can recognize one on first sight. Zero-shot learning tries to give machines the same ability. It sits at the far end of the spectrum that includes few-shot learning and one-shot learning.

Why zero-shot learning matters

The world has far more categories than any dataset can cover. New products, species, diseases, topics and slang appear all the time, and labeling examples for every one is impossible. Zero-shot learning lets a model handle such cases from the start, which saves labeling cost and speeds deployment. It also underlies the flexibility of modern foundation models, which can be asked to do a task described only in words.

How zero-shot learning works

The key is a shared semantic space that connects seen and unseen classes. During training, the model sees labeled examples of some classes, called seen classes, along with side information describing every class. Side information can be a vector of attributes, such as has stripes, has four legs, lives on grassland, or a word embedding of the class name, or a text description. The model learns to map inputs, such as images, into the same space as the side information. At test time, an image of an unseen class is mapped into the space, and the model picks the class whose description is closest. Because descriptions exist for classes with no examples, the model can name them.

Main approaches

  • Attribute-based methods: classes are described by human-defined attributes, and the model learns to predict attributes from inputs. An early influential version was proposed by Christoph Lampert and colleagues in 2009.
  • Embedding-based methods: inputs and class names or descriptions are mapped to a joint embedding space, and classification uses similarity. Examples include DeViSE from Google in 2013, which used word embeddings.
  • Generative methods: a generative model produces synthetic examples of unseen classes from their descriptions, which are then used to train an ordinary classifier.
  • Vision-language models: models such as CLIP are trained on hundreds of millions of image and caption pairs. To classify an image, users write a text prompt for each class, such as a photo of a dog, and the model chooses the best match.
  • Instruction-following language models: large language models perform tasks described only in the prompt, such as classify the sentiment of this review, with no examples. This is called zero-shot prompting.

Generalized zero-shot learning

In the basic setting, test data come only from unseen classes. In real use, test data include both seen and unseen classes, a harder setting called generalized zero-shot learning. Models tend to be biased toward the classes they saw during training and mislabel unseen items as seen ones. Methods such as calibration, which lowers the confidence in seen classes, and generative augmentation help reduce this bias.

Applications of zero-shot learning

In image recognition, zero-shot classification lets a system recognize new objects, species or products from names or descriptions. In natural language processing, models classify text into topics or intents that were defined only a moment earlier, which is useful in customer support and content moderation. In search and recommendation, it helps with new items that have no interaction history. In medicine, researchers use descriptions of rare conditions to help models flag them. In robotics, a system can be told to pick up an object by name. In translation, multilingual models can sometimes translate between language pairs they were not directly trained on.

Advantages of zero-shot learning

The approach needs no labeled data for the new classes, adapts quickly, scales to huge label sets and lets non-experts define tasks in natural language. It can be the first step in a project, giving a baseline before any labeling investment, and it can help find which examples are worth labeling.

Challenges and limitations

Zero-shot accuracy is usually lower than that of models trained on labeled examples of the target classes. Results depend on the quality of descriptions and prompts, and small wording changes can change the outcome. Models may inherit biases from the data used to build the shared space. Domain shift is a problem, since a model trained on photos may not recognize the same class in drawings or medical images. The hubness problem, in which a few points in the embedding space become nearest neighbors of many items, can distort results. For important decisions, zero-shot outputs should be checked and compared against a labeled test set.

A worked example

A retailer wants to sort product photos into categories that change each season. Instead of collecting labeled images for every new category, it uses a vision-language model. Staff write category names such as a photo of a wool scarf or a photo of a ski jacket. The model scores each photo against each phrase and assigns the best match. The retailer tests the approach on a few hundred hand-labeled images, finds that accuracy is good for common categories and weak for similar-looking ones, and adds a handful of examples for those weak categories, moving from zero-shot to few-shot.

Writing good zero-shot prompts and labels

For vision-language and language models, results depend on how classes are described. A label such as bank is ambiguous, while a photo of the side of a river or a photo of a financial institution is clear. Teams often write several phrasings for each class and average the scores, a technique called prompt ensembling. They also test the system on a small labeled sample before relying on it, and they track which classes are confused, so that they can add clearer descriptions or a few real examples where needed.

FAQs

What is zero-shot prompting? It means asking a language model to do a task with instructions only and no examples in the prompt.

How is zero-shot different from few-shot learning? Zero-shot gives no examples of the new class or task, while few-shot gives a small number.

Is zero-shot learning accurate? It can be surprisingly good, but it is usually less accurate than training on labeled data, so testing is important.

Key facts

  • In zero-shot learning, the model is tested on classes that had no labeled examples during training.1
  • Models bridge seen and unseen classes through shared attributes, word embeddings or text descriptions.1
  • OpenAI's CLIP, released in 2021, performs zero-shot image classification by matching images with text prompts.2

Related concepts

Quick checkHow can a model recognize a class it has never seen examples of?Show answer

By using a shared description of classes, such as attributes or text embeddings, that links what it learned about seen classes to the unseen ones.

Sources

  1. Xian et al., Zero-Shot Learning: A Comprehensive Evaluation of the Good, the Bad and the Ugly, https://arxiv.org/abs/1707.00600
  2. Radford et al., Learning Transferable Visual Models From Natural Language Supervision, https://arxiv.org/abs/2103.00020
  3. Lampert, Nickisch and Harmeling, Attribute-Based Classification for Zero-Shot Visual Object Categorization, https://ieeexplore.ieee.org/document/6571196

Editorially reviewed by Specialty Digest Editorial TeamLast reviewed November 17, 2026Researched and drafted with AI assistanceReport an issue