self-consistency
Sample multiple paths, select most consistent - +17.9% on GSM8K
Best use case
self-consistency is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Sample multiple paths, select most consistent - +17.9% on GSM8K
Teams using self-consistency should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/self-consistency/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How self-consistency Compares
| Feature / Agent | self-consistency | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Sample multiple paths, select most consistent - +17.9% on GSM8K
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Self-Consistency (CoT-SC) Pattern
Sample multiple reasoning paths and select the most consistent answer. Achieved **+17.9% on GSM8K**, **+12.2% on AQuA**.
## Activation
Use for:
- Problems with fixed answer sets (math, multiple choice)
- When single-path reasoning is unreliable
- High-stakes decisions requiring confidence
- Factual queries where accuracy is critical
## Process
### 1. Sample Diverse Paths
Generate N (typically 5-10) reasoning paths with higher temperature.
### 2. Extract Final Answers
Parse the conclusive answer from each path.
### 3. Majority Vote
Select the most frequent answer across all paths.
## Implementation
```python
def self_consistency(prompt, question, num_samples=5):
answers = []
for _ in range(num_samples):
response = reason_with_cot(prompt, question)
answer = extract_final_answer(response)
answers.append(answer)
# Majority vote
from collections import Counter
return Counter(answers).most_common(1)[0][0]
```
## When NOT to Use
- Free-form generation (no fixed answers)
- Time-critical tasks (adds latency from multiple samples)
- Simple queries (overkill)
- Creative tasks (want diversity, not consensus)
## Universal Self-Consistency
For open-ended tasks without fixed answers:
```
"Here are several responses to the same question:
[Response 1]
[Response 2]
[Response 3]
Determine which elements are most consistent across these responses
and synthesize the most reliable answer."
```
## Integration
- Use with @test-automator for test case generation
- Combine with reflection for verified answers
- Log consistency scores to learning engine
---
*Based on Google Research - arXiv:2203.11171*Related Skills
/do
> The agent's primary skill. Customize this to match your agent's purpose.
/report
> Generate structured reports. Director-owned.
/primary
> Main workflow execution and routing. Director-owned.
Qualify
## Command
Prospect
## Command
Close Plan
## Command
Battlecard
## Command
Spec
## Command
Schedule
## Command
Repurpose
## Command
Ideate
## Command
Analyze
## Command