Skip to main content
PromptPalPromptPal
Pricing
Sign inGet started free
  1. Home
  2. /
  3. Blog
  4. /
  5. General

Few-Shot Prompting: What It Is and How to Use It

Few-shot prompting means showing the model a few examples of the output you want. Here's how it works, with copy-ready examples and rules for choosing them.

Author: PromptPal TeamNovember 3, 2026Updated November 4, 20267 min read
Few-Shot Prompting How to Use It
On this page
  1. What few-shot prompting is
  2. When few-shot prompting is worth the effort
  3. How to write a few-shot prompt, step by step
  4. Five few-shot prompt examples you can copy
  5. Mistakes that make examples backfire
  6. Keeping few-shot prompts from rotting
  7. Next step

Few-shot prompting means putting a handful of worked examples in your prompt before the real task, so the model copies the pattern instead of guessing what you want. Two to five examples are usually enough. It's the quickest fix when a model keeps getting the format, tone, or labelling wrong no matter how carefully you describe it.

Below: what it is, when it beats other approaches, five prompts you can paste today, and the mistakes that make examples backfire.

What few-shot prompting is

There are three common ways to prompt, and the only difference is how many examples you include.

  • Zero-shot: instructions only, no examples.

  • One-shot: instructions plus one example.

  • Few-shot: instructions plus several examples, typically two to five.

The model doesn't learn anything permanent. It reads your examples as part of the conversation and continues the pattern. Close the chat, and it's gone, which is why saving the prompt matters (more on that later).

Here's the difference on a real task: tagging customer feedback.

Zero-shot:

Prompt template
Classify this customer comment as Bug, Feature request, Billing or Praise:

"I was charged twice this month and nobody has replied to my email."

That will probably work. But swap in a messier comment, like "Love the app, but it crashes when I upload a PDF", and the model might return "Praise", or "Bug and Praise", or a full paragraph. You've told it the categories, not the rules for ambiguous cases or the exact shape of the answer.

Few-shot:

Prompt template
Classify each customer comment into exactly one category: Bug, Feature request, Billing or Praise. If a comment mixes categories, choose the one that needs action from our team. Reply with the category name only.

Comment: "Can you add dark mode? My eyes hurt at night."
Category: Feature request

Comment: "Love the app, but it crashes when I upload a PDF."
Category: Bug

Comment: "I was charged twice this month."
Category: Billing

Comment: "Best tool my team has adopted all year."
Category: Praise

Comment: "[new comment]"
Category:

The second example does the heavy lifting. It shows how to resolve a mixed comment (the bug wins over the praise), and it shows the output format without you having to explain it at length. The model ends on "Category:" and fills in one word.

When few-shot prompting is worth the effort

Examples are best for things that are easy to show and tedious to describe. If you find yourself writing a long paragraph about tone, that paragraph is usually better replaced by two samples.

Use it for:

  • Fixed output formats. JSON fields, a bug report layout, a table-like list, a subject line plus preview text.

  • Classification and tagging. Sentiment, priority, topic, intent. Examples set the boundaries between labels.

  • Voice and style matching. Your own emails, your brand's product descriptions, your newsletter intros.

  • Extraction. Pulling names, dates, and amounts out of messy text in a consistent shape.

  • Rewrites with a specific transformation. Turning rambling notes into crisp action items, for instance.

Skip it for:

  • Open-ended thinking. Brainstorming, strategy, and exploration get narrower when you show examples. The model will cluster around what you gave it.

  • Simple, common tasks. "Summarise this in three bullets" doesn't need samples. Modern models handle it fine.

  • Tasks where you don't have good examples yet. Bad examples are worse than none.

How much it helps also depends on the model. Newer, more capable models need fewer examples than older ones, and some tasks work with plain instructions. Test your zero-shot version first. If the output is already right, stop there.

