Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

PatchWorld: Gradient-Free Optimization of Executable World Models

About

Text-agent environments are typically modeled as partially observable Markov decision processes (POMDPs), assuming that the simulator's latent state and transition dynamics are hidden from the agent. Yet little work has examined whether executable code can be induced to serve as a world model for prediction and planning under partial observability. We introduce PatchWorld, a gradient-free framework that turns offline trajectories into executable Python world models through counterexample-guided code repair. Instead of predicting the next observation with a black-box model, PatchWorld induces symbolic belief-state programs whose action updates can be inspected, replayed, and locally patched. Across seven AgentGym environments, PatchWorld-Simple achieves the highest code-based planning score among evaluated methods, reaching 76.4\% macro success in live one-step lookahead while invoking no LLM calls inside the world-model prediction module itself. We further find that a human-specified residual-memory bias improves surface observation fidelity but weakens decision utility. This exposes a tradeoff in executable world models, since improving observation fidelity can come at the expense of action-discriminative dynamics, and vice versa. Code is available at https://github.com/HKBU-KnowComp/PatchWorld.

Jiaxin Bai, Yue Guo, Yifei Dong, Jiaxuan Xiong, Tianshi Zheng, Yixia Li, Tianqing Fang, Yufei Li, Yisen Gao, Haoyu Huang, Zhongwei Xie, Hong Ting Tsang, Zihao Wang, Lihui Liu, Jeff Pan, Yangqiu Song• 2026

Related benchmarks

TaskDatasetResultRank
One-step next-observation predictionMaze (test)
Token F198
16
One-step next-observation predictionTextCraft (test)
Token F195
16
One-step next-observation predictionWordle (test)
Token F10.72
16
One-step next-observation predictionALFWorld (test)
Token F177
16
One-step next-observation predictionBabyAI (test)
Token F185
16
One-step next-observation predictionSciWorld (test)
Token F169
16
One-step next-observation predictionAgentGym Unweighted Average (test)
Token F170
16
One-step next-observation predictionWebShop (test)
Token F153
16
PlanningAlfWorld, BabyAI, Maze, SciWorld, TextCraft, WebShop, Wordle (held-out)
AlfWorld Success Rate6
7
Multi-step rollout prediction7 Environments (AlfWorld, BabyAI, Maze, SciWorld, TextCraft, WebShop, Wordle) (held-out episodes)
Token F1 (t=1)69
5
Showing 10 of 10 rows

Other info

Follow for update