Skip to main content

Chain of Thought

Having an LLM write out the intermediate steps toward an answer, not just the answer, which tends to help with multi-step problems.

Chain of thought means having an LLM write out not only the answer but also the intermediate steps that lead to it. Because the model can work through multi-step calculations and reasoning one step at a time, scores on math and logic problems tend to rise. Reasoning models are built to do this without being asked. However, the written steps are not necessarily the same as the process by which the model actually reached its answer, so check the answer separately.

Having the Model Write Out Its Steps

Chain of thought means having an LLM write out not only the answer but also the intermediate steps that lead to it. You can ask it to think step by step before answering, or show examples with the steps written out. Writing out the intermediate steps lets the model work through multi-step calculations and reasoning one step at a time.

The paper that introduced this approach reported that showing a few examples with written steps improves the performance of sufficiently large language models on arithmetic, commonsense, and symbolic reasoning tasks.

How It Relates to Reasoning Models

Reasoning models are built to write out these steps without being asked. They write a long stretch of thinking before answering. Anthropic's guide says that for models with thinking, a general instruction such as think thoroughly often produces better reasoning than detailed steps written by hand.

With ordinary models, instructions to write out the steps can still help. But writing the steps adds output tokens, and the cost and waiting time grow with them. For short conversations or simple classification, it is better to have the model answer without writing out steps.

The Shown Steps Are Not Necessarily the Real Process

The written steps are not necessarily the same as the process by which the model actually reached its answer. Anthropic's research tested reasoning models by subtly giving them a hint about the answer. In most answers, the models did not admit in their written thinking that they had used the hint.

Even if the steps read as sound reasoning, that does not guarantee the answer is correct. Read the steps as clues for checking the answer, and check numbers and facts separately against the original sources or by calculation.

Was this page helpful?

Related Use Cases