WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment
About
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.
Hao Tang, Darren Key, Kevin Ellis• 2024
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Hierarchical Planning | Minihack 15x15 | Token Cost0.00e+0 | 6 | |
| Hierarchical Planning | Minihack-Traps | Token Cost0.00e+0 | 6 | |
| Hierarchical Planning | Minihack Monster | Token Cost0.00e+0 | 6 | |
| Hierarchical Planning | Sokoban | Token Cost1.97e+4 | 6 | |
| Hierarchical Planning | BabyAI Pickup | Token Cost1.80e+4 | 6 | |
| Hierarchical Planning | Minihack 5x5 | Token Cost8.14e+3 | 6 | |
| Hierarchical Planning | Labyrinth | Token Cost5.64e+4 | 6 | |
| Hierarchical Planning | Maze | Token Cost5.61e+4 | 6 | |
| Hierarchical Planning | BabyAI Unlock | Token Cost9.79e+4 | 6 | |
| Hierarchical Planning | BabyAI Combined Skills 1 | Token Cost1.19e+5 | 6 |
Showing 10 of 15 rows