Generating Code World Models with Large Language Models Guided by Monte Carlo Tree Search
On the map: World models → World models for language agents
Abstract (arXiv)
In this work we consider Code World Models, world models generated by a Large Language Model (LLM) in the form of Python code for model-based Reinforcement Learning (RL). Calling code instead of LLMs for planning has potential to be more precise, reliable, interpretable, and extremely efficient. However, writing appropriate Code World Models requires the ability to understand complex instructions, to generate exact code with non-trivial logic and to self-debug a long program with feedback from unit tests and environment trajectories. To address these challenges, we propose Generate, Improve and Fix with Monte Carlo Tree Search (GIF-MCTS), a new code generation strategy for LLMs. To test our approach in an offline RL setting, we introduce the Code World Models Benchmark (CWMB), a suite of program synthesis and planning tasks comprised of 18 diverse RL environments paired with corresponding textual descriptions and curated trajectories. GIF-MCTS surpasses all baselines on the CWMB and two other benchmarks, and we show that the Code World Models synthesized with it can be successfully used for planning, resulting in model-based RL agents with greatly improved sample efficiency and inference speed.
Key facts. Cited by 40 papers in the map (data through 14 Oct 2026). Placed in World models for language agents, one of 11 directions in World models. Builds on 48 of its 68 references that are in the map. First posted on arXiv 24 May 2024.
Builds on
48 of 68 references.
Closest ancestors · 6
Same direction, newest first
- 2024WorldCoder, a Model-Based LLM Agent: Building World Models by Writing Code and Interacting with the Environment19 Feb
- 2024Language-Guided World Models: A Model-Based Approach to AI Control24 Jan
- 2023From Word Models to World Models: Translating from Natural Language to the Probabilistic Language of Thought22 Jun
- 2023Reasoning with Language Model is Planning with World Model24 May
- 2023Leveraging Pre-trained Large Language Models to Construct and Utilize World Models for Model-based Task Planning24 May
- 2020Language Models are Few-Shot Learners28 May
Other references · 42
- 2017Attention Is All You Needcited by 60,361
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2023Self-Refine: Iterative Refinement with Self-Feedbackcited by 3,442
- 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
- 2022Do As I Can, Not As I Say: Grounding Language in Robotic Affordancescited by 2,348
- 2023Voyager: An Open-Ended Embodied Agent with Large Language Modelscited by 2,191
- 2020Offline Reinforcement Learning: Tutorial, Review, and Perspectives on Open Problemscited by 1,920
- 2020Conservative Q-Learning for Offline Reinforcement Learningcited by 1,809
- 2018World Modelscited by 1,513
30 more
- 2020D4RL: Datasets for Deep Data-Driven Reinforcement Learningcited by 1,427
- 2022Code as Policies: Language Model Programs for Embodied Controlcited by 1,210
- 2020Mastering Atari with Discrete World Modelscited by 1,007
- 2024Grounded SAM: Assembling Open-World Models for Diverse Visual Taskscited by 929
- 2021Measuring Coding Challenge Competence With APPScited by 902
- 2018Recurrent World Models Facilitate Policy Evolutioncited by 785
- 2023CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquingcited by 783
- 2024Genie: Generative Interactive Environmentscited by 747
- 2022ProgPrompt: Generating Situated Robot Task Plans using Large Language Modelscited by 611
- 2023Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Modelscited by 574
- 2022BC-Z: Zero-Shot Task Generalization with Robotic Imitation Learningcited by 523
- 2023Learning Interactive Real-World Simulatorscited by 458
- 2022CodeT: Code Generation with Generated Testscited by 384
- 2022CodeRL: Mastering Code Generation through Pretrained Models and Deep Reinforcement Learningcited by 358
- 2022Transformers are Sample-Efficient World Modelscited by 328
- 2023Photorealistic Video Generation with Diffusion Modelscited by 306
- 2023Is Self-Repair a Silver Bullet for Code Generation?cited by 197
- 2018Programmatically Interpretable Reinforcement Learningcited by 193
- 2023Planning with Large Language Models for Code Generationcited by 182
- 2018Verifiable Reinforcement Learning via Policy Extractioncited by 177
- 2023Language-Driven Representation Learning for Roboticscited by 165
- 2023Learning to Model the World with Languagecited by 68
- 2022Parsel: Algorithmic Reasoning with Language Models by Composing Decompositionscited by 64
- 2021Learning to Synthesize Programs as Interpretable and Generalizable Policiescited by 59
- 2021Human-Level Reinforcement Learning through Theory-Based Modeling, Exploration, and Planningcited by 43
- 2023Learning adaptive planning representations with natural language guidancecited by 36
- 2019Few-Shot Bayesian Imitation Learning with Logical Program Policiescited by 30
- 2021Grounding Predicates through Actionscited by 25
- 2023Hierarchical Programmatic Reinforcement Learning via Learning to Compose Programscited by 20
- 2021Scenic4RL: Programmatic Modeling and Generation of Reinforcement Learning Environmentscited by 6
Built on by
Citing papers per year: 2025: 18; 2026: 22.
40 papers.
Sort:
By area:
- 2025Monte Carlo Tree Search for Comprehensive Exploration in LLM-Based Automatic Heuristic Designcited by 109
- 2025Text2World: Benchmarking Large Language Models for Symbolic World Model Generationcited by 26
- 2025World Modeling Makes a Better Planner: Dual Preference Optimization for Embodied Task Planningcited by 26
- 2025PoE-World: Compositional World Modeling with Products of Programmatic Expertscited by 26
- 2025A Survey on LLM Test-Time Compute via Search: Tasks, LLM Profiling, Search Algorithms, and Relevant Frameworkscited by 21
- 2025Navigating the Alpha Jungle: An LLM-Powered MCTS Framework for Formulaic Factor Miningcited by 16
- 2025Synthesizing world models for bilevel planningcited by 14
- 2026Executable World Models for ARC-AGI-3 in the Era of Coding Agentscited by 14
- 2026Code World Model: Coding Agent as World Braincited by 14
- 2025Entropy-guided sequence weighting for efficient exploration in RL-based LLM fine-tuningcited by 13
- 2026Generative Visual Code Mobile World Modelscited by 13
- 2025Generating Symbolic World Models via Test-time Scaling of Large Language Modelscited by 12
28 more
- 2026EgoForge: Goal-Directed Egocentric World Simulatorcited by 12
- 2025One Life to Learn: Inferring Symbolic World Models for Stochastic Environments from Unguided Explorationcited by 10
- 2025Agent2World: Learning to Generate Symbolic World Models via Adaptive Multi-Agent Feedbackcited by 9
- 2026Budget-Constrained Agentic Large Language Models: Intention-Based Planning for Costly Tool Usecited by 8
- 2026Debugging code world modelscited by 5
- 2025Adamas: Hadamard Sparse Attention for Efficient Long-Context Inferencecited by 4
- 2026Twin: Playing an Unknown Game with a Test-Time Digital Twincited by 4
- 2025Your Language Model May Think Too Rigidly: Achieving Reasoning Consistency with Symmetry-Enhanced Trainingcited by 3
- 2025Zero-Shot Privacy-Aware Text Rewriting via Iterative Tree Searchcited by 3
- 2026Do Coding Agents Need Executable World Models, Simplification, and Verification to Solve ARC-AGI-3?cited by 3
- 2026AI for Games in the Foundation Model Eracited by 3
- 2025Streaming Looking Ahead with Token-level Self-rewardcited by 2
- 2026Trust No Tool: Evaluating and Defending LLM Agents under Untrusted Tool Feedbackcited by 2
- 2025Mini Amusement Parks (MAPs): A Testbed for Modelling Business Decisionscited by 1
- 2026Joint Learning of Hierarchical Neural Options and Abstract World Modelcited by 1
- 2026COvolve: Adversarial Co-Evolution of Large-Language-Model-Generated Policies and Environments via Two-Player Zero-Sum Gamecited by 1
- 2026Autonomous Repair for Multi-Agent Systems via Monte-Carlo Tree Searchcited by 1
- 2026World-Time Compute with Verified Code World Modelscited by 1
- 2026EMPIRIC: Experiment-Driven Learning of Residual World Models for Robot Planningcited by 1
- 2025GRACE: A Language Model Framework for Explainable Inverse Reinforcement Learningcited by 0
- 2025Lessons from Neuroscience for AI: How integrating Actions, Compositional Structure and Episodic Memory could enable Safe, Interpretable and Human-Like AIcited by 0
- 2026Code World Models for Parameter Control in Evolutionary Algorithmscited by 0
- 2026Hypothesis Generation and Inductive Inference in Children and Language Modelscited by 0
- 2026ROSUM-MCTS: Monte Carlo Tree Search-Inspired HDL Code Summarization with Structural Rewardscited by 0
- 2026Quo Vadis, World Modeling?cited by 0
- 2026When LLM Meets Tree Search: A Systematic View of Inference as Search in Large Language Modelscited by 0
- 2026Schema: Discovering Unknown Environments via Agentic Program Inductioncited by 0
- 2026D-World: An Explicit World-Language-Action Model with Recursive Self-Improvement under Dual Controlcited by 0
- 2026D-World: An Explicit World-Language-Action Model with Recursive Self-Improvement under Dual Control12 Oct 2026
- 2026Schema: Discovering Unknown Environments via Agentic Program Induction30 Sep 2026
- 2026EMPIRIC: Experiment-Driven Learning of Residual World Models for Robot Planning28 Sep 2026
- 2026AI for Games in the Foundation Model Era15 Sep 2026
- 2026When LLM Meets Tree Search: A Systematic View of Inference as Search in Large Language Models31 Aug 2026
- 2026Code World Model: Coding Agent as World Brain26 Aug 2026
- 2026Twin: Playing an Unknown Game with a Test-Time Digital Twin14 Aug 2026
- 2026Quo Vadis, World Modeling?3 Aug 2026
- 2026Autonomous Repair for Multi-Agent Systems via Monte-Carlo Tree Search31 Jul 2026
- 2026Do Coding Agents Need Executable World Models, Simplification, and Verification to Solve ARC-AGI-3?16 Jul 2026
- 2026World-Time Compute with Verified Code World Models7 Jul 2026
- 2026ROSUM-MCTS: Monte Carlo Tree Search-Inspired HDL Code Summarization with Structural Rewards6 Jun 2026
28 more
- 2026Hypothesis Generation and Inductive Inference in Children and Language Models23 May 2026
- 2026Trust No Tool: Evaluating and Defending LLM Agents under Untrusted Tool Feedback17 May 2026
- 2026Executable World Models for ARC-AGI-3 in the Era of Coding Agents6 May 2026
- 2026COvolve: Adversarial Co-Evolution of Large-Language-Model-Generated Policies and Environments via Two-Player Zero-Sum Game30 Mar 2026
- 2026EgoForge: Goal-Directed Egocentric World Simulator20 Mar 2026
- 2026Code World Models for Parameter Control in Evolutionary Algorithms25 Feb 2026
- 2026Budget-Constrained Agentic Large Language Models: Intention-Based Planning for Costly Tool Use12 Feb 2026
- 2026Debugging code world models7 Feb 2026
- 2026Joint Learning of Hierarchical Neural Options and Abstract World Model2 Feb 2026
- 2026Generative Visual Code Mobile World Models2 Feb 2026
- 2025Lessons from Neuroscience for AI: How integrating Actions, Compositional Structure and Episodic Memory could enable Safe, Interpretable and Human-Like AI27 Dec 2025
- 2025Agent2World: Learning to Generate Symbolic World Models via Adaptive Multi-Agent Feedback26 Dec 2025
- 2025Mini Amusement Parks (MAPs): A Testbed for Modelling Business Decisions19 Nov 2025
- 2025Adamas: Hadamard Sparse Attention for Efficient Long-Context Inference21 Oct 2025
- 2025One Life to Learn: Inferring Symbolic World Models for Stochastic Environments from Unguided Exploration14 Oct 2025
- 2025GRACE: A Language Model Framework for Explainable Inverse Reinforcement Learning2 Oct 2025
- 2025Zero-Shot Privacy-Aware Text Rewriting via Iterative Tree Search25 Sep 2025
- 2025Navigating the Alpha Jungle: An LLM-Powered MCTS Framework for Formulaic Factor Mining16 May 2025
- 2025PoE-World: Compositional World Modeling with Products of Programmatic Experts16 May 2025
- 2025Entropy-guided sequence weighting for efficient exploration in RL-based LLM fine-tuning28 Mar 2025
- 2025Synthesizing world models for bilevel planning26 Mar 2025
- 2025World Modeling Makes a Better Planner: Dual Preference Optimization for Embodied Task Planning13 Mar 2025
- 2025Your Language Model May Think Too Rigidly: Achieving Reasoning Consistency with Symmetry-Enhanced Training25 Feb 2025
- 2025Streaming Looking Ahead with Token-level Self-reward24 Feb 2025
- 2025Text2World: Benchmarking Large Language Models for Symbolic World Model Generation18 Feb 2025
- 2025Generating Symbolic World Models via Test-time Scaling of Large Language Models7 Feb 2025
- 2025A Survey on LLM Test-Time Compute via Search: Tasks, LLM Profiling, Search Algorithms, and Relevant Frameworks17 Jan 2025
- 2025Monte Carlo Tree Search for Comprehensive Exploration in LLM-Based Automatic Heuristic Design15 Jan 2025
- 2025Text2World: Benchmarking Large Language Models for Symbolic World Model Generationcited by 26
- 2025World Modeling Makes a Better Planner: Dual Preference Optimization for Embodied Task Planningcited by 26
- 2025PoE-World: Compositional World Modeling with Products of Programmatic Expertscited by 26
- 2025Synthesizing world models for bilevel planningcited by 14
- 2026Executable World Models for ARC-AGI-3 in the Era of Coding Agentscited by 14
- 2026Code World Model: Coding Agent as World Braincited by 14
- 2026Generative Visual Code Mobile World Modelscited by 13
- 2025Generating Symbolic World Models via Test-time Scaling of Large Language Modelscited by 12
- 2026EgoForge: Goal-Directed Egocentric World Simulatorcited by 12
- 2025One Life to Learn: Inferring Symbolic World Models for Stochastic Environments from Unguided Explorationcited by 10
- 2025Agent2World: Learning to Generate Symbolic World Models via Adaptive Multi-Agent Feedbackcited by 9
- 2026Debugging code world modelscited by 5
12 most cited of 21 All 21 (JSON)
- 2026D-World: An Explicit World-Language-Action Model with Recursive Self-Improvement under Dual Control12 Oct 2026
- 2026EMPIRIC: Experiment-Driven Learning of Residual World Models for Robot Planning28 Sep 2026
- 2026AI for Games in the Foundation Model Era15 Sep 2026
- 2026Code World Model: Coding Agent as World Brain26 Aug 2026
- 2026Twin: Playing an Unknown Game with a Test-Time Digital Twin14 Aug 2026
- 2026Quo Vadis, World Modeling?3 Aug 2026
- 2026Do Coding Agents Need Executable World Models, Simplification, and Verification to Solve ARC-AGI-3?16 Jul 2026
- 2026World-Time Compute with Verified Code World Models7 Jul 2026
- 2026Executable World Models for ARC-AGI-3 in the Era of Coding Agents6 May 2026
- 2026EgoForge: Goal-Directed Egocentric World Simulator20 Mar 2026
- 2026Code World Models for Parameter Control in Evolutionary Algorithms25 Feb 2026
- 2026Debugging code world models7 Feb 2026
12 newest of 21 All 21 (JSON)
- 2026Budget-Constrained Agentic Large Language Models: Intention-Based Planning for Costly Tool Usecited by 8
- 2026Trust No Tool: Evaluating and Defending LLM Agents under Untrusted Tool Feedbackcited by 2
- 2026Autonomous Repair for Multi-Agent Systems via Monte-Carlo Tree Searchcited by 1
- 2026Hypothesis Generation and Inductive Inference in Children and Language Modelscited by 0
- 2026Schema: Discovering Unknown Environments via Agentic Program Inductioncited by 0
- 2026Schema: Discovering Unknown Environments via Agentic Program Induction30 Sep 2026
- 2026Autonomous Repair for Multi-Agent Systems via Monte-Carlo Tree Search31 Jul 2026
- 2026Hypothesis Generation and Inductive Inference in Children and Language Models23 May 2026
- 2026Trust No Tool: Evaluating and Defending LLM Agents under Untrusted Tool Feedback17 May 2026
- 2026Budget-Constrained Agentic Large Language Models: Intention-Based Planning for Costly Tool Use12 Feb 2026
- 2025Monte Carlo Tree Search for Comprehensive Exploration in LLM-Based Automatic Heuristic Designcited by 109
- 2025A Survey on LLM Test-Time Compute via Search: Tasks, LLM Profiling, Search Algorithms, and Relevant Frameworkscited by 21
- 2025Your Language Model May Think Too Rigidly: Achieving Reasoning Consistency with Symmetry-Enhanced Trainingcited by 3
- 2026When LLM Meets Tree Search: A Systematic View of Inference as Search in Large Language Modelscited by 0
- 2026When LLM Meets Tree Search: A Systematic View of Inference as Search in Large Language Models31 Aug 2026
- 2025Your Language Model May Think Too Rigidly: Achieving Reasoning Consistency with Symmetry-Enhanced Training25 Feb 2025
- 2025A Survey on LLM Test-Time Compute via Search: Tasks, LLM Profiling, Search Algorithms, and Relevant Frameworks17 Jan 2025
- 2025Monte Carlo Tree Search for Comprehensive Exploration in LLM-Based Automatic Heuristic Design15 Jan 2025
- 2025Navigating the Alpha Jungle: An LLM-Powered MCTS Framework for Formulaic Factor Miningcited by 16
- 2025Entropy-guided sequence weighting for efficient exploration in RL-based LLM fine-tuningcited by 13
- 2025Adamas: Hadamard Sparse Attention for Efficient Long-Context Inferencecited by 4
- 2025Zero-Shot Privacy-Aware Text Rewriting via Iterative Tree Searchcited by 3
- 2025Mini Amusement Parks (MAPs): A Testbed for Modelling Business Decisionscited by 1
- 2026COvolve: Adversarial Co-Evolution of Large-Language-Model-Generated Policies and Environments via Two-Player Zero-Sum Gamecited by 1
- 2025Lessons from Neuroscience for AI: How integrating Actions, Compositional Structure and Episodic Memory could enable Safe, Interpretable and Human-Like AIcited by 0
- 2026ROSUM-MCTS: Monte Carlo Tree Search-Inspired HDL Code Summarization with Structural Rewardscited by 0
- 2026ROSUM-MCTS: Monte Carlo Tree Search-Inspired HDL Code Summarization with Structural Rewards6 Jun 2026
- 2026COvolve: Adversarial Co-Evolution of Large-Language-Model-Generated Policies and Environments via Two-Player Zero-Sum Game30 Mar 2026
- 2025Lessons from Neuroscience for AI: How integrating Actions, Compositional Structure and Episodic Memory could enable Safe, Interpretable and Human-Like AI27 Dec 2025
- 2025Mini Amusement Parks (MAPs): A Testbed for Modelling Business Decisions19 Nov 2025
- 2025Adamas: Hadamard Sparse Attention for Efficient Long-Context Inference21 Oct 2025
- 2025Zero-Shot Privacy-Aware Text Rewriting via Iterative Tree Search25 Sep 2025
- 2025Navigating the Alpha Jungle: An LLM-Powered MCTS Framework for Formulaic Factor Mining16 May 2025
- 2025Entropy-guided sequence weighting for efficient exploration in RL-based LLM fine-tuning28 Mar 2025
Similar, not cited
Close in wording, no citation either way
- 2026Distilling Game Code World Model Generation into Lightweight Large Language Models
- 2025CWM: An Open-Weights LLM for Research on Code Generation with World Models
- 2024Enhancing Code LLMs with Reinforcement Learning in Code Generation: A Survey
- 2024StepCoder: Improve Code Generation with Reinforcement Learning from Compiler Feedback
- 2024RLEF: Grounding Code LLMs in Execution Feedback with Reinforcement Learning
- 2025Code World Models for General Game Playing
- 2023Self-planning Code Generation with Large Language Models
- 2025R-WoM: Retrieval-augmented World Model For Computer-use Agents