liveBook · Manning

Chain-of-thought prompting

As explained in Prompt Engineering in Practice

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

Chain-of-thought (CoT) prompting asks a model to state intermediate reasoning steps before giving a conclusion. For multistep decisions, the resulting explanation makes the recommendation easier to inspect, challenge, and correct. It is especially useful when a standard, nonreasoning model must weigh several signals, or when a task requires a domain-specific reasoning pattern. section 9.1

Choose the least elaborate prompt that gives the team enough visibility:

  • Use a direct prompt when a short recommendation is sufficient; it may leave the weighting of individual signals unclear. section 9.1.1
  • Use zero-shot CoT to request a step-by-step assessment of each signal against its threshold before an overall recommendation. section 9.1.1
  • Use few-shot CoT when an example must demonstrate both the domain logic and the desired reasoning structure. section 9.1

Canary rollout decision

A release engineer must decide whether to continue a 20% canary rollout. The checkout-api error rate is 3.2%, against a 0.8% baseline and a rollback threshold of more than 3% for at least five minutes. Database connection-pool utilization is 78%, below its 85% alert threshold; a noncritical downstream service has intermittent timeouts. A structured prompt assigns the release-engineer role, supplies these signals, asks for each signal to be assessed against its threshold, and requests a GO or NO-GO recommendation. The intermediate assessment exposes which signals drive the decision. It also gives an engineer a place to check whether the error rate—not merely the rollout—has remained above threshold for five minutes. section 9.1.1

Do not add explicit CoT instructions merely because a task is difficult. If a reasoning or thinking model is available, enable its reasoning mode at the model or API level instead; additional CoT instructions are described as unnecessary token cost. Review an explicit reasoning trace as an argument to verify, not as a substitute for checking its inputs and thresholds. section 9.1 section 9.1.1

How Prompt Engineering in Practice covers it

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 it assumes
Assumes familiarity with structured prompts and few-shot examples; defines CoT before applying it.
What you can do after
Evaluate/understand a rollout recommendation by checking its stated signal-by-signal reasoning and thresholds.
How it connects
Connects few-shot examples and reasoning models to the choice between demonstrated reasoning and model-level reasoning mode.

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 Prompt Engineering in Practice. The section links point to the parts of the book it draws on.