liveBook · Manning

Chain-of-thought prompting

As explained in Reinforcement Learning from Human Feedback

A reasoning trace is a sequence of generated textual intermediate steps used while solving a problem before reaching an answer.

Chain-of-thought prompting asks a language model to produce intermediate reasoning steps before its final answer. It began with few-shot examples containing written-out reasoning and later shifted toward explicit instructions to generate reasoning steps. section 16.1.2 section 16.1.4

Arithmetic demonstration

A standard answer gives only “The answer is 11.” A chain-of-thought answer exposes the intermediate calculation: 2 cans of 3 balls gives 6, then 5 + 6 = 11. The next question can reuse that demonstrated format.

The technique appears in several reasoning pipelines:

  • Use demonstrations or instructions to establish a reasoning-first response format. section 16.1.2 section 16.1.4
  • Evaluate generated reasoning with exact-match checks on the final answer, often alongside format requirements. section 16.1.4
  • Score reasoning traces at step boundaries with process reward models, which can prune low-scoring branches during search or decoding. section 5.6.1
  • Interleave reasoning traces with tool actions so the model can plan, gather information, update its plan, and continue reasoning. section 13.3
Answer the following multiple-choice question by giving the correct answer 
letter in parentheses.
Provide CONCISE reasoning for the answer, and make sure to finish the
response with "Therefore, the answer is (ANSWER_LETTER)" where
(ANSWER_LETTER) is one of (A), (B), (C), (D), (E), etc.

Question: {question}
(A) {choice_A}
(B) {choice_B}
(C) ...

Answer the above question and REMEMBER to finish your response with the
exact phrase "Therefore, the answer is (ANSWER_LETTER)" where
(ANSWER_LETTER) is one of (A), (B), (C), (D), (E), etc.

A multiple-choice template combines concise reasoning with an exact final-answer phrase, illustrating how reasoning generation and answer extraction can coexist. section 16.1.4

Longer reasoning chains became central to reasoning-model training and inference-time scaling, where additional generation computation correlates with improved performance on verifiable tasks. The approach remains sensitive to prompt format, sampling settings, and whether evaluation matches the model’s training format. section 7.5 section 16.6

How Reinforcement Learning from Human Feedback covers it

How deep it goes
Defines generated reasoning traces and shows prompt formats, then connects them to process scoring, search, training, and evaluation.
Examples
Demonstrates arithmetic word problems, multiple-choice prompts with exact answer suffixes, process-scored traces, and interleaved tool actions.
What it assumes
Assumes familiarity with language-model prompting and evaluation, while demonstrating the reasoning format through elementary arithmetic examples.
What you can do after
Apply it via prompting, structure generated answers for exact-match evaluation, or support reasoning search and tool-use loops.
How it connects
Connects chain-of-thought prompting to few-shot prompting, process reward models, reinforcement learning, inference-time scaling, and tool use.

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 Reinforcement Learning from Human Feedback. The section links point to the parts of the book it draws on.