auto-cot
**Auto-CoT (Automatic Chain-of-Thought)** is the **method that automatically generates diverse chain-of-thought reasoning demonstrations for few-shot prompting by clustering questions and using zero-shot CoT ("Let's think step by step") to produce reasoning chains — eliminating the manual effort of crafting step-by-step examples while maintaining or exceeding hand-crafted performance** — the technique that democratized chain-of-thought prompting by making it practical for any task without expert example authoring.
**What Is Auto-CoT?**
- **Definition**: An automated pipeline that selects diverse representative questions from the task dataset, generates reasoning chains for them using zero-shot CoT, and assembles these auto-generated demonstrations as few-shot context for evaluating new questions.
- **Diversity Through Clustering**: Questions are embedded and clustered (e.g., k-means with k=8); one representative question is sampled from each cluster — ensuring few-shot examples span different reasoning patterns.
- **Zero-Shot Chain Generation**: For each selected question, the model generates a reasoning chain by appending "Let's think step by step" — producing the step-by-step demonstration automatically without human authoring.
- **Assembled Few-Shot Prompt**: The auto-generated (question, reasoning chain, answer) triples serve as few-shot demonstrations for evaluating new test questions.
**Why Auto-CoT Matters**
- **Eliminates Manual Example Crafting**: Hand-writing chain-of-thought demonstrations requires domain expertise and hours of careful authoring per task — Auto-CoT automates this entirely.
- **Matches Hand-Crafted Quality**: On arithmetic, commonsense, and symbolic reasoning benchmarks, Auto-CoT achieves performance comparable to expert-crafted demonstrations — sometimes even exceeding them.
- **Ensures Demonstration Diversity**: Clustering guarantees that examples cover different reasoning patterns — a common failure mode of manual selection is accidentally choosing homogeneous examples.
- **Scales to Any Task**: Works on any task where zero-shot CoT produces reasonable (even if imperfect) reasoning chains — no task-specific engineering required.
- **Reduces Sensitivity to Example Selection**: The high variance of manual few-shot CoT (different examples → different accuracy) is replaced by systematic diversity-based selection.
**Auto-CoT Pipeline**
**Step 1 — Question Clustering**:
- Embed all questions in the dataset using a sentence encoder (e.g., Sentence-BERT).
- Cluster embeddings into k groups (typically k = number of desired demonstrations, e.g., 8).
- Each cluster represents a distinct "question type" or reasoning pattern.
**Step 2 — Representative Selection**:
- From each cluster, select the question closest to the centroid — the most typical example of that reasoning pattern.
- Optionally filter by question length (very long or very short questions may produce poor chains).
**Step 3 — Chain Generation**:
- For each selected question, prompt the model: "[Question] Let's think step by step."
- The model auto-generates a reasoning chain and final answer.
- Simple heuristic filtering removes chains that are too short or contain obvious errors.
**Step 4 — Prompt Assembly**:
- Assemble demonstrations as: Q₁ + Chain₁ + A₁, Q₂ + Chain₂ + A₂, ..., Qₖ + Chainₖ + Aₖ.
- Append the test question and let the model generate its reasoning chain and answer.
**Auto-CoT Performance**
| Benchmark | Manual CoT | Auto-CoT | Random CoT |
|-----------|-----------|----------|------------|
| **GSM8K** | 78.5% | 77.8% | 72.1% |
| **AQuA** | 54.2% | 53.8% | 48.6% |
| **StrategyQA** | 73.4% | 74.1% | 68.3% |
| **SVAMP** | 79.0% | 78.3% | 71.9% |
Auto-CoT is **the automation breakthrough that made chain-of-thought prompting universally accessible** — proving that the diversity and coverage of reasoning demonstrations matters more than the perfection of any individual example, and that systematic selection outperforms both random sampling and often even careful manual curation.