Introduction
Traditional AI planning focuses on finding a sequence of actions for a specific problem instance. In contrast, generalized planning aims to synthesize a strategy or program capable of solving all instances within a given domain. While symbolic approaches have historically struggled with the complexity of such synthesis, recent advancements in Large Language Models (LLMs) offer a new path. This research, presented at AAAI 2024, explores using GPT-4 to generate Python-based generalized planners from PDDL (Planning Domain Definition Language) descriptions.
Methodology: From PDDL to Python
The authors propose a pipeline that treats the LLM as a software engineer, moving beyond simple one-shot task solving. The process involves several key stages:
- PDDL Abbreviation: Domain descriptions and small example tasks are provided to the LLM. To manage context limits, tasks are abbreviated to highlight essential objects and initial states.
- Chain-of-Thought (CoT) Summarization: The LLM first summarizes the domain and proposes a high-level, search-free strategy in natural language.
- Code Synthesis: The LLM implements the proposed strategy as a Python function,
get_plan. - Automated Interactive Debugging: This iterative loop tests the generated code against training tasks. If failures occur, the system provides feedback—ranging from raw Python exceptions and timeouts to semantic errors identified by the VAL tool—allowing the LLM to refine its code.
Evaluation and Key Results
The framework was evaluated across seven PDDL domains, including six standard benchmarks (Delivery, Forest, Gripper, Miconic, Ferry, Spanner) and a novel Heavy domain requiring object sorting.
The results highlight the significant advantages of this approach:
- Performance: GPT-4 achieved near 100% success in 5 out of 7 domains, vastly outperforming GPT-3.5.
- Efficiency: The synthesized Python programs are "search-free," meaning they execute a direct strategy rather than exploring a state space. As shown in the performance metrics, these programs are orders of magnitude faster than classical planners like Fast Downward, particularly as the number of objects in a task increases.
- Data Efficiency: Remarkably, the model often required only two small training examples to generate a program that generalized to much larger, unseen problem instances.
Discussion and Insights
The study reveals that the success of LLMs in generalized planning relies heavily on the semantic meaning of domain predicates. When action names were replaced with nonsense strings, performance dropped sharply, suggesting that GPT-4 leverages its internal "common sense" to intuit planning strategies.
However, limitations remain. The model occasionally struggles with subtle constraints not explicitly stated in the PDDL logic, such as the "one-way" nature of certain paths. Furthermore, while search-free strategies work for many domains, complex puzzles like Sokoban still require traditional search-based methods. Future work may involve hybrid systems where an LLM decides whether to generate a direct script or invoke a classical symbolic planner.
Summary updated