Leaders Insights
Leaders Insights

Stay at the top of your field, a little every day.

DomainsMarketingDataFinanceAI
ResourcesLearnTestToolsBlogGlossary
© 2026 Leaders Insights — All rights reserved.
Tracks/AI Essentials/Prompt engineering/Advanced prompting patterns/Step-by-step reasoning and chain of thought
1/3+150 XP

Advanced prompting patterns

1Step-by-step reasoning and chain of thought+1502Iteration and refinement: treating the model like a collaborator+1303Common prompting mistakes and how to fix them+130

Step-by-step reasoning and chain of thought

# Step-by-step reasoningStep-by-step reasoningA prompting technique where a language model is guided to produce intermediate reasoning steps before giving a final answer, improving accuracy on complex tasks.View full definition → and chain of thought

A four-word fix

Ask a model this: "A bat and a ball cost $1.10 total. The bat costs $1.00 more than the ball. How much is the ball?"

Many models blurt out "$0.10." Wrong. The right answer is $0.05.

Now add four words: "Think step by step." Suddenly the model writes out the math, catches its own trap, and lands on $0.05.

That trick has a name: chain of thought. It means asking the model to show its reasoning before giving the final answer. This lesson covers why it works, how to use it, and why some newer models now do it for you.

Why showing work makes models smarter

A large language model (the AI behind ChatGPT, Claude, and Gemini) generates text one piece at a time, predicting the next word based on everything before it.

large language modelA Large Language Model is an AI system trained on vast text data to predict and generate language, enabling tasks like writing, summarizing, and answering questions.View full definition →

Here's the key insight: the model can only "think" by writing. It has no scratchpad. When you force it to answer immediately, it has to compress all its reasoning into a single leap. That's where it slips.

When you ask it to work through the steps, each written step becomes context for the next one. The model literally builds its own ladder to the answer.

Think of it like mental math versus writing it on paper. Most people get 17 × 23 wrong in their head and right on paper. Same brain, more room to work. The model is no different.

What this helps with

Chain of thought (often shortened to CoTCoTA prompting technique where a language model is guided to produce intermediate reasoning steps before giving a final answer, improving accuracy on complex tasks.View full definition →) boosts accuracy on tasks that need actual reasoning:

  • Math and word problems
  • Logic puzzles and multi-step deductions
  • "If X then Y" planning and scheduling
  • Debugging code or spotting flaws in an argument
  • Anything where the answer depends on intermediate steps

It does not help much with simple lookups ("What's the capital of France?") or pure creativity. For those, it just adds noise and length.

How to actually use it

You don't need anything technical. You're just changing your wording.

The basic phrases

Add one of these to your prompt:

  • "Think step by step."
  • "Work through this carefully before answering."
  • "Show your reasoning, then give the final answer."

Try this in any chatbot:

> A store has 120 apples. They sell 40% in the morning and 25% of the *remaining* apples in the afternoon. How many are left? Think step by step.

The model will lay out: 40% of 120 is 48, leaving 72; 25% of 72 is 18; 72 minus 18 is 54. Clear, checkable, and right.

Give it a worked example (few-shot)

For tricky or repeated tasks, show the model one example of the reasoning you want. This is called few-shot prompting: you provide a few sample answers to set the pattern.

> Q: Tom has 3 boxes with 4 pens each. He gives away 5 pens. How many are left?

> A: 3 boxes × 4 pens = 12 pens. 12 − 5 = 7. Answer: 7.

>

> Q: Sara has 5 bags with 6 marbles each. She loses 8 marbles. How many are left?

> A:

The model copies your style: it shows the multiplication, then the subtraction, then the answer. You've taught it the format without writing any code.

Ask for the answer last

A practical tip: tell the model to reason first and state the final answer at the end, clearly labeled.

> Solve this. Show each step, then write "FINAL ANSWER:" on its own line.

This makes the result easy to find and easy to verify. You can skim the steps to check the logic, then trust the labeled answer.

For a deeper, plain-language explanation of the research behind this, see Google's write-up on chain-of-thought prompting.

Chain of Thought Prompting Explained

Watch on YouTube

The "thinking" models that do it automatically

Here's the 2026 reality: you often don't need to type "think step by step" anymore.

A new category of models, called reasoning models or thinking models, does chain of thought on its own, behind the scenes, before answering. They essentially talk to themselves first, then hand you the polished result.

