Introduction
In Reinforcement Learning (RL), data efficiency remains a primary hurdle. Collecting real-world interactions is often computationally expensive or physically slow. Model-Based Reinforcement Learning (MBRL) addresses this by learning a "world model"—a predictive simulation of the environment—allowing agents to practice in an imagined space. While Transformers have shown promise as world models, they often struggle with stability and computational overhead. This paper introduces three key enhancements to Transformer World Models (TWMs) that enable superhuman performance on complex benchmarks like Craftax-classic with significantly reduced data requirements.
Challenges in Transformer World Models
Despite their expressive power, Transformer-based world models face three significant obstacles:
- Non-Stationary Targets: Most MBRL systems use VQ-VAEs to compress images into discrete tokens. However, because the VQ-VAE updates alongside the world model, the "meaning" of tokens shifts constantly, creating a "moving goalposts" problem for the Transformer.
- Compounding Sequential Errors: Standard Transformers predict future states token-by-token (autoregressively). In visual domains, small errors in early tokens can snowball, leading to incoherent future state predictions.
- Divergence from Reality: Many modern agents train exclusively on imagined data, ignoring the ground-truth transitions collected during exploration, which can lead to policy degradation if the world model is inaccurate.
Proposed Enhancements
The authors propose a "ladder of improvements" to stabilize and accelerate the learning process in TWMs.
Dyna with Warmup
To bridge the gap between imagination and reality, the authors utilize a "Dyna" architecture that mixes real and imagined transitions for policy training. To ensure the policy does not learn from an immature world model, they introduce a warmup period. The agent initially trains only on real data, transitioning to imagined rollouts only after the world model has reached a sufficient level of reliability.
Nearest Neighbor Tokenizer (NNT)
To solve the problem of shifting token meanings, the authors replace the learnable VQ-VAE with a Nearest Neighbor Tokenizer. This method splits observations into patches and assigns tokens based on a static codebook. If a new patch is sufficiently different from existing entries, it is added as a permanent new token. Because tokens are never redefined, the Transformer learns against a stationary target, significantly improving training stability.
Block Teacher Forcing (BTF)
Rather than predicting tokens sequentially, Block Teacher Forcing utilizes a specialized attention mask to predict all tokens for a future frame simultaneously. This parallelization not only doubles the speed of generating imagined rollouts but also improves accuracy by preventing the accumulation of errors within a single timestep.
Optimized Foundation
Crucially, the authors also developed a highly optimized Model-Free RL (MFRL) baseline using an Impala CNN and a GRU memory module. This baseline serves as the foundation for the world model, ensuring that the benefits of MBRL are measured against a truly competitive standard.
Experimental Results
Superhuman Performance on Craftax
The primary evaluation was conducted on Craftax-classic, a complex, procedurally generated 2D environment requiring long-horizon planning. At the 1-million-step mark, the proposed MBRL agent achieved a score of 69.66%, surpassing the human expert benchmark (65.0%) and significantly outperforming the previous state-of-the-art, DreamerV3 (53.2%).
Efficiency and Generalization
- Speed: The combination of BTF and JAX-based optimization allowed the agent to train in a fraction of the time required by previous methods. The MFRL baseline alone reached 55.49% reward in just 15 minutes on a single A100 GPU.
- Robustness: The method demonstrated strong generalization across other benchmarks, including Craftax-full (achieving a new SOTA of 7.20%), MinAtar, and multi-agent tasks in OpenSpiel.
Conclusion and Future Work
By addressing the core instabilities of Transformer World Models through stationary tokenization and parallelized prediction, this research demonstrates that MBRL can achieve superhuman efficiency in complex, discrete environments. While the Nearest Neighbor Tokenizer is currently optimized for grid-based or sprite-heavy environments, future work will explore integrating pre-trained vision foundation models (like DINOv2) to extend these benefits to high-fidelity, continuous visual domains.
Summary updated