Intermediate10 min

Task Decomposition Strategies

Breaking complex tasks into manageable subtasks using two fundamental strategies: fixed sequential pipelines (prompt chaining) for predictable workflows, and dynamic adaptive decomposition for open-ended tasks. Learn when to use each and how to avoid attention dilution.

Quick Reference

  • Prompt chaining: fixed sequence of focused steps, each with its own prompt and output format
  • Dynamic decomposition: agent adapts its plan as it discovers new information
  • Per-file analysis + cross-file integration pass prevents attention dilution in code reviews
  • Attention dilution: model quality degrades when reviewing 14+ files in a single pass
  • Use prompt chaining when the workflow is predictable and steps are known in advance
  • Use dynamic decomposition when the task is open-ended and next steps depend on intermediate findings
  • Each step in a prompt chain should have a single, clear objective
  • Dynamic decomposition follows: map territory -> identify targets -> prioritize -> execute -> adapt
  • Integration passes catch cross-cutting concerns that per-file passes miss
  • Decomposition granularity matters: too coarse loses detail, too fine wastes tokens on overhead

Two Fundamental Decomposition Strategies

Every complex task needs to be broken into smaller pieces. The question is how. There are two fundamental strategies, and choosing the wrong one is a common source of agent failure.

StrategyHow It WorksBest ForFailure Mode
Prompt Chaining (Fixed Pipeline)A pre-defined sequence of steps, each with its own prompt, executed in orderPredictable workflows where all steps are known in advanceBreaks down when unexpected findings require changing the plan
Dynamic Decomposition (Adaptive)Agent creates an initial plan, executes steps, and adapts the plan based on findingsOpen-ended tasks where next steps depend on intermediate resultsCan wander aimlessly without clear termination criteria
The key distinction

Prompt chaining is decided by YOUR CODE -- you write the pipeline. Dynamic decomposition is decided by THE MODEL -- it creates and adapts its own plan. Prompt chaining is deterministic and predictable. Dynamic decomposition is adaptive and flexible. Neither is universally better; each fits different situations.