How to write a few-shot prompt, step by step

  1. Write the instruction first. State the task, the allowed outputs and any tie-break rules. Examples support the instruction; they don't replace it.

  2. Collect real examples. Pull them from your actual work: past emails, real tickets, a report you were happy with. Invented examples tend to be too tidy.

  3. Cover the edge cases. If one category is confusing, include a case that sits near its border. One clear example per label plus one tricky one is a good starting set.

  4. Format every example identically. Same labels, same spacing, same order. The model picks up on inconsistency and reproduces it.

  5. End on the open slot. Finish with the new input and the label the model should complete ("Category:", "Output:"). This signals where its answer starts.

  6. Test on inputs you haven't used as examples. Run five or six new cases. If one fails, add an example that resembles the failure, don't just add more instructions.

Five few-shot prompt examples you can copy

Each is complete. Replace the bracketed parts and paste.

1. Matching your writing voice

Prompt template
You write cold emails for me. Match the tone, length and structure of the samples below: short, direct, no flattery, one specific observation about the recipient's company, one clear ask.

Sample 1
Context: Prospect runs a 12-person design agency, uses Notion for project tracking.
Email: Hi Dana, I noticed your agency publishes every project as a Notion case study. Most agencies we talk to lose hours turning those into proposals. We built a tool that does it automatically. Worth a 15-minute look this week?

Sample 2
Context: Prospect is head of ops at a logistics startup, just raised a seed round.
Email: Hi Marcus, congrats on the seed round. Teams at your stage usually hit a wall with manual dispatch around the 20-driver mark. We help with exactly that. Open to a quick call on Thursday?

Now write one for:
Context: [prospect role, company, and one specific detail]
Email:

2. Extracting structured data

Prompt template
Extract the details from each message into JSON with the keys "name", "date", "amount" and "currency". Use null for anything missing. Return only the JSON.

Message: "Hi, this is Priya Shah. I paid 240 dollars on March 3rd for the annual plan."
JSON: {"name": "Priya Shah", "date": "March 3", "amount": 240, "currency": "USD"}

Message: "Tom here, sent you the money yesterday, check your account."
JSON: {"name": "Tom", "date": "yesterday", "amount": null, "currency": null}

Message: "[paste message]"
JSON:

Notice the second example. It teaches the model to return null instead of inventing an amount, which is the failure you most want to prevent in extraction.

3. Turning meeting notes into action items

Prompt template
Convert raw meeting notes into action items. Each item must have an owner, a task starting with a verb, and a deadline. If no deadline was mentioned, write "No date set".

Notes: "Sam said he'd look at the pricing page copy, probably before the launch. Lena needs to send the contract to legal by Friday."
Action items:
- Sam: Review pricing page copy. Deadline: Before launch.
- Lena: Send contract to legal. Deadline: Friday.

Notes: "[paste notes]"
Action items:

4. Writing consistent bug reports

Prompt template
Turn each informal bug description into a report with these headings: Summary, Steps to reproduce, Expected, Actual. Keep each section to one or two lines. Do not guess at causes.

Description: "Export button does nothing on Safari after I filter the table."
Report:
Summary: Export button unresponsive in Safari after filtering.
Steps to reproduce: 1. Open the table in Safari. 2. Apply any filter. 3. Click Export.
Expected: A CSV file downloads.
Actual: Nothing happens; no error shown.

Description: "[paste description]"
Report:

5. Labelling tone in reviews

Prompt template
Label the tone of each product review as Positive, Negative, Mixed or Neutral. Reply with the label only.

Review: "Arrived on time and works exactly as described."
Label: Positive

Review: "Great screen, terrible battery."
Label: Mixed

Review: "It's a phone charger."
Label: Neutral

Review: "Stopped working after a week and support ignored me."
Label: Negative

Review: "[paste review]"
Label:

Mistakes that make examples backfire

All your examples look the same. If every sample email opens with "Hi [name], I noticed...", every output will. Vary the openings, lengths, and subjects so the model copies the quality, not the surface.

Label imbalance. Four "Positive" examples and one "Negative" nudge the model toward Positive. Keep labels roughly even, or at least don't let one dominate.

