Zero-shot prompting
What is zero-shot prompting?
Zero-shot prompting is asking a language model to do a task without giving it any worked examples. You write the instruction in plain language, and the model answers straight away, relying on what it already learned during pretraining.
The word shot means example. Zero-shot means zero examples. You are not showing the model how the task is done. You are describing it and trusting that the model has seen enough similar tasks in its training data to work out what you want.
A zero-shot prompt looks like the request itself: Classify this review as positive or negative, and reply with one word: [review text]. No sample reviews, no demonstrations, just the instruction and the input. For common tasks, that is often all a capable model needs.
Zero-shot versus few-shot
The contrast is few-shot prompting, where you include a handful of examples in the prompt to show the exact pattern you want. Both lean on the same underlying behaviour, in-context learning: the model adjusts to the prompt in the moment without any retraining. The difference is whether you hand it demonstrations.
Zero-shot keeps the prompt short and cheap, since examples cost tokens and take up room in the context window. It leans entirely on the model's prior knowledge. Few-shot spends those tokens to pin down a specific output format, a subtle labelling rule, or a particular style that is easier to show than to describe.
A simple rule works well: start zero-shot. Reach for few-shot only when the output format drifts, the labels are subtle, or the task is easier to demonstrate than to explain.
How to write a good zero-shot prompt
With no example to imitate, the instruction has to carry all the weight, so it pays to be explicit.
State the output format. If you need one word, a JSON object, or a fixed set of labels, say so plainly. Without an example, the model guesses the shape, and that guess varies from call to call.
Name the constraints. Length, tone, what to leave out, what counts as each category. The clearer the boundaries, the steadier the answers.
Give the model a role or context. Telling it to act as a support agent, or reminding it what the input is, focuses the response. A reusable prompt template makes this repeatable across many calls.
Zero-shot and chain-of-thought
For tasks that need several reasoning steps, plain zero-shot can rush to an answer and get it wrong. A well-known trick is to add a short instruction like Let's think step by step before the model answers. Researchers found that this alone, with no examples at all, pushes models to reason through the problem and lifts their accuracy on multi-step questions. It is zero-shot chain-of-thought prompting: still no examples, just an instruction to show the working.
Use it where the task genuinely has steps, such as a calculation or a rule that must be applied in order. For simple classification or extraction, the extra reasoning wastes tokens and makes the output harder to parse.
What to watch out for with zero-shot prompting
The output format wanders. With nothing to copy, the model may answer with a single label one time and a full sentence the next. If a downstream step expects a fixed shape, spell the shape out or move to few-shot.
It assumes the model knows the task. Zero-shot leans on pretraining, so niche, domain-specific, or unusual tasks may fail where a couple of examples would have carried it.
There is no example to correct a misread. When the model misunderstands a subtle instruction, a worked example is often the fastest fix, and zero-shot has none by definition.
Test on real inputs. A zero-shot prompt can look perfect on the one case you tried and wobble on the messy real ones. Try it across a range before you rely on it.