Your bookmarks

Loading your bookmarks

Latest updates

New courses, skills, book chapters, and site improvements will appear here.

Create free accountSign upDashboardDashboard

Chain-of-thought (CoT)

  • Reasoning
  • Standard term
2 steps

Chain-of-thought (CoT) is a way of prompting an AI to write out its intermediate steps before it gives a final answer.

A model writes its reply one piece at a time, and everything written so far feeds into the next piece. Written-out steps keep each result on the page for the next step to build on, so a hard problem is solved in small pieces, each easier to get right than the whole answer at once.

Where you’ll meet it

In a team meeting, a coworker suggests ending every request with “Let's think step by step.” You try it on the assistant you use every day. The replies come back much longer, and the answers are the same as before.

What to do

Many current assistants are trained to work through hard problems before they answer, so the phrase adds little. Keep it for times you want to read the steps, such as when you're learning a method, and leave it off when you only need the result.

Easy to mix up

With hidden chain-of-thought, the model reasons out of view, and the provider may show you only a summary. Prompted chain-of-thought writes the steps into the reply, where you can read them.

Check yourself

Five friends split a dinner bill and tip evenly, and you ask the AI to show its work. Which of these checks its answer?

Go deeperWritten steps can differ from what produced the answer

Jason Wei and colleagues at Google reported in 2022 that showing a model a few worked examples with steps raised its scores on math and logic tests, mostly in the largest models. The same year, Takeshi Kojima and colleagues found that the single line “Let's think step by step” gave much of the same gain.

The steps are a piece of writing, and they may leave out what drove the answer. In a 2023 study, Miles Turpin and colleagues gave models example questions where the right answer was always the first option. The models then picked the first option even when it was wrong, and wrote explanations that never mentioned the pattern.

Practice Modern AI

Or take the learning quiz on a mix of every set