Course contentsShow
← Machine Learning and Deep Learning
Lesson 1884 of 3,53840. Advanced Prompting TechniquesFree lesson

Self-Consistency with Different Prompts

Generating diverse reasoning paths by varying prompt phrasing or examples across samples, not just sampling randomness.

Self-Consistency with Different Prompts

What you'll learn: How to boost self-consistency accuracy by strategically varying the prompt itself across reasoning samples, not just relying on temperature randomness.

The Core Idea

You've learned that self-consistency generates multiple reasoning paths via sampling (temperature > 0) and votes on the final answer. But there's another powerful axis of diversity: the prompt itself.

Instead of asking the same question 10 times with different random seeds, you can rephrase the problem, swap few-shot examples, or adjust the instruction style across samples. This creates fundamentally different reasoning approaches that may catch errors one formulation would miss.

Why Prompt Variation Matters

Think of it like asking different experts the same problem—you don't just want one expert to guess multiple times, you want perspectives from people who think differently. Similarly:

  • Different phrasings may trigger different reasoning strategies the model has learned
  • Different few-shot examples prime different solution patterns
  • Different instruction styles (concise vs. verbose) can surface alternative paths

The model's responses become more truly independent, reducing correlated errors that pure sampling might reproduce.

Practical Approach

For a math problem, you might generate:

  • 3 samples with "Solve step-by-step:"
  • 3 samples with "Let's break this down carefully:"
  • 4 samples with different worked examples

Then apply majority voting across all 10 outputs. The prompt diversity complements sampling diversity.

Trade-offs

This approach requires managing multiple prompt templates and potentially more tokens (different examples add length). However, when correctness is critical and you're already using self-consistency, prompt variation often yields better marginal gains than just increasing sample count with one prompt.

Key Takeaway: Self-consistency becomes more robust when you diversify not just the sampling randomness but the prompts themselves—different phrasings and examples encourage genuinely different reasoning strategies that vote toward more reliable answers.