Learning to Play Atari in a World of Tokens

Pranav Agarwal, Sheldon Andrews, Samira Ebrahimi Kahou

Introduction

Reinforcement Learning (RL) has historically been hindered by the massive amount of data required to master complex environments. While Model-Based Reinforcement Learning (MBRL) addresses this by training agents within a learned "world model," many existing architectures rely on continuous latent spaces and recurrent neural networks (RNNs) like LSTMs. These components often struggle with discrete state transitions and long-range dependencies.

DART (Discrete Abstract Representations for Transformer-based learning) introduces a paradigm shift by treating the environment as a sequence of discrete tokens. By leveraging a GPT-style world model and a novel self-attention-based memory mechanism, DART achieves state-of-the-art sample efficiency on the Atari 100k benchmark, demonstrating that discrete representations can significantly improve reasoning and performance in complex visual tasks.

Methodology: A Token-Centric Architecture

DART’s architecture is built on three core pillars designed to process and predict environmental states as discrete sequences.

1. Representation Learning via VQ-VAE

To bridge the gap between high-dimensional visual input and discrete reasoning, DART employs a Vector Quantized Variational Autoencoder (VQ-VAE). This component compresses raw image observations into a grid of discrete latent tokens. By discretizing the visual scene, the agent transforms a game frame into a structured "sentence" of visual concepts, avoiding the "blurry" predictions common in continuous latent models.

2. Generative World Modeling

The world model utilizes a Transformer-Decoder architecture, similar to the GPT family of models. It is trained to predict the next set of tokens, rewards, and episode termination signals auto-regressively. This allows the agent to "imagine" future states with high precision, effectively learning the underlying physics and logic of the game environment through sequence prediction.

3. Policy and the Memory Token

The agent’s decision-making "brain" is a Vision Transformer (ViT)-style encoder. Unlike traditional agents that use LSTMs for temporal memory, DART introduces a dedicated memory token. This token is passed between time steps, allowing the transformer to use self-attention to selectively retain or discard information from the past. This mechanism provides a more flexible and trainable alternative to recurrent architectures, enabling the agent to focus on critical objects (like a ball in Breakout) or ignore static backgrounds as needed.

Experimental Evaluation

The primary evaluation of DART is performed on the Atari 100k benchmark, a rigorous test of sample efficiency where agents are restricted to 100,000 environment steps—roughly two hours of real-time play. Additionally, the model was tested on Crafter, a 2D survival environment inspired by Minecraft, to evaluate its long-horizon planning capabilities.

Key Results

DART established a new state-of-the-art for sample-efficient RL:

  • Atari 100k Performance: DART achieved a median Human-Normalized Score (HNS) of 0.790, substantially outperforming previous leaders such as DreamerV3 (0.466) and IRIS (0.289).
  • Superhuman Benchmarks: The agent surpassed human-level performance in 9 out of the 26 games tested and outperformed the previous best transformer-based model, IRIS, in 18 of those games.
  • Robustness in Crafter: DART outperformed both DreamerV3 and IRIS in the Crafter environment, proving that its discrete token approach scales to tasks requiring complex survival strategies and long-term planning.

Discussion and Future Directions

The success of DART highlights the power of discreteness in world modeling. By forcing the model to use discrete codes, it avoids the accumulation of errors inherent in continuous predictions, leading to sharper and more accurate simulations. Furthermore, the parallel nature of transformer training makes DART more computationally efficient than its recurrent counterparts.

However, several avenues for improvement remain. DART is currently optimized for discrete action spaces; extending its capabilities to continuous control (e.g., robotics or driving) is a key next step. Additionally, while the current policy is highly effective, integrating look-ahead search techniques like Monte Carlo Tree Search (MCTS) could further enhance the agent's strategic depth, albeit at the cost of increased inference time.

Summary updated

BibTeX
@inproceedings{agarwal2024learning,
  author = {Pranav Agarwal and Sheldon Andrews and Samira Ebrahimi Kahou},
  title = {{Learning to Play Atari in a World of Tokens}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=w8BnKGFIYN},
}
Figure