What is zero-shot learning? Zero-shot vs few-shot explained simply

Zero-shot means an AI handles a task it was never shown examples of. The term has two meanings, one from classic machine learning and one from prompting chatbots. Here are both, with examples, plus one-shot and few-shot.

Three prompt cards in a row. Zero-shot: Tag this review as positive or negative: the battery lasts all day. No examples given. One-shot: the same instruction with one example review and its tag. Few-shot: the same instruction with three example reviews and their tags. Under each card, the model answers: positive.
Fig. 1 — Zero-shot: just the instruction. One-shot: one example. Few-shot: a few examples. The model's weights never change.

Imagine you’ve never seen a zebra, but someone tells you: “It looks like a horse, with black and white stripes.” The first time you see one, you recognise it immediately. You had zero examples of a zebra, but a description was enough.

That’s the idea behind zero-shot learning: an AI handling something it was never shown examples of. Today you’ll mostly hear “zero-shot” when people talk about prompting chatbots, but the term started in classic machine learning, and the two meanings are a little different. This guide explains both, along with one-shot and few-shot, the last letter of AI Basics A–Z.

What does “zero-shot” mean?

In AI, a shot is an example. So:

  • Zero-shot: the AI does a task with no examples of it.
  • One-shot: it gets one example.
  • Few-shot: it gets a few examples.

Zero-shot learning is when an AI model correctly handles a task, or recognises a category, without having been given any examples of that specific task or category.

Meaning 1: zero-shot in classic machine learning

In traditional machine learning, a classifier can only recognise the categories it was trained on (see supervised learning). Train it on cats, dogs and horses, and it can never say “zebra”.

Zero-shot learning in this sense means recognising new categories that had no training examples, by using extra information that describes them, such as:

  • Attributes: “zebra = horse-shaped + striped + black and white”. Early research used animal attributes exactly like this.
  • Text descriptions or names, connected to images through shared meaning.

A well-known example is CLIP, a model OpenAI published in 2021. It learned from about 400 million images paired with their captions from the internet. Because it connects pictures and words in one shared embedding space, you can give it a new list of category names and it can pick the best match for a photo, without training on that list. The researchers reported that, zero-shot, CLIP matched the accuracy of the original ResNet-50 model on ImageNet, without using any of the 1.28 million training images that ResNet-50 was trained on. (CLIP uses “zero-shot” a little more loosely: its web data likely included pictures of those categories, but it was never trained on that labelled list.)

Meaning 2: zero-shot prompting with LLMs

With large language models, “zero-shot” usually describes how you prompt. You give the model an instruction with no examples in the prompt:

“Tag this review as positive or negative: ‘The battery lasts all day.’”

The model answers “positive” based on what it learned during training. Nothing is retrained.

These terms were laid out clearly in the 2020 GPT-3 paper from OpenAI, Language Models are Few-Shot Learners, which compared three settings: zero-shot (an instruction only), one-shot (one example) and few-shot (several examples; in the paper, often 10 to 100), all with no updates to the model’s weights. The examples simply sit in the prompt. Learning from the prompt alone like this is called in-context learning.

A comparison of two meanings. Left panel, classic zero-shot learning: an image model trained on photos of horses, cats and dogs is shown a zebra for the first time. It is given the description horse-like, striped, black and white, and answers zebra. Right panel, zero-shot prompting: a chatbot receives only an instruction, translate to French: cheese, with no examples, and answers fromage.
Two meanings of zero-shot: recognising a new category from a description, and doing a task from an instruction alone.

Zero-shot vs one-shot vs few-shot

What’s in the prompt Good for
Zero-shot Just the instruction Common, clear tasks: summarise, translate, classify sentiment
One-shot Instruction + 1 example Showing a format or style once
Few-shot Instruction + a few examples Unusual formats, specific labels, a consistent tone
Fine-tuning (for comparison) Many examples, used to train the model Consistent behaviour across huge volumes

Some practical tips:

  • Start zero-shot. Modern models handle many tasks well from a clear instruction. (See prompts.)
  • Add examples when results are inconsistent, or when you need a specific format, labels or style.
  • Choose examples carefully. The model copies patterns from them, including mistakes and accidental habits, such as always putting the same label first.
  • If you need many examples every time, consider fine-tuning instead.

Why zero-shot matters

  • No labelled data needed for each new task, which saves huge amounts of time and money.
  • Flexibility: one model can handle many tasks just by changing the instruction.
  • New categories on the fly: an image search can look for “red umbrella” or “broken screen” without training a new model for each.
  • Fast prototyping: try an idea in minutes with a prompt before investing in data and training.

Limits of zero-shot

  • Less reliable on unusual or specialised tasks. A zero-shot model may not follow niche formats or expert conventions without examples.
  • Sensitive to wording. Small changes to the instruction can change the result.
  • Can be confidently wrong. Without examples or sources, the model may guess (see hallucinations).
  • “Zero” isn’t always zero. A model may have seen similar tasks during its huge training, so zero-shot success partly reflects what it already learned.
  • Bias from training data still applies (see AI bias).

Common misconceptions

“Zero-shot means the model learns from nothing.” It relies heavily on what it learned in training; it just gets no examples of this task.

“Few-shot examples train the model.” They don’t change its weights. They only guide this one answer.

“Zero-shot only applies to chatbots.” The term came from classic machine learning, and it’s used for image models too.

“More examples are always better.” Past a few good examples, gains often level off, and long prompts cost more.

Key takeaways

  • A shot is an example: zero-shot = no examples, one-shot = one, few-shot = a few.
  • Classic zero-shot learning: recognising new categories without training examples, using descriptions or attributes; CLIP is a famous example.
  • Zero-shot prompting: asking an LLM to do a task with just an instruction; the 2020 GPT-3 paper compared zero-, one- and few-shot.
  • Examples in a prompt don’t change the model’s weights; this is in-context learning.
  • Start zero-shot, add examples when results are inconsistent, and fine-tune when you need many examples every time.

Frequently asked questions

What is zero-shot learning in simple words?

It’s when an AI handles a task or recognises something it was never shown examples of, using what it already knows and a description or instruction.

What is the difference between zero-shot and few-shot?

Zero-shot gives the model only an instruction. Few-shot adds a few worked examples to the prompt so the model can follow the pattern.

Is zero-shot the same as fine-tuning?

No. Zero-shot and few-shot don’t change the model at all. Fine-tuning trains the model further on many examples and changes its weights.

What is an example of a zero-shot prompt?

“Translate to French: cheese.” or “Tag this review as positive or negative: ‘The battery lasts all day.’” There are no examples, just the instruction.

What is CLIP zero-shot classification?

CLIP is an OpenAI model that links images and text. You can give it a list of category names it wasn’t specifically trained on, and it picks the name that best matches an image, without any extra training.

Comments

LEAVE A COMMENT
No sign-up. Comments appear after a quick review.