World Models

David Ha, Jürgen SchmidhuberarXiv 2018

Introduction

Building truly intelligent agents often involves mimicking the human brain's ability to construct internal "mental models." Rather than reacting solely to raw sensory data, humans use these models to predict future states and plan actions. In the seminal paper "World Models," David Ha and Jürgen Schmidhuber demonstrate how artificial agents can achieve state-of-the-art performance by learning a compressed representation of their environment and training entirely within their own "hallucinated" dreams.

The World Model Architecture

The proposed framework addresses the bottlenecks of high-dimensional inputs and delayed credit assignment by decoupling the environment's representation from the agent's policy. The architecture consists of three primary components:

  • Vision (V): A Variational Autoencoder (VAE) that takes high-dimensional pixel inputs (64x64x3) and compresses them into a small latent vector $z$, capturing the spatial essence of the observation.
  • Memory (M): A Recurrent Neural Network (RNN) combined with a Mixture Density Network (MDN). This "World Model" predicts the probability distribution of the next latent state $z_{t+1}$ based on the current state and action, effectively modeling temporal dynamics.
  • Controller (C): A simple, single-layer linear model that maps the current vision ($z_t$) and memory state ($h_t$) to an action. Because V and M handle the heavy lifting of understanding the world, the controller remains computationally efficient with fewer than 1,000 parameters.
The World Model architecture: Vision (V) encodes observations, Memory (M) integrates history to predict future states, and the Controller (C) selects actions based on both.

A key innovation is "Dream" training: once V and M are trained on initial data, the controller can be optimized entirely within the simulations generated by the World Model (M), without further interaction with the actual game engine.

Experimental Setup and Results

The researchers evaluated their model on two challenging environments from the OpenAI Gym: CarRacing-v0, a top-down navigation task, and VizDoom: Take Cover, a 3D survival environment.

The CarRacing-v0 (left) and VizDoom (right) environments used to evaluate the agent's ability to navigate and survive using internal models.

The World Model agent achieved significant milestones in both tasks:

  • CarRacing-v0: It was the first known solution to reach the required score of 900, achieving an average of 906 ± 21. The RNN provided a sense of temporal "flow" that allowed the agent to navigate sharp corners more effectively than simple frame-stacking methods.
  • VizDoom: The agent trained entirely inside its own "hallucinated" dream achieved a survival score of ~1100 time steps in the real game, far exceeding the "solved" requirement of 750.

Key Insights

  • Separation of Concerns: By using unsupervised learning (VAE and RNN) to handle complexity, the reinforcement learning task (the Controller) is simplified, allowing for robust optimization via Evolution Strategies (CMA-ES).
  • Predictive Coding: The agent reacts to its internal state and predictions of the future, mimicking how humans anticipate motion (e.g., a baseball player swinging at a fastball).
  • Robustness through Uncertainty: Introducing a "temperature" parameter ($ au$) to increase dream stochasticity during training resulted in agents that were more resilient when transferred back to the actual game environment.

Limitations and Future Work

Despite its success, the model faces challenges. Agents sometimes discover "bugs" in their own world models—sequences of movements that trick the RNN into unrealistic states (e.g., fireballs never firing). Additionally, the VAE's pixel-wise reconstruction loss might ignore small but task-critical features. Future work may involve more complex memory structures, such as Transformers, to handle environments with longer temporal horizons.

Reference: Ha, D., & Schmidhuber, J. (2018). World Models. arXiv preprint arXiv:1803.10122v4.

Summary updated

BibTeX
@misc{ha2018world,
  author = {David Ha and Jürgen Schmidhuber},
  title = {{World Models}},
  year = {2018},
  eprint = {1803.10122},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1803.10122},
}
Figure