Task Planning for LLMs: Decomposing and Orchestrating Multi-Step Complex Tasks
This article explains task planning in large language models. It covers how a complex goal with multiple constraints is broken into ordered subtasks, how planning differs from single tool calls and simple problem decomposition, and where planning is used, including agent scheduling, office automation, workflow design, and embodied AI. It also outlines the main difficulties, such as conflicting constraints, dependencies, error accumulation, and changing environments, and shows how a plan can be represented as a directed acyclic graph.
1. Definition and Scope of Task Planning
Task planning is the ability of a large language model to take a complex goal with multiple constraints, break it into subtasks with ordering relationships, and arrange them into executable steps. The input is usually a goal described in natural language. The output is a structured plan. Each step states what to do, which earlier results it depends on, which resources it needs, and the criteria for deciding it is complete.
Task planning differs from a single tool call. A single tool call answers “Which tool should this step use?” Task planning answers “How many steps does the whole job need, in what order should they run, and which steps can run in parallel?” The two are often used together. The planning module produces a blueprint, and the execution module calls tools step by step and collects the results.
Task planning also differs from problem decomposition. Decomposition produces sub-questions, and the model then combines their answers into a final response. A plan must be executable step by step by a program or a person, and the result of each step affects the steps that follow.
2. Typical Application Scenarios
- Agent scheduling: A master agent assigns a user request to different capability modules, such as retrieval, calculation, and code execution, and coordinates the order in which they run.
- Office automation: For example, “Organize this week’s meeting minutes, generate a to-do list, and create reminders for the owners.” This kind of task spans document, spreadsheet, and calendar systems, and each step passes data to the next.
- Workflow planning: Approval routing, report generation, and data cleaning and loading are business processes. Planning can convert unstructured requirements into a standard process description.
- Embodied AI: When a robot completes a long-horizon task such as “Put the tableware into the cabinet by category,” it must first recognize the objects, then plan the grasping order, then execute the actions segment by segment, and check the result after each step.
3. Core Challenges
- Conflicting constraints. Users often set limits on time, budget, order, and preferences at the same time, and these limits can contradict each other. The planner must first identify the constraints, then decide which ones can be relaxed and which must be met.
- Complex dependencies. Steps can run in series, in parallel, or through conditional branches. A missed dependency can cause a step to read empty data or write the same result more than once.
- Error accumulation. Each step in a long process has some chance of failing, so the overall success rate drops as the number of steps grows. If each step succeeds 95% of the time, the overall success rate after ten steps is about 60%. Removing unnecessary steps and adding checks at key points matters as much as improving the reliability of each step.
- Changing environments. During execution, a file may be missing, an API may return an error, or the external state may have changed. A plan needs room for replanning.
- Unstable output format. Downstream programs need a strictly structured plan, but free-form text is hard to parse directly.
4. Structured Plan Representation
A linear list suits simple processes but cannot express parallel work or branches. A common approach is a directed acyclic graph (DAG), in which nodes are subtasks and edges are dependencies. The following is an illustrative plan structure:
{"goal": "Organize meeting minutes and create to-do reminders","nodes": [{"id": "n1", "tool": "read_document", "inputs": [], "output": "raw_text"},{"id": "n2", "tool": "extract_todos", "inputs": ["n1"], "output": "todo_list"},{"id": "n3", "tool": "group_by_owner", "inputs": ["n2"], "output": "grouped_todos"},{"id": "n4", "tool": "create_reminder", "inputs": ["n3"], "output": "reminders"}],"success_criteria": ["Every to-do item has an owner", "Reminder time is not earlier than the current time"]}
Each node has a unique ID, the tool it uses, its input dependencies, and an output name. The inputs field defines the edges in the graph, and the output field defines where the data flows. Once the dependencies are set, a topological sort of the graph produces an executable order. Nodes with no dependencies between them can run in parallel. The success_criteria field provides the basis for the final check.
5. Stages of the Planning Workflow
- Goal parsing: Convert the natural-language goal into a structured description, and clarify the deliverable, the scope, and the completion conditions.
- Constraint extraction: Separate hard constraints from soft constraints. Hard constraints must be met, such as deadlines and permission scopes. Soft constraints should be met where possible, such as output style.
- Task decomposition: Work backward from the deliverable to the intermediate outputs, until each node can be completed by one tool or one model call. The granularity should be moderate. If the steps are too coarse, they cannot be executed. If they are too fine, scheduling overhead increases.
- Dependency analysis: Label the input source of each node, build a directed graph, and check for circular dependencies.
- Resource matching: Assign an available tool to each node, and check its permissions and parameters.
