Zero-shot prompting
Zero-shot prompting is asking a language model to perform a task using only an instruction, without including any worked examples of the task in the prompt.
Most everyday use of chatbots is zero-shot prompting. You write "Summarise this email in two sentences" or "Translate this paragraph into Spanish" and the model does it, without being shown any example summaries or translations first. The model relies entirely on what it learned in training to understand what the instruction means and what a good answer looks like.
The settings were defined in OpenAI's GPT-3 paper of May 2020, which compared three ways of using a 175-billion-parameter model without changing its weights. In the few-shot setting the prompt contains several demonstrations, in one-shot it contains one, and in zero-shot it contains only a natural-language description of the task. The authors called zero-shot the most convenient setting but also the hardest, sometimes unfairly so, giving the example of a request to make a table of world records for the 200 metres, where the expected format is unclear without an example.
Zero-shot performance improved sharply as models were trained to follow instructions. Google's FLAN research in 2021 found that a 137-billion-parameter model fine-tuned on more than 60 tasks phrased as instructions beat zero-shot GPT-3 on 20 of 25 tasks tested. Today's chat models are trained this way, which is why plain instructions work so well with them.
A famous refinement came in May 2022. Researchers led by Takeshi Kojima found that simply adding "Let's think step by step" to a prompt, with no examples, lifted an InstructGPT model's accuracy on the MultiArith arithmetic benchmark from 17.7 to 78.7 per cent and on the GSM8K maths benchmark from 10.4 to 40.7 per cent. This became known as zero-shot chain-of-thought prompting.
In practice, start zero-shot: it is the quickest prompt to write and the cheapest to run. If the output is right in substance but wrong in shape, such as the wrong format or tone, adding a few examples, known as few-shot prompting, is usually the fastest fix. Anthropic's documentation describes examples as one of the most reliable ways to steer format, tone and structure.
It is giving a language model an instruction to perform a task without any examples of the task in the prompt. For instance, asking a model to classify a review as positive or negative without first showing it any labelled reviews. Zero-shot prompts contain only the instruction. Few-shot prompts add a handful of worked examples of inputs and desired outputs. Few-shot prompting usually helps when the task has a specific format or style that is hard to describe in words. It is adding a phrase such as "Let's think step by step" to a zero-shot prompt so the model writes out its reasoning before answering. A 2022 study found this greatly improved accuracy on arithmetic and maths word problems without any examples. Use it first for most tasks, since modern instruction-tuned models handle plain instructions well and it keeps prompts short. Move to few-shot examples if the model misunderstands the format, the labels or the level of detail you want.Common questions
What is zero-shot prompting?
What is the difference between zero-shot and few-shot prompting?
What is zero-shot chain-of-thought?
When should I use zero-shot prompting?
Search for "zero-shot prompting", "zero-shot vs few-shot", "zero-shot chain of thought" or "Let's think step by step" to find the key studies and current advice. The original papers on arXiv are the authoritative sources for definitions and results, while model makers' prompting guides give practical advice for specific models. Benchmark gains from older models may not carry over to newer ones, so test on your own tasks.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.