Find a course

Module 3: Core Prompting TechniquesLesson 7 of 1212 min

Step-by-Step Reasoning and Prompt Chaining

See why asking a model to reason in steps improves multi-step answers, and how splitting big tasks into a chain of smaller prompts gives you more control.

Step 1 of 14Learn

The bat, the ball and the quick answer

A bat and a ball cost $1.10 together. The bat costs $1.00 more than the ball. How much is the ball?

Many people answer 10 cents instantly. It's wrong: if the ball were $0.10, the bat would be $1.10 and the total $1.20. The ball costs 5 cents, and the bat $1.05.

Language models can fall into the same trap, for a similar reason. A model generates its answer token by token. If the very first token it writes is the final answer, it has had no chance to "work it out"; it has only its first impression.

Researchers found a simple fix: ask the model to reason step by step before answering. This is called chain-of-thought prompting. When the model writes out intermediate steps (set the ball as x, so the bat is x + 1.00, so 2x + 1.00 = 1.10...), each step becomes part of the text it conditions on, and the final answer is built on those steps rather than on a guess.

Many newer models are trained to reason internally before replying, sometimes called "thinking" or "reasoning" modes, which reduces the need to ask. But for multi-step problems in any model, prompting for visible steps still helps, and it lets you inspect the logic and spot where it went wrong.

Step 2 of 14Practice · Work it out

Try the classic puzzle with a twist: a notebook and a pen cost $2.40 together. The notebook costs $2.00 more than the pen. How much does the pen cost, in dollars?

Step 3 of 14Learn

How to ask for reasoning

There are several ways to prompt for better reasoning, from light to structured.

Simple nudge. Add "Think through this step by step before giving your final answer." This alone often improves results on math, logic and planning problems.

Specify the steps. For recurring tasks, tell the model which steps to follow: "First, list the facts given. Second, identify what is being asked. Third, work out the answer. Fourth, check the answer against the facts." Spelling out the process makes the reasoning consistent and easier to check.

Separate reasoning from the answer. If you need a clean final output, ask for the reasoning in one section and the answer in another: "Put your working inside <thinking> tags, then give only the final recommendation inside <answer> tags." You can then read or discard the working.

Ask for a self-check. "After answering, check your result against the original constraints and fix any problems." Models catch a fair share of their own errors when explicitly asked to review.

When not to bother: simple lookups, short rewrites and creative brainstorming gain little from step-by-step reasoning, and it makes answers longer and slower. Save it for problems with several dependent steps: calculations, comparisons with many criteria, planning, and debugging.

Step 4 of 14Practice · Diagram

Spelling out the steps

The "specify the steps" method from above, as a reusable routine.

Which step would catch the "10 cents" answer to the bat-and-ball puzzle?

Tap the shape that answers the question, then press Check.

Spelling out the stepsProcess diagram: List the facts given → Identify what is asked → Work out the answer → Check against the facts.List the factsgivenIdentify whatis askedWork out theanswerCheckagainst thefacts
List the facts given
Identify what is asked
Work out the answer
Check against the facts

Plug the answer back in: do all the original conditions still hold?

Step 5 of 14Practice · Sort into groups

Would a step-by-step reasoning instruction likely help with each task?

Tap an item, then tap its group (or drag it there).

Step 6 of 14Learn

Prompt chaining: one big task, several small prompts

Some tasks are too big or too varied for one prompt to handle well. "Read these 40 customer interviews, find the main themes, pick the top three problems, propose solutions and write a report for the CEO" asks for at least four different skills at once. Quality drops at every step, and when the report is weak you can't tell which step failed.

Prompt chaining splits the work into a sequence, where each prompt's output becomes the next prompt's input:

  1. For each interview: "Extract every complaint as a one-line bullet."
  2. "Group these complaints into themes and count how often each appears."
  3. "For the three most frequent themes, suggest two possible solutions each."
  4. "Write a one-page report for the CEO using these themes and solutions."

Benefits:

  • Each step is simpler, so each is done better.
  • You can check and fix intermediate results before they flow downstream.
  • You can reuse steps, for example running step 1 on next month's interviews.
  • Errors are easier to locate: if the themes look wrong, you know which prompt to improve.

Chaining is also how many AI-powered products work behind the scenes, with software passing outputs from one prompt to the next automatically.

Step 7 of 14Practice · Diagram

The interview report as a chain

The final report focuses on minor issues. Which link would you inspect first?

Tap the shape that answers the question, then press Check.

The interview report as a chainProcess diagram: Extract problems per interview → Group into themes → Rank the top three → Propose solutions → Write the CEO report.Extract problems perinterviewGroup into themesRank the top threePropose solutionsWrite the CEO report
Extract problems per interview
Group into themes
Rank the top three

By how many customers raised each and how severe it was.

Propose solutions
Write the CEO report

Step 8 of 14Compare

One big prompt vs. a chain

AspectOne big promptPrompt chain
Focus per stepSplit across many jobsOne job at a time
Finding a failureHard: everything is mixedEasy: inspect each output
Your controlOnly at the endCorrect between steps
EffortOne messageSeveral messages

Step 9 of 14Practice · Put in order

Put this prompt chain for turning a messy meeting transcript into an action-item email into a sensible order.

Drag the items, or use the arrow buttons, to put them in order.

  1. Extract every decision and action item from the transcript as bullets
  2. Check the list against the transcript for anything missed or invented
  3. Assign an owner and due date to each action item, flagging any that are missing
  4. Draft a short email to attendees summarizing decisions and action items

Step 10 of 14Note

Step 11 of 14Note

Step 12 of 14Practice · True or false

Prompt chaining makes it easier to find which part of a complex task is going wrong.

Step 13 of 14Practice · Choose one

A model keeps making arithmetic errors when comparing the total cost of three car loans. Which prompt change is most likely to help?

Step 14 of 14Practice · What would you do?

What would you do?

Kai asks one prompt to "research our three competitors from the notes below, compare their pricing, decide which features we should copy, and write a pitch deck outline." The result is shallow everywhere. What should Kai do?