Few-Shot Prompting Examples: 12 Templates That Work in 2026
Most people get mediocre AI answers because they describe what they want instead of showing it. Few-shot prompting fixes that: instead of telling the model to "write in a punchy style," you paste two or three examples of exactly what good looks like, and the model matches them. It is one of the most reliable techniques in prompt engineering, and it works in ChatGPT, Claude, Gemini, Grok, and Perplexity. This guide explains few-shot prompting in plain English, then hands you 12 copy-paste templates you can use today, plus the 4-step method for writing your own. No jargon, no theory — just examples that work.
Contents
- What is few-shot prompting? (in plain English)
- Why examples beat instructions
- 12 few-shot prompting examples you can copy
- How to write a few-shot prompt in 4 steps
- Common few-shot prompting mistakes
- Few-shot prompting in ChatGPT, Claude, Gemini & more
- FAQ: few-shot prompting questions answered
What Is Few-Shot Prompting? (In Plain English)
Few-shot prompting means giving the AI a small set of example inputs and outputs inside your prompt, so it learns the pattern you want before it answers your real request. The "shots" are the examples: a zero-shot prompt has none, a one-shot prompt has one, and a few-shot prompt has two to five. Modern models use in-context learning to pick up the style, structure, tone, and format from those examples without any retraining — which is why a handful of good examples usually beats a paragraph of description.
Zero-Shot vs Few-Shot Prompting
| Technique | Examples included | Best for |
|---|---|---|
| Zero-shot | 0 | Simple requests, first drafts, open-ended questions |
| One-shot | 1 | Style matching, single format, tone copying |
| Few-shot | 2-5 | Consistent tone, structured output, complex formats |
Why Examples Beat Instructions
Instructions tell the model what you want; examples show it. The difference matters because language models predict patterns. When you write "make it sound friendly," the model guesses what friendly means to you. When you paste two friendly captions you love, the model has concrete data to imitate. The Prompt Engineering Guide calls few-shot prompting a core technique for steering models toward better performance on complex tasks, and it is a standard recommendation across provider documentation. The practical rule: for anything subjective — tone, voice, structure, output shape — examples outperform adjectives.
12 Few-Shot Prompting Examples You Can Copy
Every template below follows the same shape: a short task line, labeled examples (EXAMPLE INPUT / EXAMPLE OUTPUT), then your real request. Paste the whole block into ChatGPT, Claude, Gemini, Grok, or Perplexity and replace the bracketed text with your own content.
1. Professional email tone
Task: rewrite my message in a professional email tone. EXAMPLE INPUT "hey, can we push the launch? thanks" EXAMPLE OUTPUT "Hi Sarah, I wanted to check in about the launch timeline. Would it work to move the date to next week? Happy to adjust if needed. Thanks!" Now rewrite this in the same tone: [paste your message]
Two examples of the tone you want beat any description of "professional." The model copies the greeting, the softening phrase, and the closing signature — then applies them to your real message.
2. Blog post outline
Task: create a blog outline in the same style as the example. EXAMPLE INPUT "blog about saving money" EXAMPLE OUTPUT "Title: 7 Painless Ways to Save Money Every Month 1. Why tiny habits beat big budgets 2. The 24-hour rule for impulse purchases 3. Automating savings without thinking about it 4. Free tools that track spending 5. A realistic weekly review ritual 6. What to do with your first $100 saved 7. Common mistakes that undo progress" Now create an outline for: [your blog topic]
The model sees that good outlines are specific, numbered, and benefit-driven. One example of the structure you want — plus a constraint like "7 items" — produces an outline that matches your site's style instead of generic filler.
3. Social media caption variants
Task: write 3 caption options in a witty, benefit-focused tone. EXAMPLE INPUT "post about our new app" EXAMPLE OUTPUT "Your morning AI assistant just got an upgrade. Now it works in 5 chats, not 1." Now write 3 captions for: [your product or update]
Short, one-line captions are a pattern the model can replicate quickly. The example sets the length, the voice, and the habit of leading with the user benefit.
4. Code function style
Task: write Python functions in the same style as the example.
EXAMPLE INPUT
"add two numbers"
EXAMPLE OUTPUT
"def add(a, b):
\"\"\"Return the sum of a and b.\"\"\"
return a + b"
Now write a function that: [describe your function, e.g. validates an email address]
Developers use few-shot prompting to lock in naming conventions, docstring style, and error handling. One clean example tells the model more about your code standards than three paragraphs of instructions.
5. Data extraction to a table
Task: extract products into the same table format as the example. EXAMPLE INPUT "Acme sells the Widget Pro for $49 and the Widget Lite for $19." EXAMPLE OUTPUT "| Product | Price | | Widget Pro | $49 | | Widget Lite | $19 |" Now extract from this text: [paste your text]
Structured output is where few-shot prompting shines. A single input-output pair teaches the model the exact table shape, headers, and formatting so you get parseable data instead of prose.
6. Image generation prompt (Midjourney style)
Task: write an image prompt in the same detailed style as the example. EXAMPLE INPUT "mountain scene" EXAMPLE OUTPUT "Snow-capped mountain at golden hour, dramatic clouds, alpine lake reflection, ultra-detailed, cinematic lighting, 8k, photorealistic" Now write a prompt for: [your image idea, e.g. a cozy cabin in snow]
Image models respond to specific style tags, lighting, and quality modifiers. The example demonstrates the vocabulary — cinematic, ultra-detailed, photorealistic — so your next prompt stops producing bland, generic renders.
7. Short video script hook
Task: write a video hook in the same style as the example. EXAMPLE INPUT "cooking video about 10-minute meals" EXAMPLE OUTPUT "HOOK: You have 10 minutes. You still eat better than most restaurants." Now write a hook for: [your video topic]
Short-form video rewards a punchy first line. One example of a hook — short, specific, a little bold — is enough to steer the model away from "In this video, we will show you..." openers.
8. Summary in a fixed format
Task: summarize articles as 3 bullets plus a one-line verdict. EXAMPLE INPUT [long paragraph about remote work trends] EXAMPLE OUTPUT "- Remote work stabilized at 30% of white-collar days - Hybrid schedules cut attrition in tech firms - Office attendance policies are being rewritten VERDICT: Remote work is here to stay, but hybrid is winning." Now summarize this article: [paste your article]
Format constraints plus an example give you a repeatable summary structure. Use this for newsletters, meeting notes, or research digests where consistency matters more than creativity.
9. Brainstorming with a specific flavor
Task: brainstorm ideas in the same style as the example. EXAMPLE INPUT "ideas for a fitness app" EXAMPLE OUTPUT "1. A streak that dies if you skip a day but revives if you train double 2. Voice coach that counts your reps and calls out form cues 3. Workout battles with strangers at the same level" Now brainstorm ideas for: [your topic]
Show the model one example of ideas that are specific and a little unexpected, and it stops producing obvious suggestions. The example sets the creativity bar for everything that follows.
10. Translation with tone control
Task: translate to German in the same formal tone as the example. EXAMPLE INPUT "Can you send the report by Friday?" EXAMPLE OUTPUT "Können Sie den Bericht bitte bis Freitag senden?" Now translate this: [paste your sentence]
Translations drift toward casual or stiff register without guidance. One example pins the formality level, the politeness marker, and the sentence structure for the rest of the session.
11. Customer support reply
Task: reply to customer messages in the same empathetic tone as the example. EXAMPLE INPUT "Your app deleted my data!" EXAMPLE OUTPUT "I am really sorry this happened. Your account is safe — let me restore everything for you right now." Now reply to: [paste the customer message]
Support replies need consistent empathy without sounding robotic. The example shows the exact balance: apologize, reassure, act. The model copies that rhythm for every new ticket.
12. Explaining concepts with analogies
Task: explain concepts the same way as the example. EXAMPLE INPUT "what is an API?" EXAMPLE OUTPUT "An API is a waiter. You order from the menu (send a request), the waiter takes it to the kitchen (the server), and brings back your dish (the response). You never need to know how the kitchen works." Now explain: [your concept, e.g. blockchain]
Analogies make technical ideas stick. Show the model one strong analogy and it will generate fresh, clear comparisons for any topic instead of falling back to textbook definitions.
How to Write a Few-Shot Prompt in 4 Steps
You do not need to memorize every template. Once you understand the pattern, you can build a few-shot prompt for any task in four steps.
- Define the output you want. Decide the format, length, and audience before you write anything.
- Write 2-3 example pairs. Each pair is one input and the output you would love to receive. Make them consistent with each other.
- Label and constrain. Use EXAMPLE INPUT and EXAMPLE OUTPUT labels, then add constraints like word count, tone, or "do not use bullet points."
- Test and iterate. Compare the output to your examples, adjust the examples, and rerun. Keep the versions that work.
Here is the skeleton you can copy:
Task: [what you want done] EXAMPLE INPUT: [example input 1] EXAMPLE OUTPUT: [example output 1] EXAMPLE INPUT: [example input 2] EXAMPLE OUTPUT: [example output 2] Now do the same for: [your real request] Constraints: [format, length, tone, things to avoid]
Common Few-Shot Prompting Mistakes (and How to Fix Them)
- Too many examples. More than five bloat the context and confuse the model. Two to five is the sweet spot.
- Irrelevant examples. Every example should mirror your real task. A marketing example will not teach the model how to write code.
- Inconsistent examples. If one example is a table and the next is a paragraph, the model does not know which pattern to follow.
- Missing labels. Without EXAMPLE INPUT / EXAMPLE OUTPUT markers, the model may treat your examples as part of the request.
- No output constraints. Examples shape style, but you still need explicit limits on length, tone, and format.
Few-Shot Prompting in ChatGPT, Claude, Gemini, Grok & Perplexity
The best part of few-shot prompting is that it is portable. Every major AI chatbot — ChatGPT, Claude, Gemini, Grok, and Perplexity — runs on a large language model that reads your examples in context, so the same template works everywhere with only minor differences in output length and formatting. That is also why a prompt enhancer is such a natural fit for this technique: instead of hand-writing example pairs every time, a free Chrome extension like Prompt Helper Gemini turns your rough idea into a structured prompt with role, context, constraints, and example scaffolding in one click. When you are signed in, an Improve button appears right next to the send button in all five chats, and the Ctrl+Shift+E (Cmd+Shift+E on Mac) shortcut upgrades your current message instantly. The free tier gives you 5 prompt enhancements and 5 Ask questions per week — enough to feel the difference before you ever consider Pro.
Frequently Asked Questions
What is few-shot prompting in simple terms?
Few-shot prompting means adding two to five examples of the task you want done directly inside your prompt. The model copies the pattern from those examples and applies it to your real request. It works because modern AI models learn from examples in context, without any retraining. Think of it as showing, not telling.
How many examples should I include in a few-shot prompt?
Two to five examples is the sweet spot for most tasks. One example can work for simple style matching, while more than five starts to waste context and confuse the model. Choose examples that are similar to your real request and consistent with each other. Quality matters more than quantity: three excellent examples beat eight mediocre ones.
What is the difference between zero-shot and few-shot prompting?
Zero-shot prompting gives the model a task with no examples, so it relies on its training to guess what you want. Few-shot prompting includes two to five examples that demonstrate the desired output before the real request. Few-shot usually produces more consistent tone, format, and structure, while zero-shot is faster and fine for simple or open-ended tasks.
Does few-shot prompting work on ChatGPT, Claude, and Gemini?
Yes. Few-shot prompting works on all major AI chatbots, including ChatGPT, Claude, Gemini, Grok, and Perplexity, because they are all built on large language models that learn from in-context examples. You can paste the same example-based prompt into any of them and get consistent results, though output length and formatting style vary slightly between providers.
Can you give me an example of a few-shot prompt?
Here is a simple few-shot prompt. Task: write a friendly error message. EXAMPLE INPUT: 'The server is down.' EXAMPLE OUTPUT: 'Heads up — we are fixing it right now.' Now write an error message for: 'Your payment did not go through.' The model copies the reassuring tone from the example and applies it to the new situation.
Is few-shot prompting the same as fine-tuning?
No. Few-shot prompting adds examples to your prompt at request time and requires no training, so it is instant and costs nothing extra. Fine-tuning changes the model's weights through additional training on your data, which is expensive and slow. For most everyday tasks, few-shot prompting is the practical choice because you can change the examples anytime without retraining.
Conclusion: Show the Model What Good Looks Like
Few-shot prompting is the closest thing prompt engineering has to a cheat code. You stop describing quality and start demonstrating it — with two to five examples that the model copies onto your real request. Start with the email template above today, then work through the other eleven as the situations come up. If your output still feels generic, our guide on why AI gives generic answers explains the root causes, and prompt engineering best practices for 2026 covers the full toolkit. When you want the examples, role, and constraints written for you automatically, install Prompt Helper Gemini — free tier included — and let the Improve button handle the scaffolding while you focus on the ideas.