liveBook · Manning

Chain-of-thought prompting

Chain-of-thought prompting is a technique that elicits or guides a model to produce or follow intermediate reasoning steps before a final answer.

How 18 Manning books explain it

Introduction to Generative AI, Second Edition

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

How it is used
Encourages intermediate reasoning when a model might otherwise jump to an answer.
How deep it goes
Defines the prompting move and works through a simple example, while leaving reasoning-model internals undisclosed.
Examples
Uses an apple-addition word problem and a four-line rhyming poem to contrast prompted steps with extended model reasoning.
What you can do after
Practice/perform step-by-step prompting when an answer is rushed or oversimplified, while checking whether it actually helps.

Read how Introduction to Generative AI, Second Edition explains chain-of-thought prompting →

Coding with AI

Chain-of-thought prompting is a prompting technique that guides an AI model through a problem using a sequence of intermediate reasoning steps.

How it is used
Guides AI-assisted debugging, implementation, and architecture decisions through ordered prompts instead of one-shot requests.
How deep it goes
Defines sequential reasoning, contextual awareness, and iterative refinement, then demonstrates them with practical prompt sequences.
Examples
Uses Docker failure diagnosis, staged cache construction, and JWT-versus-session authentication decisions.
What you can do after
Apply it to break complex technical tasks into testable steps and refine AI responses iteratively.

Read how Coding with AI explains chain-of-thought prompting →

AI Agents in Action, Second Edition

How it is used
Guides agents through intermediate steps when multistep questions invite plausible but shallow answers.
How deep it goes
Defines CoT, works through a six-step time-travel calculation, and implements a minimal agent instruction without exploring model internals.
Examples
Uses a 26-day time-travel riddle, a year-jump agent, and an exercise that requests numbered reasoning steps.
What you can do after
Build it from scratch as a step-by-step prompt or agent instruction, then inspect and validate the answer.

Read how AI Agents in Action, Second Edition explains chain-of-thought prompting →

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.

How it is used
Guides language models through multistep content generation and agent task planning rather than requesting an immediate final answer.
How deep it goes
Defines decomposition and partial-solution generation, then works through an article prompt without descending into model internals.
Examples
Uses a staged blog-article prompt, a technical report outline, and a product-roadmap agent plan.
What you can do after
Apply it via structured prompts to break complex writing or planning tasks into steps and assemble a final output.

Read how The Art of AI Product Development explains chain-of-thought prompting →

LLMs in Production

Chain-of-thought prompting encourages a language model to produce or use intermediate reasoning steps before giving a final answer.

How it is used
Uses intermediate reasoning to improve language-model performance on multistep questions, especially mathematical tasks.
How deep it goes
Explains zero-shot prompting, response trade-offs, evaluation, and DSPy optimization, but does not detail model-internal reasoning.
Examples
Demonstrates “think step by step,” GSM8K math questions, a DSPy QASignature, and optimized Llama 3 results.
What you can do after
Apply it via DSPy to construct, evaluate, and optimize reasoning prompts for mathematical question answering.

Read how LLMs in Production explains chain-of-thought prompting →

WordPress Power Toolkit: Harness AI to build next-level websites

Chain-of-thought reasoning is a problem-solving technique in which an AI model generates intermediate reasoning steps before producing a final answer.

How it is used
Guides iterative AI conversations for stronger website advice, analysis, and revisions.
How deep it goes
Explains staged prompting through a full website-design prompt and multi-AI revision workflow, while noting hidden model reasoning without detailing internals.
Examples
Uses a stepwise website-design discussion and analytics-data rewriting between Meta and Perplexity.
What you can do after
Apply it by structuring a goal into interactive steps and corroborating or polishing results with another AI.

Read how WordPress Power Toolkit: Harness AI to build next-level websites explains chain-of-thought prompting →

Build AI-Enhanced Web Apps

A prompting technique that guides a language model through a single sequential reasoning path.

How it is used
Guides LLMs through manageable steps to make problem-solving answers easier to verify in web-application interactions.
How deep it goes
Provides a prompt-construction procedure and worked calculation, but stops short of model internals or application code.
Examples
Works through 25% of 80 and sketches a circle-area prompt with a radius-three example.
What you can do after
Practice/perform it by drafting structured prompts with examples and step-by-step instructions, then testing varied inputs.

Read how Build AI-Enhanced Web Apps explains chain-of-thought prompting →

Prompt Engineering in Practice

A reasoning or prompting technique in which a model generates intermediate steps toward an answer.

How it is used
Makes multistep recommendations auditable when standard models must weigh several signals or follow domain-specific reasoning.
How deep it goes
Defines explicit reasoning steps and compares direct, zero-shot, and few-shot prompting through a deployment decision.
Examples
Compares prompts for a 20% canary rollout with an elevated error rate, connection-pool utilization, and downstream timeouts.
What you can do after
Evaluate/understand a rollout recommendation by checking its stated signal-by-signal reasoning and thresholds.

Read how Prompt Engineering in Practice explains chain-of-thought prompting →

Grokking AI Applications

A prompting technique that asks a language model to express intermediate reasoning steps before presenting a conclusion.

