Do We Still Need Reinforcement Learning When We Can Read the World Model?
Zhang et al. in RL & post-training
Can a coding agent turn simulator code into a policy?
Do We Still Need Reinforcement Learning When We Can Read the World Model?
The world model becomes code the agent can read

Source code makes the world model readable: it specifies transitions and rewards. PS-RWM uses an LLM coding agent to turn that code into an executable policy, rather than using it only for planning or optimization.
How an executable policy takes shape
- 1
Read the implementation
Trace how actions change state, what the agent observes, what earns reward and what ends an episode.
- 2
Write decision code
Translate those mechanics into a policy; offline versions may also fit non-neural models to fixed experience.
- 3
Refine, then evaluate
Use online rollouts or offline records to revise. Final policies are evaluated on held-out seeds, and those scores are hidden from the coding agent.
Source access is for construction, not execution
The coding agent can inspect source code and use online feedback or a fixed offline dataset to revise candidate policies.
Frozen programs use the same public observation/action interface as RL baselines, without privileged environment state or further LLM inference.
Knowledge changes how the policy is built, not what it sees while acting.
A representative episode shows coordinated tactics

Rows are allied units; columns are steps. (a) PS-RWM, (b) QMIX; cells show actions, outlines targets. Here, Stalkers move away from enemies while Zealots focus fire, more coherently than QMIX in this episode.
The executable rules explain the coordination
- 1
Stalkers kite
Retreat when the nearest visible enemy Zealot is within 2.8 map units; for fewer than four steps after an attack, the threshold widens to 5.7.
- 2
Zealots focus fire
Rank visible enemy Stalkers by health, shields and distance, converging on one target; attack if in range, otherwise approach.
Competitive on most online tasks, not all

Solid curves show RL; shading is three-run SD; Box2D plots training returns. PS-RWM beat model-free RL in 15/16. QMIX and MBVD led on 8m_vs_9m, SeqWM on Speaker–Listener, DreamerV3 on BipedalWalker.
MiniGrid DoorKey reaches the target with fewer steps
DoorKey 8×8; target 80% success. PS-RWM counts all development steps; RL uses first qualifying checkpoint. Main sample-efficiency table.
Zero demonstrations is not zero knowledge
The BabyAI construction received no demonstration trajectories, transitions or dataset summaries.
With environment code and task description still available, PS-RWM averaged 100.00% success across six BabyAI tasks on 100 held-out seeds.
Zero demonstrations does not mean zero environment knowledge.
Offline D4RL results split by task family
PS-RWM averaged 176.9 D4RL normalized score; CQL, the strongest listed baseline, averaged 62.0.
PS-RWM averaged 59.9 versus CQL's 80.6. The D4RL baseline scores come from prior work, not same-run reruns.
Strong offline maze scores coexist with weaker MuJoCo locomotion performance.
Kitchen-partial: readable code raises completion
Kitchen-partial; same full dataset, goals, interface; no environment interaction. Three policies/condition, evaluated on same 100 seeds. Main table.
Combat control survived removal of intermediate rewards
On SMAC 3s5z_vs_3s6z, separately trained QMIX averaged 0.00% wins across three seeds.
Synthesized separately from the sparse-reward implementation, PS-RWM averaged 100.00% wins over three runs; terminal outcome rewards remained.
The source exposed combat mechanics without dense damage and kill rewards.
What this evidence does not settle
Model fidelity
A readable simulator may still differ from the real dynamics; code access alone cannot guarantee a reliable controller.
Precise control
On D4RL, PS-RWM trails the strongest listed averages on MuJoCo locomotion and Adroit manipulation.
Interaction is not total cost
Environment steps are not total computation: policy construction also consumes coding-agent tokens, with estimated inference costs reported separately.
Why it matters
- Readable world models can supply executable decision logic, not only predictions for planning.
- For programmable environments, test policy synthesis as a low-interaction alternative and count coding-agent inference alongside environment steps.
- The open question is whether it stays reliable with incomplete models, changing environments and precision-heavy control.
14 slides, 4 min
5 days ago