When people start with few-shot prompting, the first question is usually a number: how many examples do I need to paste in? The honest answer is smaller than most expect. One complete pair is enough to run, two to five good pairs is the range that usually works best, and past that the count stops deciding your results. What decides them is whether your pairs are correct, complete and consistent.
This guide explains where those numbers come from and how to judge your own set, using the free Few-Shot Example Formatter on Ovatly, which turns input and output pairs into a clean, consistently labelled block for the top of a prompt.
Contents
- Quick answer
- The floor: one complete pair
- The working range: two to five
- Why more is not better
- How to build a set of the right size, step by step
- Worked example: two pairs doing the whole job
- When a new example is actually needed
- Limitations and alternatives
- Common mistakes
- FAQs
- Conclusion
Quick answer
You need at least one complete input and output pair. In practice, two to five good examples usually beat ten sloppy ones: enough pairs for the model to see the pattern, few enough that you can verify every one. Build your pairs in the Few-Shot Example Formatter, keep each pair complete and identically formatted, and add a new example only when it covers a situation your set does not.
The floor: one complete pair
Few-shot prompting means giving a model a few worked examples of the task inside the prompt, so it copies the pattern for the new input that follows. Zero examples is zero-shot, which relies on instructions alone.
One pair is the minimum because one pair is the smallest thing that demonstrates a mapping: this kind of input becomes that kind of output. The formatter enforces the same floor: fill in at least one complete pair, and if no pair is complete, the tool says so instead of producing an empty block.
Completeness is part of the floor, not a detail. A pair missing its output is skipped, and a pair missing its input is skipped too. Three typed pairs with one left half blank are a set of two. When you count your examples, count complete pairs only.
The working range: two to five
Two pairs are stronger than one for a simple reason: a single example can be read several ways. Show one review labelled "positive" and the model cannot tell whether the lesson is the label set, the answer length, or something about that particular review. A second pair, different input, same shape, rules out most wrong readings. The pattern is what the pairs have in common.
From there, each added pair earns its place by covering something new: a negative case beside the positive one, a short input beside a long one, the borderline input you know your real data contains. Somewhere around five pairs, most simple tasks have shown their pattern and their main variations. That is why two to five is the working range: the pattern is clear and the set is still small enough to check line by line.
Why more is not better
The model copies the pattern it sees, all of it. Ten pairs assembled in a hurry tend to include the things a hurry produces: an output that is slightly wrong, two pairs whose answers follow different rules, one pair formatted a little differently. None of these announce themselves. They get learned alongside the good pairs, and the results vary in ways that are hard to trace back to a single bad example.
There is a second cost: a long block makes every prompt longer without making it clearer, and a long set is one nobody re-reads. The bigger it grows, the less likely anyone checks pair seven again.
Two to five good examples beat ten sloppy ones because quality and consistency are what the model learns from. Count is just how many chances you had to get those two things right or wrong.
How to build a set of the right size, step by step
- Open the Few-Shot Example Formatter. Type an instruction line if the block needs one; it is optional.
- Fill in your first complete pair: a typical input and the exact output you want for it. Plan on at least one more.
- Add pairs with the button until each main variation of your task is covered once: the other label, the other length, the borderline case. For most tasks this lands at two to five pairs.
- Choose the label style that matches your prompt: Input/Output, Q/A or User/Assistant. Keep or remove the trailing empty prompt, which leaves a labelled slot for the real input.
- Copy the block, then count the pairs in it. If the count is lower than the number you typed, a pair was incomplete and got skipped; fix it rather than assuming it is in there.
Worked example: two pairs doing the whole job
The formatter's own demonstration set is a sentiment classifier with an instruction line and two pairs, trailing empty prompt on:
Classify the sentiment of each review.
Input: I love this film
Output: positive
Input: The food was cold
Output: negative
Input:
Output:
Two pairs, and the job is fully specified. The first pair shows one label, the second shows the other, so the label set is defined. Both outputs are one word, so the answer shape is defined. The empty final pair shows where the real review goes. A third pair would only help if it covered something these two do not, such as a mixed review; another clearly positive review would add length and nothing else.
When a new example is actually needed
The signal for adding a pair is a wrong answer on a kind of input your set does not cover. If the model mishandles sarcastic reviews and no pair is sarcastic, one sarcastic pair, correctly labelled, beats five more pairs of a kind it already gets right.
The opposite signal matters too. If the model gets a covered case wrong, the problem is usually inside the set: a pair whose output contradicts the rule the others teach, or labels that drift between pairs. Fix the pair you have before adding another; extra examples layered over an inconsistent set give the model two patterns to copy, and it will copy both.
Limitations and alternatives
The formatter can guarantee consistency, but it cannot judge example quality. It does not know whether your outputs are correct, whether your pairs contradict each other, or whether they cover the inputs you will really send. The two-to-five range is guidance, not a rule the tool enforces; it will format a larger set without complaint.
The labels in the block are literal text. If your chat tool has its own few-shot or examples feature, use that instead of pasting a block, since a built-in feature carries the examples in a structured way.
And no count fixes a task the examples do not demonstrate. If none of your pairs resembles the input you care about, the model will improvise, whether the block holds three pairs or thirty.
Common mistakes
- Counting incomplete pairs. A pair with a blank output is skipped, so your set is smaller than you think. Count the pairs in the finished block.
- Padding to a round number. Ten is not a target. Pairs added to reach a number add noise, not signal.
- Five versions of the same case. Near-duplicate pairs teach nothing new. Spend each pair on a different variation.
- Adding pairs to fix an inconsistency. Contradictions are removed, not outnumbered. Find the pair that breaks the pattern and correct it.
FAQs
What is the minimum number of few-shot examples? One complete pair. The formatter requires at least one input with its expected output; pairs missing either side are skipped and do not count toward your set.
Is there an ideal number of examples? Two to five good examples is the working range. That is enough pairs for the model to infer the pattern, and few enough that you can keep every pair correct and consistent.
Why are ten examples not better than three? Because the model copies the pattern it sees. Ten rushed pairs usually include inconsistencies, borderline answers or contradictions, and those get copied too. A small set you have checked pair by pair teaches a cleaner pattern.
Can I add an example with only an input? You can type it, but incomplete pairs are ignored in the output. Every example needs its expected output to teach the pattern, so it does not raise your count.
Should I add more examples when the model gets a case wrong? Add an example that covers the case it got wrong, not more examples of the cases it already handles. Coverage of different situations is what extra pairs are for.
Conclusion
The count question has a short answer: one complete pair to run, two to five good pairs to work well, and no prize for going past that. The real work is choosing pairs that are correct, complete and consistent; the formatting side is covered in the companion guide: How to Format Few-Shot Examples So the Pattern Is Obvious The Few-Shot Example Formatter keeps the block uniform while you decide which pairs earn a place in it. More prompt guides are in the AI and Prompt Tools guides.