How it is used
Improves prompt reliability by structuring complex tasks and making the model’s reasoning more visible.
How deep it goes
Defines step-by-step prompting and pairs it with decomposition and self-validation, without discussing model internals.
Examples
Uses business-plan decomposition and energy-drink tagline generation to contrast unstructured and structured requests.
What you can do after
Apply CoT by writing prompts that request intermediate reasoning, final answers, and response verification.

Read how Grokking AI Applications explains chain-of-thought prompting →

AI Agents and Applications

How it is used
Guides language models through reasoning steps to answer questions such as whether a sequence meets a defined rule.
How deep it goes
Defines CoT through worked few-shot examples and step-by-step instructions, without explaining model internals.
Examples
Uses a custom “strange” sequence rule and worked examples that count odd numbers and test their sum for divisibility by three.
What you can do after
Apply it by adding worked examples and step-by-step reasoning instructions to a prompt.

Read how AI Agents and Applications explains chain-of-thought prompting →

Generative AI in Action

Chain of thought is a prompting technique that decomposes a problem into intermediate reasoning steps before producing an answer.

How it is used
Deploys intermediate prompts to guide complex reasoning tasks such as question answering, translation, and code generation.
How deep it goes
Explains sequential reasoning, zero-shot and few-shot variants, and examples, but stops short of model internals or mathematical derivation.
Examples
Uses photosynthesis explanations, proportional arithmetic, and few-shot word problems to demonstrate intermediate reasoning.
What you can do after
Apply it via zero-shot instructions or few-shot demonstrations to structure model reasoning and inspect intermediate answers.

Read how Generative AI in Action explains chain-of-thought prompting →

Sutskever's List

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

How it is used
Uses explicit intermediate traces as an inference-time scaffold for multistep reasoning and planning.
How deep it goes
Explains the stepwise mechanism through examples and notes that it changes neither model architecture nor parameters.
Examples
Uses a farm-legs arithmetic problem, math word problems, and logic puzzles to illustrate stepwise solving.
What you can do after
Apply it by prompting a model to generate intermediate natural-language steps before its final answer.

Read how Sutskever's List explains chain-of-thought prompting →

Building Reliable AI Systems

Chain-of-thought prompting is a prompting method that elicits explicit intermediate reasoning steps from a model.

How it is used
Guides multistep answers toward explicit, inspectable reasoning as part of prompt engineering for reliable outputs.
How deep it goes
Shows worked and zero-shot prompt patterns plus model-specific caveats, without detailing model internals.
Examples
Uses odd-number sums, an apple-counting problem, and an order-number discount rule to illustrate intermediate steps.
What you can do after
Practice/perform it by adding worked reasoning or a step-by-step instruction to prompts and testing results on the target model.

Read how Building Reliable AI Systems explains chain-of-thought prompting →

Time Series Forecasting Using Foundation Models

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

How it is used
Frames forecasting and anomaly detection as natural-language tasks for LLMs.
How deep it goes
Explains prompt structure, demonstrations, chunking, and output handling, but does not establish probabilistic forecasts.
Examples
Uses binary anomaly labels, statistical bounds, few-shot demonstrations, and chunked Python-style processing.
What you can do after
Apply it to anomaly detection by constructing prompts, parsing labels, and handling incomplete model output.

Read how Time Series Forecasting Using Foundation Models explains chain-of-thought prompting →

Transformers in Action

Chain-of-thought prompting guides a language model by providing or eliciting a sequence of intermediate reasoning steps before the final answer.

How it is used
Guides language-model generation toward intermediate reasoning for complex text-to-text and multistep reasoning tasks.
How deep it goes
Explains decomposition, demonstrations, structured outputs, and self-consistency, but does not detail model internals.
Examples
Uses arithmetic commonsense reasoning, the Roger tennis-ball problem, and a cube-root request with a structured response schema.
What you can do after
Apply it via few-shot demonstrations, structured schemas, and repeated sampling for more inspectable reasoning outputs.

Read how Transformers in Action explains chain-of-thought prompting →

How Large Language Models Work

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

How it is used
Uses step-by-step prompting to improve performance on tasks that benefit from generated intermediate text.
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.

Read how How Large Language Models Work explains chain-of-thought prompting →

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.

How it is used
Uses demonstrations or instructions to elicit intermediate reasoning before answers, especially in evaluation, reasoning training, and tool-use pipelines.
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 you can do after
Apply it via prompting, structure generated answers for exact-match evaluation, or support reasoning search and tool-use loops.

Read how Reinforcement Learning from Human Feedback explains chain-of-thought prompting →

Deep Learning with Python, Third Edition

A search-based inference approach that explores reasoning in natural language by generating intermediate thought steps before an answer.

How it is used
Uses intermediate natural-language steps to improve answers to math problems and search for solutions at test time.
How deep it goes
Explains few-shot and zero-shot prompting, gives a Gemma example, and relates the method to fine-tuning without detailing model internals.
Examples
Uses worked math demonstrations, “Let’s think step by step,” and Judy’s letter-counting problem.
What you can do after
Apply it by adding worked reasoning examples or a step-by-step cue to a prompt, then check the final answer.

Read how Deep Learning with Python, Third Edition explains chain-of-thought prompting →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.