Chain-of-thought
What it is
Chain-of-thought (CoT) means having the model work through a problem in steps before giving its answer, instead of answering at once.
- The model writes text one piece at a time, and each piece is influenced by what it has already written.
- Working written out first becomes material the final answer is built on.
- Many current models do this internally, as extended thinking or reasoning, before they reply. You set how much with a parameter, not a prompt.
Why it matters
It improves accuracy on anything with several steps: arithmetic, logic, comparing options, choosing a tool.
- It is the base every other pattern here is built on.
- For an agent, a brief stated reason before each action also makes its behaviour explainable in a trace.
- The cost is extra output tokens and time on every call.
In the real world: A pricing assistant that jumped straight to a discount figure was wrong one time in eight; asked to list the applicable rules first, it was wrong one time in forty.
Visual example
Chain-of-thoughtThe question: is order 88213, promised at 6:00 pm and delivered at 7:02 pm, eligible for a fee refund if the rule is 'more than 30 minutes late'?
Treating the written reasoning as a faithful account of why the model decided. It is useful evidence, not a guarantee. Also, with a model that already reasons internally, adding 'think step by step' to the prompt adds cost and little else.