Abstract
Learning to autonomously execute long-horizon procedures from natural language remains a core challenge for intelligent agents. Free-form instructions such as recipes, scientific protocols, or business workflows encode rich procedural knowledge, but their variability and lack of structure cause agents driven by large language models (LLMs) to drift or fail during execution. We introduce Procedure Aware DynaMic Execution (PADME), an agent framework that produces and exploits a graph-based representation of procedures. Unlike prior work that relies on manual graph construction or unstructured reasoning, PADME autonomously transforms procedural text into executable graphs that capture task dependencies, decision points, and reusable subroutines. Central to PADME is a two-phase methodology: a Teach phase, which focuses on systematic structuring and enrichment with executable logic, followed by an Execute phase, which enables dynamic execution in response to real-time inputs and environment feedback. Empirically, PADME achieves state-of-the-art performance on four diverse benchmarks, including ALFWorld and ScienceWorld.
Introduction
While Large Language Models (LLMs) excel at short-term instruction following, they often struggle with "long-horizon" procedures—tasks involving dozens of steps, conditional logic, and environmental feedback. In these scenarios, agents tend to "drift," accumulating small errors that eventually lead to total task failure. Most procedural knowledge exists as unstructured text (SOPs, manuals, recipes), and existing solutions either rely on error-prone unstructured reasoning or unscalable manual flowchart construction. PADME addresses this by automatically transforming free-form text into structured, executable decision graphs.
Methodology
PADME introduces a modular, two-phase methodology designed to provide a strong inductive bias for agent behavior.
1. The Teach Phase (Structuring)
In this phase, an LLM-based agent parses raw text, filters non-actionable content, and segments instructions into a Directed Acyclic Graph (DAG).
- Node Categorization: Steps are typed (e.g., Human Input, InfoProcessing, Decision).
- Logic Enrichment: Nodes are bound to executable code snippets or API calls, ensuring the procedure is grounded in actionable tools.
2. The Execute Phase (Dynamic Traversal)
The execution agent follows the graph in real-time using topological traversal to ensure dependencies are met. When encountering a "Decision" node, the agent pauses to evaluate the environment state and chooses the appropriate path. This separation ensures the agent stays "on the rails" of the predefined procedure while maintaining the flexibility to handle real-world unpredictability.
Evaluation and Results
The framework was evaluated on four diverse benchmarks: Business Process, Recipe, ScienceWorld, and ALFWorld. These benchmarks test a range of complexities, from linear workflows to scientific experiments requiring precise equipment handling.
PADME significantly outperformed standard LLM agent patterns such as ReAct and Chain-of-Thought (CoT) across all metrics. On the Recipe dataset, PADME achieved a Final Match (FM) score of 0.87, nearly tripling the performance of competitors in ambiguous scenarios. Furthermore, PADME demonstrated superior Trajectory Fidelity, maintaining alignment with intended SOPs where baselines often diverged or hallucinated steps.
Conclusion
PADME demonstrates that graph-based procedure representations offer a powerful intermediate abstraction for robust agent-driven automation. By restricting the action space to valid paths within a graph, the framework drastically limits error propagation and allows for human-readable verification of agent logic before deployment. Future work will explore the use of smaller, fine-tuned models for the Teach phase and extending the framework to handle cyclic procedures.
Summary updated