Breaking Tasks into Steps and Prompt Chaining
Why does "write my whole talk" go wrong so often? Srihitha asks an assistant to turn her messy notes into a five-minute talk in one prompt. The result sounds polished, but it skips her best point and adds a statistic that isn't in her notes. One big step hid two mistakes.
This lesson shows a better way: break the task into steps, and chain small prompts together.
Prompt Chaining
Prompt chaining means splitting a task into smaller prompts, where the output of one becomes the input of the next. Each step is simple enough for the model to do well and for you to check.
Clear Steps Inside One Prompt
Sometimes you don't need separate prompts, just clear steps inside one prompt:
Help me decide between two laptops for school.
Step 1: List what matters for a student who writes essays and runs small Python programs.
Step 2: Compare the two laptops below on each point, in a table.
Step 3: Recommend one, in two sentences, and say what would change your mind.
[laptop details pasted here]Numbered steps make the model work through the problem in order, and make it easy for you to see where its reasoning went wrong. Reasoning models do some of this on their own, but explicit steps still help you check the work.
When to Chain
| Chain when... | Example |
|---|---|
| The task has distinct stages | Research, outline, draft, edit |
| Each stage needs checking | Extracting facts before writing about them |
| Different stages need different instructions | A strict extraction step, then a creative writing step |
| You will reuse a stage | The same "extract key points" step for many documents |
Common Mistakes
Passing a bad output to the next step. Check each output before you feed it forward.
Chaining a simple task. A one-line question doesn't need four steps.
Losing the original source along the way. Give the final check step the original notes, not just the latest draft.
Interview Corner
What is prompt chaining?
Splitting a task into a sequence of smaller prompts, where each output becomes the next input. It improves quality and makes each step easier to check and fix.
What is the difference between task decomposition and prompt chaining?
Task decomposition is breaking a problem into steps, which can happen inside one prompt. Prompt chaining runs those steps as separate prompts, passing outputs along.
Practice
Exercise: chain a real task. Pick a task you would normally do in one prompt, such as planning a trip or writing a cover letter. Design a three- or four-step chain, run it, and check each output before the next step. Which step needed fixing, and would you have noticed in a single prompt?
Check your understanding:
- What is prompt chaining?
- Why is the final "check" step useful?
- When is chaining not worth it?
Key Takeaways
Quick reference
| Term | Meaning |
|---|---|
| Task decomposition | Breaking a task into steps |
| Prompt chaining | Running steps as separate prompts, passing outputs along |
| Check step | A final prompt that compares the result with the source |
Was this tutorial helpful?