Skip to content

1.5 Decomposition Techniques for Complex Problems

Decomposition splits one task into subtasks. Each subtask gets its own model pass. A pipeline chains those subtasks as stages. Decompose a task that is too large, too varied, or too important to trust to one pass.

This lesson uses one made-up example throughout: a car body shop. The shop wants an estimate for each repair job, based on the job’s file of notes and damage photos. It also wants a monthly check of all its files.

Fixed decomposition happens at design time: the architect splits the task into known stages and builds a pipeline. The stages are known, so the pipeline is predictable and you can test it stage by stage. Fixed decomposition suits structured, repeatable work, such as processing documents, review pipelines and generating reports. Its workflow pattern is prompt chaining.

Dynamic decomposition happens at run time: the model discovers the task’s structure as it works. The model generates subtasks from its findings. Dynamic decomposition suits open-ended work whose structure appears during the work: investigation, research, exploratory analysis. Its workflow pattern is orchestrator-workers (objective 1.4).

The test is this: can you write the steps in advance? If yes, fix the steps in code, and you gain predictability. If no, let the model decompose the task. You gain adaptability, but you lose predictability. The shop’s estimate passes this test. A question about why repaired cars keep returning fails the test, because each finding decides the next step.

The real design decision is how to split the task. That decision determines the workflow pattern.

  • By stage : sequential phases with clear hand-offs, such as extract, analyse, draft, review. Use this axis when later work depends on earlier output. The estimate splits this way, because pricing needs the damage list first.
  • By section : independent units that are processed in parallel, such as one unit per document, per file or per region. Use this axis when units do not interact. The monthly check splits by job file.
  • By perspective : the same input analysed from different viewpoints (security review plus performance review), or analysed repeatedly, with voting for confidence. Use this axis when one viewpoint systematically misses what another catches.
  • By specialism : subtasks that need different tools, prompts or models. Use this axis when one configuration cannot serve all subtasks well.

Attention dilution happens when one pass covers too much material. The depth of the pass becomes inconsistent. It gives detailed findings on some items and makes obvious misses on others. It gives contradictory judgements on identical patterns in different places. Consider a code review of fourteen files that is thorough on three files and misses everything in five files. That review has a decomposition problem, not a model capability problem. The shop’s single monthly pass might flag a cracked bracket on one job and miss it on another.

The fix is structural, and it has two mandatory parts. Neither part is enough alone.

  1. Per-unit local passes : the model analyses each file, section or document alone. Every unit gets a full pass, so depth is consistent on every unit. Each job file gets its own pass. Without the integration pass, these local passes miss everything between units.
  2. A separate integration pass : this pass searches for the cross-unit issues (data flow between files, rules that span contract sections). Local passes cannot see these issues by design, because each one sees only its own unit. For the shop, such an issue is one part billed on two jobs for the same car. Without local passes, a single integrated pass dilutes again.

Between stages, intermediate outputs should be structured against a defined schema, not free prose. A schema has three effects.

  • you can test each stage independently, because you can check its output against the schema
  • downstream stages stop re-interpreting prose
  • attribution (source locations, clause references) passes through the pipeline as fields, such as the photo reference on each of the shop’s damage records

Add acceptance gates between stages: programmatic checks that stop bad intermediate output from spreading. Unchecked errors grow worse across stages. One hallucinated field in stage two becomes a confident conclusion in stage five. The shop’s gate checks in code that every part number exists before pricing starts.

Every split adds latency, cost and an interface to maintain. Errors also propagate across stage boundaries. Decompose a task when one of these conditions is true:

  • quality measurably improves
  • the task cannot fit one context
  • stages need independent verification

A task that fits comfortably in one call and shows no symptoms of dilution should stay in one call. An example is the shop’s estimate for one scratched door. A five-stage pipeline for that task is pure overhead.

The Professional exam tests decomposition as a design skill with named failure modes. The exam tests attention dilution most heavily. The exam scores a five-stage pipeline for a one-call task as over-engineering.

A compliance team must check 400-page loan agreements against 60 policy rules. A single-prompt approach misses violations inconsistently — some sections are analysed thoroughly, others barely. What should the architect design?

  • A. Fine-tune a model on past violation examples so it learns the policy rules and applies them without needing the rule text in the prompt
  • B. Run the single prompt three times over the full agreement and keep only the violations flagged in at least two of the three runs
  • C. Switch to a model with a context window large enough to hold the whole agreement in one pass, so no section is dropped from the analysis and every rule sees the full document
  • D. Chunk the agreement by section, check each section against the rules in parallel, then run a cross-section integration pass, with structured violation records throughout
Answer & explanation

Correct: D

  • A — Expensive and slow, and the fine-tuned model still dilutes attention across 400-page inputs. The failure is structural, so the fix must be structural.
  • B — Voting adds confidence to what the passes find, but consistently-missed violations stay missed in every run. It does not fix the systematic depth problem.
  • C — The problem was never that the material did not fit. The problem was inconsistent depth. One pass over 400 pages dilutes attention regardless of window size.
  • D — Sectioning fixes attention dilution, the integration pass catches rules spanning sections, and structured records keep findings testable and attributable end to end.