Transition Function Prediction in AI Planning Using LLMs

Eliezer Shlomi, Guy Azran, Eilam Shapira, Omer Nahum, Guy Uziel, Michael Katz, Ateret Anaby Tavor, Roi Reichart, Sarah KerenLM4Plan @ AAAI 2024

TL;DR

This paper introduces EmbedPlan, a novel approach that uses Large Language Models (LLMs) to embed states and actions into a latent space, then employs a lightweight neural network to predict state transitions. This significantly reduces the computational cost of LLM-based planning by minimizing direct LLM calls during inference, while maintaining logical consistency and achieving competitive accuracy across various planning domains.

What Problem Does This Paper Address?

Classical AI planning systems rely on precise definitions of states and actions to determine how the environment changes. However, describing these elements in natural language presents a significant challenge. While Large Language Models (LLMs) excel at understanding and generating natural language, directly using them for planning often leads to computationally expensive solutions due to the need for frequent LLM calls to predict state transitions. Existing methods either struggle with the complexity of natural language or are computationally prohibitive. This paper aims to bridge this gap by developing a more efficient and scalable planning approach that leverages LLMs' language understanding capabilities without incurring high inference costs.

Methods

The core of EmbedPlan lies in its three-pronged approach:

  1. LLM Embeddings: States and actions described in natural language are first encoded into dense vector representations (embeddings) using pre-trained LLMs. This captures the semantic and syntactic relationships inherent in the text.
  2. Shallow Neural Network Transition Function: A lightweight neural network is trained to approximate the transition function. This network takes the embeddings of a current state and an action as input and predicts the embedding of the resulting next state. The training objective is to minimize the cosine similarity loss between the predicted and actual next state embeddings, which is well-suited for comparing the directional similarity of text-based representations.
  3. Latent Space Planning: Once the transition function is trained, planning is performed in this learned latent space. The algorithm iteratively selects actions that minimize a heuristic (Euclidean distance to the goal state embedding) based on the predicted next state embeddings, thereby reducing the need for repeated, costly LLM calls during the planning process.

Datasets

The paper evaluates EmbedPlan on seven domains: Ferry, FloorTile, Grid, Gripper, Logistics, Rovers, and VisitAll. These domains are described in natural language and are derived from conventional planning datasets, often translated from PDDL (Planning Domain Definition Language). The models were trained on increasing subsets of data (10% to 90%) from a total of 10,000 samples per domain to assess scalability.

Key Insights and Ideas

  • Decoupling LLM Inference from Planning: The most significant insight is the separation of LLM embedding generation from the actual planning process. By training a separate, lightweight transition function on these embeddings, the system avoids the high computational cost of calling a large LLM for every state transition prediction during planning.
  • Latent Space Efficiency: Performing planning in a learned latent space, inspired by prior work like LatPlan but adapted for natural language, proves to be a computationally efficient strategy. This allows for faster inference compared to methods that rely on direct LLM reasoning for each step.
  • Cosine Similarity for Textual Embeddings: The choice of cosine similarity as the loss function for training the transition model is crucial. It effectively captures the angular similarity between embeddings, which is more relevant for semantic alignment in text-based representations than simple Euclidean distance.
  • Bridging NLP and Classical Planning: EmbedPlan demonstrates a practical way to integrate the rich understanding capabilities of LLMs into classical AI planning frameworks, making planning more accessible for domains described purely in natural language.

Key Results

EmbedPlan demonstrated substantial improvements in top@k accuracy across all seven tested domains. While specific percentage improvements are not detailed, the paper highlights that the method effectively approximates transition functions in complex planning environments. The accuracy generally increases with the number of training samples, indicating good scalability and learning efficiency. The approach is shown to be computationally efficient, significantly reducing the overhead associated with frequent LLM calls.

Limitations and Future Work

The authors acknowledge that while EmbedPlan shows promising results, further research is needed to enhance its robustness and applicability. Future work will focus on:

  • Improving generalization across diverse domains.
  • Exploring the method's applicability to more complex scenarios like multi-agent systems or dynamic environments.
  • Optimizing transition function accuracy for long-horizon planning tasks.
  • Further bridging the gap between natural language understanding and practical planning systems.

Summary updated

BibTeX
@inproceedings{shlomi2024transition,
  author = {Eliezer Shlomi and Guy Azran and Eilam Shapira and Omer Nahum and Guy Uziel and Michael Katz and Ateret Anaby Tavor and Roi Reichart and Sarah Keren},
  title = {{Transition Function Prediction in AI Planning Using LLMs}},
  booktitle = {LM4Plan @ AAAI},
  year = {2024},
  url = {https://openreview.net/forum?id=SPRYlWKaPj},
}
Figure