Skip to content

BorealisAI/llm-pddl-planning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[Neurips 2024] Leveraging Environment Interaction for Automated PDDL Translation and Planning with Large Language Models

arXiv

This is the official Repository to the paper Leveraging Environment Interaction for Automated PDDL Translation and Planning with Large Language Models.

Quick Run

To reproduce the experiments in our paper, follow below steps:

  1. Prepare the data. You can obtain the original PDDL files from the LLM+P repository and DownwardBenchmarks repository. We provide the pddl files for some of the environments in the data folder. You can then produce the back translations, templates, and descriptions using the files back_translate.py, gen_pddl_template_pddl.py.

  2. Install the python requirements via

pip install requirements.txt

Note: requires Python >= 3.9

  1. Download the following external libraries:
  1. Configure the following environment variables in reproduce.sh: FD_PY_PATH (path to the .py file of fast downard), VAL_BIN_PATH (path to the VAL library binary file), OPENAI_API_KEY (OpenAI key), WANDB_ENTITY (wandb entity), WANDB_PROJECT (wandb project). We use the gpt-4-1106-preview GPT4 model in our project by default.

  2. Run

bash reproduce.sh

to reproduce the experiments.

Repository Structure

The data used in our experiments can be found in the data directory. Each domain has the following format:

📦domain
 ├ 📜domain.pddl               # The domain PDDL file
 ├ 📜domain_template.pddl      # Domain template PDDL
 ├ 📜domain.nl                 # Natural language description of the domain (GPT-generated).
 ├ 📜predicate_descriptor.py   # Mapping between NL descriptions and predicates (GPT-generated).
 ├ 📜p{i}.pddl                 # The {i}-th problem PDDL file
 ├ 📜p{i}_template.pddl        # The {i}-th problem template 
 ├ 📜p{i}.nl                   # Natural language description of the {i}-th problem (GPT-generated).
 ├ 📜p_example.pddl            # Example problem PDDL file.
 ├ 📜p_example_template.pddl   # Example problem template.
 ├ 📜p_example.nl              # Example natural language description.
 └ 📜p_example.sol             # Example solution.

The following is the code structure for source files:

📦src
 ├ 📜back_translate.py         # Backtranslation utils for domain/problem/description natural language geneation
 ├ 📜domains.py              
 ├ 📜error_messages.py        
 ├ 📜evaluation.py            
 ├ 📜gen_pddl_template_pddl.py # Generates PDDL templates from the original PDDL files.
 ├ 📜gpt_client.py            
 ├ 📜intrinsic_planning.py     # Intrinsic planning baselines
 ├ 📜main.py                   # Main entry point for our method
 ├ 📜pddl_utils.py             # Utility functions to work with PDDL files.
 ├ 📜planning.py               # Core planning logic and functions.
 ├ 📜problem_domain_translation.py
 ├ 📜prompts.py               
 ├ 📂rw_analysis              # Analysis for exploration walk
 │  ├ 📜rw_analysis.py        # Core reward analysis logic.
 │  └ 📜rw_corr_plot.py       # Plots for reward correlation analysis.
 └ 📜utils.py 

Citation

If you find this work useful, please cite our paper:

@inproceedings{
  mahdavi2024leveraging,
  title={Leveraging Environment Interaction for Automated {PDDL} Translation and Planning with Large Language Models},
  author={Sadegh Mahdavi and Raquel Aoki and Keyi Tang and Yanshuai Cao},
  booktitle={The Thirty-eighth Annual Conference on Neural Information Processing Systems},
  year={2024},
  url={https://openreview.net/forum?id=RzlCqnncQv}
}

Questions/Bugs

Please submit a Github issue or contact [email protected] if you have any questions or find any bugs.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published