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

TechniqueHow it worksUse it for
Few-shot CoTExamples show worked reasoning, then the answerProblems with a repeatable method
Zero-shot CoTAdd "Let's think step by step"Quick boost with no examples
Self-consistencySample several CoT answers at higher temperature, take the majorityQuestions with one checkable answer
Least-to-mostList subproblems first, then solve them in orderProblems harder than any example
Tree of ThoughtsExplore branches, score them, backtrack from dead endsSearch 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

  1. Pick a multi-step word problem the model gets wrong without CoT.
  2. Rerun it with zero-shot CoT, then with self-consistency (5 samples, majority vote).
  3. 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.