You'll see these as named modes or model picks:

  • ChatGPT: the "thinking" models in the GPT-5 family (look for a reasoning or "Thinking" toggle)
  • Claude: "extended thinking" mode in the Claude 4 series
  • Gemini: the "Thinking" variants of Gemini 2.5

When you use one of these, the interface usually shows a "Thinking..." indicator or a collapsible summary of the reasoning. The model burned extra effort working through the problem before replying.

When to use a thinking model

Use one when the task is genuinely hard: a logic-heavy problem, a multi-step plan, a tricky piece of code, a careful comparison.

Use a regular (faster) model for everyday tasks: rewriting an email, summarizing a doc, brainstorming names. Thinking models are slower and sometimes overkill.

A simple rule: if you'd want a smart human to pause and work it out, pick the thinking model.

You can still nudge regular models

If you're on a standard, faster model, "think step by step" still earns you most of the benefit. The phrase isn't dead. It's just built into the premium reasoning modes now.

Knowledge check

1. According to the lesson, why does asking a model to reason step by step improve its accuracy on hard problems?

2. The lesson compares chain of thought to a familiar human experience. Which analogy best captures its point?

3. For which task would chain of thought most likely just add noise rather than help?

MULTIPLE CHOICE

4. Select ALL phrases the lesson suggests you can add to a prompt to trigger chain-of-thought reasoning.

Select all the correct answers.

MULTIPLE CHOICE

5. Select ALL tasks the lesson says chain of thought tends to improve.

Select all the correct answers.

Doing it in code

If you use the APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.View full definition → (a way to send prompts to a model from a program), chain of thought is just part of your instructions. Here's a short Python example using a simple request:

python
from openai import OpenAI

client = OpenAI()

prompt = """A train leaves at 2:15 PM and arrives at 4:50 PM.
The return trip takes 20 minutes longer. 
What time does the return trip take in total?
Think step by step, then write FINAL ANSWER: on its own line."""

response = client.chat.completions.create(
    model="gpt-5",
    messages=[{"role": "user", "content": prompt}]
)

print(response.choices[0].message.content)

The model returns the steps (2:15 to 4:50 is 2 hours 35 minutes; plus 20 minutes is 2 hours 55 minutes) and then a clean "FINAL ANSWER:" line you can pull out programmatically.

If you switch to a reasoning model, you often drop the "think step by step" instruction entirely, because the model handles that internally. You just ask the question.

Watch-outs

Chain of thought is powerful, not magic. Keep these in mind.

It can reason confidently and still be wrong. Showing steps makes errors visible, but it doesn't guarantee correctness. Always check the logic on anything that matters.

The visible "reasoning" may not be the real reasoning. The steps a model writes are a useful approximation, not a literal transcript of its internal process. Treat them as a sanity check, not gospel.

More steps cost more. Reasoning models use more time and (on the APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.View full definition →) more money. For trivial questions, that's wasted effort.

Don't force it on creative work. Asking for step-by-step reasoningstep-by-step reasoningA prompting technique where a language model is guided to produce intermediate reasoning steps before giving a final answer, improving accuracy on complex tasks.View full definition → on "write me a poem" usually makes it stiff and mechanical.

A quick before-and-after

Bad prompt:

> Is 2,310 divisible by 6?

The model might guess.

Good prompt:

> Is 2,310 divisible by 6? A number is divisible by 6 if it's divisible by both 2 and 3. Check each, show your work, then answer.

Now the model checks: it ends in 0, so divisible by 2; its digits sum to 6, which is divisible by 3; therefore yes, divisible by 6. Transparent and correct.

You didn't get smarter. You gave the model room to work.

Key Takeaways

  • Add "think step by step" to any reasoning task on a standard model. It turns a single risky guess into a checkable chain of steps and often flips wrong answers to right.
  • Use few-shot examples for repeated or tricky formats: show one worked example, and the model copies your reasoning style.
  • Pick a thinking model (GPT-5 Thinking, Claude extended thinking, Gemini 2.5 Thinking) for genuinely hard problems. They do chain of thought automatically, so you can skip the phrase.
  • Ask for the final answer last, clearly labeled, so you can skim the reasoning to verify it.
  • Always check the logic. Visible reasoning makes errors easier to catch, but it doesn't guarantee the answer is right.

What to do, from this lesson

These actions are compiled in the role's Playbook.

  • Provide two or three consistent worked examples for tricky formats
  • Add "think step by step" and label the final answer last
  • Pick a dedicated thinking model for genuinely hard problems
See the full action playbook →

Next

Iteration and refinement: treating the model like a collaborator