Aiodic

Back to the table

25 Intermediate Ct Chain of Thought Prompting

Chain of Thought

Having the model reason step by step.

What it is

Chain of thought means getting an AI model to work through a problem in written steps before it gives you its final answer. Instead of jumping straight to "the answer is 27", the model writes out its working, one step at a time, and only then commits to a conclusion.

If that sounds like a maths teacher saying "show your work", that is exactly the idea. And it helps for the same reason it helped you at school. When you do a long sum in your head, you lose track. When you write down each step, every step is small and easy, and you can build on what is already on the page.

To see why this matters so much for AI, it helps to know one thing about how a language model writes. It produces text one small piece at a time (these pieces are called tokens, and a token is roughly a word or part of a word). Each new piece is chosen by looking at everything written so far, including what the model itself has just written. The model has no private notepad. There is no hidden place where it quietly does the arithmetic before it starts typing. The page is its only scratch paper.

So if you ask a hard question and the model has to answer in its very first words, it is being forced to blurt out a guess. But if it writes out the steps first, each step becomes something it can read back and build on. By the time it reaches the final answer, most of the hard work is sitting right there on the page, and the last step is easy.

Here is the example that made the technique famous. Researchers gave a model this question:

The cafeteria had 23 apples. If they used 20 to make lunch and bought 6 more, how many apples do they have?

Asked for just the answer, the model said 27. That is wrong. When the same model was shown how to reason in steps, it wrote: "The cafeteria had 23 apples originally. They used 20 to make lunch. So they had 23 – 20 = 3. They bought 6 more apples, so they have 3 + 6 = 9. The answer is 9." Same model, same knowledge, same question. The only difference was room to think.

Chain of thought comes in two forms today:

Why it matters

It makes answers more accurate on anything with several steps. That includes maths, but also the everyday problems that are secretly maths or logic: pricing a product, comparing two phone plans, fitting a schedule together, deciding whether a deal is actually a good deal, or untangling "if this, then that" rules in a contract or a policy. These are exactly the tasks where a quick gut answer goes wrong, for people and for AI.

It lets you check the work. A bare answer of "charge $34" gives you nothing to inspect. You either trust it or you don't. An answer that shows the steps lets you spot the moment things went wrong: "wait, it forgot the payment processing fee" or "it assumed I work five days a week, and I work three." This is a big deal if you are not technical. You do not need to understand how the AI works. You only need to read the steps the way you would read a colleague's notes.

It lets you fix one step instead of starting over. When you can see that step three used the wrong number, you can say so: "In step three, shipping is $6.50, not $4. Redo it from there." That is much faster than rewording the whole question and hoping for a better result.

It shows you how the model understood your question. Quite often the reasoning reveals that the AI answered a slightly different question from the one you meant. That is useful feedback on your prompt, and you would never see it in a one-line answer.

It is free and works with the tools you already have. No new software, no paid upgrade. It is one extra sentence.

There are honest costs. Step-by-step answers are longer and slower to arrive. If you pay for AI by usage, which is how it works when a business connects to a model through an API, longer answers cost more because you pay per token. And for simple questions it adds nothing. You do not need a chain of thought to find out the capital of France or to get ten ideas for a newsletter name.

Real-world examples

The Google study that gave it a name

In January 2022, a team at Google, with researcher Jason Wei as lead author, published a paper called "Chain-of-Thought Prompting Elicits Reasoning in Large Language Models". Their method was simple. Before asking the real question, they showed the model a handful of example questions where the answer was written out in full steps, not just stated. (Showing a model a few worked examples like this is called few-shot prompting.) The apple question above comes from that paper.

The results surprised people. On a well-known set of primary-school maths word problems, their largest model went from solving fewer than one in five (17.9 percent) to solving more than half (56.9 percent), using just eight worked examples. Nobody retrained the model or made it bigger. The ability was already in there. It needed a different kind of prompt to come out. The researchers also noticed that the trick mainly helped large models. Small models tended to produce steps that sounded fluent but didn't make sense, which is a useful warning that steps are not magic in themselves.

One sentence: "Let's think step by step"

A few months later, in May 2022, researchers from the University of Tokyo and Google asked a natural follow-up question: do you really need the worked examples? They tried adding a single sentence before the model's answer: "Let's think step by step." Nothing else changed.

On one standard arithmetic test, accuracy jumped from 17.7 percent to 78.7 percent. Giving no examples at all is called zero-shot prompting, so this became known as zero-shot chain of thought. It is the reason you still see that exact sentence recommended in prompt guides everywhere. For anyone who is not a programmer, this was the moment the technique became something you could use in ten seconds.

From a prompt trick to a built-in feature

For about two years, chain of thought was something users had to ask for. Then AI companies began training models to do it by themselves. In September 2024, OpenAI released a preview of a model called o1 that spends time reasoning before it replies. Other labs followed with their own versions. In January 2025, the Chinese lab DeepSeek released a reasoning model called R1 that displayed its thinking openly, and many people saw for the first time what a model's long, winding working-out looks like, including the moments where it stops to double-check itself. Google released a "thinking" version of Gemini in December 2024, and Anthropic added extended thinking to Claude in February 2025.

