Reasoning

Chain of Thought

Elicit multi-step reasoning by prompting the model to produce intermediate steps before its final answer.

Problem

When the prompt shows the model only example pairs of (question, final answer) and asks for the next final answer directly, the model tends to skip straight to a single output token. Because the correct answer depends on a chain of intermediate inferences that have to be carried in working memory, jumping to the answer in one step produces confidently wrong results on anything beyond the simplest case. The reasoning never becomes a token the model can attend to, so it has no opportunity to use what it actually knows one step at a time.

Solution

Prompt the model with exemplars showing intermediate reasoning, or use a zero-shot trigger ('Let's think step by step') before answering. The reasoning trace is visible and parseable.

When to use

  • The task requires multi-step reasoning that single-shot answers fail at.
  • Either exemplars with reasoning traces or a zero-shot trigger ('think step by step') are easy to add.
  • The reasoning trace is useful as a debug or audit artefact.

Open the full interactive page

Diagram, neighbourhood map, code examples, related patterns and full provenance.

Related