See the Difference
Same math problem. One prompt shows only correct examples. The other shows both correct and incorrect examples with explanations of what went wrong.
Correct answer: 20 - 8 + 5 = 17
AI: 15 + 6 + 4 = 25 stickers.
AI saw numbers and added them all. "Gives away" should mean subtraction, but the model missed it.
Incorrect: 20 + 8 + 5 = 33.
Why wrong: "Sold" means items leave the store, so you subtract, not add.
AI: "Gives away" means stickers leave (subtract). "Gives him" means stickers arrive (add).
15 - 6 + 4 = 13 stickers.
AI recognized "gives away" as subtraction because it saw that exact mistake in the example.
Why This Works
Showing only correct examples teaches AI what to do, but it doesn't teach what to avoid. When AI sees a plausible wrong approach alongside the right one — with a clear explanation of where it went wrong — it learns the boundary between good and bad reasoning.
It's the same way humans learn. A driving instructor doesn't just say "turn the wheel smoothly." They also say "don't jerk the wheel — here's what happens when you do." Knowing the mistake makes you better at avoiding it.
How to Structure Your Examples
- Show the correct reasoning with clear step-by-step logic
- Show a plausible wrong approach — one that looks reasonable at first glance
- Explain exactly where the wrong reasoning went off track and why
- Include 2–3 contrastive pairs before giving AI your actual problem
The Technique
When giving AI examples, don't just show the right answer. Also show a common wrong answer and explain why it's wrong. AI learns better from seeing both sides of the line.
When to Use This
- • When AI keeps making the same type of mistake on similar problems
- • When the problem has tricky language that could be read two ways
- • When doing math or logic where specific operations are easy to confuse
- • When you can clearly articulate what the common wrong approach is
- • When you're already using examples (few-shot prompting) and want better results
Common Mistakes It Catches
Research shows contrastive examples are especially good at preventing four types of errors:
- • Operation confusion — words like "gives away" triggering addition instead of subtraction
- • Order errors — calculating A minus B when it should be B minus A
- • Missing steps — skipping an intermediate calculation that changes the final answer
- • Logical fallacies — assuming "all A are B" means "all B are A"
How It Relates
This technique extends Show by Example and Think Step by Step. If you're already giving AI examples, adding contrastive (wrong) examples alongside the right ones makes your examples more powerful. It pairs naturally with any task where you're providing few-shot demonstrations.