Order effects. Models can lean on the last example more than the others. If results skew, shuffle the order and re-test.

Examples that contradict the instruction. If the instruction says "one sentence" and a sample runs to three, the sample usually wins.

Too many examples. Past five or six, you're mostly adding cost and clutter. If you need dozens to get consistency, the task may need clearer rules, a different model, or fine-tuning instead.

Sensitive data in samples. Real customer messages are great examples, but strip names, emails, and account details first, especially if the prompt will be shared.

Keeping few-shot prompts from rotting

A good few-shot prompt takes real effort to build. You pick examples, test edge cases, tweak the wording. Then it lives in a chat window and disappears, or ends up pasted in three slightly different versions across a team.

Save it somewhere you can find it. In PromptPal, you can store the full prompt, examples included, in your prompt library and keep a history of changes with prompt version control. That matters here because few-shot prompts get edited constantly: you add an example after a failure, swap one out, and later can't remember which version actually worked. Versions let you roll back.

If you want to see how others structure theirs before writing your own, the public prompt library has role- and task-based templates, many of which use examples.

One more habit: when the output drifts after you change models, check the examples first. A set tuned for one model may need a different mix on another, and it's worth noting which model each version was tested on. Our guide on getting consistent results across Claude, ChatGPT, and Gemini covers that side in more detail.

Next step

Pick one task you repeat every week, write a two-example version using the templates above, and save it. Start with the PromptPal prompt library so the next version builds on this one instead of starting over.

Tags:few-shot promptingprompt engineeringprompt examplesprompt templateschatgpt

Read this article as Markdown

Stay Updated

Get the latest blog posts and AI prompt engineering tips delivered to your inbox.

No spam, unsubscribe at any time. We respect your privacy.

On this page

  1. What few-shot prompting is
  2. When few-shot prompting is worth the effort
  3. How to write a few-shot prompt, step by step
  4. Five few-shot prompt examples you can copy
  5. Mistakes that make examples backfire
  6. Keeping few-shot prompts from rotting
  7. Next step

Turn ideas into prompts that work

Describe what you need and PromptPal writes a reusable prompt in your style for ChatGPT, Claude and Gemini.

Try PromptPal free

Related Posts

Continue reading

General · November 4, 2026

Resume Prompts for Claude: 7 Templates That Don't Invent

Copy-ready resume prompts for Claude: a system prompt, tailoring, bullet rewrites, keyword checks, cover letter and interview prep, all built to stop made-up claims.

General · November 4, 2026

Prompts for Claude: 7 Templates You Can Paste Today

Seven copy-ready prompts for Claude, plus notes on system prompts, Claude Code and resumes, and how to fix a prompt that keeps giving you bad output.

General · November 3, 2026

Prompt Writing Generator: A Template You Can Reuse Today

A prompt writing generator turns a rough request into a structured prompt. Here is a copy-ready generator prompt, a worked example, and how to save what works.

Ready to get started?

Join thousands of developers and teams using PromptPal to build better AI prompts.

Start Free TrialContact Sales

Footer

Get better at AI, one email a week

One great prompt, one quick tip, and what’s new in ChatGPT, Claude and Midjourney. Five minutes, every Thursday.

No spam. Unsubscribe in one click.

PromptPalPromptPal

Great prompts for any AI, in seconds. Free to start, no account needed.

Create a prompt
Browser extensionConnect to Claude, ChatGPT, Cursor

Product

  • Prompt builder
  • Browser extensionNew
  • Connect to your AI
  • Pricing

Prompt generators

  • ChatGPT
  • Claude
  • Gemini
  • Midjourney
  • Perplexity
  • See all

Use cases

  • Students
  • Writers
  • Solo builders
  • Everyday users
  • Developers
  • AI teams

Resources

  • Guides
  • Blog
  • Prompt Store
  • Docs
  • Help center

Company

  • About
  • Contact
  • Enterprise
  • Press

© 2026 Securestack Technologies Inc.

PrivacyTermsRefund policyChangelog

PromptPal