liveBook · Manning

Chain-of-thought prompting

As explained in The Art of AI Product Development

Chain-of-thought is a prompting technique that elicits an intermediate sequence of reasoning steps before a model produces a final answer.

A content-generation app may handle a short social post well but struggle with a detailed article. Chain-of-thought (CoT) prompting addresses multistep tasks by asking a language model to work through intermediate steps before producing a final answer. The additional detail can make the output easier to follow and improve the chance of a useful result, but it does not guarantee correctness. section 6.3 section 6.3.1 section 9.2.2

A CoT prompt guides the model through two related activities:

  • Decompose the problem into smaller, manageable components. section 6.3.1
  • Generate a partial solution for each component, then combine the results into a final solution. section 6.3.1
Figure 6.5 Schema for CoT prompting
A blue line drawing of a diamond

AI-generated content may be incorrect.

The schema illustrates how a CoT prompt organizes intermediate thoughts around a task. section 6.3.1

A blog-writing prompt

Instead of asking only for an article, instruct the model to brainstorm relevant points, organize an outline, write the introduction and body, conclude, and edit for clarity and flow. These subtasks give a complex writing request a workable sequence. section 6.3.1

Use CoT when a task needs several connected steps; simpler requests may need only a direct prompt. Reflection can add a separate review and improvement pass. In retrieval-augmented generation, a report prompt might ask the model to summarize trends, explain industry impacts, and offer actionable insights. section 6.5 section 7.3.3

Planning a roadmap update

An agent can use a step-by-step plan to fetch the current roadmap, research trends and competitors, analyze user feedback, and use an analysis tool to propose items aligned with company priorities. Planning is uncertain, so workflows may instead be explicitly coded to reduce error potential. section 9.2.2

How The Art of AI Product Development covers it

How deep it goes
Explains decomposition and partial-solution generation, with a structured writing prompt and an agent-planning sequence.
Examples
Uses a tennis-ball calculation, a blog-writing prompt, a technical report, and a roadmap-planning agent.
What you can do after
Apply it by writing step-by-step prompts for complex content and agent planning.
How it connects
Connects chain-of-thought prompting to few-shot prompting, reflection, retrieval-augmented generation, and agent planning.

Also explained in

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

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Art of AI Product Development. The section links point to the parts of the book it draws on.