Skip to main content

When Examples Beat Explanations

You’ve learned Task, Context, and Format. You know how to provide the four types of context. But sometimes, even detailed descriptions fall short. Have you ever tried explaining something to someone, only to realize they understood it perfectly the moment you showed them an example? “No, no, the email should sound more like… here, let me just show you one I wrote last week.” That instant click of understanding when someone sees what you mean instead of just hearing it? That’s what you’ll use today, with a technique called “few-shot prompting”: putting examples of what you want into the prompt.

Core Concepts

Zero-Shot vs. Few-Shot: What’s the Difference?

Zero-shot prompting is what you’ve been doing all along. You give the AI a task with no examples:
“Write a product description for a coffee mug.”
The AI takes its best guess at what you want based on your instructions alone. Sometimes that works great. Sometimes… not so much. Few-shot prompting is when you include examples of what you want before asking for the task:
“Here are some product descriptions in my brand’s style: Ceramic Coaster Set: Rest easy knowing your surfaces are protected. These handcrafted coasters bring artisan charm to any room while keeping water rings where they belong: nowhere. Bamboo Cutting Board: Slice, dice, and serve in style. Sustainably sourced bamboo meets thoughtful design in a board that’s as kind to your knives as it is to the planet. Now write a product description for a coffee mug in the same style.”
See the difference? Instead of hoping the AI guesses your brand voice, you’ve demonstrated exactly what “good” looks like. Think of it this way: Zero-shot is like telling a new employee “make it professional.” Few-shot is like handing them three emails you’ve written and saying “make it sound like these.”

The “Shot” Lingo

You might hear people throw around these terms:
  • Zero-shot: No examples, just instructions
  • One-shot: One example provided
  • Few-shot: Two to five examples provided
There’s no perfect number, but 2-3 well-chosen examples are often enough to set a pattern without overwhelming the AI (or yourself).

Why Does This Work?

Remember from earlier lessons that AI predicts “what would likely come next” based on patterns? Examples tell it: “Here’s the pattern I want you to follow.” Instead of drawing on its entire training data to decide what a “professional email” looks like, it has a much clearer target.

How to Write Effective Examples

1. Make Your Examples Representative

Your examples should genuinely reflect what you want. If you’re asking for short, punchy responses but your examples are all long and detailed, you’re sending mixed signals. Poor choice: Providing formal examples when you want casual output Better choice: Providing examples that match the tone, length, and style you actually want

2. Show Variety Within Consistency

If you’re providing multiple examples, show the AI that your pattern works across different scenarios:
Example 1 (positive review response): “Thanks so much for the kind words, Sarah! We’re thrilled the workshop helped. See you at the next one!” Example 2 (addressing a concern): “Thanks for letting us know, Mike. That’s not the experience we want for you. I’m reaching out directly to make this right.” Example 3 (answering a question): “Great question, Jamie! Our next session starts March 15th. Grab your spot at the link in our bio!”
These examples show the AI that your brand voice stays consistent even when the content changes.

3. Use the Same Format You Want Back

If you want the AI to give you bullet points, use bullet points in your examples. If you want headers, use headers. Format teaches format.

4. Include Edge Cases When They Matter

If there’s a tricky scenario you want handled a certain way, include an example of it:
“When someone asks about pricing before we’ve announced it, respond like this: ‘We’re putting the finishing touches on our pricing now! Drop your email at [link] and you’ll be first to know when we launch.’”

When Examples Help (and When They Hurt)

Examples Help Most When:

You need a specific style or voice Brand voice, writing tone, personality—these are hard to describe but easy to demonstrate. The task has a consistent format Things like data transformation, categorization, or structured responses benefit a lot from examples. Your requirements are unusual If what you want differs from the “typical” way something is done, examples help the AI understand your unique needs. You’ve struggled to get it right with instructions alone If you’ve tried describing what you want and keep getting close-but-not-quite results, examples often bridge that final gap.

Examples Might Hurt When:

