liveBook · Manning

Zero-shot learning

As explained in Transformers in Action

Zero-shot learning is the ability to perform a task or recognize classes without task-specific examples during adaptation or inference.

Zero-shot learning enables a model to perform tasks it was never specifically trained for. It relies on broad pre-existing training rather than task-specific examples or explicit retraining during adaptation or inference. section 1.3 section 1.5

The technique expands the practical reach of pretrained transformers, making existing model knowledge usable across new tasks while reducing the time and resources required for task-specific training. Few-shot learning differs by using a small amount of task-related data. section 1.3 section 1.5

Use zero-shot learning with the following trade-offs:

  • Leverage a pretrained transformer when a new task lacks task-specific examples. section 1.3
  • Balance generalization benefits against weaker performance in specialized domains such as finance or healthcare. section 1.3 section 1.5
  • Distinguish zero-shot prompting from broader prompt-engineering methods, including one-shot and few-shot prompting. section 4.2

How Transformers in Action covers it

How deep it goes
Defines generalization beyond training and contrasts few-shot learning, but stops short of implementation procedures or model internals.
What it assumes
Assumes pretrained models and broad training knowledge while defining how they support unseen tasks without explicit retraining.
What you can do after
Evaluate whether pretrained-model generalization can replace task-specific training while accounting for domain and deployment constraints.
How it connects
Connects zero-shot learning with pretrained transformers, few-shot learning, prompt engineering, and model selection.

Also explained in

Compare how 10 books explain zero-shot learning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Transformers in Action. The section links point to the parts of the book it draws on.