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 | |
|---|---|---|---|---|
| One-step next-observation prediction | WebShop (test) | Token F158 | 16 | |
| One-step next-observation prediction | ALFWorld (test) | Token F163 | 16 | |
| One-step next-observation prediction | Maze (test) | Token F188 | 16 | |
| One-step next-observation prediction | TextCraft (test) | Token F188 | 16 | |
| One-step next-observation prediction | BabyAI (test) | Token F178 | 16 | |
| One-step next-observation prediction | Wordle (test) | Token F10.55 | 16 | |
| One-step next-observation prediction | AgentGym Unweighted Average (test) | Token F163 | 16 | |
| One-step next-observation prediction | SciWorld (test) | Token F141 | 16 | |
| Planning | AlfWorld, BabyAI, Maze, SciWorld, TextCraft, WebShop, Wordle (held-out) | AlfWorld Success Rate3.5 | 7 | |
| Hierarchical Planning | Minihack 15x15 | Token Cost0.00e+0 | 6 |
Showing 10 of 30 rows