Organizations: Shandong University · Li Auto Inc. · Tsinghua University · Institute of Automation, Chinese Academy of Sciences · Nanyang Technological University · Institute of Microelectronics, Chinese Academy of Sciences
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.
Figures & tables
Figure 1: Comparison of conventional RL and policy synthesis from readable world models.
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.
Setting
Benchmark
Action
Task
Metric
Online
SMAC
Discrete
Multi-agent combat
Win (%)
MPE
Continuous
Multi-agent coordination
Return
MiniGrid
Discrete
Single-agent navigation
Success (%)
Box2D
Continuous
Single-agent control
Return
Offline
D4RL
Continuous
Offline control
Return
BabyAI
Discrete
Instruction following
Success (%)
Table 1: Summary of evaluation benchmarks.
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.
Scenarios
CQL
IQL
BEAR
TD3+BC
BC
DT
PS-RWM
Maze2D
maze2d-umaze
94.7
42.1
65.7
14.8
16.4±4.7
60.3±7.7
154.0±7.6
maze2d-medium
41.8
34.9
25.0
62.1
20.1±8.4
37.0±8.3
157.5±18.3
maze2d-large
49.6
61.7
81.0
88.6
10.3±8.6
25.4±4.9
219.2±21.4
Average (3 tasks)
62.0
46.2
57.2
55.2
15.6
40.9
176.9↑114.9
AntMaze
antmaze-umaze
74.0
87.5
73.0
78.6
82.3±3.2
67.0±1.7
83.0±15.6
antmaze-umaze-diverse
84.0
62.2
61.0
71.4
81.7±9.5
63.0±4.6
88.7±9.9
Table 2: Performance comparison on D4RL benchmarks. Higher normalized scores indicate better performance. PS-RWM results are reported as mean ± sample standard deviation over three independent policy-construction runs.
(a) Full Dataset
(b) PS-RWM Data Efficiency
Task
IQL
CQL
BEAR
TD3+BC
BC
DT
PS-RWM
M=0
M=64
M=256
GoToRedBall
93.00
96.33
90.33
91.67
94.33
98.67
100.00
100.00
100.00
100.00
GoToLocal
74.00
76.33
73.00
75.67
73.67
80.33
100.00
100.00
100.00
100.00
GoToSeq
53.33
55.00
56.67
41.00
52.00
70.33
100.00
100.00
100.00
95.00
PutNextLocal
9.33
19.00
14.33
13.67
11.67
12.67
100.00
100.00
100.00
100.00
UnlockLocalDist
58.00
50.67
35.00
38.33
53.67
84.67
100.00
100.00
100.00
100.00
Table 3: Performance comparison and demonstration efficiency on BabyAI. Success rates are reported in percentages. M denotes the number of complete demonstration episodes available to PS-RWM during policy construction.
Benchmark
Scenario
Target
Model-Free RL
Model-Based RL
PS-RWM
SMAC
QMIX
MBVD
3s_vs_5z
80
1,617,569(3/3)
1,821,847(3/3)
19,409(3/3)
8m_vs_9m
80
490,910(3/3)
320,452(3/3)
27,413(2/3)
3s5z_vs_3s6z
80
— (0/3)
972,874(1/3)
70,711(3/3)
corridor
80
— (0/3)
2,002,383(1/3)
47,744(3/3)
MPE
MAPPO
SeqWM
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 8
Scenario
QMIX
PS-RWM
Allied Death Rate ( ↓ )
3s_vs_5z
51.78
8.56
8m_vs_9m
86.29
53.83
3s5z_vs_3s6z
99.79
39.08
corridor
99.94
37.72
Average
84.45
34.80
Table 6: Allied death rates and zero-death episode rates on SMAC (%).
Figure 5: Joint action traces on 3s5z_vs_3s6z from 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 on 3s5z_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.
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.
Figure 8: Feedback-driven policy refinement on BipedalWalker .
Figure 9: Offline policy refinement at the upper-right turn in maze2d-umaze-v1 . All three panels show the same recorded state. Dashed arrows indicate upward velocity, and solid arrows show braking and turning commands.
Benchmark
Scenario
Model-Free RL
PS-RWM
Without RWM
With RWM
SMAC
3s_vs_5z
69.79±28.36
100.00±0.00
100.00±0.00
8m_vs_9m
94.79±6.51
79.00±7.00
85.33±18.18
3s5z_vs_3s6z
6.25±5.41
93.00±8.19
100.00±0.00
corridor
0.00±0.00
94.00±7.94
99.33±1.15
Average
42.71±5.32
91.50±4.18
96.17±4.47
Table 7: Performance comparison with and without access to readable world models across 16 online scenarios. Results are reported as mean ± sample standard deviation over three runs.
D4RL Normalized Score
Full Completion (%)
Dataset
Without RWM
With RWM
Without RWM
With RWM
kitchen-complete
60.75±31.95
84.25±8.11
41.00±37.99
63.33±17.04
kitchen-partial
40.92±12.88
96.17±2.84
3.00±5.20
92.33±5.69
Table 8: Performance comparison with and without access to readable world models on offline Kitchen tasks. Results are reported as mean ± sample standard deviation over three independently constructed policies. Full completion denotes the percentage of episodes in which all four tasks are completed.
Figure 10: FourRooms navigation with and without readable world model access. PS-RWM infers unobserved walls from environment rules, while policies without source access retain them as unknown.
Benchmark
Scenario
RL baseline
PS-RWM
Dense
Sparse
Dense
Sparse
SMAC
3s5z_vs_3s6z
6.25±5.41
0.00±0.00
100.00±0.00
100.00±0.00
3s_vs_5z
69.79±28.36
0.00±0.00
100.00±0.00
100.00±0.00
8m_vs_9m
94.79±6.51
0.00±0.00
85.33±18.18
55.67±1.53
corridor
0.00±0.00
0.00±0.00
99.33±1.15
100.00±0.00
MiniGrid
DoorKey ( 8×8 )
11.67±5.77
0.00±0.00
100.00±0.00
100.00±0.00
Table 9: Performance under dense and sparse rewards across SMAC (win rate, %), MiniGrid (success rate, %), and Box2D (episode return), reported as mean ± standard 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.
Benchmark
Scenario
Observation
RL Baseline
PS-RWM
Original Policy
One-Round Revision
MiniGrid
DoorKey ( 8×8 )
Full
0.00±0.00
0.00±0.00
100.00±0.00
7×7
0.00±0.00
100.00±0.00
—
5×5
0.00±0.00
0.00±0.00
100.00±0.00
FourRooms
Full
2.67±2.31
11.33±0.58
100.00±0.00
Table 10: Performance comparison under different observation settings on MiniGrid and SMAC. Results are reported as mean ± standard 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.
Task
Method
7×7
5×5
3×3
Success (%)
Length
Success (%)
Length
Success (%)
Length
GoToRedBall
PS-RWM
100.0
5.4
100.0
6.0
100.0
9.0
BC
94.3
9.3
94.7
10.6
89.7
17.1
TD3+BC
91.7
11.0
92.7
11.0
91.3
15.9
IQL
93.0
10.3
92.7
11.8
87.0
19.1
CQL
96.3
8.5
95.3
9.5
97.0
13.7
Table 11: Offline BabyAI success rates (%) and mean episode lengths (steps) under different view sizes.
Benchmark
Scenario
PS-RWM
PS-RWM
Default Policy
One-Round Revision
SMAC
8m_vs_9m
85.33±18.18
—
10m_vs_11m
×
94.33±3.21
5m_vs_6m
×
13.67±3.79
27m_vs_30m
×
0.00±0.00
MiniGrid
Dynamic Obstacles ( 8×8 )
100.00±0.00
—
Table 12: Generalization and one-round adaptation results across environment variations in SMAC (win rate, %) and MiniGrid (success rate, %). PS-RWM Default Policy directly executes the policies synthesized for 8m_vs_9m and Dynamic Obstacles ( 8×8 ) on target scenarios without modification. PS-RWM One-Round Revision applies 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 ± standard deviation). × indicates execution failure due to observation-format incompatibility.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Benchmark
Dataset
Transitions
AntMaze
antmaze-umaze-v2
1,000,000
antmaze-umaze-diverse-v2
1,000,000
antmaze-medium-play-v2
1,000,000
antmaze-medium-diverse-v2
1,000,000
antmaze-large-play-v2
1,000,000
antmaze-large-diverse-v2
1,000,000
Appendix
Table 15: D4RL datasets and transition counts.
Task
Full data
Demonstration budgets
2,000 trajectories
M=64
M=256
GoToRedBall
10,737
318
1,308
GoToLocal
10,809
315
1,393
GoToSeq
147,256
4,651
18,225
PutNextLocal
24,156
813
3,128
UnlockLocalDist
32,285
1,129
4,175
Appendix
Table 16: BabyAI transition counts by construction input.
Environment
Public execution interface shared by both conditions
SMAC
Each unit’s local observation, legal-action mask, and own previous action; one legal discrete action per decision.
MPE
Each agent’s local observation and its own bounded continuous action; in Speaker--Listener , the two roles communicate through environment messages.
MiniGrid
A flattened symbolic observation containing the 7×7 local view and the task instruction; three discrete actions in Dynamic Obstacles and seven in the other three tasks.
Box2D
Frozen PPO-normalized and clipped observations; bounded continuous actions for the lander or walker.
Appendix
Table 17: Public execution interfaces shared by both access conditions.
How do LLM agents come to both understand environments they act in and master tasks set within them? Through controlled experiments combining world-model training (next-state prediction) and policy training (reward maximization), we investigate this question. We dissect the resulting models through their additive parameter updates. Geometrically, we find effective world-model updates are low-rank and share an input-feature subspace with policy updates while writing to nearly orthogonal output directions, whether trained separately or sequentially. However, we find that, in projection interventions, the sequential update induces more robustness than separate policy RL when removing the world model's leading input directions, suggesting that it has learned alternative input pathways. Behaviorally, we find the sequentially trained agent explores a wider range of states and actions. Based on this, we ask: does policy training preserve world knowledge as well as it could? We probe this with training-free merging built on the geometrically motivated input basis plus an online world-model loss during policy RL, and show both improve over the untreated baseline. Our findings suggest world knowledge and task-directed ability can be learned in geometrically complementary forms, and that future post-training pipelines should consider how best to engineer the interface between them.
Large language models (LLMs) have achieved strong performance in language-centric tasks. However, in agentic settings, LLMs often struggle to anticipate action consequences and adapt to environment dynamics, highlighting the need for world-modeling capabilities in LLM-based agents. We propose Reinforcement World Model Learning (RWML), a self-supervised method that learns action-conditioned world models for LLM-based agents on textual states using sim-to-real gap rewards. Our method aligns simulated next states produced by the model with realized next states observed from the environment, encouraging consistency between internal world simulations and actual environment dynamics in a pre-trained embedding space. Unlike next-state token prediction, which prioritizes token-level fidelity (i.e., reproducing exact wording) over semantic equivalence and can lead to model collapse, our method provides a more robust training signal and is empirically less susceptible to reward hacking than LLM-as-a-judge. We evaluate our method on ALFWorld and τ2 Bench and observe significant gains over the base model, despite using no expert data, task-success rewards, or strong-LLM annotations - only an off-the-shelf embedding model as a distance metric. When combined with task-success rewards, our method outperforms direct task-success reward RL by 6.9 and 5.7 points on ALFWorld and τ2 Bench respectively; it further outperforms expert-data training on ALFWorld and is comparable to it on τ2 Bench.
Xiao Yu, Baolin Peng, Ruize Xu +6
Columbia University, New York · Microsoft Research, Redmond · Dartmouth College, Hanover
Recent studies on world modeling for Large Language Model (LLM) agents typically formulate the learning objective as next-observation prediction. However, this objective ties supervision to what a transition happens to reveal, which may omit the dynamics most relevant to the agent's current decision. To bridge this gap, we propose Agent-Authored World Modeling (AAWM), a training procedure that constructs supervision from the policy's own decision needs. Specifically, at each state, the agent identifies what it needs to understand about the environment before acting. These needs drive the retrieval of relevant transition evidence across trajectories, which is then synthesized into training targets that capture decision-oriented dynamics instead of reconstructing the next observation. This aligns the training objective with the dynamics the policy needs before acting, not with the contents of the next observation. Experimental results validate the effectiveness of AAWM across multiple environments and training settings. These results show that decision-aware world-model targets provide a more effective learning signal than next-observation prediction.