Thought-Based Reasoning Techniques for LLMs
Overview
Chain-of-Thought (CoT) prompting and its variants encourage LLMs to generate intermediate reasoning steps before arriving at a final answer, significantly improving performance on complex reasoning tasks. These techniques transform how models approach problems by making implicit reasoning explicit.
Quick Reference
Core Techniques
1. Chain-of-Thought (CoT) Prompting
Paper: "Chain of Thought Prompting Elicits Reasoning in Large Language Models" (Wei et al., 2022) Citations: 14,255+
When to Use
- Multi-step arithmetic or math word problems
- Commonsense reasoning requiring logical deduction
- Symbolic reasoning tasks
- When you have good exemplars showing reasoning
How It Works
Provide few-shot examples that include intermediate reasoning steps, not just question-answer pairs. The model learns to generate similar step-by-step reasoning.
Prompt Template
Strengths
- Significant accuracy improvements on reasoning tasks
- Interpretable intermediate steps
- Works well with large models (>100B parameters)
Limitations
- Requires crafting good exemplars
- Less effective on smaller models
- Can still make calculation errors
2. Zero-shot Chain-of-Thought
Paper: "Large Language Models are Zero-Shot Reasoners" (Kojima et al., 2022) Citations: 5,985+
When to Use
- No exemplars available
- Quick reasoning needed
- General-purpose reasoning across task types
- Prototyping before creating few-shot examples
How It Works
Simply append "Let's think step by step" (or similar phrase) to the prompt. This triggers the model to generate reasoning steps without any examples.
Prompt Template
Alternative trigger phrases:
- "Let's work this out step by step to be sure we have the right answer."
- "Let's break this down."
- "Let's approach this systematically."
- "First, let me understand the problem..."
Two-Stage Approach (More Robust)
Stage 1 - Reasoning Extraction:
Stage 2 - Answer Extraction:
Strengths
- No exemplar crafting required
- Generalizes across task types
- Simple to implement
Limitations
- Less effective than few-shot CoT
- Can produce verbose or irrelevant reasoning
- Sensitive to exact phrasing
3. Self-Consistency
Paper: "Self-Consistency Improves Chain of Thought Reasoning in Language Models" (Wang et al., 2022) Citations: 5,379+
When to Use
- High-stakes decisions requiring confidence
- Problems with multiple valid reasoning paths
- When you need to reduce variance in outputs
- Verification of reasoning correctness
How It Works
Sample multiple diverse reasoning paths, then select the most consistent answer via majority voting. The intuition: correct answers can be reached through multiple reasoning paths.
Prompt Template
Implementation Example
Strengths
- Significant accuracy boost over single-path CoT
- Provides confidence measure (agreement level)
- Task-agnostic improvement
Limitations
- Higher computational cost (N times more generations)
- Requires extractable discrete answers
- Diminishing returns beyond ~10-20 samples
4. Tree of Thoughts (ToT)
Paper: "Tree of Thoughts: Deliberate Problem Solving with Large Language Models" (Yao et al., 2023) Citations: 3,026+
When to Use
- Complex problems requiring exploration/backtracking
- Tasks where initial decisions are pivotal
- Creative problem-solving (writing, puzzles)
- When CoT alone achieves <50% accuracy
How It Works
Generalize CoT to a tree structure where each node is a "thought" (coherent language unit). Uses search algorithms (BFS/DFS) with self-evaluation to explore and select promising reasoning paths.
Prompt Template
Thought Generation:
State Evaluation:
BFS/DFS Search:
Example: Game of 24
Strengths
- Dramatically improves performance on hard tasks (4% → 74% on Game of 24)
- Enables backtracking and exploration
- Self-evaluation catches errors early
Limitations
- Significantly higher computational cost
- Requires task-specific thought decomposition
- Complex to implement
5. Least-to-Most Prompting
Paper: "Least-to-Most Prompting Enables Complex Reasoning in Large Language Models" (Zhou et al., 2022) Citations: 1,466+
When to Use
- Problems harder than your exemplars
- Compositional generalization tasks
- Multi-step problems with clear subproblems
- Symbol manipulation and SCAN-like tasks
How It Works
Two-stage process:
- Decomposition: Break complex problem into simpler subproblems
- Sequential Solving: Solve subproblems in order, using previous answers
Prompt Template
Stage 1: Decomposition
Stage 2: Sequential Solving
Strengths
- Excellent at generalizing to harder problems
- Works well on compositional tasks
- Explicit problem decomposition aids interpretability
Limitations
- Requires two-stage prompting
- Decomposition step can fail on novel structures
- More complex setup than single-stage CoT
6. ReAct (Reasoning + Acting)
Paper: "ReAct: Synergizing Reasoning and Acting in Language Models" (Yao et al., 2022) Citations: 5,012+
When to Use
- Tasks requiring external information (search, APIs)
- Interactive decision-making environments
- Multi-hop question answering
- When pure reasoning leads to hallucination
How It Works
Interleave reasoning traces ("Thought") with actions ("Action") and observations ("Observation"). Reasoning helps plan actions; actions provide new information for reasoning.
Prompt Template
Action Types
Search[query]- Search for informationLookup[keyword]- Look up keyword in current contextFinish[answer]- Return final answer
Strengths
- Reduces hallucination by grounding in external knowledge
- Interpretable action traces
- Handles exceptions through adaptive reasoning
Limitations
- Requires integration with external tools
- More complex orchestration
- Action space must be defined
7. PAL (Program-Aided Language Models)
Paper: "PAL: Program-aided Language Models" (Gao et al., 2022) Citations: 608+
When to Use
- Mathematical/arithmetic reasoning
- Problems requiring precise computation
- Symbolic manipulation
- When CoT makes calculation errors
How It Works
Generate code (typically Python) instead of natural language reasoning. Execute the code to get the answer. The LLM handles decomposition; the interpreter handles computation.
Prompt Template
Strengths
- Eliminates arithmetic errors
- Clear variable naming aids interpretability
- Leverages code execution for verification
Limitations
- Requires code interpreter
- Not suitable for non-computational reasoning
- Model must generate syntactically correct code
8. Auto-CoT
Paper: "Automatic Chain of Thought Prompting in Large Language Models" (Zhang et al., 2022) Citations: 838+
When to Use
- No manually crafted exemplars available
- Want to automate few-shot CoT setup
- Scaling CoT to many tasks
- When zero-shot CoT isn't sufficient
How It Works
- Cluster questions by diversity
- Use Zero-shot CoT to generate reasoning chains for representative questions
- Use these auto-generated chains as few-shot exemplars
Prompt Template
Step 1: Generate diverse demonstrations
Step 2: Use as few-shot exemplars
Strengths
- No manual exemplar creation
- Diversity sampling improves robustness
- Matches manual CoT performance
Limitations
- Quality depends on zero-shot CoT quality
- Clustering requires similarity metric
- Some generated chains contain errors
9. Reflexion
Paper: "Reflexion: Language Agents with Verbal Reinforcement Learning" (Shinn et al., 2023) Citations: 2,179+
When to Use
- Iterative improvement over multiple attempts
- Learning from errors without fine-tuning
- Complex coding or decision-making tasks
- When single-pass reasoning is insufficient
How It Works
After task failure, the agent generates a verbal "reflection" analyzing what went wrong. This reflection is stored in memory and used in subsequent attempts to avoid repeating mistakes.
Prompt Template
Initial Attempt:
Reflection:
Subsequent Attempt (with memory):
Example: Code Generation
Strengths
- Learns from errors without weight updates
- Achieves 91% on HumanEval (surpassing GPT-4's 80%)
- Builds episodic memory of insights
Limitations
- Requires multiple attempts
- Memory management for long sessions
- Quality of reflection affects improvement
Decision Matrix: Which Technique to Use
Best Practices
1. Start Simple
Begin with Zero-shot CoT ("Let's think step by step"), then progress to more complex techniques if needed.
2. Match Technique to Task
- Math/Logic: CoT, PAL, Self-Consistency
- Multi-hop QA: ReAct, Least-to-Most
- Creative/Puzzles: Tree of Thoughts
- Iterative Tasks: Reflexion
3. Combine Techniques
Techniques are often complementary:
- ReAct + Self-Consistency for robust factual answers
- ToT + PAL for complex computational exploration
- Least-to-Most + Reflexion for hard multi-step problems
4. Prompt Engineering Tips
- Use clear step markers ("Step 1:", "First,", etc.)
- Include diverse exemplars covering edge cases
- Format consistently across examples
- Add verification steps ("Let me verify...")
Common Mistakes
References
-
Wei, J. et al. (2022). "Chain of Thought Prompting Elicits Reasoning in Large Language Models." arXiv:2201.11903
-
Kojima, T. et al. (2022). "Large Language Models are Zero-Shot Reasoners." arXiv:2205.11916
-
Wang, X. et al. (2022). "Self-Consistency Improves Chain of Thought Reasoning in Language Models." arXiv:2203.11171
-
Yao, S. et al. (2023). "Tree of Thoughts: Deliberate Problem Solving with Large Language Models." arXiv:2305.10601
-
Zhou, D. et al. (2022). "Least-to-Most Prompting Enables Complex Reasoning in Large Language Models." arXiv:2205.10625
-
Yao, S. et al. (2022). "ReAct: Synergizing Reasoning and Acting in Language Models." arXiv:2210.03629
-
Gao, L. et al. (2022). "PAL: Program-aided Language Models." arXiv:2211.10435
-
Zhang, Z. et al. (2022). "Automatic Chain of Thought Prompting in Large Language Models." arXiv:2210.03493
-
Shinn, N. et al. (2023). "Reflexion: Language Agents with Verbal Reinforcement Learning." arXiv:2303.11366


