Explainer
What one example teaches
An example in a prompt shows the shape you want, and it also teaches whatever else it happens to contain.
A prompt with no example is called zero-shot; one example makes it one-shot and a few make it few-shot (also multishot). Learning from examples in the prompt is called in-context learning; unlike fine-tuning, it leaves the model's weights, the numbers it learned in training, unchanged. The GPT-3 paper (2020) gave tasks as “few-shot demonstrations specified purely via text”.
In a 2022 study of 12 models including GPT-3, on classification and multiple-choice tasks, Min et al. gave the examples random answers instead of correct ones. Scores barely fell. The examples showed the possible answers, the kind of input and “the overall format of the sequence”, and those mattered more. Those tasks had fixed answer options, unlike free-text replies. Examples can also carry details you did not mean, such as a name or a length, as in Build an AI judge.
Makers disagree on how many (checked 21 November 2026). Google's Gemini guide: “We recommend to always include few-shot examples in your prompts.” OpenAI's reasoning guide: “Try zero shot first, then few shot if needed”. Anthropic's article: “Start with one example (one-shot).” Whatever the count, a case shown in the prompt can no longer test it; keep test cases out (see holdout).
Going deeper
Order once mattered: on 2021 GPT-family models, Lu et al. found order alone “can make the difference between near state-of-the-art and random guess performance”. Very many examples are mixed: gains with hundreds on Gemini 1.5 Pro (Agarwal et al., 2024), losses on some models including GPT-4o (Tang et al., 2025). For one reasoning model, the DeepSeek-R1 paper (January 2025) says “Few-shot prompting consistently degrades its performance.”
In the long read: What does an example teach?. Then try Teach a boundary with one example.