Zero-Shot Prompting

The simplest prompting technique is just to ask. Zero-shot prompting means giving the model a task with no examples — relying entirely on its pre-trained knowledge to understand and perform it. "Zero-shot" literally means zero examples ("shots") in the prompt.

💡 In one line: Zero-shot prompting asks the model to do a task with no examples — it works from the instruction alone.

What is Zero-Shot Prompting?

You provide an instruction and the input, and nothing else — no demonstrations of the desired output. The model performs the task using what it learned during pre-training and instruction tuning.

Why It Works

Large, instruction-tuned LLMs have seen an enormous range of tasks during training. That lets them generalise to new instructions they weren't explicitly shown — so a clear, direct request is often enough.

When to Use Zero-Shot

  • Simple, common tasks — translation, summarisation, classification.
  • When you have no examples on hand.
  • Quick prototyping — a fast first attempt.
  • To keep prompts short — fewer tokens, lower cost.

Limitations

  • Can struggle with unusual or precise output formats.
  • Ambiguous tasks may give inconsistent results.
  • Exact structure often needs examples (few-shot).
  • Hard reasoning may need chain-of-thought.

When zero-shot underperforms, the usual next step is to add examples (one-shot or few-shot).

Zero-Shot Chain-of-Thought (a Powerful Trick)

A famous booster: adding "Let's think step by step" triggers reasoning without any examples. This simple phrase noticeably improves multi-step tasks — a zero-shot way to unlock better reasoning (more in the Chain-of-Thought subtopic).

Examples

  • "Classify the sentiment as POSITIVE or NEGATIVE: 'This is amazing!'"
  • "Translate to French: 'Good morning.'"
  • "Summarise the following in one sentence: [text]"

Code Example


Best Practices

  • Be clear and specific.
  • Specify the exact output format you want.
  • If results are inconsistent, add examples (→ one-/few-shot).
  • For reasoning tasks, add "think step by step."

Summary

  • Zero-shot prompting gives a task with no examples, relying on the model's pre-trained knowledge.
  • It's great for simple, common tasks and quick prototyping, and keeps prompts short.
  • It can struggle with precise formats, ambiguity, or hard reasoning.
  • Zero-shot chain-of-thought ("Let's think step by step") boosts reasoning without examples.
  • When it's not enough, add examples — leading to one-shot and few-shot. EOF echo "created"