Skip to content

Chain-of-thought prompting

Also called: chain of thought, chain-of-thought, CoT, CoT prompting, chain-of-thought reasoning

Published:

How is chain-of-thought prompting done?

The idea took off with a 2022 paper from Google researchers. Wei and colleagues showed a model worked examples that included the reasoning steps leading to each answer, not just the question and the answer [1]. Faced with a new question, the model then wrote out its own steps before answering.

The headline result: a 540-billion-parameter model, prompted with just eight chain-of-thought examples, reached state-of-the-art accuracy on the GSM8K maths word problems [1]. The authors also observed that this ability emerges naturally in sufficiently large models [1].

Does it work without examples?

Yes. Later that year, Kojima and colleagues found that adding a single line, "Let's think step by step", before the answer was enough [2]. With InstructGPT (text-davinci-002), accuracy on MultiArith rose from 17.7% to 78.7% and on GSM8K from 10.4% to 40.7% [2].

A concrete case: "The cafeteria had 23 apples, used 20 and bought 6 more. How many are left?" Asked for the answer directly, a model can land on the wrong number. With a chain-of-thought prompt it first writes 23 - 20 = 3, then 3 + 6 = 9, and arrives at 9.

How does it relate to reasoning models?

Chain-of-thought is a prompting technique: the model stays the same and only the prompt changes. Today's reasoning models are trained to produce their intermediate steps on their own, so telling them to think step by step is often unnecessary.

Frequently asked questions

What does CoT stand for?

CoT is short for chain of thought, as in chain-of-thought prompting.

Does chain-of-thought prompting help every model?

Wei and colleagues found the gains show up mainly in sufficiently large models; smaller models may benefit little.

Sources

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models — arXiv
  2. Large Language Models are Zero-Shot Reasoners — arXiv