What Is It?
Giving Examples (also called few-shot prompting) means showing the AI what you want by providing sample inputs and outputs. Instead of describing the pattern, you demonstrate it.
Think of it like training a new colleague. You could explain the process in detail… or you could say “Here are 3 examples of how I categorised similar tickets. Now do the same with these.” Most people learn faster from examples.
๐ก When words fail, examples succeed. If you’ve tried describing what you want and the AI keeps getting it wrong, give it 2-3 examples of the correct output. This often solves the problem instantly.
When to Use It
- โ When you need a specific format that’s hard to describe in words
- โ When you want consistent categorisation or classification
- โ When the AI keeps getting the style or tone wrong
- โ When you need the output to match an existing pattern
Before & After
โ Before (No Examples)
Categorize these support tickets
โ After (With Examples)
Categorize each support ticket into one of these categories: Billing, Technical, Access, Feature Request.
Here are examples:
- “I can’t log in to my account” โ Access
- “I was charged twice this month” โ Billing
- “The dashboard keeps crashing on mobile” โ Technical
Now categorize these tickets:
- “Can you add dark mode?”
- “My password reset email never arrived”
- “The export to CSV is generating empty files”
What’s better: The AI now understands exactly how to format the output and what each category means in practice โ not just in theory.
Platform Tips
Microsoft 365 Copilot
- In Excel, examples work great: “Flag column B like this: if amount > $1000 โ ‘High’, if $500-$1000 โ ‘Medium’, else ‘Low’”
- In Word, show a sample paragraph then say “Write 5 more in this style”
- M365 Copilot can reference existing files as examples: “Format it like the Q1 report”
ChatGPT
- Paste examples in code blocks for clean formatting
- ChatGPT carries examples across the conversation โ set the pattern once, then give new inputs
Claude
- Use XML tags:
<examples><example>input โ output</example></examples> - Claude excels at learning complex patterns from just 2-3 examples
Gemini
- Number your examples clearly: “Example 1:”, “Example 2:”
- Gemini works best when examples are concise and consistent in format
Real Examples from the Prompt Library
- Customer Service โ Shows example tone for consistent responses
- Writing โ Uses style examples to match voice
- Data Analysis โ Example categorisations for consistent labels
Related Techniques
- ๐ฏ Give Clear Instructions โ Instructions set the task; examples show the pattern
- ๐ Define the Format โ Examples are the most powerful way to define format
- ๐ง Think Step by Step โ Show reasoning examples for complex tasks
๐งช Try It Yourself
Rewrite this vague prompt using the Give Examples technique:
๐ก Stuck? Show example answer
Categorize each support ticket into: Billing, Technical, Access, or Feature Request. Examples: - "I can't log in" โ Access - "Charged twice" โ Billing - "Dashboard crashes" โ Technical Now categorize: 1. "Can you add dark mode?" 2. "Password reset email never arrived" 3. "CSV export is empty"
๐ง Fix This Prompt
This prompt is broken. Can you spot what's wrong and fix it?