Quick Answer
Few-shot prompting means showing an AI a few worked examples of input and desired output before your real request, so it copies your tone, format, and structure. Usually two to five clear, consistent examples work best, since quality matters more than quantity. It beats plain instructions whenever you need reliable, repeatable output.
Few-shot prompting is the practice of showing an AI a few worked examples of input and desired output before your real request, so it copies your tone, format, and structure. The name comes from how many examples you provide: zero-shot means none, few-shot means a few, usually two to five. And the difference is real. In a BoolQ comparison by DeepDive Labs, few-shot prompting hit 0.875 accuracy against 0.8577 for zero-shot on the same task. This guide covers how it works, how many examples to use, and copy-ready templates you can adapt today.
Here's a quick note on why this matters. The whole idea of learning a task from a handful of in-context examples was introduced in OpenAI's 2020 paper "Language Models are Few-Shot Learners" (Brown et al.), which showed GPT-3 reaching 71.2 percent accuracy on the TriviaQA benchmark using only prompt examples, competitive with fine-tuned models. Few-shot prompting is that same trick, and you can use it in any chat window.
What is few-shot prompting?
Few-shot prompting is giving an AI model a small set of worked examples before you make your real request. Each example shows an input and the output you would have wanted for it. The model studies that pattern and applies the same approach to the new item you give it.
Zero-shot means no examples at all, just instructions: you tell the AI what to do and hope it understands. Few-shot means a few examples, usually two to five. The difference in output quality is often dramatic, especially for tasks where tone, format, or structure matter. For a closer look at how zero-shot compares to few-shot across different task types, see our zero-shot vs few-shot prompting guide.
Here is the simplest way to picture it. Imagine training a new teammate. You could write a long document describing exactly how you want support tickets categorised, or you could just show them five tickets you already labelled and say "do the rest like these." The second approach is faster and clearer, and people get it right more often. Few-shot prompting works the same way with AI.
If you are new to writing prompts in general, start with our prompt engineering basics guide, then come back here. Few-shot is one of the highest-leverage techniques once you have the fundamentals down.
How does it work, and why does showing beat telling?
An AI language model does not reason about your request the way a person does. It predicts what should come next based on patterns. When you give it examples, you are handing it the exact pattern to continue. The model matches your tone, your sentence length, your formatting, and your structure, because those are the patterns it sees right in front of it.
This is why showing beats telling. Suppose you want product captions that are "playful but not childish, short, and never use exclamation marks." You can write that sentence, but it leaves a lot open to interpretation. Two examples that embody the voice remove the guesswork entirely. The model does not have to guess what "playful but not childish" means to you. It can see it.
Examples also carry information that is genuinely hard to put into words. The rhythm of a good subject line, the way you trim filler words, the order you list fields in. You feel these things more easily than you can describe them. Few-shot prompting lets you communicate them without trying to write a style manual.
How many examples should you use?
For most tasks, two to five examples are plenty. The goal is to show the pattern clearly, not to flood the model with data. Quality and consistency matter far more than quantity.
Three things make examples effective:
- Consistency. Every example should follow the same format. If one caption ends with a hashtag and another does not, the model cannot tell whether hashtags are part of the pattern.
- Coverage. Pick examples that show the range you care about. If some inputs are tricky, include a tricky one so the model learns how to handle it.
- Clarity. Label the input and the output so the boundary between them is obvious. The model should never have to guess where one ends and the next begins.
How far can a few examples take you? Further than you'd think. A 2025 fact-checking evaluation from CEA-LIST at the CheckThat! shared task found that ten well-chosen examples let a model nearly match a fine-tuned classifier, scoring an F1 of 95 percent versus the fine-tuned model's 96.2 percent (arXiv, 2025). So if two examples already produce good output, stop there. Adding more only helps when the task has edge cases the model keeps missing. When you find yourself needing dozens of examples in every prompt, that is the signal to consider fine-tuning instead, which we cover in the FAQ.
How do you write a few-shot prompt for brand voice?
This is the classic use case. You want new copy that sounds like your existing copy. Show the model what your voice looks like, then ask for more.
Here are 2 examples of our brand's Instagram captions:
Input: New oat milk latte, launching this week
Output: Cold mornings just got a soft, creamy upgrade. Meet your new 8am ritual.
Input: Weekend opening hours extended
Output: More time for slow coffee. We are open later all weekend.
Now write one caption in the same voice for this:
Input: New seasonal mango cold brew on the menu
Notice what the examples do. They set the length, the warm tone, and the rule of no exclamation marks, all without a single line of description. The model matches the pattern because it can see it.
How do you use few-shot prompting for classification?
Classification tasks, like labelling support tickets or scoring sentiment, are where few-shot prompting really shines. You show a few labelled pairs, then hand over a new item to label.
Classify each support ticket into one of these categories:
Billing, Bug, Feature Request, or Account Access.
Ticket: I was charged twice for my subscription this month.
Category: Billing
Ticket: The export button does nothing when I click it.
Category: Bug
Ticket: Can you add a dark mode to the dashboard?
Category: Feature Request
Ticket: I forgot my password and the reset email never arrives.
Category: Account Access
Now classify this ticket:
Ticket: My invoice shows a plan I never signed up for.
Category:
The examples teach the model exactly which category each kind of issue belongs to, including the difference between a billing problem and an account problem. Leaving the final "Category:" line open nudges the model to fill in just the label, which keeps the output clean and easy to parse. The same structure works for sentiment, priority levels, intent detection, or any task where you sort items into a fixed set of buckets.
How do you use few-shot prompting for data tasks?
Few-shot prompting is excellent for pulling messy text into a consistent format, or for normalising entries that arrive in many different shapes. Show the model the format you want, and it will follow it precisely.
Extract the contact details from each line into this format:
Name | Email | Company
Line: Hi, I'm Sarah Tan from Lumen Studios, reach me at sarah@lumen.co
Output: Sarah Tan | sarah@lumen.co | Lumen Studios
Line: David Lim (Acme Pte Ltd) david.lim@acme.sg
Output: David Lim | david.lim@acme.sg | Acme Pte Ltd
Now extract from this line:
Line: You can contact Mei Ling at meiling@brightpath.io, she works at BrightPath
The two examples handle different phrasings, a casual sentence and a more compact one, so the model learns to extract the same three fields regardless of how the input is written. This is far more reliable than describing the format in prose, because the model can see exactly where each field goes and which separator to use. The same approach cleans up inconsistent dates, standardises phone numbers, or reshapes a list into a table. Whenever you need many items in one tidy format, a couple of worked examples lock it in.
What are the most common few-shot mistakes?
- Inconsistent examples. Use the same format, the same separators, and the same labels across every example. Inconsistency is the single most common reason few-shot prompts produce messy output.
- Skipping the edge cases. If some inputs are unusual or tricky, include one in your examples so the model learns how you want them handled rather than guessing.
- Contradicting yourself. If one example breaks a rule that another follows, the model gets a mixed signal. Read your examples back as a set and make sure they agree.
- Fuzzy boundaries. Mark the input and the output, and leave the final output line open for the new item. Clear boundaries help the model know exactly what to produce.
- Reaching for fine-tuning too early. Few-shot prompting is the right tool for occasional and varied tasks. Only switch to fine-tuning when you run the same task at high volume and have a large labelled dataset.
Get these right and few-shot prompting is one of the simplest changes you can make for an outsized jump in quality. Instead of describing what you want, show two to five clear examples, keep them consistent, and let the model match the pattern. Many of the prompts in the PromptCraft Asia library already include example slots you can fill with your own samples, and for a technique that pairs naturally with this one, see our guide to prompt chaining.
What do people ask about few-shot prompting?
What is few-shot prompting?
Few-shot prompting is the practice of giving an AI model a few worked examples of input and the desired output before making your real request. The model studies the pattern in your examples and applies the same tone, format, and structure to the new item. It contrasts with zero-shot prompting, where you give instructions with no examples at all.
How many examples should you use in a few-shot prompt?
Usually 2 to 5 examples are enough. Quality and consistency matter far more than quantity. A handful of clear, consistent examples that share the same format teaches the pattern better than a dozen messy ones. Add more examples only when the task has edge cases the model keeps getting wrong.
Is few-shot better than zero-shot prompting?
For tasks where tone, format, or structure matter, few-shot usually wins. In a BoolQ test by DeepDive Labs, few-shot reached 0.875 accuracy versus 0.8577 for zero-shot, and other evaluations show few-shot beating zero-shot by around 10 percent on accuracy. Zero-shot is still fine for simple, well-known tasks where no pattern needs teaching.
When should you use fine-tuning instead of few-shot prompting?
Few-shot prompting works well for most everyday tasks because it needs no training and no data pipeline. Switch to fine-tuning only when you have a large, labelled dataset and need the same behaviour at scale, with lower per-request cost and no examples taking up space in every prompt. For occasional use, few-shot is faster and cheaper to set up.
Does few-shot prompting work on ChatGPT and Claude?
Yes. Few-shot prompting is model-agnostic and works on ChatGPT, Claude, Gemini, and every other major chat model. The idea traces back to OpenAI's GPT-3 paper, which showed large models learn tasks from a handful of in-context examples. Just paste your examples into the chat before your real request, using the same format across all of them.
Sources: Brown et al., "Language Models are Few-Shot Learners" (arXiv, 2020); DeepDive Labs zero-shot vs few-shot BoolQ comparison; CEA-LIST at CheckThat! 2025 fact-checking evaluation (arXiv). All linked above.