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.

Standard examples only
Example you give: "A store has 20 items. 8 are sold. 5 new items arrive. How many now?"

Correct answer: 20 - 8 + 5 = 17
New problem: "Tom has 15 stickers. He gives away 6 to friends. His mom gives him 4 more."

AI: 15 + 6 + 4 = 25 stickers.

AI saw numbers and added them all. "Gives away" should mean subtraction, but the model missed it.

With contrastive examples
Correct: 20 - 8 + 5 = 17. "Sold" means items leave (subtract).

Incorrect: 20 + 8 + 5 = 33.
Why wrong: "Sold" means items leave the store, so you subtract, not add.
New problem: "Tom has 15 stickers. He gives away 6 to friends. His mom gives him 4 more."

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

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

Common Mistakes It Catches

Research shows contrastive examples are especially good at preventing four types of errors:

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.