What is zero-shot learning?

Zero-shot learning is a model performing a task without seeing any examples of it, using only an instruction and the general knowledge it learned earlier.

It differs from few-shot learning in the number of examples: few-shot adds a few worked examples to the prompt, while zero-shot adds none. It means no task examples, not no instructions or context.

Topic
Prompts, context, reasoning and generation
Also known as
Zero-shot, zero-shot prompting, ZSL

How zero-shot learning works

  1. The prompt contains only the task description and, where needed, class names or output format; no worked examples are added.
  2. The model interprets the task using general language and concept knowledge gained in pre-training and instruction tuning.
  3. Weights do not change; it is the example-free form of in-context learning.
  4. Results depend on how clear the instruction is and how well the model generalises to the task.

In more detail

Classic zero-shot learning versus zero-shot prompting in LLMs

Broader machine learning distinguishes classical zero-shot learning (ZSL), such as vision-language models like CLIP matching images to unseen class names via shared embeddings or NLI models classifying text via entailment hypotheses, from LLM zero-shot prompting. Understanding this distinction helps teams choose a lightweight zero-shot classifier or embedding model instead of a heavy generative LLM when only fixed-label classification is needed.

Pre-training overlap and data contamination

Evaluating whether a model is truly performing zero-shot generalisation is complicated by pre-training and instruction-tuning overlap: public benchmarks or very similar enterprise formats may already have appeared in pre-training corpora (data contamination). Consequently, zero-shot accuracy on public leaderboards often overestimates real-world performance on proprietary internal taxonomies.

Structured output, boundary rules and zero-shot chain of thought

For complex analytical tasks, standard zero-shot prompting often underperforms until paired with structured outputs (JSON schema enforcement) and zero-shot Chain-of-Thought or reasoning-capable models. In enterprise pipelines, giving clear boundary rules, explicit 'unknown / other' fallback classes and strict output schemas can noticeably improve reliability without adding few-shot examples.

Commonly confused terms

TermHow it differs
Fine-tuningZero-shot learning uses the model as-is at inference time with unchanged weights; fine-tuning updates model weights on a labelled training dataset to specialise behaviour for a task or domain.
Zero-shot chain of thoughtZero-shot Chain-of-Thought (e.g., appending 'Let's think step by step') is a specific prompting technique within zero-shot inference that elicits intermediate reasoning steps before the final answer, whereas standard zero-shot prompting may ask for a direct label or output.

Why zero-shot learning matters for on-premises AI

It enables fast prototypes and first deployments for new tasks where labelled data is costly or hard to collect for privacy reasons. Short prompts save context window space and inference cost. Performance varies by task, so it should not go to production before being measured on the organisation's own evaluation set (model evaluation). For critical tasks needing high accuracy, human review or options such as few-shot prompts and fine-tuning are considered.

ON-PREMISES EXAMPLE

A manufacturer gives its in-house assistant only class names and definitions to classify quality control notes, runs it without examples and measures results on a labelled test set.

Common questions

How does zero-shot differ from few-shot learning?

Zero-shot adds no examples to the prompt, only instructions. Few-shot adds a few worked examples, which often improves format and consistency.

When is zero-shot enough for enterprise tasks?

Often when the task can be defined clearly and the model has met similar work in its general training. Whether it is enough is measured on the organisation's test set.

Sources

In the glossary: Glossary, R to Z

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.