Chain-of-thought
Definition
Having a model work through intermediate reasoning steps before it gives a final answer, either by prompting or by training.
In more detail
Asking a model to think step by step improved accuracy on maths and logic tasks in earlier models. Reasoning models now do this internally, so explicit chain-of-thought prompts matter less with them.
With non-reasoning models it still helps to ask for working before the answer on multi-step problems, and to put the final answer in a fixed place, such as a tag, so code can extract it. With reasoning models, prefer setting the reasoning effort or thinking budget over writing 'think step by step', and do not rely on the visible reasoning as an exact record of how the model reached its answer.
Related terms
Extended thinking
A model setting that gives it a budget of reasoning tokens to use before writing its final answer, trading time and cost for accuracy.
Reasoning model
A model trained to spend extra tokens thinking through a problem before it answers, trading speed and cost for accuracy on hard tasks.
ReAct
A prompting pattern where a model alternates between writing out its reasoning and taking an action, then reads the observation before the next step.
Self-consistency
Sampling several reasoning paths for the same question and taking the most common final answer, instead of trusting a single response.
Read more about Chain-of-thought
- Prompt engineering
Writing clear, testable instructions for models and checking them on real inputs.
- Reasoning effort
An API setting that controls how much a reasoning model thinks before answering, trading cost and latency against accuracy.
- Self-consistency
Sampling several reasoning paths for the same question and taking the most common final answer, instead of trusting a single response.