16. Self-Consistency
Chapter 16 of 25 · 15 min
Self-consistency prompting generates multiple solution paths for a single problem, then selects the most frequently occurring answer. The insight is that correct solutions converge while incorrect solutions diverge—even when they sound equally confident.
EXERCISE
Implement self-consistency querying for a code generation task. Generate 5 samples for each of 10 test cases, record the consensus answer and vote margin, then compare consensus accuracy against single-sample baseline accuracy.