NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Mastering Atari with Discrete World Models

Danijar Hafner, Timothy P Lillicrap, Mohammad Norouzi, Jimmy Ba

TL;DR

DreamerV2 is the first model-based reinforcement learning (RL) agent to achieve human-level performance on the Atari 55 benchmark by training entirely within its own "imagination." By utilizing discrete latent variables and a novel "KL balancing" technique, it surpasses leading model-free agents like Rainbow and IQN using the exact same computational budget.

What Problem Does This Paper Address?

Reinforcement learning agents generally fall into two camps: model-free, which learn purely through trial and error, and model-based, which learn a "world model" to predict the outcomes of their actions. While model-based RL (MBRL) is theoretically more sample-efficient and better at generalizing, it has historically struggled with the complex, non-smooth visuals and logic of Atari games.

Previous world models weren't accurate enough to support high-level behavior; errors in prediction would accumulate, leading the agent astray in its "imagined" training. Consequently, model-free methods remained the gold standard for Atari. DreamerV2 aims to close this gap, proving that an agent can master complex environments by learning purely from predictions in a compact latent space.

Methods

DreamerV2 is an evolution of the original Dreamer (V1) architecture, which uses a Recurrent State-Space Model (RSSM). The authors introduced two critical modifications to make it viable for complex discrete environments:

  1. Discrete Latent Variables: Unlike DreamerV1, which used continuous Gaussian variables, DreamerV2 represents the environment using a vector of categorical variables (specifically, 32 groups of 32-class one-hot vectors). This allows the model to better capture multi-modal distributions and sudden, non-smooth changes in the environment (e.g., an enemy suddenly disappearing or a new room being entered).
DreamerV2 World Model Architecture
  1. KL Balancing: In variational world models, the "KL loss" typically regularizes the representation (posterior) toward the prediction (prior). However, if the prior is poorly trained, it can "pull" the representation away from useful image information. KL balancing minimizes the loss faster for the prior than the representation, encouraging the model to learn an accurate temporal prior without degrading the quality of its current state representations.

The agent (an actor-critic) is trained on trajectories "imagined" by this world model. It uses straight-through gradients to backpropagate through the discrete samples and Reinforce gradients for policy optimization in the Atari setting.

Datasets

  • Atari 55 Benchmark: The primary evaluation suite consisting of 55 classic games. The authors used the "sticky actions" protocol to ensure a more challenging, stochastic environment.
  • DeepMind Control Suite (Humanoid Walk): Used to demonstrate that the discrete world model approach still excels in continuous control tasks, even when learning from raw pixels.

Key Insights and Ideas

  • The Power of Discreteness: The shift from Gaussian to categorical latents was the "aha moment." Discrete variables provide a better inductive bias for the logic-heavy, discrete transitions found in video games. They also prevent "posterior collapse," where the model ignores the latent state.
  • Imagination as a Data Supercharger: Because the agent trains in a compact latent space rather than on raw images, it can simulate thousands of parallel trajectories. In the 200M frames of real-world experience, DreamerV2 actually learned from 468 billion imagined states—a 10,000x increase in training data.
  • World Models are Generalists: The study found that stopping gradients from the reward predictor into the world model didn't hurt performance much. This suggests the world model learns a general representation of the environment's physics and visuals that is useful regardless of the specific task or reward.

Key Results

  • Human-Level Performance: DreamerV2 achieved a median gamer-normalized score of 2.15, making it the first MBRL agent to reach this milestone on the full Atari 55 suite.
Atari Performance Comparison
  • Surpassing Model-Free SOTA: With the same computational budget (one V100 GPU, ~10 days of training), it outperformed the top single-GPU model-free agents, Rainbow and IQN.
  • Efficiency: It reached 200M frames of experience in under 10 days, a significant improvement over previous high-performing model-based attempts like MuZero, which required massive TPU clusters.
  • Zero-Shot Success on Humanoid: It solved the complex Humanoid Walk task from pixels, proving the architecture isn't just an "Atari specialist."

Limitations and Future Work

  • The "One-Pixel" Problem: DreamerV2 struggled with Video Pinball. The authors hypothesize that because the ball is only a single pixel, the world model's reconstruction loss (which looks at the whole screen) doesn't prioritize it enough, causing the model to "lose" the ball in its imagination.
  • Exploration: While DreamerV2 performed well on Montezuma’s Revenge (a notoriously difficult exploration game), it did so without an explicit exploration mechanism. Integrating advanced intrinsic motivation could further boost performance.
  • Long-Horizon Planning: While the imagination horizon is 15 steps, very long-term planning remains a challenge for all world models due to compounding errors over time.

Summary updated

BibTeX
@inproceedings{hafner2021mastering,
  author = {Danijar Hafner and Timothy P Lillicrap and Mohammad Norouzi and Jimmy Ba},
  title = {{Mastering Atari with Discrete World Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=0oabwyZbOu},
}
Figure