Skip to content
Back to skills

Self Consistency

ASecurity

Sample multiple paths, select most consistent - +17.9% on GSM8K

  • 229 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added June 6, 2026
developmentpythongo

Security analysis

A100/100

Scanned June 6, 2026

npx -y skills add Miosa-osa/canopy --skill self-consistency --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Self Consistency?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Self Consistency
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/miosa-osa-self-consistency/badge)](https://www.skillsdirectory.com/skills/miosa-osa-self-consistency)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: self-consistency
description: "Sample multiple paths, select most consistent - +17.9% on GSM8K"
trigger: "math, logic puzzles, fact-based reasoning, high-stakes decisions"
priority: 3
dynamic: false
created: "2026-01-26"
---

# 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*

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.