liveBook · Manning

Zero-shot prompting

As explained in The Art of AI Product Development

Zero-shot prompting is prompting a model to perform a task without providing example input-output pairs in the prompt.

Zero-shot prompting asks a language model to perform a task using only the task specification, without input-output demonstrations. It is a practical starting point for testing an AI product quickly, because it uses existing model capabilities without fine-tuning. section 6.0 section 6.1.1

From sentiment labels to product content

A basic prompt might ask the model to determine whether text is positive or negative, producing the answer after “Sentiment:”. A richer zero-shot request asks: “Generate a blog article on Small Language Models for CIOs of large businesses. Make it engaging and actionable, showing ways to integrate SLMs into their IT operations.” Both prompts provide a task, not demonstrations. section 6.1.1 section 6.1.1

Figure 6.2 Example of an input-output prompt for sentiment analysis
A diagram of a video game

AI-generated content may be incorrect.

Use the sentiment-analysis figure to see how a task-only prompt produces an output without examples. section 6.1.1

Use zero-shot prompting deliberately:

  • Start with straightforward tasks or topics likely to be well represented in the model’s training data. section 6.5
  • Improve output by adding context, detailed instructions, or a desired style while keeping the prompt demonstration-free. section 6.1.1
  • Switch to few-shot prompting when a complex or unfamiliar task needs demonstrations; use chain-of-thought prompting when the task requires multiple reasoning steps. section 6.1.1 section 6.5

How The Art of AI Product Development covers it

How deep it goes
Defines the input-output method and explains next-token generation, but defers complex tasks to demonstrations or reasoning prompts.
Examples
Uses sentiment analysis and a CIO-focused Small Language Models blog request as concrete prompts.
What it assumes
Assumes a task description and a language model, while teaching the basic input-output pattern from zero.
What you can do after
Apply zero-shot prompts to generate responses for simple tasks or topics well represented in training data.
How it connects
Connects prompt engineering with few-shot prompting, chain-of-thought prompting, and reusable prompt components.

Also explained in

Compare how 9 books explain zero-shot prompting →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of AI Product Development. The section links point to the parts of the book it draws on.