Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:ANative Lab EvoAgentX Self Consistency Voting

From Leeroopedia
Knowledge Sources
Domains Voting, NLP, Ensembling
Last Updated 2026-10-21 00:00 GMT

Overview

Technique for improving LLM answer reliability by generating multiple candidate answers and selecting the most consistent one via majority voting or ensembling.

Description

Self-Consistency Voting leverages the observation that while individual LLM samples may be incorrect, the correct answer tends to appear more frequently across multiple samples. The method generates N candidate solutions (with temperature > 0 for diversity), then ensembles them: the most common answer is selected as the final output. In EvoAgentX, the QAScEnsemble operator implements this for QA tasks, and it is also used as a judge mode in MultiAgentDebateActionGraph.

Usage

Use this principle when single-shot LLM answers are unreliable:

  • QA workflows: `QAActionGraph` generates 3 candidate answers and ensembles via `QAScEnsemble`
  • Debate consensus: Set `judge_mode="self_consistency"` in `MultiAgentDebateActionGraph` to vote on debaters' final answers
  • Standalone: Use `QAScEnsemble(llm).execute(solutions=[...])` directly for ensembling any list of candidate answers

Theoretical Basis

The self-consistency method samples and aggregates:

# Abstract algorithm (not real implementation)
candidates = []
for _ in range(N):
    answer = llm.generate(problem, temperature=T)  # diverse samples
    candidates.append(answer)
final_answer = majority_vote(candidates)  # most frequent answer

answer*=arg⁡maxa∑i=1N𝟙[samplei=a]

Key properties:

  • Diversity: Multiple samples with temperature provide answer diversity
  • Robustness: Correct answers are more likely to be sampled consistently
  • Ensemble operator: `QAScEnsemble` performs the voting logic
  • Integration: Used in both `QAActionGraph` and `MultiAgentDebateActionGraph`

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment