An OpenAI gym environment to evaluate the ability of large language models (LLMs; eg. GPT-4) in long-horizon reasoning and task planning in dynamic multi-agent settings based on gym-cooking [1].
https://www.youtube.com/watch?v=4LmcpkS53Wg
There is a new area of AI research where foundation models such as LLMs are used for decision making in complex environments that involve long-horizon reasoning, control, and planning [2]. For instance, Text2Motion [3] enables robots to solve sequential manipulation tasks by using LLMs. Also OpenAI's GPT-4 performs well in theory-of-mind (ToM) tasks [6], which require understanding other agents' beliefs, goals, and mental states.
OvercookedGPT is an interactive 2D game environment where OpenAI's GPT-4/3.5-Turbo generates intertemporal and sequential tasks in a centralized fashion to control multiple agents to achieve a goal in a simulation (i.e., to cook food at a kitchen). It is based on gym-cooking [1] and was also inspired by overcooked_ai [4] (which is used in [5]). The purpose of this simulator is to evaluate the ability of the LLMs in long-horizon reasoning and task planning in dynamic multi-agent environments. To this end, in-context learning (i.e., few-shot learning with prompt engineering methods of CoT and PAL [7]) is used to guide the LLMs to generate a task queue in Python that is executed by the simulator on the fly.
python3 -m pip install -U pygame --user
git clone https://github.com/BladeTransformerLLC/OvercookedGPT.git
cd OvercookedGPT
pip3 install -r requirements.txt
Set the OPENAI_API_KEY
environment variable (alternatively put the key string in utils/chatgpt/openai.json
)
Start a single-agent simulation (enter a task eg. "Make a tomato and lettuce salad and deliver it."):
python3 main.py --num-agents 1 --level partial-divider_salad --gpt
Start a multi-agent simulation:
python3 main.py --num-agents 2 --level partial-divider_salad --gpt
Mannually control agents with arrow keys (switch between agents by pressing 1 or 2):
python3 main.py --num-agents 2 --level partial-divider_salad --gpt --manual
- Allow simultaneous/parallel subtask execution by multiple agents within the same timestep
- Prevent agents from moving through other agents (make them avoid/wait others)
- Evaluate with 3 or more agents
- Wu et. al., "Too many cooks: Bayesian inference for coordinating multi-agent collaboration," 2020.
- Yang et. al., "Foundation Models for Decision Making: Problems, Methods, and Opportunities," 2023.
- Lin et. al., "Text2Motion: From Natural Language Instructions to Feasible Plans," 2023.
- Carroll et. al., "On the Utility of Learning about Humans for Human-AI Coordination," 2020.
- Hong et. al., "Learning to Influence Human Behavior with Offline Reinforcement Learning," 2023.
- Moghaddam & Honey, "Boosting Theory-of-Mind Performance in Large Language Models via Prompting," 2023.
- Gao et. al., "PAL: Program-aided Language Models," 2022