Agents in complex, stochastic environments must contend with dynamics that can exceed their world models' predictive capacity and randomness that obscure the consequences of their actions. We hypothesize that, compared to imagining entirely new trajectories in such complex environments, it can be easier to transform observed trajectories with alternative actions. Counterfactual world models condition on observations to predict alternative outcomes under the same underlying environmental randomness, using experience as a reference for predicting action-dependent changes. We present a policy gradient estimator, REINFORCE Look Back (RLB), that uses counterfactual returns as baselines to distinguish action effects from environmental luck, and prove conditions for unbiasedness and variance reduction. In settings where environmental evolution is harder to predict than action-induced changes, we show that counterfactual world models are easier to learn and support better policy learning than ordinary world models. Our findings suggest that counterfactual thinking can help agents learn effective behavior without independently reproducing the full complexity of their worlds.
Figures & tables
Figure 1: Overview. To evaluate an action jump against the observed action stand , a world model imagines the future anew (top), mixing the action’s effect with luck, whereas a counterfactual world model edits the observed experience, isolating it (bottom).
Figure 2: Counterfactual world models (CWMs). (Left) A CWM transforms the factual outcome under the same environmental noise ui , requiring no model of p(u) . (Right) CWMs can be learned from paired outcomes with shared noise, or from unpaired data by inverting a (diffusion) WM.
Figure 3: RLOO vs. RLB. Independent branches differ by both action and luck, whereas counterfactual branches share the factual noise and differ by action only.
Figure 4: Results for the contextual bandit problem across six independent randomized trials. (Left) Policy learning across various levels of environmental noise σ . (Right) Prediction error of ordinary and counterfactual world models over training, where for both, the minimum attainable error is zero .
Figure 5: Results for the multi-agent bandit problem across six randomized trials. (Left) Policy learning across various numbers K of agents in the environment. (Right) Prediction error of ordinary and counterfactual world models over training, where for both, the minimum attainable error is zero .
Figure 6: An agent among others of equal capacity (top). A world model must simulate them (left). A counterfactual world model observes them (right).
Figure 7: Visualization of an environmental transition under action stand , a counterfactual world model imagination under action jump , and a world model imagination under action jump .
Table 8
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
Variance
Relative bias
Method
σ=0.1
σ=30
σ=60
σ=0.1
σ=30
σ=60
REINFORCE
95.8
21,122
301,493
-
-
-
REINFORCE + baseline
95.4
20,995
301,304
-
-
-
CCA
36.8
8,465
121,238
0.48
2.20
8.70
RLOO
70.6
18,794
268,276
-
-
-
RLOO + WM
70.5
18,539
265,281
0.004
0.52
1.79
Appendix
Table 3: Gradient variance and bias of contextual bandit at a uniform policy. - denotes unbiased.
Variance
Variance (with learned models)
Bias 2 (with learned models)
Updates
RLB
RLOO
RLB + CWM
RLOO + WM
RLB + CWM
RLOO + WM
500
43.8
59.6
61.2
60.3
1.05 [ + 0.34, + 2.12]
0.00 [ − 0.18, + 0.35]
1,000
23.8
59.1
54.2
89.2
0.02 [ − 0.10, + 0.24]
0.25 [ − 0.21, + 1.19]
1,500
27.0
63.3
50.5
79.7
0.05 [ − 0.08, + 0.31]
0.37 [ − 0.04, + 1.00]
Appendix
Table 4: Gradient variance and bias of Dino game. Brackets are 95% confidence interval.
m
σ
Method
2
4
8
16
32
64
30
RLB
2,155
1,544
1,539
1,866
2,649
4,242
RLOO
28,102
18,761
16,113
15,051
14,534
14,394
60
RLB
8,318
5,964
5,946
7,214
10,247
16,426
RLOO
400,882
267,586
229,721
214,363
206,629
203,740
Appendix
Table 5: Gradient variance in the contextual bandit for different group sizes m , averaged over five seeds. Bold marks the lowest RLB variance within sampling error.
σ
Method
m=2
m=4
m=8
m=16
30
RLB
− 16.26 ± 0.24
− 15.01 ± 0.30
− 16.58 ± 0.31
− 18.87 ± 0.11
RLOO
− 41.83 ± 0.19
− 38.94 ± 0.14
− 37.83 ± 0.09
− 37.30 ± 0.07
60
RLB
− 28.73 ± 0.25
− 25.49 ± 0.18
− 25.83 ± 0.19
− 28.00 ± 0.24
RLOO
− 59.16 ± 0.48
− 56.92 ± 0.44
− 56.06 ± 0.11
− 55.58 ± 0.19
Appendix
Table 6: Expected reward of RLB and RLOO after 10M interactions in the contextual bandit, across group sizes m . Mean and 95% normal confidence interval over six seeds. The optimum is zero.
Figure 8: Policy learning results for the multi-agent bandit problem, with additional baselines difference rewards ( Wolpert and Tumer, 2002 ) and COMA ( Foerster et al., 2018 ) .
Figure 9: Additional examples. CWM and WM use the same intervention action.
DDIM steps
Guidance
Composition (%) ↓
Failure (%) ↓
Effectiveness (%) ↑
Relative runtime ↓
5
1.0
0.371
34.4
99.5
0.55 ×
10
1.0
0.197
9.9
99.8
1.00 ×
20
1.0
0.121
3.9
99.8
1.86 ×
10
1.5
0.202
11.4
100.0
1.01 ×
10
2.0
0.210
12.2
100.0
1.01 ×
10
3.0
0.226
16.1
100.0
1.06 ×
Appendix
Table 7: Impact of diffusion inversion steps and guidance scale.
Method or stage
Workload
GPUs
Time cost
Diffusion WM training
9,000 steps
8
2 h 15 min
REINFORCE
100 updates
1
7.48 min
REINFORCE + baseline
100 updates
1
7.59 min
RLOO
100 updates
1
7.61 min
RLB
100 updates
1
7.33 min
RLOO + WM
100 updates
1
58.91 min
Appendix
Table 8: Wall-clock time cost of Dino model and policy training on RTX 3090 GPUs.
Figure 10: Results for the task interleaving environment across five randomized trials.
Figure 11: Results for the linear key-to-door environment across five randomized trials.
Figure 12: Sensitivity to the choice of SCMs in RiverSwim.
λ=σluck
0
0.5
1
1.5
1.58
2
3
RLB / RLOO
3.45
2.77
1.75
1.08
1.00
0.70
0.35
Appendix
Table 9: Gradient variance of RLB relative to RLOO on interaction bandit. Values <1 favor RLB.
Action-conditioned world models offer a scalable alternative to costly real-world interaction for improving robot policies. However, existing world-model-based methods largely treat world models as forward-only surrogates of the physical environment, leaving untapped a capability no physical environment affords: rewinding to past decision points to explore counterfactual futures. We introduce Rollback, a policy improvement paradigm that turns world models from passive simulators into counterfactual engines: it rolls back to critical decision points, branches into alternative actions, and contrasts their outcomes to attribute success to individual decisions. This concentrates imagination where it matters most and distills counterfactual outcomes into fine-grained, action-level supervision without a separately learned value model. We build a scalable training system that unifies distributed world-model search with asynchronous real-robot execution, forming a self-reinforcing cycle: real-world experience continually sharpens the world model, and a sharper world model in turn drives further policy improvement. We term the world-model side of this cycle test-time physics grounding, a capability that hand-built physics simulators lack: while the world model serves as the training environment, real transitions from the policy it trains correct its dynamics through a lightweight LoRA pipeline. Experiments on three challenging real-world tasks show that Rollback improves success rates over the strongest baseline by an absolute 10.67%, 11.11%, and 11.85% on block extraction, ball tossing, and tabletop curling, respectively, while achieving more stable improvement throughout training. Although initialized from teleoperated demonstrations far below human level, Rollback surpasses the average success rate of human players on both ball tossing and tabletop curling within 8 hours of training.
Could model-free reinforcement learning algorithms actually be learning a model of the environment? In this work, we apply counterfactual interventions which hold everything about a state fixed, besides a targeted change, to explore if the value function of a Proximal Policy Optimization agent forms a world model of the Crafter environment. Despite only being trained to optimize reward, we discover that the value function learns concepts such as the rules governing when a diamond is collectible, water and food having an impact on health, heuristics regarding inventory, and more. Finally, we discuss the safety implications of our visualizations and some shortcomings of current reinforcement learning agents that will prevent us from building truly advanced machine intelligence.
Equipping VLM agents with world modeling capabilities has shown strong potential for complex reasoning and long-horizon planning, while reducing the dependence of policy learning on costly real-world interactions. Existing methods mainly rely on prospective simulation to predict the consequences of candidate actions. However, this forward-only paradigm focuses on what will happen next and provides limited constraints for verifying whether an action is causally consistent with the observed state transition, which can lead to plausible-looking but physically incoherent behaviors. In this paper, we challenge the view of world modeling as only prospective prediction and introduce Retrospective World Modeling, a new agent learning paradigm that enables agents to reason backward by estimating the retrospective attribution distribution P(a^t∣st,st+1) for the action that most likely caused a given transition. Based on this capability, we formulate the Self-Consistency Reward (SCR), an intrinsic signal that measures the probabilistic consistency between the policy action and the retrospective explanation. Integrating SCR into reinforcement learning provides dense transition-level feedback and steers agents toward behaviors that are both task-effective and physically grounded. Extensive experiments across diverse agentic tasks show that our method substantially improves policy robustness and generalization over prospective-only world modeling baselines.
Yongjiang Liu, Jie Zhang, Haoyue Zhang +3
The Hong Kong University of Science and Technology · The Hong Kong Polytechnic University · China University of Geoscience