Internalizing World Models via Self-Play Finetuning for Agentic RL

Shiqi Chen, Tongyao Zhu, Zian Wang, Jinghan Zhang, Kangrui Wang, Siyang Gao, Teng Xiao, Yee Whye Teh, Junxian He, Manling Li · DOI

Introduction

Large Language Model (LLM) agents frequently struggle in "out-of-distribution" (OOD) scenarios—environments that differ significantly from their training data. In these cases, models often fail to "ground" their knowledge, treating environment states as abstract symbols without understanding the underlying "physics" or how their actions affect the world. This leads to a "systematic divergence" in standard Reinforcement Learning (RL): while a model might improve at finding a specific solution (Pass@1), its ability to find diverse solutions (Pass@k) often stagnates or drops, suggesting memorization rather than true rule-learning.

To address this, the authors introduce SPA (Self-Play Agent), a framework that enables LLMs to internalize a world model through self-play and state-transition prediction before proceeding to policy optimization.

The SPA Framework

The SPA approach decomposes agent training into three distinct phases designed to build a robust internal representation of the environment.

The SPA framework uses self-play to generate trajectories where the model predicts world states within a <think> tag before outputting an action.
  1. State Estimation: Raw environment states (e.g., complex symbolic grids) are converted into structured, natural-language descriptions. This reduces the perplexity (PPL) of the state, making it more interpretable for the LLM.
  2. Transition Modeling via Self-Play SFT: Before RL, the model undergoes a "cold-start" Supervised Fine-Tuning (SFT) phase. By interacting with the environment, the model collects trajectories and is trained to predict both the current state and the next state within a <think> tag. Crucially, hallucinated predictions are replaced with ground-truth environment data during training to ensure the model learns accurate dynamics.
  3. Policy Optimization: Finally, the model is fine-tuned using Proximal Policy Optimization (PPO), starting from the foundation of the internalized world model.

Key Insights

  • Exploration Over Exploitation: By learning world dynamics before optimizing for rewards, SPA prevents premature strategy narrowing, maintaining high Pass@k scores.
  • Internalization vs. External Reward: Unlike methods that use auxiliary rewards for world modeling during RL, SPA "internalizes" the rules first. This avoids "multi-objective interference," where the model struggles to learn the rules and the winning strategy simultaneously.
  • The Necessity of Ground Truth: Training on the model's own "self-belief" (hallucinations) during SFT degrades performance. The model must be corrected by the environment's ground truth to build a functional world model.

Experimental Results

The researchers evaluated SPA on multi-step spatial reasoning tasks including Sokoban, FrozenLake, and Sudoku. The performance gains were substantial across various model sizes.

Comparison of SPA against Vanilla RL and State Estimation RL, showing significant improvements in Pass@1 as training progresses.
  • Sokoban: For a Qwen2.5-1.5B model, SPA boosted the success rate from 25.6% (Vanilla RL) to 59.8%.
  • FrozenLake: Success rates jumped from 22.1% to 70.9%, outperforming much larger models like GPT-OSS-20B.
  • Sudoku: SPA achieved a 59.6% success rate, whereas Vanilla RL failed to solve any puzzles (0.0%).
  • Efficiency: SPA-trained models produced shorter, more deliberate trajectories, indicating superior planning capabilities compared to the random wandering often seen in standard RL agents.

Limitations and Future Work

While SPA represents a significant step forward, challenges remain. High-stochasticity environments like FrozenLake still present stability issues. Additionally, the quality of SFT data relies on the model's ability to follow complex formatting instructions. Future work aims to incorporate uncertainty-aware transitions and scale the approach to richer, multi-modal environments.

Summary updated

BibTeX
@misc{chen2025internalizing,
  author = {Shiqi Chen and Tongyao Zhu and Zian Wang and Jinghan Zhang and Kangrui Wang and Siyang Gao and Teng Xiao and Yee Whye Teh and Junxian He and Manling Li},
  title = {{Internalizing World Models via Self-Play Finetuning for Agentic RL}},
  year = {2025},
  eprint = {2510.15047},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.15047},
}
Figure