Large Programs

Home / How LLMs Work

How LLMs Work

Chain-of-Thought Prompting: Showing the Steps

Asking a language model to show intermediate steps can improve its answers to hard problems. What the research found and how it is like showing your working in maths.

27 November 2026 · 1 min read

In maths class you are told to "show your working". Writing the steps helps you avoid mistakes. A similar idea works for language models.

A question solved in three written steps.

What a chain of thought is

A chain of thought is a series of intermediate steps that lead to an answer. In 2022 researchers explored what happens when a model generates such a chain before it gives its final answer. They found that this significantly improves a large language model's ability to do complex reasoning.

How the method works

The method is called chain-of-thought prompting. In the prompt, you give the model a few examples (exemplars) that show the steps being worked through. The model then tends to write out similar steps for the new problem.

The researchers report that these reasoning abilities emerge naturally in sufficiently large language models.

One technique among many

Chain-of-thought is listed among common prompting techniques alongside few-shot prompting (giving several examples) and role assignment (telling the model what role to play). See how to write a good prompt.

An example to try

Ask a chatbot with a grown-up: "A box has 3 red pens and twice as many blue pens. How many pens are there? Show each step." Then ask it again without "Show each step". Compare. This is not a scientific test. Different chatbots behave differently.

Limits

Written steps do not prove that the answer is right. Check the working yourself. For more on why models slip on sums, see why AI makes maths mistakes.

Sources