The DOI matches its DataCite record; 1 of the 1 references it cites were found in a registry or an index.
Code World Models for General Game Playing
Abstract
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.
Overview
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
In the citing paper
“Recent work further applies CWMs to general game environments (Lehrach et al., 2025), where an LLM induces complete rule-based simulators and planning is performed directly on the executable model.”
From The landscape of agentic reinforcement learning for LLMs: a survey (2025) · cites this paper as Lehrach et al., 2025
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Generative Agents for Multi-Agent Autoformalization of Interaction Scenarios
Mensfelt, A., Stathis, K., & Trencsenyi, V. (2025) · Frontiers in Artificial Intelligence and Applications · doi:10.3233/faia251256
Cited by
The landscape of agentic reinforcement learning for LLMs: a survey
Zhang, G., Geng, H., Yu, X., Yin, Z., Zhang, Z., Tan, Z., Zhou, H., Li, Z., Xue, X., Li, Y., et al. (2025) · arXiv · doi:10.48550/arxiv.2509.02547 · Cited by 229
Self-citationMemento 3: Model-Based Recursive Self-Improvement through Reflective Rulebooks
Zhao, H., Yu, Z., He, Z., Fang, M., Tutunov, R., Bou-Ammar, H., Luo, W., & Wang, J. (2026) · arXiv · doi:10.48550/arxiv.2610.11794
AutoHarness: improving LLM agents by automatically synthesizing a code harness
Lou, X., Lázaro-Gredilla, M., Dedieu, A., Wendelken, C., Lehrach, W., & Murphy, K. P. (2026) · arXiv · doi:10.48550/arxiv.2603.03329
“LLMs can also be used to generate code for the entire state transition function (i.e. world model) for a game (Lehrach et al., 2025), but that is unnecessarily onerous for complex games in which a comparatively simple strategy can be applied.”
Self-citationBaba in Wonderland: Online Self-Supervised Dynamics Discovery for Executable World Models
Seo, S., Han, D., Noh, S., & Kang, H. (2026) · arXiv · doi:10.48550/arxiv.2605.16725
Metadata
- Authors
- Lehrach, W., Hennes, D., Lazaro-Gredilla, M., Lou, X., Wendelken, C., Li, Z., Dedieu, A., Grau-Moya, J., Lanctot, M., Iscen, A., Schultz, J., Chiam, M., Gemp, I., Zielinski, P., Singh, S., & Murphy, K. P.
- Venue
- arXiv
- Publisher
- arXiv
- Published
- 2025
- arXiv
- 2510.04542
- References
- 1
- Type
- Preprint
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.