Reasoning Techniques
LLMs often get multi-step problems wrong when they answer in one jump. Simply asking them to show their working, like we did in school maths, makes them much more accurate. In this session, let us learn the main reasoning prompts and when to use each.
In this session
- Chain-of-thought (CoT): zero-shot and few-shot
- Self-consistency: ask several times and take a vote
- Tree-of-thought and decomposition (least-to-most) prompting
- How built-in reasoning models change the picture
01Chain-of-thought prompting
Here is a small word problem:
Two ways to get chain-of-thought (CoT):
- Zero-shot CoT: add a line like
Let's think step by step.to the question. - Few-shot CoT: include one or two examples where the answer shows the full working, so the model copies that style.
Like a maths teacher saying “show your working”. Students who write each step make fewer silly mistakes, and the teacher can see exactly where a mistake happened.
02Self-consistency: ask several times, take a vote
With some randomness (temperature around 0.7), the model may follow different reasoning paths. Self-consistency samples several CoT answers and picks the most common final answer. Wrong paths tend to disagree with each other, while correct paths agree.
Self-consistency improves accuracy on maths and logic, but costs N times more calls. Use it where a wrong answer is expensive and the answer can be compared exactly (a number, a label).
03Tree-of-thought and decomposition
Tree-of-thought (overview)
Instead of one chain, the model explores several possible next steps, scores each one, keeps the promising branches and drops the bad ones, like a chess player thinking a few moves ahead. It helps planning and puzzle-like problems, but needs many calls, so it is usually built with code (or an agent framework), not a single prompt.
Decomposition (least-to-most) prompting
Break a big question into smaller sub-questions, solve them in order, and use each answer in the next step. This is simple and works very well in practice:
04What about reasoning models?
Newer “reasoning” or “thinking” models (Session 24) are trained to do chain-of-thought internally before answering. With them:
- You usually don’t need “think step by step”; describe the goal and constraints clearly instead.
- You can often control the thinking budget (more thinking = better on hard problems, but slower and costlier).
- Self-consistency and decomposition still help for high-stakes answers and very long tasks.
| Technique | Calls | Best for |
|---|---|---|
| Zero-shot CoT | 1 | Quick boost for multi-step questions |
| Few-shot CoT | 1 | When you want a specific style of working |
| Self-consistency | 5–20 | Maths, logic, labels where errors are costly |
| Tree-of-thought | Many | Planning, puzzles, search problems |
| Decomposition | A few | Big business questions, multi-part analysis |
05Summary
- Chain-of-thought asks the model to show its steps; it improves multi-step accuracy.
- Self-consistency samples several answers and takes a majority vote.
- Tree-of-thought explores and scores multiple branches; decomposition solves sub-questions in order.
- With reasoning models, focus on clear goals; the model does the step-by-step work itself.
06Quick quiz
1. Adding “Let’s think step by step.” to a question is called…
2. Self-consistency works by…
3. CoT helps most on…
4. Which technique explores and scores multiple branches?
5. With a built-in reasoning model, the best prompt is usually…
07References
- Wei et al., Chain-of-Thought Prompting Elicits Reasoning (2022) · Kojima et al., Large Language Models are Zero-Shot Reasoners (2022)
- Wang et al., Self-Consistency (2022) · Yao et al., Tree of Thoughts (2023)
- Zhou et al., Least-to-Most Prompting (2022)