When Examples Help vs. Hurt

Know when to use few-shot prompting and when zero-shot is actually better.

6 min read
2 quiz questions

Few-shot prompting is powerful, but it isn't always the right choice. Sometimes examples can actually hurt your results — by biasing the AI toward your examples instead of the best possible answer, or by using up valuable context window space. Knowing when to use examples and when to skip them is a key skill.

  • Custom formats: When you need output in a specific structure the AI wouldn't default to
  • Brand voice: When the tone needs to match existing content exactly
  • Edge cases: When the task has unusual rules the AI might not infer from instructions alone
  • Classification with custom categories: When your categories are domain-specific
  • Consistent output: When you need every response to follow the exact same pattern

  • Biasing toward example content: If your examples are about dogs, the AI may inject dog-related content into unrelated outputs
  • Limiting creativity: Examples can make the AI too conservative, copying your examples instead of generating novel output
  • Wasting tokens: Each example uses context window space that could be used for actual content or more detailed instructions
  • Conflicting examples: If your examples are inconsistent, the AI gets confused
  • Standard tasks: For common tasks like "summarize this" or "translate to French," zero-shot works fine
Test both approaches. Try your prompt zero-shot first. If the output format or style isn't right, add examples. If it's good without examples, save the tokens.

One subtle issue with examples is topic leakage. If all your examples are about finance, the AI may unconsciously use financial metaphors or examples even when the actual task is about healthcare. To avoid this, diversify your example topics or add an explicit instruction: "The examples below show the desired format only — don't copy their subject matter."

Biased examples (all about food): "Summarize: [article about pizza] → A new pizza chain..." "Summarize: [article about sushi] → Japanese cuisine..." "Summarize: [article about quantum computing] → ???" The AI might produce: "Quantum computing is to classical computing what a five-star restaurant is to fast food..." — injecting food metaphors unnecessarily.

  1. Start with zero-shot. If the output structure and quality are good, stop there.
  2. If the format is wrong, add 2-3 examples of the correct format.
  3. If the tone is wrong, add examples that demonstrate the right tone.
  4. If the output is good but inconsistent across runs, add examples for consistency.
  5. If you have limited context window space, prioritize instructions over examples.

Prompt Templates

Anti-Bias Example Setup

Adds examples while explicitly preventing topic leakage.

[INSTRUCTION]

Below are examples showing the DESIRED FORMAT ONLY. Do not copy the subject matter or content themes from these examples — only match the structure and style.

Example 1:
Input: [example input]
Output: [example output]

Example 2:
Input: [example input]
Output: [example output]

Now apply this format to:
Input: [YOUR ACTUAL INPUT]
Output:

Zero-Shot vs Few-Shot Tester

Start with zero-shot to test if examples are needed.

I need to [TASK]. First, do it without any examples (zero-shot). Then I'll evaluate whether I need to add examples.

[FULL TASK DESCRIPTION WITH FORMAT AND CONSTRAINTS]

Test Your Knowledge

Knowledge Check

1 / 2

What is "topic leakage" in few-shot prompting?

Key Takeaways

  • Examples aren't always better — they can bias output and waste tokens
  • Use examples for custom formats, brand voice, and edge cases
  • Skip examples for standard tasks where zero-shot instructions work fine
  • Watch for topic leakage: examples can inject their subject matter into unrelated outputs
  • Start zero-shot, add examples only when needed