---
title: Self-Consistency — Prompt Engineering Technique
description: Self-consistency samples several independent chain-of-thought answers and takes the majority result. Averaging over diverse reasoning paths corrects individual mistakes and improves accuracy over a single greedy chain.
canonical: https://prompeteer.ai/techniques/self-consistency
category: Reasoning & decomposition
---

# Self-Consistency

Self-consistency samples several independent chain-of-thought answers and takes the majority result. Averaging over diverse reasoning paths corrects individual mistakes and improves accuracy over a single greedy chain.

## What it is

Self-consistency is a decoding strategy that improves chain-of-thought. Instead of taking one greedy reasoning path, it samples multiple diverse reasoning chains (using a non-zero temperature) and then selects the answer that appears most often across them.

The intuition is that a correct answer can be reached by many valid reasoning routes, while different mistakes tend to be inconsistent. Marginalizing over sampled paths and voting on the final answer therefore recovers the answer the model "really" supports, yielding significant gains on arithmetic and reasoning benchmarks.

## When to use

- A single chain-of-thought answer is unreliable and accuracy matters more than cost.
- The task has a well-defined final answer that can be compared and voted on.
- You can afford several sampled generations per query.
- Reasoning paths are genuinely diverse, so voting is meaningful.

## How it works

1. Prompt with chain-of-thought so each generation includes reasoning and a final answer.
2. Sample multiple completions with a non-zero temperature to get diverse reasoning paths.
3. Extract the final answer from each sampled chain.
4. Return the most frequent final answer (majority vote) as the result.

## Illustrative structure

The structure runs the same chain-of-thought prompt N times with temperature > 0, collects the N final answers, and returns the mode. Schematically: sample {answer_1 … answer_N} → majority_vote(answers).

## Pitfalls

- Cost and latency scale roughly linearly with the number of samples.
- Only works when the final answer is discrete enough to aggregate; free-form text is hard to vote on.
- Temperature too low removes diversity; too high produces noise — both weaken voting.
- A confident-but-wrong majority can still win if the model is systematically biased.

## Sources

- [Wang et al. (2022), Self-Consistency Improves Chain-of-Thought Reasoning](https://arxiv.org/abs/2203.11171)
- [Wei et al. (2022), Chain-of-Thought Prompting](https://arxiv.org/abs/2201.11903)

## Related techniques

- [chain-of-thought](https://prompeteer.ai/techniques/chain-of-thought)
- [sampling-control](https://prompeteer.ai/techniques/sampling-control)
- [task-decomposition](https://prompeteer.ai/techniques/task-decomposition)
