Advanced Reasoning / Self-Improvement

Contrastive Chain of Thought

Advanced [4/5]
Contrastive CoT Positive-negative reasoning Error-aware prompting

Definition

Contrastive Chain of Thought enhances reasoning by showing both correct AND incorrect reasoning examples. By demonstrating what NOT to do alongside what to do, models learn to avoid common mistakes and reasoning pitfalls.

This technique leverages the insight that understanding errors is as valuable as understanding correct solutions.

Key Concepts

  • Positive examples: Correct reasoning chains to emulate
  • Negative examples: Incorrect reasoning to avoid
  • Error annotation: Explaining WHY the wrong approach fails
  • Contrast learning: Learning boundaries by seeing both sides

Examples

Comparison
Standard CoT vs Contrastive CoT
STANDARD CHAIN OF THOUGHT: (Only shows correct reasoning) Q: "A bat and ball cost $1.10 total. The bat costs $1 more than the ball. How much does the ball cost?" Example reasoning (correct): "Let ball = x. Bat = x + $1. x + (x + 1) = 1.10 2x + 1 = 1.10 2x = 0.10 x = $0.05 The ball costs 5 cents." CONTRASTIVE CHAIN OF THOUGHT: (Shows both correct AND incorrect) INCORRECT reasoning (common mistake): "The bat costs $1 more, and total is $1.10. So ball = $0.10 and bat = $1.00" ❌ ERROR: This makes bat only $0.90 more than ball! Check: $1.00 - $0.10 = $0.90 ≠ $1.00 CORRECT reasoning: "Let ball = x. Bat = x + $1 (exactly $1 more). x + (x + 1) = 1.10 2x = 0.10 x = $0.05 Check: $0.05 + $1.05 = $1.10 ✓ Difference: $1.05 - $0.05 = $1.00 ✓" WHY CONTRASTIVE WORKS: ┌──────────────────────────────────────────────┐ │ Standard CoT: "Do this" │ │ → Model might still make common errors │ │ │ │ Contrastive CoT: "Do this, NOT that" │ │ → Model learns to recognize & avoid pitfalls │ └──────────────────────────────────────────────┘
Implementation
Contrastive CoT Prompt Template
CONTRASTIVE COT PROMPT TEMPLATE: I'll show you how to solve problems correctly by demonstrating both CORRECT and INCORRECT approaches. EXAMPLE PROBLEM: [problem] ❌ INCORRECT APPROACH: [wrong reasoning] WHY THIS FAILS: [explanation of error] ✓ CORRECT APPROACH: [right reasoning] WHY THIS WORKS: [explanation of correctness] --- Now solve this problem, being careful to avoid the type of error shown above: PROBLEM: [actual problem] --- TYPES OF ERRORS TO CONTRAST: 1. ARITHMETIC ERRORS: ❌ "5 × 7 = 32" → Missing step ✓ "5 × 7 = 35" → Verified calculation 2. LOGICAL FALLACIES: ❌ "All A are B, X is B, so X is A" ✓ "All A are B, X is A, so X is B" 3. MISREADING PROBLEMS: ❌ Reading "more than" as "total" ✓ Setting up equation correctly 4. PREMATURE CONCLUSIONS: ❌ Jumping to answer without verification ✓ Checking answer against constraints PERFORMANCE IMPROVEMENT: ┌─────────────────────┬───────┬──────────────┐ │ Task │ CoT │ Contrastive │ ├─────────────────────┼───────┼──────────────┤ │ GSM8K (math) │ 74% │ 82% (+8%) │ │ Logic puzzles │ 65% │ 78% (+13%) │ │ Cognitive reflection│ 58% │ 89% (+31%) │ └─────────────────────┴───────┴──────────────┘ Biggest gains on problems with common pitfalls!

Interactive Exercise

Create Contrastive Examples

Problem: "If it takes 5 machines 5 minutes to make 5 widgets, how long would it take 100 machines to make 100 widgets?"

Create both incorrect (common mistake) and correct reasoning chains.

Pro Tips
  • Include the MOST COMMON error, not obscure edge cases
  • Clearly explain WHY the incorrect approach fails
  • Works especially well for problems with intuitive-but-wrong answers
  • Combine with self-consistency for even better results

Related Terms