Your examples are inconsistent Conflicting examples confuse the AI more than no examples at all. You’re dealing with a simple, straightforward task “Translate this sentence to Spanish” doesn’t need examples. Adding them just wastes space in your prompt. You want creative diversity If you want the AI to surprise you with different approaches, too many examples can make it stick too closely to your pattern. Your examples are low quality The AI will mimic what you show it—including your mistakes. Bad examples lead to bad outputs.

Building Your Own Example Library

Here’s a habit that pays off: start collecting good examples.

What to Save:

  • Emails you’ve written that perfectly captured your voice
  • Responses you’ve crafted that you were proud of
  • Formats that worked well for specific tasks
  • AI outputs that were exactly what you wanted (yes, save the good ones!)

How to Organize Them:

Keep a simple document or note with categories like:
  • Professional email tone
  • Casual social media voice
  • Customer support responses
  • Technical explanations made simple
  • Meeting summaries
When you need to prompt for something similar, you’ll have ready-made examples at your fingertips.

The Flywheel Effect

As you use few-shot prompting, you’ll generate more great outputs. Save them as examples for next time. Your example library grows, your prompts get better, and the cycle continues.

Try It Yourself

Exercise 1: Feel the Difference

Try this zero-shot prompt:
“Write a brief bio for a freelance graphic designer.”
Now try this few-shot version:
“Here are two bios in the style I want: Sarah Chen, UX Researcher: I help teams stop guessing what users want. Ten years of asking the right questions, now helping startups build products people actually use. Currently obsessed with accessibility in fintech. Marcus Williams, Content Strategist: Words are my medium, clarity is my mission. I’ve helped brands from scrappy startups to Fortune 500s find their voice. When I’m not writing, I’m probably arguing about Oxford commas. Now write a bio for a freelance graphic designer in the same style.”
Compare the results. Notice how the few-shot version captures the casual-but-professional tone, the structure, and even the little personality touches?

Exercise 2: Format Matching

You need to create FAQ responses. First, write out 2-3 example Q&As in exactly the format and tone you want. Then ask the AI to continue the pattern with new questions.

Exercise 3: Voice Cloning

Find an email or piece of writing you’ve created that you really like. Use it as an example, then ask the AI to write something new in the same voice. How close did it get?

Common Pitfalls

The “Kitchen Sink” Mistake

Providing too many examples (7, 8, 10…) doesn’t usually help and can confuse the AI or use up valuable space in your prompt. Stick to a few strong examples; two or three is often enough.

Inconsistent Examples

If your examples conflict with each other in style, format, or approach, the AI has to guess which pattern to follow. Make sure your examples tell a coherent story.

Examples That Don’t Match the Task

Providing examples of customer support emails when you’re asking for marketing copy sends the AI in the wrong direction. Keep examples relevant to what you’re actually asking for.

Forgetting to Include the Actual Request

It sounds obvious, but after setting up all those examples, don’t forget to clearly state what you want the AI to do with them. “Now write one for [X]” or “Following this pattern, create [Y].”

Using Outdated or Poor-Quality Examples

Your examples set the ceiling for quality. If they’re mediocre, expect mediocre results. Take time to choose (or craft) examples that represent your best work.

Level Up

Here’s your challenge: Think about a recurring task where you’ve struggled to get consistent results from AI. Maybe it’s writing in a specific style, formatting data a certain way, or responding to a particular type of message.
  1. Find or create 2-3 examples of exactly what you want
  2. Build a few-shot prompt with those examples
  3. Test it and compare to your previous zero-shot attempts
  4. Save the prompt template for future use
Bonus points: Start your example library today with at least three examples in one category.

Key Takeaway

A few well-chosen examples can communicate more than paragraphs of instructions. Use 2-3 representative examples that match the style, format, and tone you want, and build an example library for tasks you do repeatedly.
Try it on Gloo: send the same request with and without examples in the Chat Playground and compare the results.

What’s next

Another powerful technique for shaping AI behavior is telling it who to be. In an app, examples usually go in the system prompt: Using the Completions API shows a request with one, and Testing, Evaluation and Observability helps you check that they improve results.

Lesson 6: Role Play: Giving AI a Persona

Explore how assigning a role or perspective changes the outputs you get: the right persona shapes the expertise, tone, and focus of the answer.