AgentGen: Enhancing Planning Abilities for Large Language Model based Agent via Environment and Task Generation

Mengkang Hu, Pu Zhao, Can Xu, Qingfeng Sun, Jian-Guang Lou, Qingwei Lin, Ping Luo, Saravan Rajmohan

TL;DR

This paper introduces AGENTGEN, a novel framework that automates the generation of diverse planning environments and tasks for training Large Language Model (LLM) agents. By leveraging LLMs to create these training materials, AGENTGEN significantly enhances the planning capabilities of LLM agents, leading to state-of-the-art performance on complex planning tasks.

What Problem Does This Paper Address?

LLM-based agents are becoming increasingly powerful, but their ability to plan and interact with environments to achieve goals is a critical area for improvement. Current methods for training these agents, known as "agent training," rely heavily on expert-level trajectory data. However, generating this data is bottlenecked by the labor-intensive process of manually designing diverse planning tasks and environments. This limitation restricts the variety and complexity of training data, hindering the development of robust LLM agents. AGENTGEN aims to overcome this by automating the creation of a vast and varied dataset of environments and tasks.

Methods

AGENTGEN employs a two-stage approach for automated environment and task generation:

  1. Environment Generation: To ensure diversity, AGENTGEN uses an "inspiration corpus" of diverse text segments as context for LLMs to generate environment specifications. These specifications are then translated into executable environment code (e.g., PDDL, Python). An environment library is maintained and iteratively expanded with high-quality generated environments.
  2. Task Generation: Conditioned on the generated environments, AGENTGEN creates planning tasks. To achieve a gradual learning curve, it introduces BI-EVOL (Bidirectional Evolution), a method that evolves initial tasks in both simpler and more complex directions. This creates a task set with a smoother difficulty progression, which is crucial for effective LLM training.

Datasets

The paper introduces a newly constructed dataset comprising 592 diverse environments and 7246 high-quality trajectories generated by AGENTGEN. This dataset was used to instruction-tune LLMs. For evaluation, the authors used tasks implemented in PDDL (in-domain) and tasks in other programming languages like Python (out-of-domain). Specific in-domain tasks included Blocksworld, Gripper, Tyreworld, and Barman. Out-of-domain tasks included Alfworld, BabyAI, and Jericho.

Key Insights and Ideas

  • Automated Data Generation is Key: The core insight is that the bottleneck in training capable LLM agents is the manual creation of training data. Automating this process with LLMs themselves is a powerful solution.
  • Inspiration Corpus for Diversity: Simply prompting LLMs to generate random environments leads to limited diversity. Using an "inspiration corpus" of diverse text segments significantly enhances the variety of generated environments.
  • Bidirectional Task Evolution for Learning: Creating tasks that gradually increase in difficulty (BI-EVOL) is more effective for LLM learning than a steep difficulty curve. This helps LLMs build foundational planning skills before tackling more complex challenges.
  • Generalization Beyond PDDL: The success of AGENTGEN-tuned models on both PDDL-based (in-domain) and other programming language-based (out-of-domain) tasks demonstrates the framework's ability to foster generalizable planning skills.

Key Results

  • AGENTGEN-tuned Llama-3.1-8B significantly outperforms GPT-3.5 on planning tasks, achieving a 33.3% overall progress rate compared to GPT-3.5's 25.0%.
  • AGENTGEN-tuned Llama-3.1-70B achieves state-of-the-art results, even surpassing GPT-4 in some instances (e.g., 81.5% vs. 81.2% overall progress rate).
  • The framework demonstrates robustness, with several 7-8B foundation models showing significant improvements after training with AGENTGEN-generated data. For instance, Llama-3-8B saw a 10.0% increase in success rate.
  • On out-of-domain tasks, AGENTGEN-tuned Llama-3.1-8B also showed substantial gains, with an average progress rate increase of 13.1%.

Limitations and Future Work

  • Inspiration Corpus Quality: The diversity and quality of the generated environments are dependent on the inspiration corpus. Future work could explore more sophisticated methods for curating or generating this corpus.
  • Task Complexity Scaling: While BI-EVOL improves difficulty progression, further research could explore more nuanced methods for scaling task complexity.
  • Generalization to Other Agent Capabilities: The paper focuses on planning. Future work could investigate if AGENTGEN's principles can be extended to enhance other LLM agent capabilities like reasoning, tool use, or navigation.
  • Real-World Grounding: The current environments are simulated. Extending this to more realistic or grounded environments would be a valuable next step.

Summary updated

BibTeX
@misc{hu2024agentgen,
  author = {Mengkang Hu and Pu Zhao and Can Xu and Qingfeng Sun and Jian-Guang Lou and Qingwei Lin and Ping Luo and Saravan Rajmohan},
  title = {{AgentGen: Enhancing Planning Abilities for Large Language Model based Agent via Environment and Task Generation}},
  year = {2024},
  eprint = {2408.00764},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2408.00764},
}
Figure