Day 04·Show and shape·2 min read
Chain-of-thought and related reasoning techniques
Chain-of-thought has the model write out intermediate steps before the answer. Its relatives either sample several reasoning paths or break the problem apart, and each has a cost.
By the end
Choose between zero-shot CoT, self-consistency, least-to-most and Tree of Thoughts for a given problem, and say when reasoning text cannot fix a wrong answer.
Chain-of-thought (CoT) has the model write out intermediate steps before the answer. That improves math, logic and multi-step planning. Its relatives either sample several reasoning paths or break the problem apart.
Learn
| Technique | How it works | Use it for |
|---|---|---|
| Few-shot CoT | Examples show worked reasoning, then the answer | Problems with a repeatable method |
| Zero-shot CoT | Add "Let's think step by step" | Quick boost with no examples |
| Self-consistency | Sample several CoT answers at higher temperature, take the majority | Questions with one checkable answer |
| Least-to-most | List subproblems first, then solve them in order | Problems harder than any example |
| Tree of Thoughts | Explore branches, score them, backtrack from dead ends | Search and planning puzzles |
- Limits. CoT costs tokens and latency, and helps little on simple lookups. The written reasoning may not match how the model actually got to its answer.
- Missing information. CoT can help a model notice what a query leaves out, but it cannot supply missing facts. Pair it with clarifying questions or retrieval.
- Reasoning models. Models with built-in thinking modes do this internally, so an explicit "think step by step" matters less for them.
Drill
- Pick a multi-step word problem the model gets wrong without CoT.
- Rerun it with zero-shot CoT, then with self-consistency (5 samples, majority vote).
- Record accuracy over 10 problems for each method.
Check yourself
- Why does self-consistency need a temperature above 0?
- When does CoT fail to fix a wrong answer?
Test yourself
6 multiple-choice questions and 9 flashcards on this lesson, shuffled every time, with the reason behind every answer.