WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment
Abstract
We give a model-based agent that builds a Python program representing its knowledge of the world based on its interactions with the environment. The world model tries to explain its interactions, while also being optimistic about what reward it can achieve. We define this optimism as a logical constraint between a program and a planner. We study our agent on gridworlds, and on task planning, finding our approach is more sample-efficient compared to deep RL, more compute-efficient compared to ReAct-style agents, and that it can transfer its knowledge across environments by editing its code.
Cite
Text
Tang et al. "WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment." Neural Information Processing Systems, 2024. doi:10.52202/079017-2243Markdown
[Tang et al. "WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment." Neural Information Processing Systems, 2024.](https://mlanthology.org/neurips/2024/tang2024neurips-worldcoder/) doi:10.52202/079017-2243BibTeX
@inproceedings{tang2024neurips-worldcoder,
title = {{WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment}},
author = {Tang, Hao and Key, Darren and Ellis, Kevin},
booktitle = {Neural Information Processing Systems},
year = {2024},
doi = {10.52202/079017-2243},
url = {https://mlanthology.org/neurips/2024/tang2024neurips-worldcoder/}
}