Zero-shot learning (ZSL)

Zero-shot learning is a machine learning setup in which a model must recognise or handle categories or tasks it saw no labelled examples of during training, using descriptions or other side information instead.

A classic image classifier can only name the classes it was trained on. Show a model trained on cats and dogs a picture of an okapi and it will call it one or the other. Zero-shot learning tackles the harder problem: getting a model to recognise a class for which it had no training examples at all. The trick is to give it some other information that connects the new class to what it already knows.

That side information can take several forms. One is attributes: a bird species might be described as having a red head and a long beak, and a model that has learned to spot red heads and long beaks can recognise the combination. Another is text, such as a dictionary definition or an encyclopedia description of the class. A third is placing classes in a shared mathematical space, so a new example is assigned to whichever class description it lands nearest.

The research goes back to 2008, when a paper at the AAAI conference called the idea dataless classification and another at the same conference called it zero-data learning. The name zero-shot learning was introduced at the NIPS conference in 2009 by Palatucci, Hinton, Pomerleau and Mitchell. Also in 2009, Lampert, Nickisch and Harmeling showed attribute-based recognition of unseen animal classes, which became a standard reference in computer vision.

Large models made zero-shot ability practical at scale. OpenAI's CLIP, described in February 2021, was trained on 400 million image and caption pairs from the internet. Because it learned to match images to text, it could classify images by comparing them with written class names, and it matched the accuracy of the original ResNet-50 on ImageNet without using any of ImageNet's 1.28 million training examples. In language, Google's FLAN work in 2021 showed that training a 137-billion-parameter model on more than 60 tasks phrased as instructions made it much better at unseen tasks.

The term is now used in two senses. Strictly, it is the research setup above. Loosely, especially in coverage of large language models, it means a model doing any task without being shown examples first, which is better described as zero-shot prompting. A harder variant, generalised zero-shot learning, tests models on a mix of seen and unseen classes, closer to real conditions where the model must also decide whether something is new.

Common questions

What is zero-shot learning?

It is a machine learning setup where a model must deal with classes or tasks it saw no labelled examples of during training. It relies on extra information, such as attribute lists or text descriptions, to link the unseen classes to what it learned.

What is the difference between zero-shot, one-shot and few-shot learning?

The number refers to how many examples of the new class or task the model gets: none, one, or a handful. Zero-shot relies entirely on descriptions or general knowledge, while one-shot and few-shot give the model a small number of examples to work from.

What is an example of zero-shot learning?

OpenAI's CLIP model can classify photos into categories simply by being given the category names as text, without training on labelled examples of those categories. Used this way, it matched a standard ResNet-50 classifier on ImageNet without using ImageNet's training images.

Is zero-shot learning the same as zero-shot prompting?

They are related but not identical. Zero-shot learning is the broader research problem of handling unseen classes or tasks. Zero-shot prompting is the practical technique of asking a language model to do a task with instructions only and no examples in the prompt.

Finding more

Search for "zero-shot learning", "generalised zero-shot learning", "zero-shot image classification" or "CLIP zero-shot" to see both the classic research and modern uses. The most reliable sources are the original papers on arXiv and in conference proceedings, encyclopedia articles that cite them, and model documentation that reports zero-shot benchmark results. When a news story calls a model zero-shot, check whether it means truly unseen classes or simply no examples in the prompt.

Working out what this means for your business?

Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.