A few-shot prompt teaches by showing. You place a handful of worked examples at the top of the prompt, then the real input, and the model continues in the same shape. That only works when the shape is unmistakable. If one example is labelled "Input:", the next uses "Question -", and a third has an input with no output at all, the model has to guess which pattern you meant, and guesses vary from run to run.
This guide covers the formatting side of few-shot prompting: how to make the pattern so consistent that there is nothing to guess. It uses the free Few-Shot Example Formatter on Ovatly, which turns your input and output pairs into a clean, consistently labelled block you can paste at the top of a prompt.
Contents
- Quick answer
- Why the pattern is the lesson
- What consistent formatting actually means
- How to format examples, step by step
- Worked example: sentiment examples in Input/Output style
- The incomplete pair problem
- Limitations and alternatives
- Common mistakes
- FAQs
- Conclusion
Quick answer
Format every pair identically: same labels, same spacing, same order, and a complete input and output in each one. Choose one label style, Input/Output, Q/A or User/Assistant, and never mix styles inside one block. Add an optional instruction line at the top if the block needs one, and keep the trailing empty prompt so the real input has a labelled slot to land in. The Few-Shot Example Formatter applies all of this mechanically: you type the pairs, pick the label style, and it produces the uniform block.
Why the pattern is the lesson
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: the model works from your instructions alone. With examples, the instructions matter less and the examples matter more, because the model infers what you want from repetition.
That inference is only as clean as the repetition. The model reads your block and extracts a rule: text after this label gets answered with text after that label, in this shape. Every inconsistency is noise in that rule. A pair labelled differently, a missing output, a stray extra line: each one widens the range of outputs the model considers acceptable. Consistent formatting narrows it back down.
What consistent formatting actually means
Three things have to stay fixed across the whole block.
First, the labels. Every input gets the same label and every output gets the same label. The formatter offers three styles because different prompts read naturally in different voices: Input/Output for data-like tasks, Q/A for question answering, and User/Assistant for chat-style exchanges. Any of them works. Mixing two of them in one block does not.
Second, the shape. Each pair should look like every other pair: label, content, blank line, next pair. If one output is a single word and another is a paragraph, that difference is sometimes the task itself (short answers versus long ones), but if it is accidental, the model will treat both lengths as acceptable and you will get both.
Third, completeness. Every pair needs its input and its expected output. An input on its own teaches nothing, because the lesson of a pair is the mapping from one to the other. This point matters more than it looks, for a reason covered below: incomplete pairs do not survive formatting.
How to format examples, step by step
- Open the Few-Shot Example Formatter. Type an instruction line if the block needs one; this is optional, and a clear task often needs none.
- Fill in at least one complete input and output pair. One complete pair is the minimum the tool accepts. Add more pairs with the button; two to five good examples is the range that usually works best.
- Choose the label style that matches your prompt: Input/Output, Q/A or User/Assistant.
- Decide on the trailing empty prompt. Keeping it leaves a labelled slot for the real input at the bottom of the block, with the answer label already in place.
- Copy the block and paste it at the top of your prompt. Before you send it, read the block once and count the pairs; the next section explains why.
Worked example: sentiment examples in Input/Output style
Here is a real block in the shape the formatter produces. The instruction line is "Classify the sentiment of each review." There are two pairs, and the trailing empty prompt is on:
Classify the sentiment of each review.
Input: I love this film
Output: positive
Input: The food was cold
Output: negative
Input:
Output:
Notice what makes the pattern obvious. The instruction sits alone at the top. Both pairs use the same two labels in the same order. Both outputs are a single word, so the expected answer shape is unmistakable. The empty final pair tells the model exactly where the new review goes and what should follow it. Nothing in the block needs interpreting, which is the point: the model spends its effort on classifying your review, not on decoding your layout.
The incomplete pair problem
Pairs missing either the input or the output are skipped. If no pair is complete, the tool says so instead of producing an empty block. That behaviour is correct, but it has a quiet consequence: the block you copy can contain fewer examples than the set you typed.
Say you drafted four pairs and left the output of the third blank because you had not decided the right answer yet. The formatter drops that pair without complaint, and your prompt now teaches from three examples. Nothing looks broken; the block is clean and consistent. It is simply not the set you intended. The fix is a habit, not a feature: after formatting, count the pairs in the output and compare with the pairs you entered. If one is missing, it was incomplete.
Limitations and alternatives
The formatter guarantees consistency, not quality. It cannot judge whether your examples are good ones: whether the outputs are correct, whether the pairs cover the range of inputs you will actually send, or whether two examples quietly contradict each other. Two to five good examples usually beat ten sloppy ones, and choosing the good ones is your job.
The labels are literal text. The block works by being pasted into a prompt as plain text, so if your chat tool has its own few-shot or examples feature, use that instead of pasting a block; a built-in feature carries the examples in a structured way that plain text cannot.
Finally, formatting cannot rescue a task the examples do not demonstrate. If your real inputs include a case none of your pairs resembles, the model will improvise. Add a pair that covers it rather than adding more pairs of the cases already covered.
Common mistakes
- Mixing label styles. "Input:" in one pair and "Q:" in the next muddies the pattern. Pick one style and hold it.
- Leaving a pair incomplete. A blank output means the pair is skipped, and your set silently shrinks. Check the finished block.
- Varying the output shape by accident. One-word answers next to paragraph answers teach both. If the task has one right shape, show only that shape.
- Padding the set. Ten rushed pairs are worse than three careful ones. Consistency and correctness beat count.
- Skipping the final read. The block takes ten seconds to scan. That scan catches the dropped pair and the stray label before the model does.
FAQs
What makes a few-shot pattern obvious to a model? Repetition without variation. When every pair uses the same labels, the same spacing and the same shape, the model can infer exactly what to produce for the next input.
Which label style should I choose? Any of the three the formatter offers: Input/Output, Q/A or User/Assistant. Pick the one that matches your prompt and use it for every pair; consistency matters more than the choice itself.
What happens to a pair with only an input? It is skipped. Pairs missing either the input or the output do not appear in the finished block, so the example set you get can be smaller than the set you typed.
What is the trailing empty prompt for? It leaves a labeled slot where you (or your app) put the real input, with the answer label ready so the model continues in the same format.
Do the labels have to match my chat tool? The labels are literal text in a block you paste. If your chat tool has its own few-shot or examples feature, use that instead of pasting a block.
Conclusion
An obvious pattern is a boring block: one instruction line, a few complete pairs, identical labels, identical shape, and an empty slot waiting for the real input. The Few-Shot Example Formatter builds that block for you and quietly removes the pairs that would have broken it, as long as you remember to check what survived. Once the format is settled, the remaining question is quantity, covered in the companion guide: How Many Examples Does Few-Shot Prompting Need? More guides on building better prompts are in the AI and Prompt Tools guides.