Introduction
In classical AI planning, environments are typically assumed to be deterministic. However, real-world applications—ranging from robotics to network communications—are often nondeterministic, where actions like picking up a block or sending a message can fail or yield unexpected outcomes. Planning in these domains is computationally expensive because agents must account for every possible failure branch.
Hierarchical Task Networks (HTNs) offer a solution by providing a "recipe" or domain-specific roadmap to simplify the search. Yet, hand-coding HTNs is a labor-intensive process prone to error. This paper introduces HTN-MAKER$^{ND}$, the first algorithm designed to automatically learn HTNs for nondeterministic planning domains from execution traces.
Methods: Learning with Recursion
The core innovation of HTN-MAKER$^{ND}$ lies in its ability to handle unpredictable outcomes through a specific structural approach:
- Right-recursive Bottom-Up Learning: Instead of learning rigid sequences, the algorithm constructs methods as either a single primitive action (base case) or an action followed by the task itself (recursive case). This structure inherently builds in "retry" logic; if an action fails, the recursive structure allows the planner to attempt the task again from the new state.
- Step-wise Precondition Identification: Using goal regression, the algorithm identifies the necessary conditions for a task's success. It performs this step-by-step for every observed outcome in the training data, ensuring the learned HTN can navigate different "branches" of the hierarchy based on the current environment state.
The authors prove that this approach is both sound and complete. Furthermore, the algorithm operates in low-order polynomial time relative to the length and number of input traces, making it a practical solution for complex domains.
Evaluation and Results
The researchers evaluated HTN-MAKER$^{ND}$ using the ND-SHOP2 planner against MBP, a state-of-the-art symbolic model checker, across two benchmarks: Robot Navigation and Nondeterministic Blocks World.
Performance and Scalability
In the Robot Navigation domain, where a robot moves packages through rooms with randomly opening/closing doors, the HTN-based approach demonstrated superior scalability.
As shown in Figure 1, while MBP's computation time increased exponentially with the number of packages, ND-SHOP2 maintained near-constant performance, outperforming MBP by up to three orders of magnitude. The learned HTNs effectively pruned the search space, avoiding the millions of dead-end states that a general-purpose model checker must explore.
Learning Efficiency
In the Nondeterministic Blocks World, the system's ability to find solutions improved as it processed more execution traces.
Figure 2 illustrates the learning curve. While simpler problems (3-4 blocks) required very few traces to reach 100% solution coverage, more complex scenarios (8 blocks) required significantly more data to account for the exponential increase in possible nondeterministic states and edge cases.
Conclusion
HTN-MAKER$^{ND}$ represents a significant step forward in automated planning. By leveraging the natural relationship between recursion and nondeterminism, it allows planners to achieve massive speedups over general-purpose model checkers. Future work aims to address current limitations, such as the dependence on trace coverage and the need for automated subgoal ordering, to further enhance the robustness of learned hierarchical knowledge.
Summary updated