Agents & Tool Use intermediate 8 min read 5 flashcards

Planning and Task Decomposition in Agents

Why an LLM that reasons well step by step still fails to produce a valid multi-step plan, and how decomposition, external planners, and replanning close the gap.

Ask a frontier model to move three blocks into a stack and it will usually get it right. Ask for a twenty-block rearrangement with a precondition on every move and the plan will look fluent, cite the right block names, and be invalid. Kambhampati's group built PlanBench precisely to separate these two cases, using Blocksworld and its obfuscated twin so that a model cannot succeed by recalling a plan it saw in training (Valmeekam et al., 2023, PlanBench, arXiv:2206.10498). Their finding has held up through several model generations: performance on plan generation falls far short of what fluency suggests, and it degrades sharply as plan length grows.

This is the single most important asymmetry in agent design. Models are strong at proposing the next action and weak at guaranteeing that a sequence of actions is coherent.

Three places the plan can live

In the context, implicitly. ReAct interleaves a thought, an action, and an observation, and the "plan" is only ever the next step (Yao et al., 2022, arXiv:2210.03629). This is robust to surprise because there is no committed plan to invalidate, and weak on tasks where an early choice forecloses a later one.

In the context, explicitly. Plan-and-Solve and its descendants ask the model to emit a full plan first, then execute it step by step (Wang et al., ACL 2023, arXiv:2305.04091). The plan becomes a durable artefact that survives context compaction and can be checked before any side effect happens. The cost is brittleness: a plan written before the first observation is a plan written in ignorance.

Outside the model. LLM+P translates the natural-language task into PDDL, hands it to a classical planner that is complete and sound, and translates the returned plan back (Liu et al., 2023, arXiv:2304.11477). The planner cannot hallucinate an illegal move. The translation step can, and the approach only applies where the domain is formalisable.

Decomposition is a context-engineering decision

Splitting a task into subtasks is usually described as a reasoning technique. In production it is mostly a memory technique. A subtask executed by a subagent gets a fresh window, so the tokens it burns exploring dead ends never pollute the parent's context. What returns is a summary, not a transcript. The parent's context grows with the number of subtasks rather than with the total work done.

This is why the orchestrator-worker pattern beats a single long loop on research-style tasks, and why it loses on tasks with tight coupling between steps: the summary is a lossy channel, and anything the worker learned but did not write down is gone.

Replanning, and the trigger problem

Static plans die on contact with the environment. The useful question is not whether to replan but what fires it. Three triggers appear in real systems:

  • an action's observation contradicts a precondition the plan assumed
  • a step fails twice with the same error, which is the signal that retrying is not the fix
  • a budget threshold is crossed, whether tokens, wall-clock, or dollars

Without an explicit trigger, agents replan on every step (expensive, and unstable because the plan churns) or never (they loop). Reflexion added a verbal self-critique written into episodic memory between attempts, which is a replanning trigger plus a place to keep the lesson (Shinn et al., NeurIPS 2023, arXiv:2303.11366).

When it breaks

Plans are graded on fluency, not validity. An LLM judge scoring plan quality will reward a plan that reads well. Only an executor or a formal validator can tell you the plan is executable, and most teams discover this after shipping.

Decomposition hides dependencies. Two subtasks written as independent are often not, and the failure surfaces as a merge conflict in the parent's synthesis step, long after the cheap place to catch it.

Longer plans fail super-linearly. If each step succeeds independently with probability \(p\), a \(k\)-step plan succeeds with \(p^k\). At \(p = 0.95\), twenty steps gives 0.36. Agents that look reliable in a five-step demo are not reliable at thirty steps, and no amount of prompt tuning changes the exponent. See long-horizon agent reliability for what does.

Check yourself

5 flashcards for this concept

Click a card to reveal the answer.

Drill the whole track