Few-shot prompting is the name for something you can do in a chat box in about ninety seconds: instead of describing the answer you want, you paste in a few complete input-and-output pairs from your own task and let the model continue the pattern. No examples is zero-shot, one example is one-shot, and two to five is few-shot, also called multishot.
Nothing is being trained in the sense that a model changes. The examples live in the prompt, and when the conversation is gone they are gone with it. That is what separates few-shot prompting from fine-tuning, where a model is retrained on hundreds or thousands of examples and its weights change. Few-shot prompting is the cheap version, available to anyone who can type.
What examples buy you is narrower than "better answers," and it is easiest to see by running one small task end to end.
Take sorting inbound email for a five-person design studio. (The studio is invented. The failures are the ones this kind of prompt reliably produces.) Every message gets one bucket, either QUOTE, CLIENT, VENDOR or NOISE, plus one line saying what to do next. Here is one week of messages, with the bucket each one belongs in:
- "We're opening a second shop in autumn and need signage, menus and packaging. What would that cost?" —
QUOTE - "The logo files in our shared folder still show the old colours." —
CLIENT - "We worked with you on the brewery brand last spring. What would packaging design for the new range cost?" —
QUOTE - "Invoice 4471 for the print run is attached, due on the 30th." —
VENDOR - "Press release: another studio in town wins a regional design award." —
NOISE - "We're an agency and think we could bring you three or four clients a year. Can we talk?" —
NOISE - "Could you resend last month's invoice? I can't find it anywhere." —
CLIENT - "I'm out of the office until the 14th and will reply then." —
NOISE
The instruction-only version of the prompt is the obvious one: sort each message into exactly one of QUOTE, CLIENT, VENDOR or NOISE, then write one sentence on what to do next. Run all eight messages through it and you get five right. Message 3 comes back CLIENT, because the model noticed you had worked together before. Message 6 comes back QUOTE, because it contains the word "clients." Message 7 comes back VENDOR, because it contains the word "invoice." The shape wanders too: one answer arrives as a table, two open with a friendly "Sure, here's my read."
Those three misses are not random. Each is a message where two categories both look defensible, and the detail that settles it appears nowhere in the prompt. That tells you which fix applies:
Fix the shape with words first, because words are free and general. The rewritten instruction says the answer is one line, BUCKET | next step, with no greeting and no table. It also states the rule the buckets are built on. VENDOR is only for people who bill us. NOISE is only for messages that ask nothing of us. Between CLIENT and QUOTE, what decides is whether the work is new, needing a price, or already ours. The shape settles immediately, and messages 6 and 7 now come out right, because the rule names exactly the trap each one sets. Message 3 still comes back CLIENT in both runs. "We worked with you last spring" is a louder signal than a rule buried in a paragraph, and no amount of rewording that paragraph beat it.
This is the situation examples are for: a boundary you can state but can't make the model feel. Three examples, each aimed at a different boundary, and not one of them a repeat of an easy case:
1<instructions>
2Sort each message into exactly one of QUOTE, CLIENT, VENDOR, NOISE.
3VENDOR is only for people who bill us. NOISE is only for messages that ask
4nothing of us. Between CLIENT and QUOTE, what decides is whether the work
5is new (needs a price) or already ours.
6Answer in one line: BUCKET | next step. No greeting, no table.
7The "Why" lines in the examples are for you; never include them in the answer.
8</instructions>
9
10<examples>
11<example>
12Message: Hi — you designed our café's signage in 2024. We're opening a second
13site; what would signage and menus for it cost?
14Why: new work that needs a price, even though we already know the sender.
15Answer: QUOTE | Estimate and reply with a range.
16</example>
17<example>
18Message: Please send the March invoice again — our accounts team can't find it.
19Why: someone we bill asking about their own invoice. VENDOR is people who bill us.
20Answer: CLIENT | Forward the invoice.
21</example>
22<example>
23Message: We're a studio in Leeds and would love to explore a partnership where
24we introduce you to our clients.
25Why: mentions clients but asks nothing of our work yet.
26Answer: NOISE | None.
27</example>
28</examples>
29
30Message: {{message}}All eight messages now come out right, twice, and the shape holds. What the examples added was the placement of the rule, at the point where it collides with a stronger surface cue. Each example is a worked case where the obvious answer loses, plus one line saying why. They are also rewrites of the failed messages rather than the messages themselves, because pasting in the exact case you are testing measures whether the model can copy, not whether it can judge.
Then the part most few-shot explanations leave out. On the next week's mail, a new message, "Do you have capacity for a small brochure in May, and roughly what would it cost?", came back QUOTE | Estimate and reply with a range for signage and menus. The label is right and the next step carries nouns from the café example. Everything in an example is part of the pattern, including the details you thought were incidental.
That failure comes in several ordinary shapes. If every example is short, your answers get short. If every example ends in the same bucket, that bucket starts winning borderline cases. If an example contradicts the instruction, expect the example to win. If your examples contain a real customer's name and order number, that data now travels in every request and every saved log, so redact it. The instability is also measurable. With the same four examples, the order they appear in has been enough to move some classification tasks from near-state-of-the-art to near-random, and a good order for one model does not carry over to the next 4. Part of the reason is bias inside the model, towards labels that appear more often in the prompt and towards labels near the end of it. In one measurement, adding a single example made accuracy drop, because the model kept repeating that example's label 5. Balance your buckets, avoid ending on a run of the same one, and re-test the set whenever you switch models.
How many, then? There is no number that is right in general, only a number you arrived at by testing. Anthropic's current guidance is three to five well-chosen examples 1. Google's warns the other way, that too many examples can make the model overfit to them 2. Both describe the same curve. The first two or three buy most of the gain, and each extra one costs tokens on every single call, adds latency, and competes for space with the message you actually want sorted. Start with two or three aimed at your worst failures, then add another only for a specific kind of input that is still coming back wrong.
When to stop adding them at all is a question people ask less often than they should, and the answer is sooner than they expect. If a rule can be stated in a sentence, the sentence is the better tool: it is shorter, and it generalizes to inputs no example covers. If the failure is missing information rather than unclear judgment, for instance the model got a priority wrong because it cannot see the client's contract value, no example supplies that; the material does. If the task needs several steps of reasoning and your examples show only the final answers, the pattern being copied is the answer rather than the reasoning, and few-shot prompting tends to stall on exactly those tasks 6. If you are using a reasoning model that thinks before answering, OpenAI's guidance is to try zero-shot first and add examples only when you have a specific output requirement to pin down, since otherwise they may add tokens without adding accuracy 3. And if covering the boundaries would take fifteen examples, the prompt is now longer than the work it describes, which is a sign the task should be split.
The test you run on your own prompt is short. Does the shape of the output stay put across two runs? Do the cases that used to be debatable now come out the way you would judge them? Do new inputs come back in their own words, rather than borrowing nouns and numbers from an example? When the third check starts failing, the examples are teaching something you did not put in them, and the fix is usually a smaller, tighter set rather than a bigger one.
Instructions say what you want. Examples show where the line falls when the words run out.