@dair_ai: Intriguing paper on leveraging world models to make RL unnecessary. Do agents still need RL when they can read the simu…
Summary
An intriguing paper proposes replacing task-specific RL training with LLM-based coding agents that read environment source code and directly synthesize control policies, matching or beating baselines like QMIX, PPO, and DreamerV3 across multiple benchmarks with far fewer interactions.
View Cached Full Text
Cached at: 11/29/26, 12:36 AM
Intriguing paper on leveraging world models to make RL unnecessary.
Do agents still need RL when they can read the simulator’s source code?
Researchers find that, in many cases, they don’t.
(bookmark it)
A coding agent reads the environment’s source code, writes a control policy as a program, and refines it with online feedback or offline data. There is no task-specific RL training.
They test it on SMAC, MPE, MiniGrid, Box2D, D4RL, and BabyAI, against QMIX, MAPPO, DQN, PPO, and DreamerV3 trained for 2M to 10M environment steps.
The synthesized policies match or beat those baselines with far fewer interactions. On D4RL maze2d-umaze, the agent’s policy scores 154.0, against 94.7 for CQL. In some tasks, a working policy comes directly from the source code with zero trial and error.
Policies written without source access do worse, so reading the dynamics is what produces the gain.
https://arxiv.org/abs/2611.34656
Chat with Paper: https://academy.dair.ai/papers/do-we-still-need-reinforcement-learning-when-we-can-read-the-world-model-2611.34656…
Do We Still Need Reinforcement Learning When We Can Read the World Model?
Source: https://arxiv.org/html/2611.34656 Mingchao ZhangMiduo CuiKangze HeYuanjun LiDapeng LiCe ZhangChuanchen LuoAffiliation:Shandong UniversityAffiliation:Institute of Automation, Chinese Academy of SciencesAffiliation:Li Auto Inc.Affiliation:Tsinghua UniversityXue YanMingzhe XingZhumin ChenHangyu MaoBin ZhangZhiwei XuAffiliation:Shandong UniversityAffiliation:Institute of Automation, Chinese Academy of SciencesAffiliation:Nanyang Technological UniversityAffiliation:Institute of Microelectronics, Chinese Academy of Sciences*Equal contribution.†Corresponding author:[email protected]
Abstract
Reinforcement learning has achieved remarkable success in sequential decision-making, but learning effective policies often requires substantial interaction experience. Model-based reinforcement learning alleviates this dependence by leveraging world models, which are typically used to support planning or policy optimization. In this paper, we investigate an alternative paradigm in which autonomous LLM-based coding agents directly synthesize control policies by reasoning over readable world models. By examining environment source code, these agents translate environmental knowledge into executable decision rules and iteratively refine their policies using online feedback or offline data, without task-specific RL training. Experiments across diverse decision-making benchmarks show that synthesized policies match or outperform conventional RL methods while requiring substantially less experience. Further analyses reveal interpretable decision rules and how they evolve through feedback-driven refinement. Comparisons with policies generated without source code access and experiments under challenging conditions further demonstrate the benefits of readable world models. These findings suggest that direct policy synthesis can reduce reliance on trial and error, challenging the necessity of task-specific RL training.
The great end of life is not knowledge, but action. — Thomas Henry Huxley
1Introduction
Figure 1:Comparison of conventional RL and policy synthesis from readable world models.Reinforcement learning (RL)[1]has emerged as a powerful framework for sequential decision-making. It has demonstrated remarkable capabilities in single-agent control[2]and multi-agent coordination[3,4]. Offline RL has further extended its applicability by enabling policy learning from previously collected experience[5]. Despite these advances, the effectiveness of RL remains heavily dependent on interaction data. Online RL often requires extensive trial and error to acquire sufficient experience. In contrast, offline RL avoids additional environment interaction but remains constrained by the quality and coverage of existing data. To improve data efficiency, model-based RL[6]leveragesworld models[7]to predict how environments respond to actions. By supporting planning or generating simulated experience, these models can reduce the need for real environment interactions[8,9]. However, prediction-based planning and policy optimization are not the only ways to exploit knowledge of the environment. When the environment implementation is accessible, its source code provides an explicit description of the underlying dynamics and reward mechanisms. Such knowledge opens up an alternative possibility: directly constructing executable control policies from areadable world model, without task-specific RL training. This raises a fundamental question:Can access to a readable world model make reinforcement learning unnecessary for effective decision-making?
Answering this question requires bridging the gap between understanding an environment and deriving an effective control policy. Although a known world model can support planning, it does not directly specify how an agent should act to maximize cumulative rewards. Traditional approaches typically address this problem through explicit planning or task-specific optimization[10,11]. Recent advances in large language models (LLMs)[12], particularly their code understanding[13]and reasoning capabilities[14], offer a different possibility. By examining the environment implementation, LLMs can reason about how actions influence future states. They can further use this knowledge to identify effective decision rules and translate them into executable control policies. Unlike conventional RL methods, this process does not necessarily require learning policy parameters through repeated interaction. Instead, environment interactions can primarily serve toevaluateandrefinethe generated policies. This suggests a different paradigm for sequential decision-making, in which control policies are directly synthesized from world models rather than acquired through task-specific RL training.
To investigate this possibility, we study whether autonomous LLM-based coding agents, such asCodex(OpenAI)[15]andClaude Code(Anthropic)[16], can synthesize effective control policies directly from environment source code. In this setting, the agent is given access to the environment implementation, which serves as an explicit and readable world model. By analyzing this implementation, the agent seeks to understand the underlying environment mechanisms and derive suitable decision rules. These rules are then translated intoexecutable programsthat directly determine the agent’s actions. The generated policies can be evaluated through environment interaction and iteratively refined based on execution feedback, as shown in Figure1. Importantly, this process does not require task-specific RL training, as policies are constructed through code reasoning rather than conventional policy optimization. We conduct extensive experiments across diverse sequential decision-making benchmarks to examine the effectiveness of this approach. Our evaluation focuses on both the performance of the synthesized policies and the environment interactions required to obtain them.
Experimental results demonstrate that policies synthesized from readable world models achieve performance comparable to or even surpassing that of established RL methods across diverse sequential decision-making tasks. More importantly, they attain such performance with substantially fewer environment interactions than conventional RL training. In some tasks, effective policies can be synthesized directly from readable world models without any trial and error. In others, a small number of feedback-driven refinements can further improve policy performance. Beyond these aggregate results, we further investigate how the synthesized policies make decisions by examining their underlying code. This analysis provides insights into the structure and interpretability of the generated strategies, revealing how environmental knowledge is translated into concrete decision rules. To understand the contribution of readable world models, we further compare these strategies with code-based policies generated without access to environment source code. This comparison allows us to assess how explicit environmental knowledge influences policy performance and interaction efficiency. These analyses suggest that access to a readable world model can fundamentally change the role of environment interaction. Rather than learning policies primarily from interaction experience, agents can construct effective strategies by reasoning over explicit environmental knowledge. Subsequent refinement can be guided by execution feedback in online settings or by existing datasets in offline settings. Taken together, these experimental results and further analyses suggest thatdirect policy synthesis from readable world modelsoffers a promising alternative to task-specific RL training.
2Related Work
2.1World Models for Decision-Making
World models provide representations of environment dynamics that can support planning and control. When the environment dynamics are known, optimal decision-making can be formulated through dynamic programming or planning over Markov decision processes[17,18]. Early model-based RL methods, such as Dyna[19], integrated model learning with planning to improve policy learning from experience. AlphaZero[20]further demonstrated the effectiveness of planning with known game rules, while still relying on reinforcement learning to optimize its policy. Subsequent research has focused on learning world models when the environment dynamics are unknown. PILCO[21]and PETS[22]employ probabilistic dynamics models to enable sample-efficient control. PlaNet[23]extends model-based planning to visual environments by learning compact latent dynamics. Similarly, TD-MPC[24]and TD-MPC2[25]leverage learned latent models for efficient trajectory optimization. Another line of research exploits world models to generate simulated experience for policy learning. Early work on recurrent world models[26]demonstrated that policies could be trained within learned simulated environments. SimPLe[27]and the Dreamer family[28,29,30]further advanced this direction by enabling policy learning from imagined trajectories. MBPO[31]incorporates short model-generated rollouts into policy optimization, while MOReL[32], MOPO[33], and COMBO[34]extend model-based learning to offline settings. Meanwhile, MuZero[35]and EfficientZero[36]combine learned models with search to improve decision-making.
Beyond neural representations, recent research has explored explicit and executable world models. WorldCoder[37], for example, employs language models to construct programmatic world models from interaction experience and subsequently performs planning over them. These advances highlight the potential of representing environmental knowledge in a form that supports explicit reasoning. However, when the environment implementation itself is accessible, the underlying dynamics need not be inferred solely from interaction data. Instead of using a world model primarily for simulation or policy optimization, an agent may directly reason over its source code to construct executable control policies. This perspective motivates our investigation into whether readable world models can support effective decision-making without task-specific RL training.
2.2LLMs for Decision-Making
Large language models (LLMs) have increasingly been explored as a means of solving sequential decision-making problems through reasoning and planning. Early studies demonstrated that pretrained language models could generate actionable plans from task descriptions[38]or select feasible actions by leveraging pretrained skills[39]. Subsequent approaches, such as ReAct[40]and AdaPlanner[41], incorporated environmental feedback to support adaptive decision-making. Reflexion[42]further demonstrated that language agents could improve their behavior through verbal feedback without updating model parameters. Other studies combined LLMs with symbolic planning, either by translating task descriptions into formal planning problems[43]or by constructing explicit domain models[44]. Together, these advances establish the potential of LLMs to support decision-making without task-specific policy training.
Beyond generating action sequences, recent research has explored the use of LLMs to synthesize executable decision programs. Code as Policies[45]and ProgPrompt[46]demonstrated how generated programs could represent robot control policies and task plans. VoxPoser[47]further leveraged code generation to construct spatial value maps for model-based control. Similarly, Voyager[48]developed reusable executable skills through iterative interaction with the environment. In symbolic planning, LLM-generated programs have also been shown to generalize across different task instances[49]. These studies suggest that executable code can provide a reusable representation of decision-making strategies.
Another line of research has employed LLMs to automate components of conventional RL policy optimization. Language to Rewards[50]and Text2Reward[51]used LLMs to generate reward functions that guide subsequent control optimization. Eureka[52]and DrEureka[53]further explored automated reward design, while retaining reinforcement learning as the primary mechanism for acquiring control policies. More closely related to direct policy synthesis, Code to Control[54]generated executable controllers whose parameters were optimized using environment feedback. Recent work on generalized task and motion planning[55]also demonstrated that coding agents could synthesize reusable decision programs and investigated the benefits of environment source code access.
Building on these advances, our work investigates whether readable world models can substantially reduce the need for task-specific RL training across diverse sequential decision-making benchmarks. Rather than focusing on a particular policy synthesis algorithm, we systematically examine the performance and interaction efficiency of generated control programs. We further analyze their underlying decision logic and investigate how access to environment source code contributes to effective policy synthesis.
3Policy Synthesis from Readable World Models
This section introduces the setting for synthesizing control policies from readable world models. The sequential decision-making problem is first formulated, with environment source code serving as an explicit representation of the world model. The policy development process is then described, focusing on how autonomous coding agents construct and iteratively refine executable policies. Finally, we present the evaluation protocol for assessing policy performance and interaction efficiency. AppendicesA.3andB.1provide details on environment access and online task prompts, respectively.
3.1Problem Formulation
We consider a sequential decision-making environmentℰ\mathcal{E}involvingNNagents, whereN=1N=1corresponds to the single-agent setting. At each time steptt, the environment has an underlying statests_{t}, from which each agentiireceives an observationotio_{t}^{i}. In partially observable settings, the observationotio_{t}^{i}may not fully reveal the underlying statests_{t}. Each agent selects an actionatia_{t}^{i}based on its interaction historyhtih_{t}^{i}. The environment then transitions to the next statest+1s_{t+1}and provides a rewardrtr_{t}. The objective is to find a joint policy𝝅={πi}i=1N\boldsymbol{\pi}=\{\pi_{i}\}_{i=1}^{N}that maximizes the expected cumulative reward, defined asJℰ(𝝅)=𝔼[∑t=0T−1γtrt]J_{\mathcal{E}}(\boldsymbol{\pi})=\mathbb{E}[\sum_{t=0}^{T-1}\gamma^{t}r_{t}], whereγ\gammadenotes the discount factor andTTis the episode horizon.
Conventional RL methods acquire policies by optimizing them using interaction experience, either collected online or provided through offline datasets. In contrast, we consider a setting where environmental mechanisms can be directly accessed and understood through readable representations. Motivated by this perspective, we formally define the concept of a readable world model as follows.
Definition 1 (Readable World Model).Areadable world modelis an accessible and interpretable representation of an environment’s underlying mechanisms that can be directly examined and reasoned over by coding agents. In this work, the environment source code𝒞ℰ\mathcal{C}_{\mathcal{E}}serves as a readable world model. It encodes the state transition dynamicsPℰ(st+1∣st,𝒂t)P_{\mathcal{E}}(s_{t+1}\mid s_{t},\boldsymbol{a}_{t})and the reward functionRℰ(st,𝒂t,st+1)R_{\mathcal{E}}(s_{t},\boldsymbol{a}_{t},s_{t+1}), where𝒂t=(at1,…,atN)\boldsymbol{a}_{t}=(a_{t}^{1},\ldots,a_{t}^{N})denotes the joint action. The implementation also specifies the observation and termination mechanisms.
Given the readable world model𝒞ℰ\mathcal{C}_{\mathcal{E}}, the goal is to synthesize an executable programccthat implements a control policy𝝅c\boldsymbol{\pi}_{c}. A pretrained coding agent constructs this program by reasoning over the environment implementation. The generated policy can be evaluated and iteratively refined through environment interaction. Unlike conventional RL training, this process does not require task-specific policy parameter optimization. Our objective is to investigate whether such synthesized policies can achieve competitive performance with substantially fewer environment interactions.
Figure 2:Overview of policy synthesis from readable world models. An autonomous coding agent constructs executable policies by reasoning over environment source code. The policies are iteratively refined using online feedback or offline data. The resulting policies are then independently evaluated and further analyzed under various settings.
3.2Policy Construction and Refinement
We consider an autonomous LLM-based coding agent, such as Codex or Claude Code, that independently manages the entire policy development process. Given the environment source code𝒞ℰ\mathcal{C}_{\mathcal{E}}, the agent first explores the implementation to understand the mechanisms governing environment behavior. In particular, it examines how actions influence future states and how the resulting transitions affect rewards. Based on this understanding, the agent derives decision rules aimed at maximizing long-term returns. These rules are then translated into an executable programccthat implements the control policy𝝅c\boldsymbol{\pi}_{c}. Importantly, the entire process is driven by the coding agent without human intervention, including subsequent policy refinement.
Policy synthesis isNOTnecessarily completed in a single attempt. Starting from an initial programc(0)c^{(0)}, the agent can iteratively revise its decision logic based on available feedback. This process produces a sequence of candidate programs{c(k)}k=0K\{c^{(k)}\}_{k=0}^{K}, where each revision aims to address weaknesses identified in earlier versions. The candidate with the best assessed performance during development is selected as the final policyc∗c^{*}. The feedback available for policy refinement depends on whether the agent operates in an online or offline setting:
Online.In online settings, the agent can execute a candidate policy in the environment to collect interaction trajectories. By examining the resulting states and rewards, it can identify situations where the current policy makes ineffective decisions. These observations then guide modifications to the policy code, allowing the agent to progressively improve its behavior. Each execution contributes to the interaction cost of policy development, which is explicitly accounted for in our evaluation.
Offline.In offline settings, the agent instead relies on a fixed dataset𝒟off\mathcal{D}_{\mathrm{off}}containing previously collected interaction trajectories. The availability of such data also allows the agent to construct policies using statistical machine learning (ML) methods, such as decision trees[56]or regression models[57]. To assess a candidate policy, the agent can compare its predicted actions with those recorded in the dataset. For example, agreement with actions from high-return trajectories may reveal useful behavioral patterns, while disagreement with actions from low-return trajectories may highlight alternative decisions. Such comparisons provide useful diagnostic signals, although they do not directly establish the expected return of the generated policy. Based on these observations, the agent can identify potential weaknesses and refine its decision logic without collecting additional environment interactions.
To track the performance of synthesized policies, we independently evaluate selected intermediate versionsc(k)c^{(k)}and the final versionc∗c^{*}. These evaluations follow the same protocol as the RL baselines, using held-out random seeds to estimate policy performance. Unlike the feedback used for policy refinement, the evaluation results are withheld from the coding agent and do not influence subsequent code revisions. Consequently, the corresponding evaluation interactions are excluded from the policy development interaction budget. During evaluation, each synthesized program operates through the prescribed observation-action interface without further LLM inference or policy updates. This separation ensures that evaluation measures policy performance without providing additional information for policy development.
3.3Evaluation Protocol
We evaluate the effectiveness of synthesized policies from two primary perspectives:policy performanceandinteraction efficiency. For each benchmark, policy performance is measured using its standard evaluation metrics, such as episode return or task success rate. At selected development checkpoints, the synthesized programc(k)c^{(k)}is independently evaluated using held-out random seeds. The same evaluation protocol is applied to conventional RL baselines to ensure consistent performance comparisons. These evaluations allow us to track how policy quality evolves throughout the development process.
Interaction efficiency measures the amount of experience required to obtain a policy with a given level of performance. For online policy synthesis, interaction efficiency is measured by the cumulative number of environment transitions consumed during policy development. This includes all interactions whose feedback is accessible to the coding agent, regardless of whether they lead to successful policy improvements. Independent evaluation interactions are excluded, as their results are not available for policy refinement. For offline policy synthesis, the experience budget is determined by the size of the provided dataset𝒟off\mathcal{D}_{\mathrm{off}}, without additional environment interaction during development. We compare synthesized policies with RL baselines under matched experience budgets and examine the amount of experience needed to achieve comparable performance.
Beyond aggregate performance, we analyze the decision logic embedded in the generated programs. By examining representative policies and their revisions, we investigate how environmental knowledge is translated into executable decision rules. To assess the contribution of readable world models, we further compare policies synthesized with and without access to environment source code. Both settings employ the same coding agent and comparable development budgets, while differing in the availability of the environment implementation. This comparison helps isolate the benefits of explicit environmental knowledge from the general policy synthesis capabilities of coding agents. Finally, we conduct additional analyses under specialized scenarios and experimental settings to gain a broader understanding of the capabilities and limitations of this policy synthesis paradigm.
4Policy Performance and Sample Efficiency
4.1Experimental Setup
Benchmarks.We first evaluate the overall effectiveness of policy synthesis from readable world models across diverse sequential decision-making benchmarks. The online experiments include theStarCraft Multi-Agent Challenge(SMAC)[58]andMulti-Agent Particle Environments(MPE)[4]for multi-agent coordination, along withMiniGrid[59]andBox2D[60]for single-agent decision-making and control. The offline experiments employDatasets for Deep Data-Driven Reinforcement Learning(D4RL)[61]to investigate policy synthesis from fixed experience datasets.BabyAI[62]is further included to examine instruction-following tasks under different demonstration budgets. Table1summarizes the benchmark configurations and evaluation metrics.
Policy Synthesis Setup.All policy synthesis experiments employ Codex powered bygpt-6-astrawithmaxreasoning effort. For clarity, we refer toPolicySynthesis withReadableWorldModels asPS-RWMthroughout the experiments. Each experimental configuration is evaluated through three independent runs with different random seeds, covering both online and offline settings. In each run, the coding agent autonomously examines the environment implementation, constructs executable control policies, and refines them using available development feedback. During policy construction and refinement, PS-RWM can leverage additional environmental knowledge obtained from the readable world model. However, during policy execution and independent evaluation, synthesized policies receive theSAMEobservations as the corresponding RL baselines, without access to privileged environment information. In multi-agent environments, each agent receives its own observation and selects its action independently. For SMAC, each agent additionally receives its legal-action mask and previous action, consistent with the corresponding RL baselines. This ensures that the comparison focuses on differences in policy development rather than differences in the information available during decision-making.
Table 1:Summary of evaluation benchmarks.SettingBenchmarkActionTaskMetricOnlineSMACDiscreteMulti-agent combatWin (%)MPEContinuousMulti-agent coordinationReturnMiniGridDiscreteSingle-agent navigationSuccess (%)Box2DContinuousSingle-agent controlReturnOfflineD4RLContinuousOffline controlReturnBabyAIDiscreteInstruction followingSuccess (%)
Baselines.For online benchmarks, we compare PS-RWM with representative model-free and model-based RL methods. The model-free baselines include QMIX[63]for SMAC, MAPPO[64]for MPE, DQN[65]for MiniGrid, and PPO[66]for Box2D. The model-based baselines include MBVD[67]for SMAC, SeqWM[68]for MPE, and DreamerV3[30]for both MiniGrid and Box2D. QMIX and MBVD have a training budget of approximately 2 million environment steps. The remaining online baselines use a 10-million-step training budget, with comparisons for SeqWM onSpread (5 agents)using the first 8 million steps. For offline benchmarks, we consider Conservative Q-Learning (CQL)[69], Implicit Q-Learning (IQL)[70], Bootstrapping Error Accumulation Reduction (BEAR)[71], and TD3+BC[72]as representative offline RL baselines. Behavior Cloning (BC) and Decision Transformer (DT)[73]are further included to represent imitation learning and sequence modeling approaches, respectively. Implementation details and evaluation schedules for the core online baselines are provided in AppendixA.1.2.
Evaluation Settings.Policy selection and performance evaluation follow different protocols depending on the experimental setting. In online benchmarks, the final PS-RWM policy is selected based on the highest score achieved in a complete 100-episode development validation within the first 1,600 attempted episodes. This budget covers preliminary tests, failed attempts, and validation episodes. Offline experiments adopt a different procedure, where policy construction relies on previously collected dataWITHOUTadditional environment interaction. On D4RL, three policies are independently constructed for each task and subsequently evaluated over 100 episodes using normalized scores. Policy synthesis is further evaluated on BabyAI using demonstration budgets of 0, 64, and 256 episodes, without additional environment interaction during development. The resulting policies are evaluated on 100 held-out random seeds, with success rate as the performance metric. Throughout offline policy development, independent evaluation feedback remains inaccessible to the coding agent. All results are summarized using the mean and standard deviation across independent runs where applicable.
4.2Overall Policy Performance
We first investigate whether policies synthesized from readable world models can achieve competitive performance without task-specific RL training. Figure3presents the performance of PS-RWM alongside the learning curves of conventional RL methods. PS-RWM outperforms the corresponding model-free RL baselines in 15 of the 16 online scenarios. In SMAC, it achieves mean win rates of at least 99.3% on three maps, while QMIX and MBVD achieve higher scores on8m_vs_9m. In MPE, PS-RWM outperforms MAPPO across all four tasks and surpasses SeqWM in three, with SeqWM achieving a higher return onSpeaker--Listener. In single-agent benchmarks, PS-RWM achieves 100% success across all four MiniGrid tasks in each independent run. It also outperforms PPO across all Box2D tasks and surpasses DreamerV3 on bothLunarLandervariants. However, DreamerV3 maintains an advantage on the more challengingBipedalWalkertasks. Overall, these results demonstrate the strong competitiveness of synthesized policies across diverse online decision-making environments.
The offline experiments further examine whether effective policies can be constructed directly from fixed experience datasets. As shown in Table2, PS-RWM achieves the highest average normalized scores on Maze2D, AntMaze, and Kitchen. The advantages are particularly pronounced in Maze2D and Kitchen, where PS-RWM outperforms all reported baselines across every evaluated task. On AntMaze, the generated policies also demonstrate competitive performance, although the advantages vary across datasets. In contrast, PS-RWM remains less competitive on MuJoCo locomotion and Adroit manipulation, particularly in tasks requiring precise continuous control. These results indicate that direct policy synthesis can achieve strong performance in various offline decision-making problems, although its effectiveness remains task-dependent.
Beyond D4RL, BabyAI extends the offline evaluation to instruction-following tasks under varying demonstration budgets. As reported in Table3(a), PS-RWM achieves an average success rate of 99.28%, substantially outperforming all six learning-based baselines. Remarkably, PS-RWM maintains a 100% success rate across all six tasks even without access to demonstration data, as shown in Table3(b). Comparable performance is observed with 64 demonstrations, while the average success rate decreases slightly to 98.83% with 256 demonstrations. These findings suggest that readable world models can provide sufficient environmental knowledge to construct highly effective policies even when interaction experience is limited or unavailable during development.
Figure 3:Performance comparison between PS-RWM and RL baselines across 16 online tasks. Solid curves show RL performance, with shading indicating standard deviation across three runs. Box2D curves report training returns.Table 2:Performance comparison on D4RL benchmarks. Higher normalized scores indicate better performance. PS-RWM results are reported as mean±\pmsample standard deviation over three independent policy-construction runs.Table 3:Performance comparison and demonstration efficiency on BabyAI. Success rates are reported in percentages.MMdenotes the number of complete demonstration episodes available to PS-RWM during policy construction.
4.3Sample Efficiency
We further investigate how much experience is required to construct effective control policies in both online and offline settings. In online settings, a performance target is defined for each task to enable a consistent comparison of the environment steps required by different methods. Specifically, the targets are set to an 80% win rate for SMAC and an 80% success rate for MiniGrid. For MPE and Box2D, the target is the lowest final-test mean return among the three model-free RL runs. The interaction cost of PS-RWM includes all development steps up to the first 100-episode validation that reaches the target, including unsuccessful attempts and earlier policy versions. For online RL baselines, the required steps are determined by the earliest periodic or final checkpoint evaluation that reaches the target. Since Box2D reports training returns, smoothed training returns are used instead to determine target attainment. RL evaluation interactions and model-generated rollouts are accounted for separately. In offline settings, data efficiency is assessed by varying the amount of previously collected experience available for policy construction. The performance of the resulting policies is then evaluated under different data budgets, without collecting additional environment interactions during development.
Online.Table4summarizes the online sample efficiency results under the predefined performance targets. PS-RWM successfully reaches the target in all three independent runs on 15 of the 16 scenarios. The advantage is particularly pronounced in MiniGrid, where PS-RWM requires only 1,789 environment steps onDoorKey, compared with 400,000 steps for DreamerV3. This represents a reduction of more than 200 times in environment interactions. Similar improvements are observed in other tasks, although their magnitude varies. For instance, PS-RWM reaches the target onBipedalWalkerafter 529,773 steps, compared with 633,333 steps for PPO. Overall, these results suggest that reasoning over readable world models can substantially reduce the experience required to obtain competitive policies.
Offline.The offline analysis further examines the data efficiency of PS-RWM using four nested subsets ofhalfcheetah-medium-v2, ranging from 1% to 100% of the original dataset. As shown in Table5, PS-RWM can construct an effective controller using only 1% of the data, corresponding to 10 trajectories and 10,000 transitions. With this limited experience, the coding agent constructs a policy based on Matérn kernel ridge regression to predict control actions from observed states. The resulting policy achieves a D4RL normalized score of 41.03, comparable to the average score of 40.886 obtained by the demonstration trajectories. Notably, this policy is constructed without additional environment interaction or task-specific RL training. These results suggest that PS-RWM can extract useful control strategies from limited offline experience by combining readable world models with conventional statistical learning methods.
The above results demonstrate that readable world models can substantially reduce the experience required for effective policy development. PS-RWM achieves competitive performance with fewer environment interactions in online settings and constructs effective policies from limited data in offline settings. To better understand these findings, we next examine the decision-making mechanisms and evolution of the synthesized policies.
Table 4:Environment steps required to reach predefined performance targets. Results indicate the mean steps to first attainment among successful runs. Parentheses report the number of successful runs out of three. Bold indicates the fewest steps, while a dash indicates that the target was never reached.Table 5:Offline data efficiency onhalfcheetah-medium-v2.
Figure 4:Performance trends under different offline dataset fractions onhalfcheetah-medium-v2.
5Understanding Synthesized Policies
5.1Decision-Making Mechanisms
While the preceding results demonstrate the effectiveness of PS-RWM, aggregate performance metrics provide limited insight into how the synthesized policies make decisions. Understanding their decision-making behavior is essential for revealing the strategies underlying their performance. To this end, we examine representative policy behaviors in both online and offline settings. The analysis focuses on coordination among agents in multi-agent tasks and the use of environment dynamics in continuous control.
Table 6:Allied death rates and zero-death episode rates on SMAC (%).Online.To examine multi-agent decision-making behavior, we compare PS-RWM with QMIX across four SMAC scenarios. Table6reports the allied death rate and the proportion of episodes without allied casualties. Across the four scenarios, PS-RWM achieves a substantially lower average death rate than QMIX (34.80% vs. 84.45%). It also achieves higher zero-death episode rates in every scenario. The largest difference occurs on3s_vs_5z, where 74.67% of PS-RWM episodes end without allied casualties, compared with only 13.67% for QMIX. These results indicate that synthesized policies are more effective at preserving allied units during combat.
To further understand this behavior, Figure5compares the action sequences of both policies on3s5z_vs_3s6z. PS-RWM exhibits two coordinated combat strategies:kitingandfocus fire. The allied Stalkers repeatedly retreat between attacks, while all five Zealots concentrate their attacks on enemy StalkerE8during steps 16-25 before switching together toE7. In contrast, QMIX shows less coordinated behavior in the illustrated episode, with limited retreating and more dispersed target selection. Figure6further visualizes these strategies in action, showing the Stalkers retreating while the Zealots jointly attack the same target. These observations illustrate how the synthesized policy coordinates individual actions to improve team-level behavior. The underlying decision rules are further examined in Section5.2.
Offline.The offline analysis further examines how synthesized policies account for environment dynamics in continuous control. We considermaze2d-large, where a point mass is controlled through acceleration and receives rewards for remaining inside a goal region. Since the episode continues after reaching the goal, excessive momentum may cause the agent to leave the rewarding region. An effective policy therefore needs to regulate its velocity to remain near the goal. To examine this behavior, we evaluate PS-RWM on recorded observations where the agent is inside the goal region but moving away from its center. PS-RWM selects actions that oppose the current velocity in 99.87% of these states, compared with only 28.64% of the recorded dataset actions. This difference suggests that the synthesized policy accounts for momentum and favors actions that help maintain the agent within the rewarding region.
These findings reveal that synthesized policies can exhibit meaningful decision-making behaviors across different environments. The coordinated combat strategies in SMAC and momentum-aware control in Maze2D suggest that PS-RWM can translate environmental knowledge into effective actions. The following subsections further examine how these behaviors are reflected in the generated policy code.
Figure 5:Joint action traces on3s5z_vs_3s6zfrom representative episodes of (a) PS-RWM and (b) QMIX. Rows represent allied units, and columns represent environment steps. Cell colors indicate actions, while colored outlines identify attack targets. Retreat refers to movement away from the nearest living enemy.
Figure 6:Illustration of PS-RWM’s coordinated behavior on3s5z_vs_3s6z. At step 16 (left), three allied Stalkers retreat, as indicated by the orange arrows. At step 22 (right), all five allied Zealots (A3–A7) focus fire on enemy Stalker E8.
5.2Interpretability of Synthesized Policies
Unlike neural policies, the executable policies synthesized by PS-RWM expose explicit decision rules that can be directly inspected. We examine representative policies from both online and offline tasks to understand how these rules produce effective behaviors.
Online.Listing1presents the policy rules for Stalker kiting and Zealot focus fire in3s5z_vs_3s6z. Each allied unit selects its action based on its local observation, legal-action mask, and previous action. The listing is abridged, with the complete policy and additional examples provided in AppendixE.2.
For Stalkers, the policy triggers retreat when the nearest visible enemy Zealot is within2.82.8map units. This threshold increases to5.75.7units for fewer than four steps after the last recorded attack. During retreat, the unit moves away from visible enemies, with closer enemies receiving greater weight in determining the escape direction. When retreat is no longer necessary, the Stalker resumes attacking if a target is within range. These rules enable Stalkers to alternate between attacking and retreating based on enemy proximity and recent actions. For Zealots, the policy prioritizes visible enemy Stalkers based on their distance, health, and shields. Each Zealot attacks its preferred target when in range and moves toward it otherwise. This shared targeting rule allows multiple Zealots to independently converge on the same enemy, producing the focus-fire behavior observed in Figure5(a).
Offline.Listing2illustrates how the synthesized controller approaches the final waypoint in the offlinemaze2d-largetask. The controller first computes a desired velocity toward the goal center from the displacement(dx, dy). It then determines a bounded action based on the difference between this desired velocity and the current velocityv. When the agent overshoots the goal center, the desired velocity reverses direction, causing the controller to brake rather than continue moving away. This feedback mechanism explains the goal-region behavior observed in Section5.1.
These examples show that PS-RWM synthesizes interpretable decision rules rather than opaque action mappings. The resulting policies exhibit distinct mechanisms for multi-agent coordination and continuous control, which can be directly traced to their executable implementations.
Listing 1:Local decision rules for Stalker kiting and Zealot focus fire in3s5z_vs_3s6z.defmake_policy(agent_id):
defact(context):
obs=context[’observation’]
avail=context[’avail_actions’]
ifstalker:
ifsize==136:
melee=[rfor_,rinenemiesifr[6]>.5]
danger=min((r[1]*9forrinmelee),default=9.)
kite=danger<2.8or(tick-last_shot<4anddanger<5.7)
ifkite:
vx=vy=0.
for_,rinenemies:
w=1./max(.1,r[1]*9)**2
vx-=r[2]*9*w
vy-=r[3]*9*w
returnmove(vx,vy-(.35iftick<25else0),True)
ifsize==136andnotstalker:
ranged=[(i,r)fori,rinenemiesifr[7]>.5]
ifranged:
enemy=min(ranged,key=lambdae:e[1][4]*.2+e[1][5]*.1+e[1][1]*2)
ifavail[6+enemy[0]]:return6+enemy[0]
returnmove(enemy[1][2]*9,enemy[1][3]*9)
iftargets:
target=min(targets,key=target_score)[0]
ifstalkerandtick-last_shot>=4:
last_shot=tick
return6+target
returnmove(nearest[2],nearest[3])
returnact
Listing 2:Velocity feedback at the final waypoint inmaze2d-large.speed=min(cfg[“max_speed”],cfg[“goal_position_gain”]*d)
s=speed/max(d,1e-12)
vd=(dx*s,dy*s)
gain=cfg[“velocity_gain”]
actions=[clip(gain*(vd[j]-v[j])+cfg[“drag_compensation”]*v[j])forjinrange(2)]
5.3Policy Evolution through Feedback
In this subsection, we examine how PS-RWM uses feedback during development to revise the decision rules of synthesized policies. By comparing initial and revised policy versions, we investigate how these revisions affect decision-making behavior in both online and offline tasks.
Figure 7:Policy development across 16 online scenarios. For each scenario, the three vertically stacked panels represent independent development sessions. The horizontal axis indicates the policy version, while the vertical axis shows the mean evaluation performance. Filled markers connected by lines indicate evaluations over 100 episodes, while hollow markers represent smaller or partial tests conducted during development.Online.We analyze successive policy versions synthesized by PS-RWM forBipedalWalker-v3. In this Box2D environment, a two-legged robot controls its hip and knee joints to walk forward without falling. Figure8illustrates how feedback from early failures leads to revised control rules and improved walking behavior. In the initial rollout, the torso moves ahead of the support foot before the next step, eventually causing the robot to fall. After examining these failures, PS-RWM reduces the forward-speed threshold (s[2]) from0.290.29to0.220.22in two decision rules. During single-leg support, this change allows the support-knee target angle to increase more rapidly at lower speeds. During push-off, it also permits an earlier leg switch when the transition is triggered by forward speed. With these revised rules, the walker alternates support legs and remains upright until the1,6001{,}600-step time limit in the illustrated rollout. Figure7provides additional evaluations of frozen policy versions across all four environment families, with three development sessions per family.
Figure 8:Feedback-driven policy refinement onBipedalWalker.Offline.Unlike online refinement, offline refinement relies on recorded trajectories rather than feedback from executing candidate policies. For example, inmaze2d-umaze-v1, PS-RWM examines recorded positions and velocities to refine how the controller negotiates a sharp turn.
Figure9compares the initial and revised policies at the same recorded state. As shown in the left panel, the agent is at the upper-right corner of the maze, moving upward with a vertical velocity of2.702.70. The initial policy applies vertical braking (ay=−1.00a_{y}=-1.00) and delays turning until the vertical speed falls below1.101.10. The revised policy instead considers whether the agent has reached the turn and whether its estimated stopping interval remains within the corridor boundaries. It then initiates a leftward command (ax=−1.00a_{x}=-1.00) while continuing to brake vertically. In the subsequent evaluation from this state, the revised policy reaches the goal region in9999steps, compared with167167for the initial policy. The corresponding returns increase from134134to202202.
Figure 9:Offline policy refinement at the upper-right turn inmaze2d-umaze-v1. All three panels show the same recorded state. Dashed arrows indicate upward velocity, and solid arrows show braking and turning commands.These analyses show how PS-RWM’s synthesized policies make decisions and improve through feedback. Their decision-making behaviors can be traced to explicit policy rules, providing insight into multi-agent coordination and continuous control. The evolution of these rules further reveals how PS-RWM incorporates feedback from online rollouts or offline trajectories to refine its policies.
6The Role of Readable World Models
The preceding experiments demonstrate the performance of PS-RWM when readable world models are available. This section investigates how access to environment implementations affects policy synthesis. We compare PS-RWM with and without such access under matched experimental conditions, covering both online and offline tasks.
6.1With vs. Without Readable World Models
Online.We first compare policy synthesis with and without access to readable world models across 16 online scenarios. Both conditions use the same underlying model, reasoning effort, task instructions, and environment versions. With readable world models, PS-RWM can inspect the environment implementation during development. Without such access, it relies on task descriptions and public interface documentation. Both conditions use the same observation and action interfaces and can refine policies through environment feedback. Both conditions follow the evaluation protocol in Section4.1.
Table7shows that access to readable world models improves the mean development-validation score in eight scenarios, while the condition without access performs better in three and ties in five. Both conditions achieve 100% success rates on all four MiniGrid tasks and3s_vs_5z. Access to readable world models provides higher scores on the remaining three SMAC scenarios, while differences across MPE tasks remain below 0.50. For Box2D, the condition without access performs slightly better on bothLunarLandervariants, whereas access improves performance on bothBipedalWalkervariants. The largest difference occurs onBipedalWalker-v3. The condition without access also exhibits greater variation across development sessions.
Table 7:Performance comparison with and without access to readable world models across 16 online scenarios. Results are reported as mean±\pmsample standard deviation over three runs.Offline.We further examine the role of readable world models on the offline Kitchen benchmark. Both conditions receive the same full offline dataset, four task goals, and public policy interface. With readable world models, PS-RWM additionally accesses the environment implementation and implementation notes, including object coordinates and task completion thresholds. Without such access, policy synthesis relies only on the provided dataset and task information. Three non-neural policies are constructed under each condition without environment interaction. Each frozen policy is evaluated on the same 100 seeds using public observations and within-episode history. We report the D4RL normalized score and full completion rate, which measure the average percentage of completed tasks and the percentage of episodes completing all four tasks, respectively.
Table 8:Performance comparison with and without access to readable world models on offline Kitchen tasks. Results are reported as mean±\pmsample standard deviation over three independently constructed policies. Full completion denotes the percentage of episodes in which all four tasks are completed.As shown in Table8, access to readable world models substantially improves both normalized scores and full completion rates on offline Kitchen tasks. The improvement is particularly pronounced onkitchen-partial, where successful demonstrations are relatively scarce. These results suggest that readable world models can provide valuable guidance for policy synthesis when offline data offer limited examples of successful task completion. Dataset sizes are provided in AppendixA.2.1.
Overall, the results from both online and offline tasks demonstrate the value of readable world models for policy synthesis, although their benefits vary across scenarios. The improvements are particularly evident in challenging control tasks and offline settings with limited successful demonstrations, highlighting the value of environment knowledge beyond task descriptions and interaction data.
6.2How World Model Access Changes Policy Synthesis
Figure 10:FourRoomsnavigation with and without readable world model access. PS-RWM infers unobserved walls from environment rules, while policies without source access retain them as unknown.Beyond performance comparisons, we further investigate how access to readable world models influences the policy synthesis process. Two representative examples illustrate how explicit environmental knowledge can guide decision-making and improve the utilization of offline experience.
Online.In MiniGridFourRooms, PS-RWM incorporates the environment geometry and doorway rules into its decision logic. As illustrated in Figure10, knowing that each internal wall contains a single opening allows the policy to infer walls that have not yet been observed. In contrast, policies synthesized without readable world model access construct their maps from observations and explore unknown regions. Although both settings achieve 100% success, PS-RWM requires only 28.4 actions per episode on average, compared with 34.4 without source access. This suggests that readable world models can improve decision efficiency by providing structural knowledge beyond immediate observations. Further details are provided in AppendixD.4.
Offline.A different benefit emerges in Kitchen, where readable world models help extract task-specific information from offline trajectories. Although recorded rewards indicate task progress, they do not directly identify which objects have reached their target states. By examining the task completion rules, PS-RWM can distinguish the outcomes of different action sequences and organize the data accordingly. In two recorded segments with the same reward at step 60, the next objects to reach their reference configurations are the bottom burner and the kettle, respectively. PS-RWM uses these events to label action sequences by object, keeping actions associated with the unscored burner out of the kettle’s reference set. Additional details are provided in AppendixD.5.
These examples demonstrate how readable world models provide useful knowledge beyond direct interaction experience. Such knowledge supports inference about unobserved environmental structure and enables more informative use of offline data.
7Policy Synthesis under Challenging Conditions
Readable world models provide explicit knowledge of environmental mechanisms, which may offer advantages under challenging decision-making conditions. Sparse rewards provide limited feedback for discovering effective behaviors. Partial observability restricts the information available during policy execution. Task generalization further requires synthesized policies to remain effective under changing task configurations. This section investigates whether PS-RWM can address these challenges by leveraging environmental knowledge rather than relying primarily on trial and error.
7.1Sparse-Reward Environments
Sparse rewards pose a major challenge to RL, as infrequent feedback makes effective behaviors difficult to discover through trial and error[74,75]. To examine whether readable world models can alleviate this challenge, we investigate policy synthesis under sparse rewards in both online and offline settings. For a fair comparison, the source code provided to the coding agent contains only the sparse-reward implementation, with all dense-reward shaping terms removed.
Online.We compare PS-RWM with conventional RL methods under dense and sparse reward settings across SMAC, MiniGrid, and Box2D, as reported in Table9. For each reward setting, RL baselines are trained separately, while PS-RWM independently constructs policies from the corresponding readable world models. A dense-reward variant is additionally introduced forDoorKey, which originally provides only terminal rewards. The results show that conventional RL methods suffer substantial performance degradation under sparse rewards. In particular, QMIX and DQN fail to achieve successful episodes, while PPO exhibits a significant decline in landing performance. In contrast, PS-RWM maintains strong performance across these benchmarks, with nearly unchanged success or win rates on SMAC and MiniGrid. Similar results are observed in Box2D, where PS-RWM achieves nearly perfect landing success despite the removal of intermediate rewards. Notably, the lower numerical returns under sparse rewards primarily reflect the removal of reward shaping rather than degraded control performance.
Table 9:Performance under dense and sparse rewards across SMAC (win rate, %), MiniGrid (success rate, %), and Box2D (episode return), reported as mean±\pmstandard deviation over three seeds. RL baselines are QMIX (SMAC), DQN (MiniGrid), and PPO (Box2D). Both RL baselines and PS-RWM are trained or synthesized separately for each reward setting. Bold indicates the higher score between RL and PS-RWM within each reward setting.Offline.The offline analysis further examines whether useful control strategies can be derived from datasets containing limited reward information. As shown in Table2, PS-RWM outperforms the reported baselines across all three Maze2D layouts, where rewards are obtained only within the goal region. Inmaze2d-large, positive rewards account for less than 1% of recorded transitions in a representative construction. Nevertheless, the agent can exploit the recorded movements and environment dynamics to construct navigation and velocity-control strategies. A similar phenomenon appears in AntMaze, where trajectories without positive returns can still provide useful information about locomotion. Such experience allows the coding agent to derive gait-related control rules, although performance remains less consistent across different AntMaze datasets.
These results demonstrate that readable world models can substantially reduce the dependence of policy synthesis on dense reward feedback. Across both online and offline settings, PS-RWM can construct effective policies by reasoning over environmental mechanisms and extracting useful information from experience, even when rewards are sparse. This highlights the potential of direct policy synthesis for decision-making problems where reward-driven learning is particularly challenging.
7.2Partial Observability
Partial observability poses a fundamental challenge to sequential decision-making, as individual observations may not fully reveal the underlying environment state[76]. This challenge becomes more pronounced in multi-agent environments, where agents must coordinate their actions based on limited local information[77]. To investigate this issue, we examine the performance of PS-RWM under varying observation scopes in both online and offline settings.
Table 10:Performance comparison under different observation settings on MiniGrid and SMAC. Results are reported as mean±\pmstandard deviation over three seeds. PS-RWM policies synthesized under the default observation settings are directly reused, with one-round interaction-free revisions evaluated under altered settings.Online.Table10compares PS-RWM with conventional RL methods under different observation settings in MiniGrid and SMAC. The results show that broader observations do not necessarily lead to better RL performance. DQN struggles on several MiniGrid tasks requiring historical information, while QMIX exhibits considerable performance variations across different sight radii. In contrast, PS-RWM achieves perfect success across all four MiniGrid tasks under the original7×77\times 7observation setting. The generated policies explicitly incorporate memory and state inference to compensate for incomplete observations. For example, theMemorypolicy retains previously observed cues, while theFourRoomspolicy infers unobserved map structures from accumulated information. Directly transferring these policies to different observation dimensions leads to substantial degradation due to mismatches in observation handling. However, a single source-guided revision without additional environment interaction restores nearly perfect success under both full and5×55\times 5observations. This demonstrates the ability of coding agents to adapt existing policies to new observation formats through code reasoning.
The SMAC experiments further examine policy adaptation under changing local visibility. Unlike MiniGrid, changing the sight radius preserves the observation vector format, allowing direct execution of the original policies. With expanded visibility, PS-RWM maintains strong performance and outperforms QMIX across the evaluated scenarios. Under restricted visibility, however, the results become more task-dependent. Some policies remain competitive, while others suffer substantial degradation because their decision rules rely on information about nearby units. A single interaction-free revision improves performance in certain scenarios but can also weaken previously effective strategies. These results suggest that explicit decision rules can support adaptation to changing visibility, although their effectiveness depends on the information available during execution.
Table 11:Offline BabyAI success rates (%) and mean episode lengths (steps) under different view sizes.Offline.The offline experiments extend this investigation to six BabyAI instruction-following tasks with7×77\times 7,5×55\times 5, and3×33\times 3local observations. The same offline trajectories are provided across different observation settings, with smaller views obtained through consistent spatial cropping. Each synthesized policy is independently constructed and evaluated on the same 100 environment seeds. As shown in Table11, PS-RWM maintains strong success rates even under severely restricted observations. Reduced visibility primarily increases the number of actions required to complete tasks. For example, theGoToSeqpolicy maintains 100% success under both7×77\times 7and3×33\times 3observations, although its average episode length increases substantially. In contrast, several offline learning baselines exhibit lower success rates and longer episodes as visibility decreases. Analysis of the generated programs reveals that PS-RWM explicitly maintains memory to compensate for missing information. For instance, theGoToRedBallpolicy constructs a relative map from historical observations, while thePutNextLocalpolicy remembers object locations and previously executed actions to guide object placement.
These findings demonstrate that readable world models can support effective decision-making under partial observability by enabling explicit memory and state inference. Furthermore, coding agents can adapt existing policies to changes in observation conditions without additional RL training. Nevertheless, successful adaptation depends on the compatibility between the generated decision logic and the information available during execution.
7.3Generalization to Environment Variations
Generalizing policies across environment variations remains challenging in RL and MARL, as changes in task configurations may invalidate previously learned decision strategies. To investigate this issue, we evaluate the transferability of PS-RWM policies across related SMAC and MiniGrid scenarios, as shown in Table12. Two settings are considered: direct execution of the original policy and a single source-guided revision. The revision uses only the original policy, target task description, and environment source code, without additional environment interaction or execution feedback.
In SMAC, changes in agent counts alter the observation structure, preventing the original policy from executing directly on the target scenarios. A single revision restores executability across all three variants and achieves a high win rate on the similarly scaled10m_vs_11m. However, performance remains limited under larger changes in force ratios and battle scale. In contrast, the observation interface remains compatible across MiniGrid variants, allowing direct execution of the original policy. Although performance declines on randomized layouts, a single interaction-free revision restores 100% success across all three target configurations. These results demonstrate that coding agents can adapt existing policies to new task configurations by revising their decision logic, although the effectiveness of such adaptation varies with task complexity.
The findings highlight both the potential and limitations of transferring synthesized policies across environment variations. While direct transfer can be limited by task-specific assumptions, the explicit structure of generated programs enables targeted modifications based on readable world models. This offers a promising alternative to retraining policies from scratch, particularly when adapting to closely related environments.
Table 12:Generalization and one-round adaptation results across environment variations in SMAC (win rate, %) and MiniGrid (success rate, %).PS-RWM Default Policydirectly executes the policies synthesized for8m_vs_9mandDynamic Obstacles (8×88\times 8)on target scenarios without modification.PS-RWM One-Round Revisionapplies a single interaction-free code revision using only the source policy, target scenario description, and environment code. All policies are evaluated over 100 episodes per seed across three seeds (mean±\pmstandard deviation).×\timesindicates execution failure due to observation-format incompatibility.
8Discussion and Conclusion
This work investigates whether autonomous coding agents can synthesize effective control policies directly from readable world models without task-specific RL training. Across diverse online and offline benchmarks, PS-RWM achieves competitive performance against established RL methods. More importantly, these policies often require substantially fewer environment interactions or can be constructed from limited offline data. Further analyses reveal how the synthesized programs implement effective decision rules, while comparisons with source-free policy synthesis highlight the benefits of readable world models. Additional experiments under challenging conditions further demonstrate the potential and limitations of this approach.
These findings suggest that world models can play a broader role in sequential decision-making. In conventional model-based RL, world models are primarily used to predict future transitions and support planning or policy optimization. However, when a world model is available as readable source code, it can also serve as a direct source of knowledge for policy construction. Autonomous coding agents can interpret the underlying environmental mechanisms and translate this knowledge into executable control policies. These policies may incorporate explicit decision rules or statistical models constructed from available experience. The key distinction therefore lies not in whether a world model is used, but in how its knowledge is converted into effective actions. This perspective highlights an alternative use of world models, where general-purpose coding agents can construct control policies without relying on task-specific RL training.
Importantly, access to readable world models represents a practical information setting rather than an assumption of universally perfect environmental knowledge. Although coding agents can inspect additional environmental mechanisms during policy development, the synthesized policies follow the same observation constraints as RL baselines during execution. The distinction therefore lies in how environmental knowledge is acquired and utilized, rather than in privileged information available during decision-making. Such a setting is particularly relevant to programmable simulators and software-defined systems, where environment implementations are directly accessible. Moreover, the growing development of digital twins creates further opportunities for applying this paradigm to real-world decision-making problems. These examples suggest that readable world models can serve as a valuable foundation for policy synthesis beyond conventional RL benchmarks.
These findings raise an important question about the necessity of task-specific RL training. When readable world models are available, effective policies can often be constructed directly without learning them through conventional RL algorithms. This suggests that RL training need not always be the default approach to sequential decision-making. However, this does not imply that RL is universally unnecessary. Some complex control tasks may still benefit from interaction-driven policy optimization, even when environmental mechanisms are accessible. Rather than completely replacing RL, direct policy synthesis offers an alternative that may also complement conventional learning methods. For example, synthesized policies could provide effective initial strategies that are subsequently improved through RL when necessary.
Despite these opportunities, several challenges remain for broader applications of readable world models. While executable environment models are available in many simulation-based and software-defined systems, their accessibility and accuracy may vary across applications. In particular, discrepancies between available models and actual environment dynamics can affect the reliability of synthesized policies. Even with source code access, constructing effective strategies remains challenging for tasks requiring precise continuous control. Moreover, generated policies may rely on task-specific assumptions and require revision when environment configurations change. Although PS-RWM substantially reduces environment interactions, the computational cost of coding agents should also be considered. Future research could extend policy synthesis to incomplete or uncertain world models and investigate how interaction feedback can improve the reliability of generated policies.
Effective control policies do not always need to be acquired through task-specific reinforcement learning. Our findings demonstrate that autonomous coding agents can translate readable world models into competitive control policies with substantially less reliance on interaction experience. As executable world models become increasingly accessible, direct policy synthesis offers a promising path toward decision-making driven by environmental knowledge rather than extensive trial and error.
References
- [1](1998)Reinforcement learning: an introduction.IEEE Trans. Neural Networks9(5),pp. 1054–1054.External Links:DocumentCited by:§1.
- [2]H. van Hasselt, A. Guez, and D. Silver(2016)Deep reinforcement learning with double q-learning.InProceedings of the Thirtieth AAAI Conference on Artificial Intelligence, February 12-17, 2016, Phoenix, Arizona, USA,D. Schuurmans and M. P. Wellman (Eds.),pp. 2094–2100.External Links:DocumentCited by:§1.
- [3]P. Sunehag, G. Lever, A. Gruslys, W. M. Czarnecki, V. Zambaldi, M. Jaderberg, M. Lanctot, N. Sonnerat, J. Z. Leibo, K. Tuyls,et al.(2017)Value-decomposition networks for cooperative multi-agent learning.arXiv preprint arXiv:1706.05296.Cited by:§1.
- [4]R. Lowe, Y. I. Wu, A. Tamar, J. Harb, O. Pieter Abbeel, and I. Mordatch(2017)Multi-agent actor-critic for mixed cooperative-competitive environments.Advances in neural information processing systems30.Cited by:§1,§4.1.
- [5]S. Levine, A. Kumar, G. Tucker, and J. Fu(2020)Offline reinforcement learning: tutorial, review, and perspectives on open problems.arXiv preprint arXiv:2005.01643.Cited by:§1.
- [6]T. M. Moerland, J. Broekens, A. Plaat, and C. M. Jonker(2023)Model-based reinforcement learning: a survey.Foundations and Trends in Machine Learning16(1),pp. 1–118.Cited by:§1.
- [7]D. Ha and J. Schmidhuber(2018)World models.arXiv preprint arXiv:1803.101222(3),pp. 440.Cited by:§1.
- [8]R. S. Sutton(1991)Dyna, an integrated architecture for learning, planning, and reacting.ACM Sigart Bulletin2(4),pp. 160–163.Cited by:§1.
- [9]V. Feinberg, A. Wan, I. Stoica, M. I. Jordan, J. E. Gonzalez, and S. Levine(2018)Model-based value estimation for efficient model-free reinforcement learning.arXiv preprint arXiv:1803.00101.Cited by:§1.
- [10]J. Oh, S. Singh, and H. Lee(2017)Value prediction network.Advances in neural information processing systems30.Cited by:§1.
- [11]J. Schrittwieser, I. Antonoglou, T. Hubert, K. Simonyan, L. Sifre, S. Schmitt, A. Guez, E. Lockhart, D. Hassabis, T. Graepel,et al.(2020)Mastering atari, go, chess and shogi by planning with a learned model.Nature588(7839),pp. 604–609.Cited by:§1.
- [12]S. Minaee, T. Mikolov, N. Nikzad, M. Chenaghlu, R. Socher, X. Amatriain, and J. Gao(2024)Large language models: a survey.arXiv preprint arXiv:2402.06196.Cited by:§1.
- [13]J. Jiang, F. Wang, J. Shen, S. Kim, and S. Kim(2026)A survey on large language models for code generation.ACM Transactions on Software Engineering and Methodology35(2),pp. 1–72.Cited by:§1.
- [14]J. Huang and K. C. Chang(2023)Towards reasoning in large language models: a survey.InFindings of the association for computational linguistics: ACL 2023,pp. 1049–1065.Cited by:§1.
- [15]OpenAI(2025)Introducing codex.Note:https://openai.com/index/introducing-codex/Cited by:§1.
- [16]Anthropic(2025)Claude 3.7 sonnet and claude code.Note:https://www.anthropic.com/news/claude-3-7-sonnetCited by:§1.
- [17]A. M. Brandt, W. Dzieniszewski, S. Jendo, W. Marks, S. Owczarek, and Z. Wasiutyński(2018)Dynamic programming.Journal of the Operational Research Society44,pp. 526–527.External Links:LinkCited by:§2.1.
- [18]A. Feinberg(1996)Markov decision processes: discrete stochastic dynamic programming (martin l. puterman).SIAM Rev.38(4),pp. 689.External Links:DocumentCited by:§2.1.
- [19]R. S. Sutton(1990)Integrated architectures for learning, planning, and reacting based on approximating dynamic programming.InML Workshop,External Links:LinkCited by:§2.1.
- [20]D. Silver, T. Hubert, J. Schrittwieser, I. Antonoglou, M. Lai, A. Guez, M. Lanctot, L. Sifre, D. Kumaran, T. Graepel, T. P. Lillicrap, K. Simonyan, and D. Hassabis(2018)A general reinforcement learning algorithm that masters chess, shogi, and go through self-play.Science362,pp. 1140 – 1144.External Links:LinkCited by:§2.1.
- [21]M. P. Deisenroth and C. E. Rasmussen(2011)PILCO: a model-based and data-efficient approach to policy search.InInternational Conference on Machine Learning,External Links:LinkCited by:§2.1.
- [22]K. Chua, R. Calandra, R. McAllister, and S. Levine(2018)Deep reinforcement learning in a handful of trials using probabilistic dynamics models.InAdvances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada,S. Bengio, H. M. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (Eds.),pp. 4759–4770.External Links:LinkCited by:§2.1.
- [23]D. Hafner, T. P. Lillicrap, I. Fischer, R. Villegas, D. Ha, H. Lee, and J. Davidson(2019)Learning latent dynamics for planning from pixels.InProceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA,K. Chaudhuri and R. Salakhutdinov (Eds.),Proceedings of Machine Learning Research, Vol.97,pp. 2555–2565.External Links:LinkCited by:§2.1.
- [24]N. Hansen, H. Su, and X. Wang(2022)Temporal difference learning for model predictive control.InInternational Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA,K. Chaudhuri, S. Jegelka, L. Song, C. Szepesvári, G. Niu, and S. Sabato (Eds.),Proceedings of Machine Learning Research, Vol.162,pp. 8387–8406.External Links:LinkCited by:§2.1.
- [25]N. Hansen, H. Su, and X. Wang(2024)TD-MPC2: scalable, robust world models for continuous control.InThe Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024,External Links:LinkCited by:§2.1.
- [26]D. Ha and J. Schmidhuber(2018)Recurrent world models facilitate policy evolution.InAdvances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada,S. Bengio, H. M. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (Eds.),pp. 2455–2467.External Links:LinkCited by:§2.1.
- [27]L. Kaiser, M. Babaeizadeh, P. Milos, B. Osinski, R. H. Campbell, K. Czechowski, D. Erhan, C. Finn, P. Kozakowski, S. Levine, A. Mohiuddin, R. Sepassi, G. Tucker, and H. Michalewski(2020)Model based reinforcement learning for atari.In8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020,External Links:LinkCited by:§2.1.
- [28]D. Hafner, T. P. Lillicrap, J. Ba, and M. Norouzi(2020)Dream to control: learning behaviors by latent imagination.In8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020,External Links:LinkCited by:§2.1.
- [29]D. Hafner, T. P. Lillicrap, M. Norouzi, and J. Ba(2021)Mastering atari with discrete world models.In9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021,External Links:LinkCited by:§2.1.
- [30]D. Hafner, J. Pasukonis, J. Ba, and T. P. Lillicrap(2025)Mastering diverse control tasks through world models.Nat.640(8059),pp. 647–653.External Links:Link,DocumentCited by:§2.1,§4.1.
- [31]M. Janner, J. Fu, M. Zhang, and S. Levine(2019)When to trust your model: model-based policy optimization.InAdvances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada,H. M. Wallach, H. Larochelle, A. Beygelzimer, F. d’Alché-Buc, E. B. Fox, and R. Garnett (Eds.),pp. 12498–12509.External Links:LinkCited by:§2.1.
- [32]R. Kidambi, A. Rajeswaran, P. Netrapalli, and T. Joachims(2020)MOReL: model-based offline reinforcement learning.InAdvances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual,H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin (Eds.),External Links:LinkCited by:§2.1.
- [33]T. Yu, G. Thomas, L. Yu, S. Ermon, J. Y. Zou, S. Levine, C. Finn, and T. Ma(2020)MOPO: model-based offline policy optimization.InAdvances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual,H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin (Eds.),External Links:LinkCited by:§2.1.
- [34]T. Yu, A. Kumar, R. Rafailov, A. Rajeswaran, S. Levine, and C. Finn(2021)COMBO: conservative offline model-based policy optimization.InAdvances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual,M. Ranzato, A. Beygelzimer, Y. N. Dauphin, P. Liang, and J. W. Vaughan (Eds.),pp. 28954–28967.External Links:LinkCited by:§2.1.
- [35]J. Schrittwieser, I. Antonoglou, T. Hubert, K. Simonyan, L. Sifre, S. Schmitt, A. Guez, E. Lockhart, D. Hassabis, T. Graepel, T. P. Lillicrap, and D. Silver(2020)Mastering atari, go, chess and shogi by planning with a learned model.Nat.588(7839),pp. 604–609.External Links:Link,DocumentCited by:§2.1.
- [36]W. Ye, S. Liu, T. Kurutach, P. Abbeel, and Y. Gao(2021)Mastering atari games with limited data.InAdvances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual,M. Ranzato, A. Beygelzimer, Y. N. Dauphin, P. Liang, and J. W. Vaughan (Eds.),pp. 25476–25488.External Links:LinkCited by:§2.1.
- [37]H. Tang, D. Key, and K. Ellis(2024)WorldCoder, a model-based LLM agent: building world models by writing code and interacting with the environment.InAdvances in Neural Information Processing Systems 37: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 - 15, 2024,A. Globersons, L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. M. Tomczak, and C. Zhang (Eds.),External Links:LinkCited by:§2.1.
- [38]W. Huang, P. Abbeel, D. Pathak, and I. Mordatch(2022)Language models as zero-shot planners: extracting actionable knowledge for embodied agents.InInternational Conference on Machine Learning, ICML 2022, 17-23 July 2022, Baltimore, Maryland, USA,K. Chaudhuri, S. Jegelka, L. Song, C. Szepesvári, G. Niu, and S. Sabato (Eds.),Proceedings of Machine Learning Research, Vol.162,pp. 9118–9147.External Links:LinkCited by:§2.2.
- [39]B. Ichter, A. Brohan, Y. Chebotar, C. Finn, K. Hausman, A. Herzog, D. Ho, J. Ibarz, A. Irpan, E. Jang, R. Julian, D. Kalashnikov, S. Levine, Y. Lu, C. Parada, K. Rao, P. Sermanet, A. Toshev, V. Vanhoucke, F. Xia, T. Xiao, P. Xu, M. Yan, N. Brown, M. Ahn, O. Cortes, N. Sievers, C. Tan, S. Xu, D. Reyes, J. Rettinghouse, J. Quiambao, P. Pastor, L. Luu, K. Lee, Y. Kuang, S. Jesmonth, N. J. Joshi, K. Jeffrey, R. J. Ruano, J. Hsu, K. Gopalakrishnan, B. David, A. Zeng, and C. K. Fu(2022)Do as I can, not as I say: grounding language in robotic affordances.InConference on Robot Learning, CoRL 2022, 14-18 December 2022, Auckland, New Zealand,K. Liu, D. Kulic, and J. Ichnowski (Eds.),Proceedings of Machine Learning Research, Vol.205,pp. 287–318.External Links:LinkCited by:§2.2.
- [40]S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. R. Narasimhan, and Y. Cao(2023)ReAct: synergizing reasoning and acting in language models.InThe Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023,External Links:LinkCited by:§2.2.
- [41]H. Sun, Y. Zhuang, L. Kong, B. Dai, and C. Zhang(2023)AdaPlanner: adaptive planning from feedback with language models.InAdvances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023,A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine (Eds.),External Links:LinkCited by:§2.2.
- [42]N. Shinn, F. Cassano, A. Gopinath, K. Narasimhan, and S. Yao(2023)Reflexion: language agents with verbal reinforcement learning.InAdvances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023,A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine (Eds.),External Links:LinkCited by:§2.2.
- [43]B. Liu, Y. Jiang, X. Zhang, Q. Liu, S. Zhang, J. Biswas, and P. Stone(2023)LLM+P: empowering large language models with optimal planning proficiency.CoRRabs/2304.11477.External Links:Link,Document,2304.11477Cited by:§2.2.
- [44]L. Guan, K. Valmeekam, S. Sreedharan, and S. Kambhampati(2023)Leveraging pre-trained large language models to construct and utilize world models for model-based task planning.InAdvances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023,A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine (Eds.),External Links:LinkCited by:§2.2.
- [45]J. Liang, W. Huang, F. Xia, P. Xu, K. Hausman, B. Ichter, P. R. Florence, and A. Zeng(2022)Code as policies: language model programs for embodied control.2023 IEEE International Conference on Robotics and Automation (ICRA),pp. 9493–9500.External Links:LinkCited by:§2.2.
- [46]I. Singh, V. Blukis, A. Mousavian, A. Goyal, D. Xu, J. Tremblay, D. Fox, J. Thomason, and A. Garg(2022)ProgPrompt: generating situated robot task plans using large language models.2023 IEEE International Conference on Robotics and Automation (ICRA),pp. 11523–11530.External Links:LinkCited by:§2.2.
- [47]W. Huang, C. Wang, R. Zhang, Y. Li, J. Wu, and L. Fei-Fei(2023)VoxPoser: composable 3d value maps for robotic manipulation with language models.InConference on Robot Learning, CoRL 2023, 6-9 November 2023, Atlanta, GA, USA,J. Tan, M. Toussaint, and K. Darvish (Eds.),Proceedings of Machine Learning Research, Vol.229,pp. 540–562.External Links:LinkCited by:§2.2.
- [48]G. Wang, Y. Xie, Y. Jiang, A. Mandlekar, C. Xiao, Y. Zhu, L. Fan, and A. Anandkumar(2024)Voyager: an open-ended embodied agent with large language models.Trans. Mach. Learn. Res.2024.External Links:LinkCited by:§2.2.
- [49]T. Silver, S. Dan, K. Srinivas, J. B. Tenenbaum, L. P. Kaelbling, and M. Katz(2023)Generalized planning in pddl domains with pretrained large language models.InAAAI Conference on Artificial Intelligence,External Links:LinkCited by:§2.2.
- [50]W. Yu, N. Gileadi, C. Fu, S. Kirmani, K. Lee, M. G. Arenas, H. L. Chiang, T. Erez, L. Hasenclever, J. Humplik, B. Ichter, T. Xiao, P. Xu, A. Zeng, T. Zhang, N. Heess, D. Sadigh, J. Tan, Y. Tassa, and F. Xia(2023)Language to rewards for robotic skill synthesis.InConference on Robot Learning, CoRL 2023, 6-9 November 2023, Atlanta, GA, USA,J. Tan, M. Toussaint, and K. Darvish (Eds.),Proceedings of Machine Learning Research, Vol.229,pp. 374–404.External Links:LinkCited by:§2.2.
- [51]T. Xie, S. Zhao, C. H. Wu, Y. Liu, Q. Luo, V. Zhong, Y. Yang, and T. Yu(2024)Text2Reward: reward shaping with language models for reinforcement learning.InThe Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024,External Links:LinkCited by:§2.2.
- [52]Y. J. Ma, W. Liang, G. Wang, D. Huang, O. Bastani, D. Jayaraman, Y. Zhu, L. Fan, and A. Anandkumar(2024)Eureka: human-level reward design via coding large language models.InThe Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024,External Links:LinkCited by:§2.2.
- [53]Y. J. Ma, W. Liang, H. Wang, Y. Zhu, L. Fan, O. Bastani, and D. Jayaraman(2024)DrEureka: language model guided sim-to-real transfer.InRobotics: Science and Systems XX, Delft, The Netherlands, July 15-19, 2024,D. Kulic, G. Venture, K. E. Bekris, and E. Coronado (Eds.),External Links:Link,DocumentCited by:§2.2.
- [54]Z. Ahmed, J. B. Tenenbaum, C. Bates, and S. J. Gershman(2026)Code to control: synthesizing parameterized reactive controllers.CoRRabs/2609.38733.External Links:Link,Document,2609.38733Cited by:§2.2.
- [55]M. Merler, B. Li, J. Roy, Y. Liang, Q. Wang, Y. Huang, and T. Silver(2026)Coding agents for generalized task and motion planning problems.CoRRabs/2609.30233.External Links:Link,Document,2609.30233Cited by:§2.2.
- [56]G. Ke, Q. Meng, T. Finley, T. Wang, W. Chen, W. Ma, Q. Ye, and T. Liu(2017)LightGBM: a highly efficient gradient boosting decision tree.InNeural Information Processing Systems,External Links:LinkCited by:§3.2.
- [57]R. Tibshirani(1996)Regression shrinkage and selection via the lasso.Journal of the royal statistical society series b-methodological58,pp. 267–288.External Links:LinkCited by:§3.2.
- [58]M. Samvelyan, T. Rashid, C. S. de Witt, G. Farquhar, N. Nardelli, T. G. J. Rudner, C. Hung, P. H. S. Torr, J. N. Foerster, and S. Whiteson(2019)The starcraft multi-agent challenge.InProceedings of the 18th International Conference on Autonomous Agents and MultiAgent Systems, AAMAS ’19, Montreal, QC, Canada, May 13-17, 2019,E. Elkind, M. Veloso, N. Agmon, and M. E. Taylor (Eds.),pp. 2186–2188.External Links:LinkCited by:§4.1.
- [59]M. Chevalier-Boisvert, B. Dai, M. Towers, R. Perez-Vicente, L. Willems, S. Lahlou, S. Pal, P. S. Castro, and J. Terry(2023)Minigrid & miniworld: modular & customizable reinforcement learning environments for goal-oriented tasks.InAdvances in Neural Information Processing Systems 36, New Orleans, LA, USA,Cited by:§4.1.
- [60]I. Parberry(2013)Introduction to game physics with box2d.External Links:LinkCited by:§4.1.
- [61]J. Fu, A. Kumar, O. Nachum, G. Tucker, and S. Levine(2020)D4RL: datasets for deep data-driven reinforcement learning.ArXivabs/2004.07219.External Links:LinkCited by:§4.1.
- [62]M. Chevalier-Boisvert, D. Bahdanau, S. Lahlou, L. Willems, C. Saharia, T. H. Nguyen, and Y. Bengio(2018)Babyai: a platform to study the sample efficiency of grounded language learning.arXiv preprint arXiv:1810.08272.Cited by:§4.1.
- [63]T. Rashid, M. Samvelyan, C. S. de Witt, G. Farquhar, J. N. Foerster, and S. Whiteson(2018)QMIX: monotonic value function factorisation for deep multi-agent reinforcement learning.InProceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018,J. G. Dy and A. Krause (Eds.),Proceedings of Machine Learning Research, Vol.80,pp. 4292–4301.External Links:LinkCited by:§4.1.
- [64]C. Yu, A. Velu, E. Vinitsky, J. Gao, Y. Wang, A. M. Bayen, and Y. Wu(2022)The surprising effectiveness of PPO in cooperative multi-agent games.InAdvances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022,S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh (Eds.),External Links:LinkCited by:§4.1.
- [65]I. Hosu and T. Rebedea(2016)Playing atari games with deep reinforcement learning and human checkpoint replay.CoRRabs/1607.05077.External Links:Link,Document,1607.05077Cited by:§4.1.
- [66]J. Schulman, F. Wolski, P. Dhariwal, A. Radford, and O. Klimov(2017)Proximal policy optimization algorithms.CoRRabs/1707.06347.External Links:Link,Document,1707.06347Cited by:§4.1.
- [67]Z. Xu, D. Li, B. Zhang, Y. Zhan, Y. Bai, and G. Fan(2022)Mingling foresight with imagination: model-based cooperative multi-agent reinforcement learning.InAdvances in Neural Information Processing Systems,Vol.35,pp. 11327–11340.External Links:Document,LinkCited by:§4.1.
- [68]Z. Zhao, H. Guo, S. Chen, K. Xu, B. Jiang, Y. Zhu, and D. Zhao(2026)Empowering multi-robot cooperation via sequential world models.InInternational Conference on Learning Representations,External Links:LinkCited by:§4.1.
- [69]A. Kumar, A. Zhou, G. Tucker, and S. Levine(2020)Conservative q-learning for offline reinforcement learning.InAdvances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual,H. Larochelle, M. Ranzato, R. Hadsell, M. Balcan, and H. Lin (Eds.),External Links:LinkCited by:§4.1.
- [70]I. Kostrikov, A. Nair, and S. Levine(2022)Offline reinforcement learning with implicit q-learning.InThe Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022,External Links:LinkCited by:§4.1.
- [71]A. Kumar, J. Fu, M. Soh, G. Tucker, and S. Levine(2019)Stabilizing off-policy q-learning via bootstrapping error reduction.InAdvances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada,H. M. Wallach, H. Larochelle, A. Beygelzimer, F. d’Alché-Buc, E. B. Fox, and R. Garnett (Eds.),pp. 11761–11771.External Links:LinkCited by:§4.1.
- [72]S. Fujimoto and S. S. Gu(2021)A minimalist approach to offline reinforcement learning.InAdvances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual,M. Ranzato, A. Beygelzimer, Y. N. Dauphin, P. Liang, and J. W. Vaughan (Eds.),pp. 20132–20145.External Links:LinkCited by:§4.1.
- [73]L. Chen, K. Lu, A. Rajeswaran, K. Lee, A. Grover, M. Laskin, P. Abbeel, A. Srinivas, and I. Mordatch(2021)Decision transformer: reinforcement learning via sequence modeling.InAdvances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual,M. Ranzato, A. Beygelzimer, Y. N. Dauphin, P. Liang, and J. W. Vaughan (Eds.),pp. 15084–15097.External Links:LinkCited by:§4.1.
- [74]M. Andrychowicz, D. Crow, A. Ray, J. Schneider, R. Fong, P. Welinder, B. McGrew, J. Tobin, P. Abbeel, and W. Zaremba(2017)Hindsight experience replay.InAdvances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA,I. Guyon, U. von Luxburg, S. Bengio, H. M. Wallach, R. Fergus, S. V. N. Vishwanathan, and R. Garnett (Eds.),pp. 5048–5058.External Links:LinkCited by:§7.1.
- [75]A. Ecoffet, J. Huizinga, J. Lehman, K. O. Stanley, and J. Clune(2021)First return, then explore.Nat.590(7847),pp. 580–586.External Links:Link,DocumentCited by:§7.1.
- [76]L. P. Kaelbling, M. L. Littman, and A. R. Cassandra(1998)Planning and acting in partially observable stochastic domains.Artif. Intell.101(1-2),pp. 99–134.External Links:Link,DocumentCited by:§7.2.
- [77]F. A. Oliehoek, M. T. J. Spaan, and N. Vlassis(2011)Optimal and approximate q-value functions for decentralized pomdps.CoRRabs/1111.0062.External Links:Link,Document,1111.0062Cited by:§7.2.
- [78]S. Hu, Z. Fan, C. Huang, L. Shen, Y. Zhang, Y. Wang, and D. Tao(2024)Q-value regularized transformer for offline reinforcement learning.InProceedings of the 41st International Conference on Machine Learning,ICML’24.Cited by:§A.2.3.
Appendix AExperimental Setup and Evaluation
A.1Online Experimental Setup
A.1.1Task Configurations
For each condition, with or without readable world model access, PS-RWM uses three independent coding sessions per environment family, each covering the four scenarios in Table13. Each RL baseline uses three independent training seeds per scenario. Each coding session has a budget of 1,600 attempted episodes per scenario, with 100 episodes per complete policy validation.
Table 13:Core online scenarios and episode limits.##### Environment settings.
SMAC uses StarCraft II 4.10 at difficulty level 7, with eight game loops per decision. MPE uses continuous actions. MiniGrid uses a7×77\times 7local view, with four moving obstacles inDynamic Obstaclesand random corridor length inMemory. The wind-enabledLunarLanderuses wind power 15 and turbulence power 1.5.
Development objectives.
SMAC and MiniGrid target 100% win rate and success rate, respectively, in complete 100-episode validations. MPE and Box2D maximize mean episode return. The fixed score targets for sample-efficiency comparisons are defined in Section4.3.
A.1.2Baselines and Evaluation
QMIX and MBVD use shaped rewards. DQN and DreamerV3 receive MiniGrid’s flattened symbolic local view and mission encoding. PPO and DreamerV3 use the native Box2D vector observations and continuous actions. We use PyMARL for QMIX, HARL for MAPPO, CleanRL for DQN and PPO, the authors’ implementations of MBVD and SeqWM, and the official JAX implementation of DreamerV3.
Table 14:Online RL training budgets and evaluation schedules.EnvironmentBaselinesTraining steps (M)Periodic evaluationFinal episodesInterval (K)EpisodesSMACQMIX, MBVD2.052.05101032323232MPEMAPPO10.0010.0010010020205050SeqWM (Spread, 5 agents)10.0010.0010010020205050SeqWM (other MPE tasks)10.0010.0010010020205050MiniGridDQN, DreamerV310.0010.0010010020205050Box2DPPO, DreamerV310.0010.00——5050
M =10610^{6}steps; K =10310^{3}steps. Episode counts are per seed. Box2D learning curves use training returns. SeqWM onSpread (5 agents)uses an 8M-step comparison cutoff.
Curves and interaction accounting.
SMAC, MPE, and MiniGrid use periodic evaluation scores. Box2D uses complete training-episode returns in 100,000-step bins. We apply a trailing mean of up to five points or bins per seed and report across-seed means and sample standard deviations. SMAC uses a 10,000-step grid within the shared recorded range. SeqWM uses shared checkpoints within budget. One joint multi-agent transition counts as one environment step. RL training steps exclude evaluation and model-generated rollouts. Attainment follows Section4.3.
A.2Offline Experimental Setup
A.2.1D4RL Datasets
Table15lists the supplied D4RL files and transition counts. We use the full files except for the HalfCheetah data-budget comparison. Recorded segments need not form complete episodes; Maze2D counts exclude the unfinished trailing segment omitted during export.
Table 15:D4RL datasets and transition counts.
HalfCheetah data budgets.
Onhalfcheetah-medium-v2, the 1%, 10%, 30%, and 100% budgets contain 10, 100, 300, and 1,000 trajectories of 1,000 transitions each. We shuffle trajectory IDs once with seed 0 and take prefixes, yielding nested subsets shared by all methods. Selection is independent of return, and temporal order within each trajectory is preserved.
A.2.2BabyAI Demonstrations
Table 16:BabyAI transition counts by construction input.Full-data and budgeted inputs use the different source pools described at left. TheM=0M=0condition contains no transitions.
Full-data comparisons.
Each of the six tasks uses 2,000 expert trajectories: 1,000 from Minari’s task-specificoptimal-v0dataset and 1,000 fromoptimal-fullobs-v0. The second source is converted to native local observations by replaying the recorded actions before policy construction. The resulting data contain local symbolic observations, mission text, direction, actions, rewards, and episode-ending flags. The full-data comparison and the three view-size conditions use the same trajectories; changing the view size does not change their number or length. Table16gives the transition counts for all six tasks.
Demonstration budgets.
TheM=0,64,256M=0,64,256experiment uses a separate pool of 1,000optimal-fullobs-v0episodes per task. We sort episode IDs, shuffle once with seed 0, and take the first 64 or 256 complete trajectories, yielding nested subsets. Selection is independent of reward or trajectory length. These inputs retain full-map observations; the deployed policy receives only the local7×77\times 7view and within-episode history. AtM=0M=0, no demonstrations or dataset summaries are supplied.
A.2.3Baselines and Evaluation
Published D4RL baseline scores in Table2are taken from prior work[78]. The BabyAI and HalfCheetah data-efficiency comparisons are local reruns. BabyAI uses our PyTorch implementations with discrete-action adaptations where needed. All BabyAI baselines, including the partial-observation comparisons, use 50,000 updates, batch size 64, learning rate10−410^{-4}, and a 20-step history window. For HalfCheetah, we use CORL for BC, the authors’ implementations of TD3+BC, IQL, and DT, D4RL Evaluations for BEAR, and a JAX adaptation of CQL. We retain the released default training settings. We evaluate each frozen final checkpoint over 100 episodes using the same environment seeds across methods and the native episode limits. We report D4RL normalized scores for HalfCheetah and success rates for BabyAI, with mean episode length additionally reported in the partial-observation experiments.
A.3With and Without Readable World Model Access
A.3.1Online Comparison
Across SMAC, MPE, MiniGrid, and Box2D, both conditions share task descriptions, interface documentation, the development prompt, and trial feedback. Only the condition with RWM access receives environment code during development. At execution, both use only public observations and policy-local memory, without scenario-name or episode-step fields. Each SMAC or MPE agent runs in a separate process using only its own observation and action history; SMAC also provides legal-action masks. Feedback includes scores and recorded observations, actions, rewards, and episode endings.
Development budgets and validation follow AppendixA.1; Table17summarizes the shared execution interfaces.
Table 17:Public execution interfaces shared by both access conditions.
A.3.2Offline Comparison in D4RL Kitchen
Both conditions give PS-RWM the same offline data, task goals, and public interface. The condition with RWM access adds environment code and implementation details such as object reference configurations and the completion threshold. Frozen policies act on public observations and episode history during evaluation on the same 100 seeds.
Both conditions construct policies without environment interaction, using the offline data and evaluation setup in AppendixA.2. The use of source rules to organize demonstrations is detailed in AppendixD.5.
A.4Settings for Challenging Conditions
A.4.1Sparse Rewards
We evaluate sparse-reward settings in four SMAC scenarios (3s_vs_5z,8m_vs_9m,3s5z_vs_3s6z, andcorridor),DoorKey-8×88\times 8, and continuousLunarLanderwith and without wind. Within each task, the reward variants retain the corresponding transition dynamics, observation interface, action space, and episode limit.
SMAC.
We use the environment’s built-inreward_sparseparameter to configure dense-reward and sparse-reward settings for QMIX training. Settingreward_sparse=Falseretains the dense reward, whereasreward_sparse=Trueenables sparse rewards. For each reward setting, QMIX is trained independently with three random seeds for 2 million environment steps per seed. The final policy from each run is evaluated over 100 episodes. We report the mean and sample standard deviation of the resulting win rates across the three training seeds. For PS-RWM, we construct the sparse-reward environment by removing intermediate damage and kill reward terms from the environment implementation while retaining terminal outcome rewards. The modified environment source code is then provided to PS-RWM for policy generation, and development evaluations use the corresponding sparse-reward environment. All remaining experimental settings follow those of the main experiments.
MiniGrid.
DoorKey-8×88\times 8is natively a sparse-reward task, providing a nonzero reward only upon reaching the goal. To construct a dense-reward variant, we retain this terminal reward and add potential-based shaping:
rtdense=rtsparse+0.99Φ(st+1)−Φ(st),r_{t}^{\mathrm{dense}}=r_{t}^{\mathrm{sparse}}+0.99\Phi(s_{t+1})-\Phi(s_{t}),whereΦ(s)=−[k+min(d/14,1)]/3\Phi(s)=-[k+\min(d/14,1)]/3. Here,ddis the Manhattan distance to the current subgoal, andkkrepresents task progress:k=2k=2targets the key before acquisition,k=1k=1targets the locked door while carrying the matching key, andk=0k=0targets the goal after unlocking. This provides intermediate feedback for approaching subgoals, acquiring the key, and unlocking the door. The potential is set to zero upon true termination and retained at time-limit truncation. DQN is trained in the modified dense-reward environment, while PS-RWM receives the corresponding modified environment code for policy generation and uses the same reward definition during development evaluations. The shaping computation does not change the policy’s observation interface. All remaining experimental settings follow those of the main experiments.
Box2D.
ForLunarLander (no wind)andLunarLander (wind), we construct sparse-reward variants by removing intermediate shaping rewards associated with position, velocity, orientation, and ground contact, together with fuel penalties. Nonterminal transitions receive zero reward, while environment-defined successful and unsuccessful terminations receive+100+100and−100-100, respectively. Episodes ending solely because of the time limit receive zero reward. The original dynamics, observation and action interfaces, wind configurations, and termination conditions are preserved.
Under this formulation, the undiscounted episode return is determined entirely by the terminal outcome and takes values in{−100,0,100}\{-100,0,100\}. Dense-reward returns additionally accumulate intermediate shaping terms and fuel penalties, so their numerical values are not directly comparable with sparse-reward returns. In particular, a return of100100represents successful completion under the sparse formulation; a lower numerical return than in the dense setting does not necessarily indicate degraded task performance. PPO is trained in the modified sparse-reward environments, while PS-RWM receives the corresponding modified environment code for policy generation and uses sparse rewards during development evaluations. All remaining experimental settings follow those of the main experiments.
A.4.2Partial Observability
MiniGrid.
We evaluateDoorKey-8×88\times 8,FourRooms,Dynamic-Obstacles-8×88\times 8, andMemoryS17Randomunder three observation settings. The default observation is an egocentric7×77\times 7symbolic view. We reduce this view to5×55\times 5usingViewSizeWrapper, or replace it with a world-aligned full-grid observation using FullyObsWrapper. All settings use the same subsequent symbolic flattening and mission-encoding procedure. Full observation changes both visibility and the coordinate representation, while the smaller local view changes the input dimensionality. The environment dynamics, action spaces, rewards, and episode limits remain unchanged. PS-RWM policies constructed under the default7×77\times 7setting are directly reused under the alternative settings, and one interaction-free revision is additionally evaluated for each target setting. The prompt for the One-Round Revision is provided in AppendixB.3.
SMAC.
We evaluate3s_vs_5z,8m_vs_9m, and3s5z_vs_3s6zby changing the default sight radius of99to either55or1515. Entity observations are restricted according to their distance from the observing agent, with enemy and ally feature rows hidden when the distance is greater than or equal to the specified radius. Observation-vector dimensions, unit slots, and normalization of distances and relative coordinates by99remain fixed. The native shooting range of66and available-action masks are also preserved. Consequently, under radius55, the action mask may still reveal attack availability for enemies outside the entity-observation radius. Each policy executes using only its agent’s permitted local inputs and policy-local memory. We compare direct reuse of the default-radius policy with one interaction-free revision for each altered radius. The prompt for the One-Round Revision is provided in AppendixB.3.
BabyAI.
We evaluate the six tasks in Table11using the default7×77\times 7local symbolic view and smaller5×55\times 5and3×33\times 3views. The smaller views are obtained through bottom-center cropping of the original local observation, applied consistently during offline construction or training and subsequent evaluation. PS-RWM receives the cropped observation directly, whereas learned baselines encode cells outside the retained region as unseen tokens. All view settings use the same 2,000 expert trajectories per task, as described in AppendixA.2.2; changing the view size does not change the number or length of these trajectories. For each task and view size, a PS-RWM policy is independently constructed and frozen before evaluation on 100 shared environment seeds. Baseline training settings follow AppendixA.2.3. We report success rates and mean episode lengths, including failures and timeouts.
A.4.3Generalization to Environment Variations
Tables19and19summarize the SMAC andMiniGridenvironment variants used in the generalization experiments, respectively. The SMAC variants primarily differ in the numbers of allied and enemy units, while theMiniGridvariants differ in map size and initialization settings. Initial positions in Table19refer to both the agent and obstacles. All other experimental settings follow the main experiments. AppendixB.3gives the PS-RWM One-Round Revision prompt for each target scenario.
Table 18:SMAC variants relative to8m_vs_9m. Table 19:MiniGrid environment variants.
Appendix BPrompts and Policy Interfaces
B.1Online Policy Synthesis
The SMAC, MPE, MiniGrid, and Box2D sessions in both conditions receive the same English development prompt below. The task and interface documents specify the scenarios, observation and action formats, and objectives. Source availability is configured separately.
ReadTASK.mdandinterface.txt. Implement runnable policy functions for every listed scenario, following the specified observation and action interfaces. Use the evaluation entry point to test policies, inspect scores and trajectories, and improve the policies accordingly. Do not train models or load task-specific trained weights.When you judge that a modified policy is likely to improve performance, first evaluate it for a few dozen episodes. If the results suggest an improvement, extend the same frozen policy to a total of 100 episodes.End development on a scenario only after reaching its numerical target or receiving a framework stop notice. Then submit the version with the highest win rate or mean episode return, as specified inTASK.md, among versions that have completed 100-episode validation.
B.2Offline Policy Synthesis: A Representative Maze2D Example
We use the secondmaze2d-large-v1construction, analyzed in AppendixD.3, as a representative offline example. The construction prompt directs the coding agent to three supplied documents:TASK.mddefines the task and authorized materials,interface.txtdefines the data and policy interfaces, andRESEARCH_SCHEMA.mdspecifies the research report to be submitted. The box below is an English translation of an excerpt from the actual Chinese prompt, with bookkeeping instructions omitted. The accompanying paragraphs summarize the relevant contents of the three original documents.
ReadTASK.md,interface.txt, andRESEARCH_SCHEMA.md, and develop a policy using the fixed offline data authorized for this run.Do not train or fine-tune neural networks. Non-neural fitting, optimization, parameter search, offline validation and selection, and planning and rollouts in self-authored approximate models are allowed.Do not execute the real environment, native simulator, or evaluator; call environment reset/step; collect online data; evaluate candidate policies in the evaluation environment; or request or use external test feedback. Sealing and exporting do not trigger testing.Save an executable initial policy early. Analyze the available data thoroughly, and group fitting and validation by continuous source. Record the model, parameters, objectives, search, validation, and selection rationale. Distinguish recorded transitions, model predictions, and offline estimates.Static reading is permitted only for source packages explicitly listed inTASK.md. Verify the manifest and record the source-reading ledger. Do not execute environment or engine code.
TASK.md: task specification and access.
The task ismaze2d-large-v1, with all 3,999,692 recorded transitions available through a read-only data file and manifest. The objective is to improve expected undiscounted episode return using offline evidence. The file identifies the approved package of environment code and configuration for static reading. It permits non-neural fitting and planning in self-authored approximate models, while prohibiting original-environment execution, new transition collection, and access to external evaluation feedback. Other runs’ policies and analysis are outside the authorized inputs. The agent must deliver executable policy code, packaged parameters, research notes, and reproducible analysis evidence.
interface.txt: data semantics and execution contract.
This file describes both the recorded data and the inputs available when the frozen policy executes. For this dataset, source chunks are preserved; their boundaries do not by themselves establish environment resets or complete episodes. Missing successors remain missing except where the next observation can be inferred from confirmed continuity within the same chunk. At runtime,make_policy()creates a fresh callable or an object withact(context)for each episode. The public inputs and required action have the following form:
context={
“observation”:[x,y,vx,vy],
“step_index”:t,
“previous_reward”:previous_reward,
}
action=[u_x,u_y]
The controller may retain history within the episode, whose limit is 800 steps. Code, fitted parameters, and reference vectors needed at runtime are packaged with the policy; the original dataset, analysis directory, source package, environment object, test seed, and network services are unavailable during execution.
RESEARCH_SCHEMA.md: research reporting requirements.
This file specifies the evidence and decisions that the agent must record inpolicies/RESEARCH.json. The requireddata_analysisobject records the number of distinct transitions analyzed, fields used, return summaries, and supporting evidence files. Complete episodes and incomplete fragments are counted separately; when no complete episodes are available, complete-episode return statistics must be null. The report containsfindingsandhypotheses; each hypothesis records its evidence, expected effect on return, proposed change, rationale, and whether it was implemented or rejected. A top-leveldecisionspecifies whether the policy was created, revised, or retained; retaining a policy requires a data-supported reason. Analysis scripts and supporting statistics accompany the report. The schema structures the record of offline reasoning and policy revision, leaving the choice of controller to the agent.
B.3Interaction-Free One-Round Revision
You are given an existing executable policy{policy.py}, the relevant environment source code{code path}, and a description of the target scenario or observation setting. Adapt the policy to the target condition using only these supplied materials.Read the original policy and identify its assumptions about observation dimensions, coordinate conventions, visibility, action semantics, and task mechanics. Revise the policy as needed to operate under the target specification. Preserve the required callable interface and use only the runtime inputs explicitly permitted by that specification.Description:Target Scenario:{Scenario Name}, Initial setting:{Default setting}, Target setting:{Target setting}.Constraints:•Do not access previous adaptation candidates, evaluation logs, trajectories, scores, or other performance feedback.•Do not execute the environment or simulator, collect interactions, or evaluate candidate policies.•Do not execute policy factories or action functions, including tests using synthetic observations.•Static source inspection, syntax checks, and AST checks are permitted.•Do not train models or load task-specific pretrained weights.•The deployed policy may maintain within-episode memory, but must not access hidden environment state or information outside its interface.Output the final revised policy code file.
Appendix CToken Usage and Inference Cost
C.1Accounting Method
LetII,HH, andOOdenote total input, cached input, and output tokens (including reasoning). Using OpenAI’s Standard API rates forgpt-6-astraof USD 10, 1, and 50 per million uncached input, cached input, and output tokens,111https://developers.openai.com/api/docs/models/gpt-6-astrathe estimated cost is[10(I−H)+H+50O]/106[10(I-H)+H+50O]/10^{6}USD. Both tables report tokens in millions; input includes cached tokens.
C.2Online Experiments
Table20reports per-scenario means using cumulative token counts through each session’s last complete 100-episode validation within the 1,600-attempt budget per scenario. For each environment and access condition, we sum tokens and estimated costs across the three sessions and divide by 12 scenario runs.
Table 20:Mean token usage and inference cost per scenario.
C.3Offline Experiments
Table21reports PS-RWM’s per-scenario means for the main offline experiments.
Table 21:Mean token usage and inference cost per offline scenario.
Appendix DPolicy Construction Case Studies
The first three cases examine three decisions in offline policy construction: which recorded behaviors should support action prediction, which validation errors should govern selection, and how a dynamics model can guide controller design. Each case connects offline evidence to a design judgment, its implementation, and the subsequent checks and limitations. The LLM specifies the procedure, numerical routines fit the non-neural models, and the frozen program executes the resulting rules.
TheFourRoomsand Kitchen cases expand the online and offline examples in Section6.2, showing how environment rules enter map inference and the organization of demonstrations.
D.1Hopper: Defining the Behavior to Learn
We compare twohopper-medium-replay-v2constructions: Run A is the final internal revision v3 inpolicy, and Run B is the final internal revision v2 inpolicy-2. Their first documented divergence appeared in the scripts defining the fitting samples, before the final regression settings were chosen.
Case 1. Same task, different construction choicesUser (task summary).Construct a non-neural Hopper policy from the fixed offline data, without environment testing during construction.LLM, Run A (decision summary).Longer source segments with higher mean reward improved grouped action fitting. Limit local extrapolation far from the references with a distance-based kernel fallback.Policy A.Local regression based on sustained recorded behavior, with a fallback outside well-supported states.LLM, Run B (decision summary).High immediate reward can accompany poor subsequent behavior. Use recorded continuation quality to guide reference sampling and model selection, while retaining posture and velocity information.Policy B.Local regression supported by uniform references and favorable short continuations.
From offline evidence to the policy.
Run A drew 48,000 references from source segments lasting at least 400 steps with mean reward at least 2.5. Run B combined 6,000 uniform references with 18,000 references sampled using rewards over at most 100 recorded steps. Thus, Run A prioritized evidence of sustained behavior, while Run B combined broad coverage with favorable local continuations. Run A’s final revision added a distance-dependent kernel fallback to local affine regression. In Run B, continuation quality affected sampling and selection; its final local regression did not apply an additional quality weight at execution. The two procedures therefore encoded different judgments about which recorded behaviors should guide the controller.
Frozen evaluation and limitations.
The two programs were evaluated on the same 100 environment seeds, with the same recorded environment versions and 1,000-step episode limit. Run B obtained lower return and shorter episodes:
Table 22:Frozen-policy evaluation on Hopper.
The case describes two independently constructed policies, and locates a concrete LLM contribution in defining the behavioral evidence used for action prediction; neither definition guarantees sustained control under the policy’s own actions.
D.2Walker2d: Choosing Which Errors Govern Selection
This case examines the final internal revision ofwalker2d-medium-replay-v2. It illustrates how the interpretation of offline validation determines which candidate is accepted.
Case 2. From a failure example to a selection ruleUser (task summary).Construct a non-neural Walker2d policy using the fixed replay data.LLM, analysis (decision summary).Immediate reward can remain high just before termination. Use recorded 100-step continuations to assess behavioral quality.LLM, selection (decision summary).Prioritize action-prediction accuracy on states with high recorded continuation returns, while retaining smaller overall and near-rest error terms in the development score.Resulting policy.A blend of 25% Gaussian-kernel and 75% local affine regression, emphasizing imitation of actions followed by favorable continuations.
Selection criterion and implementation.
High-return states were defined using a recorded 100-step continuation score at or above the fitting set’s 75th percentile. The selection score was the action MSE on these development states plus0.10.1times overall MSE and0.10.1times near-rest MSE.
Relative to an unweighted kernel baseline, the selected blend reduced action-prediction error on states with high recorded 100-step continuation returns and slightly reduced near-rest error on the development set, while increasing overall error. These were comparisons against recorded actions, not measurements of the candidates’environment returns.
Table 23:Action prediction errors for Walker2d.
Offline audit and limitations.
Near-rest states were a proxy for startup conditions, not certified environment resets. The separate audit found worse action-prediction error on this subset, and no parameters were revised afterward. Its records had already been used for descriptive analysis, so it was not a fully blind test. Startup-like states were included in selection, but their development error did not capture all of the difficulties revealed by the audit. Accurate imitation on recorded inputs does not establish that the controller can reach and maintain favorable states under its own actions.
Frozen evaluation.
The selected controller obtained a D4RL normalized score of 3.72 and a mean episode length of 186.45 across 100 episodes. The evaluation reward formula also permits a diagnostic of its motion. With unnormalized episode returnRR, episode lengthTT, step durationΔt\Delta t, and six controls bounded by[−1,1][-1,1], net displacement satisfies
xT−x0≤Δt(R−T+0.006T).x_{T}-x_{0}\leq\Delta t\bigl(R-T+0.006T\bigr).This upper bound was negative in 67 episodes, establishing backward net displacement in those episodes. The result exposes a gap between improved action imitation on high-return states and actual control. It does not identify a single cause or establish that the unweighted baseline would have achieved a better environment score.
D.3Maze2D: Using Dynamics to Guide Controller Selection
This case examines the secondmaze2d-large-v1construction. It is the controller excerpted in Listing2. The first construction discussed in Section7.1is a separate program. Here, the coding agent fitted a non-neural motion model to support development-time predictions and parameter selection.
Case 3. From transition analysis to model-based selectionUser (task summary).Construct a non-neural Maze2D policy from fixed offline data and readable environment rules, without executing the environment.LLM, analysis (decision summary).Recorded rewards align with the current position, while environment rewards are computed after the action. Preserve the recorded labels for data analysis and use predicted next positions to score candidate motions. Estimate how far the point travels while braking.LLM, selection (decision summary).Compare controllers from historical starting states in the fitted model. Account for late arrival and wall proximity, and check whether performance persists when the assumed action gain changes.Resulting policy.Graph-based navigation with initial braking, turn-speed feedback, and goal holding; the selected program executes these rules without running model rollouts at deployment.
Offline evidence and its interpretation.
The scripts scanned 3,999,692 records, while the construction dialogue displayed 52 distinct records. The 16,726 fragments shared boundary observations and were conservatively treated as one continuous source, not independent episodes. Stored rewards matched the position on the same row, whereas the environment computes reward at the position reached after an action. This distinction matters when assessing a new controller: the reward attached to a recorded state cannot be treated as the observed consequence of a candidate action. The construction retained the original labels for trajectory analysis and used predicted next positions to compute rewards in its own model.
From a fitted model to control rules.
The agent fitted a linear velocity update by least squares on 3,931,717 free-space transitions with successors in the same fragment, excluding anomalous fragment-initial rows. The resulting non-neural model combines velocity decay and action gain with a position update; it does not use a neural network or execute the original environment. In this model, reducing an axis velocity from 5 to 0.25 units per second took about 20 steps and covered 0.48 units. This predicted stopping distance motivated braking before turns and the goal, rather than waiting until the waypoint was reached. Model failures from high-speed initial states also motivated an initial braking phase. The controller then follows geometric waypoints and uses position and velocity feedback to settle near the goal center, where each remaining step can earn reward.
Selection criterion.
For the final selection, the agent compared nine existing candidates from 2,970 historical starting observations at the nominal model action gain and at gains10%10\%below and above it. For each candidate, it used the lowest weighted predicted return across these gain settings, with penalties for late arrival and insufficient wall clearance. This criterion selected an additional planning margin of 0.12 units rather than 0.08. The perturbations were a sensitivity check on an assumed model parameter, not a statistical confidence interval. All of these scores were model predictions used during construction; no candidate environment evaluation was available for selection.
Frozen evaluation and limitations.
After freezing, the frozen controller program achieved a mean D4RL normalized score of 240.01 over 100 environment seeds. It is one of the three policies summarized in Table2; its score was not returned to construction. The fitted model describes free-space motion but does not resolve collision impulses or contact forces; near-wall failures were represented by a geometric risk cutoff. Fitting and internal checks also used the same continuous data source. Consequently, the selection procedure addresses identified model and geometric risks without establishing generalization to independent data or reliable control near contacts. The case shows how the LLM’s interpretation of data and choice of a prediction-based criterion became concrete control rules, while keeping model-based selection separate from frozen-policy performance.
D.4FourRooms: Inferring Unobserved Structure
Across the three selected programs with RWM access,FourRoomsgeometry is represented by candidate wall and doorway layouts that are updated as observations arrive. All three use these structural predictions to guide exploration. Two also allow inferred free cells in route planning; the third plans routes through observed cells and uses the layout model to choose informative exploration targets. The three selected programs without RWM access build their maps from observed cells and search toward unknown-facing frontiers. The archived development histories for all three programs with RWM access record inspection of theFourRoomsgenerator before these layout rules were implemented.
Figure10illustrates the distinction using two selected programs given the same initial public observation. Once an opening is observed, the rule that each internal wall segment has one opening identifies the four orange cells as walls in the program with RWM access. The program without access retains these cells as unknown. The displayed game frame is a native render reconstructed from an archived reset. The corresponding original episodes have identical initial public observations but different complete maps; the figure compares their map interpretations on one reference frame. Both programs act through the shared local-observation interface described in AppendixA.3.
Table24summarizes the original complete development validation of each selected program. Each session contributes 100 episodes, and all six programs achieve 100% success. Pooling the three sessions gives mean execution lengths of 28.40 actions with RWM access and 34.39 without access. The conditions use different recorded validation seed sets. Success rate determined development termination; the action counts describe execution of the selected programs.
Table 24:Mean actions inFourRoomsvalidation.Each session contributes 100 episodes with 100% success.
D.5Kitchen: Organizing Demonstrations with Source Rules
The comparison conditions are described in AppendixA.3.2.
The D4RL registration assigns Complete and Partial the same environment and four scoring targets. Listing3condenses the parts of the implementation that connect an action, the ensuing observation, and the task reward. The Kitchen interface supplies nine normalized action components. The robot controller converts these to joint position requests using its last observed joint positions and its calibrated bounds. The physics engine then advances the robot and objects. The next public observation contains nine robot positions, 21 object coordinates, and 30 goal coordinates. The Kitchen task code defines reference configurations for seven objects. Four are active goals in these two tasks. The environment starts each episode with all four pending, awards one point per newly completed goal, and ends the task once none remain. The registered time limit is 280 steps.
Listing 3:Condensed D4RL Kitchen v0 action and task rules; object indices refer to public observations.importnumpyasnp
objects={
“bottomburner”:([11,12],[-0.88,-0.01]),
“topburner”:([15,16],[-0.92,-0.01]),
“lightswitch”:([17,18],[-0.69,-0.05]),
“slidecabinet”:([19],[0.37]),
“hingecabinet”:([20,21],[0.0,1.45]),
“microwave”:([22],[-0.75]),
“kettle”:(list(range(23,30)),[-0.23,0.75,1.62,0.99,0,0,-0.06]),
}
targets=(“microwave”,“kettle”,“lightswitch”,“slidecabinet”)
defposition_request(action,last_q,vel_bounds,pos_bounds,dt):
velocity=np.clip(2*np.clip(action,-1,1),*vel_bounds.T)
returnnp.clip(last_q+dt*velocity,*pos_bounds.T)
defat_goal(obs,name):
indices,goal=objects[name]
returnnp.linalg.norm(obs[...,indices]-goal,axis=-1)<0.30
defscore_step(next_obs,pending):
reached={namefornameinpendingifat_goal(next_obs,name)}
remaining=pending-reached
returnlen(reached),remaining,notremaining
From object completions to demonstration intervals.
The third construction with RWM access applied the same distance test to every recorded observation for each of the seven objects. This makes an operation such as reaching the bottom burner’s reference configuration identifiable even though the task awards no point for it. Listing4condenses the two archived fitting routines,inspect_families.pyandfit_policy.py. Each first completion closes the preceding interval. A target completion contributes the recorded observation–action pairs in that interval to its reference set. A burner or hinge-cabinet completion also closes the interval, so its actions cannot enter the following target’s set. Actions after the last observed completion receive no label.
Listing 4:Offline sample selection in the third Partial run with RWM access; each call takes a time-ordered segment.defreference_intervals(observations):
events=[]
fornameinobjects:
hits=np.flatnonzero(at_goal(observations,name))
ifhits.size:
events.append((int(hits[0]),name))
start=0
forstop,nameinsorted(events,key=lambdaevent:event[0]):
ifnameintargets:
yieldname,slice(start,stop)
start=stop
In Partial segment 22 the microwave first reaches its goal at step 51 and the bottom burner at step 120. In segment 109 the corresponding events are the microwave at step 45 and the kettle at step 87. Applying Listing4gives action rows 5,453–5,521 and 24,548–24,589, respectively, in the original Partial file (inclusive, zero-based). The archived kettle reference set contains only the latter of these two intervals. The label describes the observed outcome of a sequence of actions. Judging the necessity of any individual action would require evidence about alternative actions at the same state. At execution, the policy has only the current public observation and its episode history. It remembers which targets have reached tolerance, then retrieves nearby examples for the next unfinished target to predict its nine action components.
Appendix EPolicy Implementations and Reproducibility Materials
E.1Materials and Code Index
Complete SMAC implementations are given in AppendixE.2. The source-access comparisons are expanded in AppendicesD.4andD.5. Figures8and10illustrate online policy revision and theFourRoomssource-access example, respectively.
E.2SMAC Policy Functions
E.2.13s5z_vs_3s6z
The complete PS-RWM policy below is used in Figure5(a) and excerpted in Listing1. Each unit runs its own copy, maintains its own memory, and selects one action using its local observation, legal-action mask, and previous action.
Listing 5Complete synthesized per-unit policy function for3s5z_vs_3s6z.
importmath
DIRECTIONS={2:(0.,1.),3:(0.,-1.),4:(1.,0.),5:(-1.,0.)}
defmake_policy(agent_id):
tick=0
last_shot=-100
old_hp=None
retreat_until=-1
last_move=5
search_vector=None
previous_enemies={}
stuck=0
escape_axis=None
enemy_memory={}
last_rows={}
missing=0
sweep_direction=5ifagent_id%2else4
lane_direction=3ifagent_id%3else2
lane_steps=0
defact(context):
nonlocaltick,last_shot,old_hp,retreat_until,last_move,search_vector,previous_enemies,stuck,escape_axis
nonlocalenemy_memory,last_rows,missing,sweep_direction,lane_direction,lane_steps
obs=context[’observation’]
avail=context[’avail_actions’]
tick+=1
ifavail[0]:
return0
size=len(obs)
ifsize==48:
ne,na,ew,aw,own=5,3,6,6,2
elifsize==85:
ne,na,ew,aw,own=9,8,5,5,1
elifsize==136:
ne,na,ew,aw,own=9,8,8,8,4
else:
ne,na,ew,aw,own=24,6,5,6,2
enemies=[]
foriinrange(ne):
r=obs[4+i*ew:4+(i+1)*ew]
ifr[1]>0:
enemies.append((i,r))
allies=[]
offset=4+ne*ew
foriinrange(na-1):
r=obs[offset+i*aw:offset+(i+1)*aw]
ifr[0]:
allies.append(r)
hp=float(obs[-own])
shield=float(obs[-own+1])ifown>1else0.
damage=old_hpisnotNoneandhp<old_hp-.001
old_hp=hp
stalker=size==48or(size==136andobs[-2]>.5)
marine=size==85
targets=[(i,r)fori,rinenemiesifavail[6+i]]
last=context.get(’last_action’,[])
prior_action=max(range(len(last)),key=lambdai:last[i])ifany(last)else1
dx=dy=0.
ifprior_actioninDIRECTIONS:
speed=1.4ifstalkerelse1.125
dx,dy=(v*speedforvinDIRECTIONS[prior_action])
elifnotstalkerandprior_action>=6andprior_action-6inlast_rows:
row=last_rows[prior_action-6]
distance=row[1]*9
travel=min(1.125,max(0.,distance-1.05))
ifdistance:
dx,dy=row[2]*9*travel/distance,row[3]*9*travel/distance
enemy_memory={i:(x-dx,y-dy,seen)fori,(x,y,seen)inenemy_memory.items()}
visible={ifori,_inenemies}
fori,rowinlast_rows.items():
ifinotinvisibleandrow[1]*9<7.2:
enemy_memory.pop(i,None)
fori,rowinenemies:
enemy_memory[i]=(row[2]*9,row[3]*9,tick)
last_rows={i:list(row)fori,rowinenemies}
defmove(vx,vy,away=False):
nonlocallast_move
choices=[]
fora,(dx,dy)inDIRECTIONS.items():
ifnotavail[a]:
continue
score=dx*vx+dy*vy
ifawayandescape_axisisnotNoneand((ain(2,3))==(escape_axisin(2,3))):
continue
ifaway:
for_,rinenemies:
d=math.hypot(r[2]*9-dx*1.25,r[3]*9-dy*1.25)
score-=4./max(.35,d)**2
forrinallies:
d=math.hypot(r[2]*9-dx*1.25,r[3]*9-dy*1.25)
score-=.15/max(.3,d)**2
score+=.02*(a==last_move)
choices.append((score,a))
ifnotchoices:
return1
last_move=max(choices)[1]
returnlast_move
missing=0ifenemieselsemissing+1
ifenemies:
seen_id,seen=min(enemies,key=lambdae:e[1][1])
search_vector=(seen[2],seen[3])
last=context.get(“last_action”,[])
prior_action=max(range(len(last)),key=lambdai:last[i])ifany(last)else1
previous=previous_enemies.get(seen_id)
ifstalkerandseen[1]*9<1.6andprior_actioninDIRECTIONSandpreviousisnotNoneandmath.hypot(seen[2]-previous[0],seen[3]-previous[1])<.03:
stuck+=1
else:stuck=0
escape_axis=prior_actionifstuck>=2elseNone
previous_enemies={i:(r[2],r[3])fori,rinenemies}
ifsize==136andnotstalkerandtick<=6:
return2ifavail[2]else1
ifsize==136andnotstalkerandtick<=14:
return4ifavail[4]else1
ifnotenemies:
ifmissing>=8andtick>25:
iflane_steps:
ifnotavail[lane_direction]:
lane_direction=2iflane_direction==3else3
lane_steps-=1
returnlane_directionifavail[lane_direction]else1
ifavail[sweep_direction]:
returnsweep_direction
sweep_direction=4ifsweep_direction==5else5
lane_steps=6
ifnotavail[lane_direction]:
lane_direction=2iflane_direction==3else3
returnlane_directionifavail[lane_direction]else1
whileenemy_memory:
i=min(enemy_memory,key=lambdaj:math.hypot(*enemy_memory[j][:2]))
x,y,seen=enemy_memory[i]
ifmath.hypot(x,y)<2.5andtick-seen>2:
delenemy_memory[i]
continue
projections=[x*dx+y*dyfora,(dx,dy)inDIRECTIONS.items()ifavail[a]]
ifnotprojectionsormax(projections)<=0:
delenemy_memory[i]
continue
returnmove(x,y)
ifsearch_vectorisnotNone:
vx,vy=search_vector
a=move(vx,vy)
dx,dy=DIRECTIONS.get(a,(0,0))
ifvx*dx+vy*dy<=0:search_vector=(dx,dy)
returna
ifalliesandmin(r[1]forrinallies)>.45:
returnmove(sum(r[2]forrinallies),sum(r[3]forrinallies))
return(4ifavail[4]else(5ifavail[5]else(2ifavail[2]else1)))iftick<70else(5ifavail[5]else(2ifavail[2]else1))
nearest=min(enemies,key=lambdae:e[1][1])[1]
dist=nearest[1]*9
ifstalker:
kite=dist<2.8or(tick-last_shot<4anddist<5.7)
ifsize==136:
melee=[rfor_,rinenemiesifr[6]>.5]
danger=min((r[1]*9forrinmelee),default=9.)
kite=danger<2.8or(tick-last_shot<4anddanger<5.7)
ifkite:
vx=vy=0.
for_,rinenemies:
w=1./max(.1,r[1]*9)**2
vx-=r[2]*9*w
vy-=r[3]*9*w
returnmove(vx,vy-(.35iftick<25else0),True)
ifmarineanddamageandhp<.57andlen(allies)>=2:
retreat_until=tick+2
ifmarineandtick<retreat_untilanddist<6.5:
returnmove(-nearest[2],-nearest[3],True)
ifsize==136andnotstalker:
ranged=[(i,r)fori,rinenemiesifr[7]>.5]
ifranged:
enemy=min(ranged,key=lambdae:e[1][4]*.2+e[1][5]*.1+e[1][1]*2)
ifavail[6+enemy[0]]:return6+enemy[0]
returnmove(enemy[1][2]*9,enemy[1][3]*9)
iftick<25:return4ifavail[4]else1
iftargets:
deftarget_score(item):
i,r=item
health=r[4]+(.5*r[5]ifewin(6,8)else0.)
ifstalkerormarine:
support=sum(math.hypot(r[2]-a[2],r[3]-a[3])<.65forainallies)
returnhealth*1.6+r[1]*.7-support*.08+i*.005
returnr[1]*4+health*.3+i*.001
target=min(targets,key=target_score)[0]
ifstalkerandtick-last_shot>=4:
last_shot=tick
return6+target
returnmove(nearest[2],nearest[3])
returnact
E.2.23s_vs_5z
Listing 6Complete synthesized per-unit policy for3s_vs_5z.
importmath
defmake_policy(agent_id):
tick=0
last_shot=-10
last_move=5
turn=2ifagent_id!=0else3
defact(context):
nonlocaltick,last_shot,last_move
tick+=1
obs=context[’observation’]
avail=context[’avail_actions’]
ifavail[0]:
return0
enemies=[(i,obs[4+6*i:10+6*i])foriinrange(5)]
enemies=[(i,r)fori,rinenemiesifr[4]>0]
legal=[(i,r)fori,rinenemiesifavail[6+i]]
nearest=min((r[1]*9for_,rinenemies),default=99)
iflegalandtick-last_shot>=5:
target=min(legal,key=lambdair:ir[1][4]*100+ir[1][5]*50+ir[0]*0.1)
last_shot=tick
return6+target[0]
directions={2:(0,1),3:(0,-1),4:(1,0),5:(-1,0)}
ifenemiesand(nearest<6.3orlegal):
defscore(a):
dx,dy=directions[a]
distances=[math.hypot(r[2]*9-dx,r[3]*9-dy)for_,rinenemies]
result=min(distances)+0.12*sum(distances)/len(distances)
result+=0.15*(a==last_move)+0.03*(a==turn)
returnresult
action=max((aforaindirectionsifavail[a]),key=score,default=1)
last_move=action
returnaction
ifenemies:
target=min(enemies,key=lambdair:ir[1][1])[1]
action=max((aforaindirectionsifavail[a]),key=lambdaa:directions[a][0]*target[2]+directions[a][1]*target[3],default=1)
last_move=action
returnaction
return4ifavail[4]else1
returnact
E.2.38m_vs_9m
Listing 7Complete synthesized per-unit policy for8m_vs_9m.
importmath
defmake_policy(agent_id):
tick=0
previous_hp=1.0
last_shot=-10
team_previous_hp={i:1.0foriinrange(8)}
rank=[6,2,1,3,5,4,0,7].index(agent_id)
defact(context):
nonlocaltick,previous_hp,last_shot
tick+=1
obs,av=context[’observation’],context[’avail_actions’]
ifav[0]:
return0
hp=obs[-1]
damage=previous_hp-hp
previous_hp=hp
enemies=[(i,obs[4+5*i:9+5*i])foriinrange(9)]
enemies=[(i,r)fori,rinenemiesifr[4]>0]
allies=[obs[49+5*j:54+5*j]forjinrange(7)]
allies=[rforrinalliesifr[0]]
team={agent_id:(0.0,0.0,hp,damage>0)}
forjinrange(7):
r=obs[49+5*j:54+5*j]
aid=jifj<agent_idelsej+1
ifr[0]:
team[aid]=(r[2]*9,r[3]*9,r[4],r[4]<team_previous_hp.get(aid,r[4]))
team_previous_hp[aid]=r[4]
directions={1:(0,0),2:(0,1),3:(0,-1),4:(1,0),5:(-1,0)}
legal=[(i,r)fori,rinenemiesifav[6+i]]
iftick==4andagent_id==5andav[2]:
behind=obs[64:69]
ifbehind[0]and-1.2<behind[2]*9<0andabs(behind[3]*9)<0.3:
return2
iftick<=4andnotlegal:
cx=sum(r[2]*9forrinallies)/(len(allies)+1)
cy=sum(r[3]*9forrinallies)/(len(allies)+1)
ty=cy+(rank-3.5)*0.8
tx=cx+abs(rank-3.5)*0.2-0.35
defformation(a):
dx,dy=directions[a]
x,y=dx*1.1,dy*1.1
score=-(x-tx)**2-(y-ty)**2
forrinallies:
dist=math.hypot(x-r[2]*9,y-r[3]*9)
score-=2*max(0,0.65-dist)
returnscore
returnmax((aforaindirectionsifav[a]),key=formation)
nearest=min((r[1]*9for_,rinenemies),default=99)
mean_hp=(hp+sum(r[4]forrinallies))/(len(allies)+1)
ifenemiesandhp<0.55andhp<mean_hp-0.1anddamage>0andnearest<5.8andtick-last_shot<2:
returnmax((aforainrange(2,6)ifav[a]),key=lambdaa:min(math.hypot(r[2]*9-directions[a][0],r[3]*9-directions[a][1])for_,rinenemies),default=1)
ifenemiesandhp>0.85andmean_hp<0.75and5.0<nearest<6.2:
fresh=[]
foraid,(x,y,ahp,hit)inteam.items():
distance=min(math.hypot(r[2]*9-x,r[3]*9-y)fori,rinenemies)
ifahp>0.85and5.0<distance<6.2:
fresh.append(aid)
center_y=sum(unit[1]forunitinteam.values())/len(team)
leader=min(fresh,key=lambdaaid:(-team[aid][2],abs(team[aid][1]-center_y),aid))iffreshelseNone
ifagent_id==leader:
r=min(enemies,key=lambdair:ir[1][1])[1]
defreinforce(a):
dx,dy=directions[a]
x,y=dx*1.1,dy*1.1
return-math.hypot(r[2]*9-x,r[3]*9-y)-6*sum(max(0,0.75-math.hypot(x-ar[2]*9,y-ar[3]*9))forarinallies)
returnmax((aforainrange(2,6)ifav[a]),key=reinforce,default=1)
iflegal:
positions={agent_id:(0.0,0.0)}
forjinrange(7):
r=obs[49+5*j:54+5*j]
ifr[0]:
positions[jifj<agent_idelsej+1]=(r[2]*9,r[3]*9)
remaining={i:r[4]*45+1.0fori,rinenemies}
coverage={i:sum(math.hypot(x-r[2]*9,y-r[3]*9)<5.8forx,yinpositions.values())fori,rinenemies}
foraidinsorted(positions):
x,y=positions[aid]
ahp,hit=team[aid][2:]
enemy_distance=min(math.hypot(x-r[2]*9,y-r[3]*9)fori,rinenemies)
ifaid!=agent_idandahp<0.55andahp<mean_hp-0.1andhitandenemy_distance<5.8:
continue
options=[(i,r)fori,rinenemiesif(av[6+i]ifaid==agent_idelsemath.hypot(x-r[2]*9,y-r[3]*9)<5.8)]
ifnotoptions:
continue
live=[(i,r)fori,rinoptionsifremaining[i]>0.01]
i,r=min(liveoroptions,key=lambdair:remaining[ir[0]]-coverage[ir[0]]*3+ir[0]*0.01)
ifaid==agent_id:
iftick-last_shot>=2:
last_shot=tick
return6+i
remaining[i]-=3
ifenemies:
r=min(enemies,key=lambdair:ir[1][1])[1]
returnmax((aforainrange(2,6)ifav[a]),key=lambdaa:directions[a][0]*r[2]+directions[a][1]*r[3],default=1)
return4ifav[4]else1
returnact
E.2.4corridor
Listing 8Complete synthesized per-unit policy forcorridor.
defmake_policy(agent_id):
tick=0
defact(context):
nonlocaltick
tick+=1
o=context[’observation’];av=context[’avail_actions’]
ifav[0]:return0
iftick==1:
direction=[5,5,3,4,4,4][agent_id]
returndirectionifav[direction]else1
iftick==2andagent_id==5:
return4ifav[4]else1
near=min((o[5+i*5]*9foriinrange(24)ifo[5+i*5]>0),default=99)
iftick<=12andnear>1.1:
return3ifav[3]else1
targets=[(i,o[4+i*5:9+i*5])foriinrange(24)ifav[6+i]]
iftargets:
return6+min(targets,key=lambdae:max(0,e[1][1]*9-1)*10+e[1][4])[0]
iftick<30:return1
return2ifav[2]else4ifav[4]else1
returnact
Similar Articles
Scaling Automatic Research Agents via World Models
This paper introduces World Model RL to scale automatic research agents by replacing environment execution with a learned world model, thereby accelerating post-training by 3-4x and enabling smaller agents to outperform larger ones on benchmarks.
@ethantsliu: meta-rl induces agentic LLM exploration traditional RL trains LLM agents to use fixed policies that struggle with activ…
A new research paper reframes LLM agent training as a cross-episode Meta-RL problem, using critic-free policy gradients to enable in-context adaptation without gradient updates. The LAMER framework improves test-time performance by 11-19% over standard RL baselines on long-horizon tasks and generalizes better to unseen environments.
Scaling Automatic Research Agents via World Models
This paper identifies a scalability bottleneck in RL-trained automatic research agents—environment execution dominates training cost—and proposes World Model RL (WMRL) with online debiasing and inverse-variance denoising to replace real execution, achieving 3–4x training speedups and better generalization.
@dair_ai: Banger paper from Meta Superintelligence Labs. They find something super interesting and unexpected. (bookmark it) Base…
Meta Superintelligence Labs finds that RL post-training narrows solution coverage of LLM agents (the 'Sharpening Tax'): base models with a light harness can solve more distinct agentic tasks at large K, while post-trained models win at pass@1. They propose PTGS, an adaptive-temperature RL method that reduces this tax while improving pass@1.
RL Environments Are All You Need (6 minute read)
The author argues that RL environments serve as the essential data for building AI agents, enabling systematic training, prompt optimization, and evaluation rather than manual iteration.