What You Need to Know
Task decomposition breaks complex work into pieces an agentic system can handle. A fixed sequential pipeline, also called prompt chaining, runs predetermined steps in order. Dynamic adaptive decomposition generates subtasks from what each step discovers. The wrong pattern makes the work suffer in predictable ways. Attention dilution is a failure mode that shows up when decomposition is too shallow.
A jeweller's agent has two jobs. It checks 40 new product listings before they go live, and finds out why the website's stock count keeps disagreeing with the shop's.
Fixed Sequential Pipelines (Prompt Chaining)
In a fixed pipeline, each step takes the previous step's output as input. The sequence does not change based on intermediate results.
Prompt chaining can break a code review into three sequential steps.
- A local analysis pass on each file individually (style, bugs, complexity).
- After all local passes, a cross-file integration pass (data flow, API consistency, import chains).
- A step that compiles the results into one review report.
The jeweller's listing check has the same shape: check each listing, check the listings against each other, write one report.
Fixed pipelines suit predictable, structured tasks with known steps: code reviews, document processing, data extraction pipelines and compliance checks. The same input always follows the same path. That gives three advantages.
- Consistent, reliable results.
- Easy debugging, because you know which step produced which output.
- Easy monitoring, because you can log the output of each step.
A fixed pipeline cannot adapt to unexpected findings. If the jeweller's Step 2 finds half the batch using the wrong size chart, Step 3 cannot change.
Key Concept
Prompt chaining suits predictable, structured tasks. It is consistent and reliable and cannot adapt to unexpected findings.
Dynamic Adaptive Decomposition
With dynamic decomposition, the plan evolves as the agent learns. The agent starts with a high-level goal, investigates and plans from what it finds. New information may change the remaining steps, and the agent adapts.
The stock mismatch needs this pattern. Nobody knows the cause at the start, so nobody can write the steps in advance. If the agent finds repairs logged as sales, its next steps follow that lead.
Adding tests to a legacy codebase runs the same way.
- Map the codebase structure (directories, modules, dependencies).
- Identify high-impact areas (most-used modules, modules with the most bugs, untested critical paths).
- Write a prioritised test plan from the map.
- Start writing tests, and discover that Module A depends on Module B, which has no tests.
- Reprioritise: test Module B first so Module A's tests can rely on it.
- Keep adapting as new dependencies and issues emerge.
This pattern suits open-ended investigation where the full scope is unknown at the start: legacy system exploration, security audits, research projects and debugging unfamiliar codebases. It responds to unexpected complexity and gives more thorough results on open-ended tasks, because it does not force-fit a predetermined plan. It is less predictable: execution time varies with discoveries, so completion time and resource usage are harder to estimate, and debugging is harder.
Choosing a Pattern
Match the pattern to the task's characteristics. The jeweller's listing check has known steps: fixed pipeline. The stock mismatch has unknown scope: dynamic decomposition.
| Task Characteristics | Pattern | Reasoning |
|---|---|---|
| Steps known in advance, structured input | Fixed pipeline | Consistency and reliability outweigh adaptability |
| Open-ended, unknown scope | Dynamic decomposition | Adaptability is essential when the problem is not fully defined |
| Multi-file code review | Fixed pipeline | Per-file analysis + cross-file integration is predictable |
| Legacy codebase exploration | Dynamic decomposition | Dependencies and issues emerge during investigation |
| Document extraction | Fixed pipeline | Fields and format are predetermined |
| Debugging an unfamiliar system | Dynamic decomposition | Root cause is unknown; investigation must adapt |
The Attention Dilution Problem
Attention dilution occurs when an agent processes too many items in a single pass. Depth becomes inconsistent: some items get thorough analysis, and others have obvious issues missed. The model allocates attention across all the items in its context, so each item gets less as the count grows. Early items get a disproportionate share, and later items get skimmed. Three symptoms show up.
- Detailed feedback on the first few items, and increasingly shallow analysis on later ones.
- A pattern flagged as a problem in one item while identical content is approved in another.
- Obvious bugs or errors missed in some items while minor style issues are caught in others.
Send the jeweller's 40 listings in one pass, and listing 3 is flagged for a missing hallmark while listing 31, with the same gap, passes. A wrong price in listing 35 goes unnoticed.
The Fix: Multi-Pass Architecture
The fix is structural. A better model, a larger context window or a more detailed prompt still leaves every item in one pass. Multi-pass architecture splits the work into two layers. Per-item local analysis passes give each file, document or module its own pass, with the full attention budget on that item. After all local passes, a cross-item integration pass looks for cross-cutting concerns: data flow issues, inconsistent pattern usage and cross-file dependencies.
The per-item passes catch local issues consistently, because each item gets dedicated attention. The integration pass catches cross-item issues, because it focuses on the relationships between items instead of doing everything at once.
With 40 single-listing passes and one integration pass, listing 35's wrong price is caught in its own pass. The integration pass finds the hallmark gap judged two ways.
In the exam
Exam Trap
A question may offer a fixed pipeline for an open-ended investigation task, or dynamic decomposition for a structured processing task. Match the pattern to the task characteristics, not to what sounds more sophisticated.
A version of the exam's sample question: a code review agent processes 14 files in a single pass.
- Files 1-5: detailed feedback with specific line references, bug identification and improvement suggestions.
- Files 6-9: moderate feedback with some issues identified but less thorough analysis.
- Files 10-14: superficial feedback that misses obvious null pointer bugs and SQL injection vulnerabilities.
- A
forEachloop flagged as inefficient in File 3, while identical code in File 11 receives no comment.
Large code reviews are split into per-file local analysis passes plus a separate cross-file integration pass to avoid attention dilution. Here the keyed fix is 14 per-file passes and one integration pass checking data flow and pattern consistency across all files. The per-file passes catch the null pointer bugs in Files 10-14, because each file gets its own pass. The integration pass identifies the inconsistent forEach evaluation, because it checks cross-file pattern consistency.
Exam Traps
Suggesting a more powerful model, a larger context window or a more detailed prompt as the fix for attention dilution
Attention dilution comes from too many items in one pass. A better model, a larger context window or a more detailed prompt still leaves every item in one pass. Give each item its own local pass, then run a cross-item integration pass.
Choosing dynamic adaptive decomposition for a structured task whose steps are known in advance
An adaptive plan makes the runtime and output depend on what each step turns up, so it is less predictable and harder to debug. When the steps are known in advance, a fixed pipeline gives consistent, reliable results.
Applying fixed pipelines to open-ended investigation tasks
Open-ended tasks require adaptability. Fixed pipelines cannot respond to unexpected findings. Dynamic adaptive decomposition is the correct pattern when the full scope is unknown at the start.
Batching files into groups without adding a cross-file integration pass
Batching reduces attention dilution within each batch but misses cross-batch issues. Without a dedicated cross-file integration pass, data flow issues and pattern inconsistencies across batches go undetected.
Practice Scenario
A code review agent processes 14 files and produces detailed feedback for the first 5 files but misses obvious bugs in files 10-14. It also flags a pattern as problematic in one file while approving identical code in another. What is the root cause and solution?
Build Exercise
Build a Multi-Pass Code Review Pipeline
What you'll learn
- Why attention dilution produces inconsistent analysis depth across files in single-pass reviews
- How multi-pass architecture (per-item + cross-item) solves the structural attention allocation problem
- The difference between fixed sequential pipelines and dynamic adaptive decomposition
- Why batching without a cross-file integration pass still misses cross-cutting issues
- How to identify attention dilution artefacts: same pattern flagged in one file, approved in another
- Create a code review agent that accepts a directory path containing at least 10 source files
Why: The 10+ file threshold is where attention dilution becomes observable. The exam uses a 14-file example where detailed feedback for early files degrades to superficial analysis for later files. Your setup must replicate this scale.
You should see: A code review function that reads all files in a directory and prepares them for analysis. It should handle at least 10 TypeScript or JavaScript source files.
- Implement a single-pass review that processes all files at once and record the results
Why: The single-pass approach is the baseline that demonstrates attention dilution. The exam expects you to recognise the symptoms: thorough analysis for early files, shallow analysis for later files, and contradictory pattern evaluation.
You should see: A review result where early files receive detailed feedback with specific line references and bug identification, while later files receive increasingly brief or missing feedback. This is the attention dilution pattern.
- Implement per-file local analysis passes that produce structured feedback for each file individually (bug count, severity, specific line references)
Why: Per-file passes give each file the full attention budget. This is the first layer of multi-pass architecture. The exam contrasts this with single-pass to show that structural decomposition solves attention dilution, not better prompts or larger context windows.
You should see: Consistent analysis depth across all files. The last file receives the same level of detail as the first. Each review includes bug count, severity ratings, and specific line references in a structured format.
- Implement a cross-file integration pass that checks for data flow issues, API consistency, and pattern usage consistency across all files
Why: Per-file passes catch local issues but miss cross-cutting concerns. The exam tests whether you include a cross-file integration pass — batching without it still misses data flow issues and pattern inconsistencies across files.
You should see: A separate analysis that takes the per-file summaries and checks for cross-file issues: inconsistent API usage, data flow problems between modules, and patterns used differently across files.
- Compare results: document which issues the single-pass review caught versus the multi-pass approach, paying special attention to consistency of analysis depth across all files
Why: This comparison demonstrates the exam argument quantitatively. Attention dilution is not a model capability problem — it is an architectural problem. The same model produces better results with multi-pass architecture, proving the fix is structural.
You should see: A comparison table showing: more total issues found by multi-pass, consistent issue counts across files (no drop-off for later files), and cross-file issues caught only by the integration pass.
- Record any cases where the single-pass review flagged a pattern in one file but approved identical code in another — these are attention dilution artefacts
Why: Contradictory pattern evaluation is the clearest symptom of attention dilution. The exam uses the forEach example: flagged as inefficient in File 3, approved without comment in File 11. Documenting these artefacts proves the structural nature of the problem.
You should see: At least one case where the single-pass review treated identical code patterns differently across files. The multi-pass review should treat the same pattern consistently.
Sources
- Claude Agent SDK Overview — Anthropic
- Claude Code in Action (Skilljar) — Anthropic
- Anthropic Prompt Engineering Guide — Anthropic
- CCAR-F Exam Guide v1.0: Task Statement 1.6 — Anthropic