Few-Shot Prompting
Few-shot prompting means including a small number of worked examples in the prompt itself — an input alongside the output wanted for it — before asking the model to handle the real case the same way. Instead of just describing the task in words, the model gets to see the pattern demonstrated first.
Asking a model to classify support tickets by describing the categories in words is zero-shot — no examples, just an instruction. Showing it three real tickets, each already labeled with the right category, before handing it a new one to classify, is few-shot. The categories are the same either way; what changed is whether the model saw them demonstrated or only described.
Why demonstrating sometimes works better than describing
Some patterns are genuinely easier to show than to explain precisely in words — an exact output format, a tone, a boundary case that's hard to state as a clean rule but obvious once you see an example of it. A worked example carries that information directly, without needing the instruction to spell out every edge case in advance.
Zero-shot, one-shot, few-shot
Zero-shot: no examples at all — just a plain description of the task, relying entirely on what the model already learned during training.
One-shot: exactly one worked example, enough to show the pattern once.
Few-shot: a small number of worked examples, usually because one example didn't pin the pattern down reliably enough on its own.
It isn't free, and bad examples actively hurt
Every example included costs part of the context window budget, so more examples means less room for everything else in the request. And the model treats the examples as the pattern to follow — an inconsistent, wrong, or oddly-formatted example doesn't just fail to help, it can actively teach the wrong pattern. There's no universal right number of examples to include; it depends on how hard the task is, how capable the model already is at it, and whether one more example is actually still changing the output for the better.
Not the same as fine-tuning
A few-shot example lives inside one prompt and only affects that one request — swap the prompt and the examples are gone. Fine-tuning trains the pattern into the model's own weights — the numbers inside it that determine how it responds — so it applies automatically to every future request without needing to be shown again. Few-shot is cheap and instant to change; fine-tuning is heavier, but the pattern doesn't need repeating on every single call once it's trained in.
When it's not the strongest tool
If the actual goal is guaranteeing a response matches an exact shape, real structured output enforcement is a stronger guarantee than showing examples of the format — a schema mechanically blocks anything that doesn't match, where an example is still just a demonstration the model could depart from.
In this guide
FAQ
Is a few-shot example the same thing as training the model on that example?
No. A few-shot example is part of the prompt for one request — nothing about the model changes, and the example has no effect on any future request that doesn't include it again. Training on an example, via fine-tuning, changes the model's underlying behavior going forward, with no need to keep resupplying it.
If two examples work, will four examples work even better?
Not necessarily. More examples cost more context and don't automatically improve results past the point where the pattern is already clear — and a weak or inconsistent fourth example can hurt more than a strong third one helps. Test with real cases rather than assuming more is always better.