When should you decompose a complex task into multiple LLM calls versus handling it in a single longer prompt?
Decompose when sub-tasks have distinct success criteria, different output formats, or need intermediate validation; keep single-call when coupling is high or latency is tight.
Imagine baking and decorating a cake. If you do everything in one shot and the icing turns out lumpy, you cannot tell whether the batter was wrong or the icing recipe was wrong. If you bake the cake, taste it, and only then start the icing, you can fix each stage on its own. LLM calls work the same way. Splitting a complex task into a few focused calls lets you see and fix each step. But if every step depends on the last one and you are in a hurry, one big call is faster, even if it is harder to debug.
Detailed answer & concept explanation~5 min readEverything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
3 min: three triggers to decompose + three triggers to stay single + the latency vs observability tradeoff + where production teams actually land.
Real products, models, and research that use this idea.
- LangGraph stitches multi-call pipelines for Claude Opus 4.7 and GPT-5.5 with per-stage eval hooks, and teams use it precisely where stages need their own success criteria.
- OpenAI Assistants exposes a planner, executor, validator pattern that formalizes decomposition for agentic workloads, with structured tool calls between stages.
- Anthropic's agent recipes show a decomposed retrieve, critique, answer flow for high stakes legal and medical use cases where intermediate validation justifies the round trips.
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you decide between decomposition and a longer single prompt for a RAG with reranker pipeline?
QWhat is the latency cost model for a three-stage pipeline?
Don't say thisRed flags and common mistakes that signal junior thinking. Click to expand.
Red flags and common mistakes that signal junior thinking. Click to expand.
Defaulting to decomposition because it feels modular, ignoring the latency hit, the orchestration overhead, and the cases where tight coupling between sub-tasks makes a single call cleaner.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.
Same topic, related formats. Practice these next.