This is why your chatbot may now pause and show "Thinking…" before it answers a hard question. It is doing chain of thought without being asked. The prompt trick of 2022 became a product feature.

An everyday case: pricing a handmade product

Imagine Maya, who sells handmade candles online. She asks a chatbot: "What should I charge for my candles?" She gets a confident paragraph and a number. She has no idea where the number came from, so she cannot tell whether to trust it.

She tries again: "I sell handmade candles. Wax, wick, and jar cost me $4.20 per candle. Each one takes 15 minutes to make, and I want to pay myself $24 an hour. The marketplace takes 6.5 percent of the sale price plus 20 cents per order. I want a 30 percent profit after all of that. Work through this step by step, show each calculation, and give the final price on its own line at the end."

Now the reply lists materials, then labour (15 minutes at $24 an hour is $6), then the fee, then the profit, then the price. Maya can follow every line. If she spots that the AI applied the marketplace fee to her costs instead of to the sale price, she can point at that exact step and ask for a correction. The quality of the final number went up, and so did her ability to trust it for a good reason.

Try it yourself

This takes about ten minutes with any chatbot.

  1. Pick a question with several moving parts. A real one from your life works best: a budget, a price, a schedule, a choice between two offers. If nothing comes to mind, use this: "I am choosing between two phone plans. Plan A is $35 a month with a $120 phone. Plan B is $28 a month with a $260 phone. Which is cheaper over 18 months, and at what month do they cost the same?"
  2. Ask it plainly first. Add "Reply with just the answer." Save what you get.
  3. Open a new chat and ask the same question with reasoning. Add this to the end: "Work through this step by step before you answer. Show each calculation. Then give your final answer on its own line, starting with 'Final answer:'."
  4. Compare the two. Are the answers the same? Which one would you be willing to act on? If your chatbot is a newer reasoning model, the answers may well match, because it reasoned quietly the first time. The difference you will notice is how much easier the second reply is to check.
  5. Read the steps like an editor. Look for an assumption you didn't state (did it invent a tax rate?), a number copied wrongly, or a step that doesn't follow from the one before.
  6. Correct one step. Change a fact and say: "In step two, use $32 a month instead. Redo it from that step." Watch it rebuild from there without starting again.
  7. Try the stronger version. Before the steps, ask: "First list any assumptions you are making and any information you are missing. Then work through it step by step." This catches the most common cause of wrong answers, which is a silent guess about something you never said.

Here is a template you can save and reuse:

[Your question, with all the numbers and facts you have.]

Before answering:
1. List any assumptions you are making.
2. Work through the problem step by step, showing each calculation.
3. Check your result against the facts I gave you.

Then give your final answer on its own line, starting with "Final answer:".

If your AI tool has a "thinking" or "reasoning" switch, try the same question with it turned on and off, and notice the difference in speed and quality.

Common mistakes and misunderstandings

Asking for the answer first and the reasoning second. Order matters more than people expect. If the model states its answer first, that answer is now on the page, and everything it writes afterwards tends to defend it. You get a justification, not reasoning. Always ask for the steps first and the answer last.

Believing that visible steps guarantee a correct answer. A chain can go wrong at step two, and every later step then inherits the mistake while still sounding perfectly confident. Tidy reasoning can also be built on a made-up fact. See hallucination. The steps make errors easier to find. They do not remove them. You still have to read.

Treating the steps as a window into the AI's mind. The written reasoning is more text the model produced. It is not a recording of what happened inside it. A 2023 study by researchers at New York University and Anthropic found that models sometimes reach an answer for one reason and write down a different, more respectable-sounding reason. In 2025, Anthropic tested this on reasoning models by slipping hints into questions. The models used the hints, but their written reasoning admitted it in well under half of cases. Treat the steps as work to be checked, not as a confession.

Asking for steps and brevity in the same breath. "Think step by step, but answer in one word" cancels itself out. If the model has no room to write, it has no room to think. If you want a short final answer, ask for the full working first and a one-line answer at the end.

Using it for everything. Simple facts, quick rewrites, and brainstorming do not need it. It makes replies slower and longer for no gain. Save it for problems where you would reach for pen and paper yourself.

Piling it on top of a model that already reasons. With reasoning models, adding "think step by step" usually changes little. OpenAI's own guidance for its reasoning models says to avoid it, because the model already reasons internally and the extra instruction can even get in the way. With those models, your effort is better spent stating the goal clearly and supplying all the facts.

Expecting reasoning to make up for missing information. If you leave out your costs, the model will invent plausible ones and reason flawlessly from fiction. Good reasoning on bad inputs gives you a wrong answer that looks right. Give it your real numbers.

Confusing it with prompt chaining. They sound alike and are different. Chain of thought is one prompt and one reply, with the steps inside the reply. Prompt chaining is when you split a big job into several separate prompts and feed each result into the next one.

Related elements