liveBook · Manning

Self-consistency

As explained in Generative AI in Action

A self-consistency check compares multiple generated results or reasoning paths to identify inconsistent or unreliable outputs.

Self-consistency improves reasoning reliability by generating multiple diverse answers instead of accepting one greedy Chain-of-Thought path, then selecting the answer that appears most consistently across outputs. Majority voting is a common selection method. section 6.4.5 section 6.4.6

A practical self-consistency workflow is:

  • Provide few-shot examples and a clearly structured reasoning prompt. section 6.4.5
  • Sample multiple reasoning paths rather than taking the greedy path. section 6.4.6
  • Compare the candidate answers and choose the most consistent result, often through majority voting. section 6.4.6
  • Monitor accuracy, consistency, and grounding, and cross-check important results with trusted external sources. section 13.2.6

Arithmetic reasoning

For a word problem such as calculating the number of computers added from Monday through Thursday, provide a few-shot reasoning format, generate several candidate solutions, and select the answer shared by the largest number of valid paths. This approach targets arithmetic, commonsense, and logical reasoning tasks. section 6.4.5 section 6.4.6

Self-consistency reduces noise and encourages multiple viewpoints, but it does not establish factual correctness. Unreliable candidates can still agree, so critical decisions require review, grounding, and safeguards against overreliance. section 6.4.6 section 13.2.6

Figure 6.16 Self-consistency sampling
figure

Use the sampling diagram to visualize how multiple reasoning paths produce candidate answers and how consistency guides selection. section 6.4.6

How Generative AI in Action covers it

How deep it goes
Explains diverse sampling and majority selection without deriving model internals or formal voting mathematics.
Examples
Uses few-shot arithmetic word problems and a sampling diagram to illustrate candidate reasoning paths and answer selection.
What it assumes
Assumes familiarity with prompt engineering and Chain-of-Thought while using few-shot prompting as the operating pattern.
What you can do after
Apply it via few-shot prompts, multiple sampled outputs, majority voting, and external verification for important results.
How it connects
Connects Chain-of-Thought with few-shot prompting, prompt engineering, grounding, automated evaluation, and retrieval-augmented generation.

Also explained in

Compare how 6 books explain self-consistency →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Generative AI in Action. The section links point to the parts of the book it draws on.