esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

What Is Self-Consistency?

What self-consistency is, why asking a model several times and taking a vote can beat one answer, and what it costs, explained simply for your AI interview.

In short

Self-consistency means asking a model the same question several times, each run with its step-by-step working, then keeping the final answer most runs agree on. A 2022 paper by Xuezhi Wang and colleagues showed clear gains on maths and reasoning tests. Each extra run is another model call, so it costs more.

9 min readIntermediateOccasional · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

Self-consistency means I ask the model the same hard question several times, and each run writes out its working. Then I keep the answer most runs reach. Wang and colleagues showed it beats a single answer on maths and reasoning tests. The cost is clear: five runs means five model calls. So I use it where a wrong number costs money, and I send a split vote to a person.

What is self-consistency, in plain words?

A language model writes its answer one word at a time, and at the usual settings it picks each word with some randomness. So ask it the same question twice and you may get two different answers. Self-consistency turns that into a tool.

Think of a claims assessor at an insurance firm. Before a payout goes out, three colleagues work out the figure on their own. If two agree and one doesn't, the team pays the figure most of them reached. A refund bot can do this too: it works out the same refund five times, and pays the figure most of the runs reach, if enough of them agree.

Key words

Chain of thought
Asking the model to write its steps before the final answer.
Sampling
Letting the model pick words with some randomness, so each run can differ.
Reasoning path
One full run of working, from the question to the final answer.
Majority vote
Counting the final answers and keeping the one that appears most.
Greedy decoding
Always picking the single most likely next word, so one run gives one answer.

How does self-consistency work, step by step?

Self-consistency builds on chain of thought prompting. Chain of thought asks the model to produce "a series of intermediate reasoning steps" before it answers. Self-consistency keeps that prompt and changes how the answer is picked.

  1. 1

    Ask for step-by-step working

    Use a chain of thought prompt, so every run writes its reasoning before the answer.

  2. 2

    Sample several paths

    Run the same prompt several times. Sampling means each run can take a slightly different path.

  3. 3

    Pull out the final answers

    Set the working aside and keep only the last answer from each run.

  4. 4

    Vote

    Keep the answer that appears most often, and note how strong the agreement was.

Sample, count, pick

Hard question

A refund question from a customer

Same prompt, five runs

Run 1: 1800

First path, 1800 from the refund rule

Run 2: 1800

Second path, same 1800 answer

Run 3: 1620

Different path, 1620 from an old rate

Run 4: 1800

Fourth path, same 1800 answer

Run 5: 2000

Outlier, 2000 from a misread date

Count the answers

The most common answer wins

Ask a person

Vote is 60%, under the 80% bar

  1. 1The same question goes to the model five times.
  2. 2All five final answers reach the counter.
  3. 3The top answer has 60% of the votes, below the bar, so a person checks.
Five runs of the same question each give a final answer. The counter keeps the most common one, and the case goes to a person when agreement is under 80 percent.

Here it is in a few lines of Python. There is no real model in it, only five answers a refund bot could give, so you can see the counting itself.

Python
# A refund bot answers the same question five times (made-up numbers, no real model).
# Each run ends in one answer, and the code counts them.
from collections import Counter

runs = [
    "refund 1800",
    "refund 1800",
    "refund 1620",
    "refund 1800",
    "refund 2000",
]

votes = Counter(runs)
answer, count = votes.most_common(1)[0]
share = count / len(runs)
print(votes)
print("Chosen:", answer)
print(f"Agreement: {count} of {len(runs)} ({share:.0%})")
if share < 0.8:
    print("Too split: send to a human")

Output

Counter({'refund 1800': 3, 'refund 1620': 1, 'refund 2000': 1})
Chosen: refund 1800
Agreement: 3 of 5 (60%)
Too split: send to a human

The vote picks 1800 with 60 percent agreement. That is under the 80 percent line in the code, so the case goes to a person. The code does the counting. The model only supplies the five answers.

Why does a vote beat one answer, and where does it fail?

The paper's authors state the intuition directly. A hard problem usually has several ways of reasoning to one correct answer, and runs that agree have earned more trust. The paper reports real gains: "boosts the performance of chain-of-thought prompting with a striking margin", including +17.9% absolute accuracy gains on GSM8K with PaLM-540B, a dataset of grade school maths word problems.

  • “Self-consistency leverages the intuition that a complex reasoning problem typically admits multiple different ways of thinking leading to its unique correct answer.”

    Wang and colleagues, 2022

  • “One limitation of self-consistency is that it incurs more computation cost.”

    Wang and colleagues, on limits

The vote is only as good as the answers it counts. Five runs that repeat the same mistake still agree, so the vote gives false confidence. Self-consistency cuts down random slips. It cannot supply a fact the model never learned.

  • Fits

    Short answers you can count

    A number, a label, yes or no, or one chosen option. Runs can be compared and counted.

  • Doesn't fit

    Long free text

    Essays and summaries have no single answer to count, so there is nothing to vote on.

The cost is the extra runs. The authors suggest starting with a small number of paths, such as five or ten, because most of the gain shows up early and the performance levels off after that.

What does the interviewer want to hear?

A strong answer covers

  • A plain definition: sample several chain of thought runs, then vote on the final answer.
  • Why it helps: runs that reach the same answer by different routes earn trust.
  • The fit: short answers you can count, not free text.
  • The cost: one model call per run, so it costs more, and the authors suggest starting with five or ten paths.
  • The limit: it repeats a mistake if the model doesn't know the fact.
  • A threshold: low agreement goes to a person.

Common traps

  • Trap"More samples always means a better answer."

    BetterMore samples help until the answers settle. After that you pay for very little gain.

  • Trap"Five runs agreeing means it must be right."

    BetterAgreement can hide a shared error. The model can repeat one mistake five times.

  • Trap"It works the same on essays."

    BetterThe vote needs answers you can compare. A long essay gives you nothing to count.

Can you pick the right use?

Pick the right task

Which task suits self-consistency best?

Quick check

A refund bot's five runs split 3, 1 and 1. What is the safest move?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q078What is chain-of-thought, and when does it help?10 min
  2. Q091What is ReAct prompting?11 min
  3. Q092What is prompt chaining?10 min
  4. Q013Greedy vs beam search vs sampling?12 min
  5. Q010What does temperature control?10 min

Learn it in depth

Last updated on 27 November 2026

Building a bot that must get a number right?

I design and build AI agents and the checks around them: when to vote, when to double-check and when to hand a case to a person. Book a short call and tell me what your bot decides.