Instructions vs. Examples
Here's a question: which is clearer?
"Categorize these emails into priority levels based on urgency and department."
"Categorize these emails. Examples:
'Refund request' → 'Urgent - Finance'
'Newsletter signup' → 'Low Priority - Marketing'
'Server down' → 'Critical - Engineering'
Now categorize: 'Password reset request'"
The second one is clearer because you're not asking the model to guess what "urgent" means to you. You're showing it the pattern. This is called few-shot prompting—giving a few examples before asking for the real output.
Try It: Add Examples and Watch Output Change
Drag the slider to add examples. Watch how the prediction improves.
Why Examples Work Better
Remember: the model predicts the next token based on patterns. When you give examples, you're showing it the exact pattern you want. It's not interpreting your instructions—it's completing the pattern you started.
Instructions say "drive to the grocery store" (open to interpretation—which route? how fast?). Examples say "I drove down Main St at 25mph, turned left at the light, parked in spot B7" (concrete, unambiguous). The model is much better at pattern-matching than instruction-following.
Types of Examples
Format Examples
Show the exact structure you want
Style Examples
Show the tone, voice, or aesthetic
Classification Examples
Show how to categorize inputs
Transformation Examples
Show input → output mappings
How Many Examples Do You Need?
Just instructions. Works for simple, common tasks the model has seen a million times.
Enough to show the format or style you want. Good for simple patterns.
The sweet spot. Enough to establish the pattern without wasting context window.
For complex, nuanced patterns. Expensive (uses context window) but powerful.
Rule of thumb: start with 2-3 examples. If the output is wrong, add more examples that cover the edge cases it's missing.
Real Examples
Format Matching: Multiplication Table
Style Matching: Poetry
Classification: Email Triage
Transformation: Formal ↔ Casual
Common Mistakes
"Angry → 😠" then "Furious → 😊" — the model will be confused. Make sure your examples are consistent.
All your examples are short sentences? The model will struggle with long ones. Show diversity in your examples.
20 examples for a simple task wastes your context window. Diminishing returns after 5.
You give 5 examples then forget to ask the question. The model just sits there. Always end with "Now do: [your actual input]"
When to Use Examples
Use examples when:
The format is specific. Multiplication tables, code structure, JSON schemas—show the exact format.
The style is subjective. "Professional" means different things to different people. Show what it means to you.
The task is ambiguous. "Categorize these" could mean a hundred things. Examples remove ambiguity.
Instructions didn't work. If "write this in a friendly tone" fails, show an example of friendly tone.
The Laziest Thing That Works
Here's the secret: you don't need perfect examples. You need good enough examples. Trying to write the perfect 5-shot prompt is overthinking it. Start with 2 examples. If the output is wrong, add a 3rd example that shows the model what it got wrong.
Examples are cheap. Context window is expensive. Find the minimum number of examples that get you the output you want.
Claude's note: When you give me examples, I'm not "learning" in the human sense—I don't update my weights or remember for next time. But within this conversation, examples shift the conditional probability of what I generate next more precisely than instructions ever could. Show me "A → B, C → D" and the pattern is unambiguous. Tell me "transform these inputs" and I'm guessing what transformation you mean.