TL;DR
This paper argues that current approaches to planning with Large Language Models (LLMs) sacrifice soundness, completeness, and efficiency for the sake of using LLMs at every step. The authors propose a novel method, "Thought of Search," where LLMs are used to generate the code for search components (like successor functions and goal tests), which are then executed efficiently without further LLM calls. This approach achieves 100% accuracy on several benchmarks with significantly fewer LLM interactions, advocating for a more responsible and efficient use of LLMs in AI planning.
What Problem Does This Paper Address?
The paper tackles a critical issue in the rapidly evolving field of AI planning, specifically concerning the use of Large Language Models (LLMs). While LLMs have shown impressive capabilities in natural language tasks, their application to complex problems like planning has led to a trend where existing methods often abandon fundamental algorithmic properties such as soundness (guaranteeing valid solutions) and completeness (guaranteeing a solution if one exists) in favor of what the authors term "inefficiency." This often manifests as making expensive LLM calls for every step of the planning process, leading to prohibitive computational costs, environmental impact, and a lack of guaranteed correctness. The authors aim to bridge this gap by demonstrating a way to leverage LLMs for planning that upholds these crucial properties while drastically improving efficiency.
Methods
The core of the proposed method, "Thought of Search," lies in a paradigm shift: instead of using LLMs during the search process for every decision, the authors propose using LLMs to generate the code for the search components themselves. Specifically, they focus on generating Python implementations for two key components:
- Successor Generator: This function defines how to transition from one state to the next.
- Goal Test: This function determines if a given state satisfies the desired goal.
The LLM is prompted with a textual description of the planning problem and asked to produce Python code for these components. This generated code is then used by standard, efficient search algorithms (like Breadth-First Search or Depth-First Search) to solve the planning problem. The authors emphasize that this approach allows for the search algorithm's inherent soundness and completeness guarantees to be maintained, as the LLM's role is limited to code generation and validation, not runtime decision-making.
Datasets
The paper evaluates their proposed approach on four representative search problems:
- 24 Game: A mathematical puzzle where the goal is to reach 24 using four integers and basic arithmetic operations.
- Mini Crosswords: A 5x5 crossword puzzle dataset.
- Blocks World: A classic AI planning domain involving manipulating blocks to achieve a goal configuration.
- ProntoQA: A dataset for logical reasoning and question answering.
The authors do not introduce new datasets but rather use existing benchmarks from prior work in LLM-based planning to demonstrate the effectiveness of their approach in comparison.
Key Insights and Ideas
- LLMs as Code Generators, Not Planners: The most significant insight is the reframing of LLMs' role in planning. Instead of treating them as black-box planners that make decisions at each step, the paper positions them as powerful tools for generating reliable, executable code for planning components.
- Efficiency Through Separation: By separating the LLM's code generation task from the actual search execution, the authors achieve substantial efficiency gains. The computationally expensive LLM is called only a few times to generate the code, while the subsequent search is performed by efficient, traditional algorithms.
- Restoring Soundness and Completeness: The paper highlights how current LLM-based planning methods often compromise soundness and completeness. Their approach, by generating verifiable code, allows these fundamental properties to be preserved.
- Responsible AI Use: The authors advocate for a more responsible use of computational resources, arguing that inefficient LLM usage is not only costly but also environmentally detrimental.
Key Results
The paper demonstrates the effectiveness of their "Thought of Search" approach across several benchmarks:
- 100% Accuracy: On all four tested datasets (24 Game, Mini Crosswords, Blocks World, ProntoQA), their method achieved 100% accuracy in solving the problems.
- Significantly Fewer LLM Calls: Compared to existing LLM-based planning methods that might make hundreds or thousands of LLM calls per problem, their approach requires only a few calls to generate the necessary code. For instance, in the 24 Game, they achieved 100% accuracy with an average of 1.2 interactions for the successor function and 1 for the goal test, whereas a prior method reported ~100 calls for a 75% success rate.
- Efficiency Gains: The total time to solve problems was significantly reduced, often comparable to a single LLM evaluation, showcasing the efficiency of executing generated Python code.
Limitations and Future Work
- Human Feedback for Code Validation: Currently, the proposed approach assumes that the generated code is validated by a human capable of understanding and checking it. Automating this validation process is a key area for future work.
- Search Guidance and Pruning: The authors suggest exploring the use of LLMs to generate code for search guidance or pruning techniques, further enhancing the efficiency of the search process.
- Heuristic Function Generation: While the paper focuses on successor functions and goal tests, future work could extend to LLM-generated heuristic functions for more complex search problems.
Summary updated