liveBook · Manning

Chain-of-thought prompting

As explained in LLM Customization and Fine-Tuning

A prompting technique that elicits intermediate reasoning steps from a language model before its final answer.

Chain-of-thought (CoT) prompting asks a model to produce brief reasoning steps before its final answer. It can improve accuracy on multi-step tasks, such as math, logic, multi-clause extraction, and code traces, but adds output tokens. A single-label task such as ticket classification does not need it. section 4.2.6

Train-distance calculation

A standard prompt asks how far a train travels at 60 km/h for 2.5 hours and gives “150 km.” A CoT response shows “Distance = speed × time = 60 × 2.5 = 150 km” before the final answer. section 4.2.6

For reasoning-tier models that emit an internal chain of thought, few-shot examples can show only inputs and final answers; the model generates the reasoning itself. This can reduce prompt overhead and the number of examples needed. section 4.2.6

How LLM Customization and Fine-Tuning covers it

How deep it goes
Compare a standard answer with a worked reasoning trace and note its accuracy and token-cost tradeoff.
Examples
Calculate a train’s distance at 60 km/h over 2.5 hours, with and without a reasoning trace.
What you can do after
Apply CoT examples to multi-step tasks when their accuracy benefit justifies the additional output tokens.
How it connects
Pair CoT with few-shot prompting; contrast explicit reasoning examples with thinking-block models.

Also explained in

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

Related concepts

This explainer was generated by Manning's knowledge graph from the text of LLM Customization and Fine-Tuning. The section links point to the parts of the book it draws on.