Designing prompts · Lesson 4 of 8
Prompt decomposition
Break big, tangled requests into smaller sub-tasks the model can do well — and learn how to spot when a prompt is trying to do too much.
You're learning as a guest — everything is open. Sign in to save progress, earn XP and pick up where you left off.
The "do everything" prompt
Here's a prompt many people write once they're comfortable with AI:
"Read these 40 customer reviews, figure out the main complaints, rank them by severity, write a report for leadership, suggest product fixes, and draft a reply to the three angriest customers."
That's at least five different jobs: extraction, classification, prioritisation, executive writing, product thinking and customer-service writing. Each needs a different kind of attention and output format. Crammed into one prompt, the model tends to do all of them a bit: shallow categories, generic fixes, and replies that don't quite match the reviews.
Prompt decomposition is the skill of splitting a complex task into smaller sub-tasks, each with a clear input, a clear output, and a clear definition of "done".
Signs a prompt needs decomposing
- It contains several verbs that each describe a different deliverable ("analyse… and write… and suggest… and draft…").
- Different parts need different audiences or tones.
- Later parts depend on the results of earlier parts.
- When the output is bad, you can't tell which part went wrong.
- You'd assign the parts to different people if a human team were doing it.
How to decompose
- Write down the final deliverable. What exactly do you need at the end?
- Work backwards. What has to exist before you can produce it? And before that?
- Define each sub-task's output. Make it concrete — a list, a table, a JSON object — so it can feed the next step.
- Find dependencies. Which steps need others' results? Which are independent?
- Decide how to run it. Sequentially in one conversation, as separate prompts (chaining), or with some steps done by code instead of a model.
Analyse these reviews, find the main problems, rank them, write a leadership report, suggest fixes, and reply to the angriest customers.
Step 1 of 4 — Extraction only. For each review in <reviews>, output one JSON object per line: {"review_id": ..., "complaints": ["short phrase", ...], "severity": 1-5, "angry": true/false} Severity guide: 5 = safety issue or data loss, 3 = broken feature, 1 = minor annoyance. Do not summarise or recommend anything yet. <reviews> ... </reviews>
Step 1 now has one job and a precise output. Step 2 might group complaints into themes and count them — or your code could do the counting. Step 3 writes the leadership report from the grouped data. Step 4 drafts replies using the original review text for each "angry" customer.
Tip: Some sub-tasks don't need a model at all. Counting, sorting, deduplicating and filtering are often better done in a spreadsheet or a few lines of code — cheaper, faster and exact.
Decomposition inside a single prompt
You don't always need multiple calls. For moderate tasks, you can decompose within one prompt by listing explicit stages and asking for each stage's output under its own heading:
I'm choosing a laptop for video editing on a $1,500 budget. Work through this in stages and label each one: 1. Requirements: list the specs that matter most for video editing and why. 2. Shortlist criteria: turn those into minimum thresholds. 3. Trade-offs: what I'd give up at this budget, ranked by impact. 4. Recommendation: what to prioritise when I compare models in shops. Don't name specific models or prices — I'll check current listings myself.
This keeps the benefits of decomposition — focused stages, visible intermediate results — without the overhead of a pipeline. If one stage turns out weak, you can ask a follow-up about just that stage.
Choosing the right grain size
Too coarse and you're back to the "do everything" prompt. Too fine and you create lots of calls, more cost and latency, and more hand-offs where context can be lost. A practical rule: split where the output type, audience, or required skill changes, and where you'd want to inspect or test the result independently.
Decomposition and context
Each sub-task should get the context it needs and not much more. The reply-drafting step needs the specific review and your tone guidelines, not all 40 reviews. Trimming irrelevant context makes each step more focused and cheaper. But don't trim things a step truly needs — a common failure is a later step that lost a key constraint from the original request.
Note: Decomposition is the design step. The next lessons cover how to run decomposed tasks: multi-step workflows and prompt chaining.
Common mistakes
Mistake: Splitting a task into steps but leaving each step's output vague.
Fix: Specify a concrete format (list, table, JSON) for every intermediate output.
Mistake: Over-decomposing a simple task into many tiny calls.
Fix: Split only where the task genuinely changes; use labelled stages in one prompt for moderate tasks.
Mistake: Dropping a key constraint from the original request when writing later steps.
Fix: List the global constraints once and check each step's prompt includes the ones it needs.
Practice exercise
Decompose a job-application request
The starter prompt asks for too much at once. Break it into 3–5 sub-tasks. For each, write: (a) what it takes as input, (b) its exact output format, and (c) the prompt for step 1 in full.
Your draft stays in this browser tab — it isn't sent anywhere.Try your draft in the Playground
Hints
You can do the whole exercise as a guest.Sign in to save progress
Knowledge check