# Chain-of-Thought Prompting

> You ask a model to show its steps first, then give the answer.

**Field:** Artificial Intelligence  
**Category:** Working with AI  
**Also known as:** Chain of Thought, CoT Prompting, Step-by-Step Prompting

## Think of it like

Think of it like a teacher who says, show your work. You get the sum right more often.

## Definition

Chain-of-thought prompting asks a model to work through a problem step by step before it gives the answer. Writing out the steps gives the model more tokens to reason with. That helps most on maths, logic and tasks with many parts. A 2022 study showed it clearly. Reasoning models now do this on their own, so the prompt matters less with them.

## Example

Jack asks how much 12 pens cost if a pack of 3 costs $2. The quick answer says $6. With a request to think it through, the model works out 4 packs and says $8.

## Example code

```text
A pack of 3 pens costs $2. How much do 12 pens cost?
Think it through step by step, then give the final answer on its own line.
```

The last line asks for the steps first. That one change often fixes maths slips.

## Why it matters

It is one of the simplest ways to cut errors on hard questions.

## Common mistake

Trusting the steps as a true record of how the model got there. The written steps can look right and still hide a slip.

## Three principles

- **Steps before answer.** Show the work.
- **More room to think.** More tokens to reason.
- **Built into some models.** Reasoning models do it.

## Related terms

- [Reasoning Model](https://learn.benibix.com/term/ai/reasoning-model)
- [Prompt (AI)](https://learn.benibix.com/term/ai/prompt)
- [Few-Shot Prompting](https://learn.benibix.com/term/ai/few-shot-prompting)
- [Self-Consistency (Prompting)](https://learn.benibix.com/term/ai/self-consistency)
- [Tree of Thoughts (ToT)](https://learn.benibix.com/term/ai/tree-of-thoughts)

## Taught in

- [Chain-of-Thought Prompting](https://learn.benibix.com/learn/ai-working-with-ai/chain-of-thought-prompting): Prompt Engineering, 7/16

![The same maths question answered two ways. Answered at once, it gives 6 dollars, marked wrong. With steps first, it works out 4 packs and gives 8 dollars, marked right.](https://learn.benibix.com/diagrams/pr-chain-of-thought.svg)

---

Source: https://learn.benibix.com/term/ai/chain-of-thought-prompting
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
