liveBook · Manning

Chain-of-thought prompting

As explained in How Large Language Models Work

A prompting technique that encourages a language model to produce an intermediate sequence of reasoning steps before an answer.

Chain-of-thought prompting asks a language model to produce intermediate reasoning steps, often with “Let’s think step by step.” This can improve task performance, but it does not prove that the model thinks or understands the world; its activity is better described as calculating and generating text. section 7.3

A useful but unreliable prompt

For a difficult math problem, asking for step-by-step output may provide useful intermediate calculations. The model can still skip steps, miss calculations, or produce logically invalid reasoning. section 7.3

Figure 7.6 The context and reason why someone is wearing or doing something unusual may be in the realm of something that an LLM properly recognizes and for which it produces an appropriate response. However, it might not be possible for an LLM to reach that appropriate response without producing some intermediate text. For a math problem, this intermediate text could be useful, but the intermediate text may not always be appropriate or desirable for a user to see.
figure

Intermediate text can help a model reach an appropriate response, yet showing that text may not always be desirable, especially outside tasks such as mathematics. section 7.3

How How Large Language Models Work covers it

How deep it goes
Explains the prompt pattern and possible mechanisms, but stops short of resolving why performance improves.
Examples
Uses “Let’s think step by step,” difficult math problems, planning, and unusual situations requiring contextual interpretation.
What you can do after
Apply it via a step-by-step prompt while checking for missing steps, calculation errors, and invalid reasoning.
How it connects
Connects chain-of-thought prompting with language models, transformers, attention mechanisms, and world models.

Also explained in

Compare how 18 books explain chain-of-thought prompting →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of How Large Language Models Work. The section links point to the parts of the book it draws on.