Beginner·3 min read

Zero-Shot

Zero-shot prompting is the technique of asking an LLM to perform a task without providing any examples of the desired input-output behavior in the pro

Definition

Zero-shot prompting is the technique of asking an LLM to perform a task without providing any examples of the desired input-output behavior in the prompt. The model relies entirely on its pre-trained knowledge to understand and execute the task.

The "Shot" Terminology

| Term | Meaning |

|------|---------|

| Zero-shot | 0 examples in prompt |

| One-shot | 1 example in prompt |

| Few-shot | 2–10+ examples in prompt |

"Shot" refers to a demonstration or example provided in context.

How Zero-Shot Works

The model generalizes from patterns learned during pre-training across billions of documents:

`

Prompt: "Translate the following English text to French: 'Good morning'"

Output: "Bonjour"

`

No translation examples were provided — the model has seen translations in training data.

Zero-Shot Examples by Task Type

Classification

`

Prompt: "Classify the sentiment of this review as positive, negative, or neutral:

'The product broke after two days.'"

Output: "Negative"

`

Summarization

`

Prompt: "Summarize the following paragraph in one sentence: [paragraph]"

Output: [one-sentence summary]

`

Code Generation

`

Prompt: "Write a Python function that checks if a number is prime."

Output: [Python function]

`

Question Answering

`

Prompt: "What is the capital of Australia?"

Output: "Canberra"

`

Zero-Shot vs. Few-Shot Performance

| Task Type | Zero-Shot Performance | Notes |

|-----------|----------------------|-------|

| Common NLP tasks | High | Translation, summarization, sentiment |

| Domain-specific tasks | Moderate | Legal, medical — benefits from examples |

| Niche/format-specific | Low-Medium | Custom output formats benefit from examples |

| Multi-step reasoning | Lower | CoT prompting helps significantly |

Zero-Shot Chain of Thought

Simply adding "Let's think step by step" to a zero-shot prompt dramatically improves reasoning:

`

Without: "What is 23 × 17?" → May get wrong answer

With: "What is 23 × 17? Let's think step by step." → Walks through the math

`

This is called Zero-Shot Chain of Thought (Zero-Shot CoT) — one of the most impactful zero-shot prompting techniques.

Instruction Tuning Enables Zero-Shot

Base models perform poorly at zero-shot tasks (they complete text instead of answering).

Instruct-tuned models are specifically trained to respond to zero-shot instructions:

  • Pre-training → learns knowledge
  • Instruction tuning → learns to follow zero-shot instructions
  • Zero-Shot with Roles

    Assigning a role improves zero-shot performance:

    `

    "You are an expert nutritionist. What are the key macronutrients in a banana?"

    `

    The role primes the model to respond from a specific knowledge frame.

    Limitations of Zero-Shot

    | Limitation | Workaround |

    |------------|-----------|

    | Poor on novel formats | Provide few-shot examples |

    | Inconsistent output structure | Specify format explicitly or use few-shot |

    | Struggles with complex reasoning | Use Chain of Thought prompting |

    | Domain-specific jargon | Add context or examples |

    | Long multi-step tasks | Decompose into sub-tasks |

    When to Use Zero-Shot

  • Task is common and well-represented in training data
  • Prototyping / quick experiments
  • Token budget is tight (no room for examples)
  • Output format is simple (yes/no, a number, a word)
  • Emergent Zero-Shot Abilities

    Larger models show emergent zero-shot abilities — capabilities that appear suddenly at scale:

  • Multi-step arithmetic
  • Logical reasoning
  • Code execution tracing
  • Novel analogy completion
  • These behaviors were absent in smaller models and appear without specific training.

    Related Concepts

  • Few-Shot, Chain of Thought, Prompt, Instruct Model, Inference, In-Context Learning

Go Deeper With Live Instruction

This topic is covered in depth in our llm engineering program (Session 5).