Code World Models for General Game Playing
Wolfgang Lehrach, Daniel Hennes, Miguel Lazaro-Gredilla, Xinghua Lou, Carter Wendelken, Zun Li, Antoine Dedieu, Marc Lanctot, Atil Iscen, John Schultz, Marcus Chiam, Ian Gemp
摘要
Large Language Models (LLMs) reasoning abilities are increasingly being applied to classical board and card games, but the dominant approach---involving prompting for direct move generation---has significant drawbacks. It relies on the model's implicit fragile pattern-matching capabilities, leading to frequent illegal moves and strategically shallow play. Here we introduce an alternative approach: We use the LLM to translate natural language rules and game trajectories into a formal, executable world model represented as Python code. This generated model---comprising functions for state transition, legal move enumeration, and termination checks---serves as a verifiable simulation engine for high-performance planning algorithms like Monte Carlo tree search (MCTS). In addition, we prompt the LLM to generate heuristic value functions (to make MCTS more efficient), and inference functions (to estimate hidden states in imperfect information games). Our method offers three distinct advantages compared to directly using the LLM as a policy: (1) Verifiability: The generated CWM serves as a formal specification of the game's rules, allowing planners to algorithmically enumerate valid actions and avoid illegal moves, contingent on the correctness of the synthesized model; (2) Strategic Depth: We combine LLM semantic understanding with the deep search power of classical planners; and (3) Generalization: We direct the LLM to focus on the meta-task of data-to-code translation, enabling it to adapt to new games more easily. We evaluate our agent on 10 different games, of which 4 are novel and created for this paper. 5 of the games are fully observed (perfect information), and 5 are partially observed (imperfect information). We find that our method outperforms or matches Gemini 2.5 Pro in 9 out of the 10 considered games.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper3
- Generative Visual Code Mobile World ModelsWoosung (Reiss) Koh, Sungjun Han, Segyu Lee, Se-Young Yun 等ICML 2026 · 被引用 6 次
- Language and Experience: A Computational Model of Social Learning in Complex TasksCédric Colas, Tracey Mills, Ben Prystawski, Michael Henry Tessler 等ICLR 2026 · 被引用 1 次
- MeepleLM: A Virtual Playtester Simulating Diverse Subjective ExperiencesZizhen Li, Chuanhao Li, Yibin Wang, Jianwen Sun 等ACL 2026 · 被引用 1 次
它引用的顶会 Paper8
- WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the EnvironmentHao Tang, Darren Key, Kevin EllisNeurIPS 2024 · 被引用 123 次
- Code Repair with LLMs gives an Exploration-Exploitation TradeoffHao Tang, Keya Hu, Jin Zhou, Sicheng Zhong 等NeurIPS 2024 · 被引用 85 次
- GTBench: Uncovering the Strategic Reasoning Capabilities of LLMs via Game-Theoretic EvaluationsJinhao Duan, Renming Zhang, James Diffenderfer, Bhavya Kailkhura 等NeurIPS 2024 · 被引用 79 次
- Amortized Planning with Large-Scale Transformers: A Case Study on ChessAnian Ruoss, Grégoire Delétang, Sourabh Medapati, Jordi Grau-Moya 等NeurIPS 2024 · 被引用 57 次
- Generating Code World Models with Large Language Models Guided by Monte Carlo Tree SearchNicola Dainese, Matteo Merler, Minttu Alakuijala, Pekka MarttinenNeurIPS 2024 · 被引用 49 次
相关 Paper
- Mastering Board Games by External and Internal Planning with Language ModelsJohn Schultz, Jakub Adámek, Matej Jusup, Marc Lanctot 等ICML 2025
- Large Language Models as Commonsense Knowledge for Large-Scale Task PlanningZirui Zhao, Wee Sun Lee, David HsuNeurIPS 2023 · 被引用 423 次
- Large Language Models Are Neurosymbolic ReasonersMeng Fang, Shilong Deng, Yudi Zhang, Zijing Shi 等AAAI 2024 · 被引用 53 次
- Agent Planning with World Knowledge ModelShuofei Qiao, Runnan Fang, Ningyu Zhang, Yuqi Zhu 等NeurIPS 2024 · 被引用 95 次
- Classical Planning with LLM-Generated Heuristics: Challenging the State of the Art with Python CodeAugusto B. Corrêa, André Grahl Pereira, Jendrik SeippNeurIPS 2025 · 被引用 27 次
