TL;DR
IRIS trains an Atari agent entirely inside a learned world model. A discrete autoencoder turns each frame into 16 tokens, and a GPT-style Transformer predicts the next frame's tokens, reward and episode end from the history of tokens and actions. With the equivalent of about two hours of game time per game, it reached a mean human-normalized score of 1.046 on the 26-game Atari 100k benchmark.
Where you'll see it: sample-efficient reinforcement learning research, and any agent that plans by imagining sequences inside a learned video model.
The problem
Deep reinforcement learning agents need enormous amounts of experience. The paper notes that unconstrained Atari agents are usually trained for 50 million steps, and that DreamerV2 was developed and evaluated with two hundred million frames available. Real robots and real products cannot afford that many interactions, so the paper treats sample efficiency as the bottleneck.
Model-based methods address this by learning a world model and training the policy on imagined trajectories. This works only if the model stays accurate over long horizons. SimPLe showed promise on Atari 100k, but the best imagination agent, DreamerV2, was developed with about two hundred million frames, far from the sample-efficient regime. The authors also point out that Transformers, which model long sequences of discrete tokens well, had not been used as world models for this setting. A pixel-level Transformer is too expensive, because standard attention cost grows with the square of the sequence length, and an image has many thousands of pixels.
So the open question was whether a Transformer world model on compact image tokens could be accurate enough, with little data, to train a competitive policy in imagination.
Key idea
Turn images into a short language of tokens and let a Transformer model that language over time. A discrete autoencoder maps each frame to tokens chosen from a vocabulary of codes. A GPT-like autoregressive Transformer then models the interleaved sequence of frame tokens and actions. Given the history, it predicts the next frame's tokens one by one, plus the reward and whether the episode ends. The policy is trained only on rollouts the world model generates. Real experience is used to train the world model and to keep it current.
flowchart LR F["Real frame x_t"] --> E["Encoder E: 16 tokens"] E --> G["Transformer G over frame and action tokens"] A["Action a_t from policy"] --> G G --> N["Predicted next tokens, reward, episode end"] N --> D["Decoder D: imagined frame"] D --> P["Policy and value learn from imagined frames"] P --> A
The design is simple on purpose. The autoencoder is a vector-quantized image coder, the sequence model is a standard Transformer, and the agent learns with an actor-critic objective. The paper argues that these standard pieces, combined carefully, are enough to get strong sample efficiency.
The method
From images to tokens
The encoder runs a convolutional network over the frame, producing a grid of vectors of dimension . Each vector is replaced by the index of its nearest entry in an embedding table with entries:
This is the quantization step from Vector Quantization. The decoder is a convolutional network that turns the tokens back into an image.
The autoencoder is trained with an equally weighted sum of four terms. The first is an reconstruction loss. The second and third form the commitment loss, with one term moving the embedding toward the encoder output and the other moving the encoder output toward the embedding, each with a stop-gradient on the other side. The fourth is a perceptual loss. The paper uses a Straight-Through Estimator to pass gradients through the nearest-neighbour choice. The autoencoder starts from the VQGAN code base with the discriminator removed, so it is a plain vector-quantized autoencoder with a perceptual loss. The original VQ-VAE weights its commitment term by a factor , and IRIS does not use that factor.
The paper's hyperparameters are a frame, four layers with two residual blocks each and 64 channels, a vocabulary of 512 entries, 16 tokens per frame and a token embedding dimension of 512.
Modeling dynamics
The Transformer takes a sequence of time steps. Each step is frame tokens followed by one action token, so with the input has tokens. Frame tokens are embedded with an table and actions with an table, where . The model has GPT-2-style blocks with four attention heads each.
At each step, models three things. It predicts the next frame's tokens one at a time, with each token conditioned on the earlier ones in the same frame. It predicts the reward and it predicts the episode end. The transition and termination predictors use a cross-entropy loss. The reward predictor uses a mean squared error or a cross-entropy loss, depending on the game's reward scale. The Transformer is trained on segments of past experience, which is standard autoregressive next-token training.
Learning in imagination
The policy never sees the real environment during learning. It starts from a real frame taken from past experience, which the autoencoder reconstructs, and then acts. The world model predicts the reward, the episode end and the next frame, and the process repeats for a fixed horizon . If an episode end is predicted first, the rollout stops.
Because rollouts are short, the paper bootstraps the return with a learned value function , using the -return from the Dreamer line of work. The value network regresses onto this target with a squared error, and the target is treated as a constant. The actor is trained with a REINFORCE-style objective, meaning a Policy Gradient that weights the log-probability of each action by the advantage, the -return minus the value . An entropy bonus with weight keeps the policy exploring. The paper says it chose the objectives and hyperparameters of DreamerV2 for simplicity, and that many other Actor-Critic Methods methods could be used. The discount is and .
Training loop
The paper runs 600 epochs. In each of the first 500, the current policy collects 200 environment steps, with an epsilon-greedy rate of 0.01. The autoencoder starts training after epoch 5, the Transformer after epoch 25 and the actor-critic after epoch 50. Training uses Adam with learning rate , and , and clips gradient norms at 10. Batch sizes are 256 for the autoencoder and 64 for the Transformer and the actor-critic.
Results
The benchmark is Atari 100k. It uses 26 games and allows 100 thousand actions per game, which the paper describes as roughly two hours of human play. Scores are reported as human-normalized, meaning . For example, on Breakout the paper reports 83.7 for IRIS, a random score of 1.7 and a human score of 30.5, so the normalized score is .
The paper's aggregate table compares IRIS with methods that use no lookahead search and with two search-based methods:
| Method | Lookahead search | Mean | IQM | Superhuman games (of 26) |
|---|---|---|---|---|
| SimPLe | no | 0.332 | 0.130 | 1 |
| CURL | no | 0.261 | 0.113 | 2 |
| DrQ | no | 0.465 | 0.280 | 3 |
| SPR | no | 0.616 | 0.337 | 6 |
| IRIS | no | 1.046 | 0.501 | 10 |
| MuZero | yes | 0.562 | not reported | 5 |
| EfficientZero | yes | 1.943 | not reported | 14 |
Mean, IQM and superhuman counts are the paper's Table 1 values. The median is 0.289 for IRIS and 0.396 for SPR, so IRIS does not lead on the median, and the paper says the median is driven by a few games. Relative to SPR, the paper reports +70% on mean score, +49% on IQM, an optimality gap of 0.512 against 0.577 for SPR (lower is better), and superhuman play on 10 games against 6. The paper's own wording is that IRIS sets a new state of the art for methods without lookahead search on this benchmark. It also reports that IRIS outperforms MuZero, which was not designed for the sample-efficient regime, and it does not claim to beat EfficientZero, whose mean is higher.
The paper's per-game results show the pattern. IRIS scores strongly in games like Pong, Breakout and Boxing, where the world model does not face changing levels. It scores poorly in Frostbite, with 259.1 against a human score of 4334.7. The authors attribute this to a double exploration problem: the agent must first discover a new level, and the world model must learn it, before the policy can exploit it. Krull, which has more frequent level transitions, does better. The paper's qualitative figures show that the world model reproduces Pong pixel-perfectly after 120 games of training and predicts rewards and episode ends in Breakout and Gopher.
Five runs per game are used for IRIS, and the paper reports stratified bootstrap confidence intervals with Agarwal et al.'s recommendations.
Why it mattered
The paper shows that a Transformer over discrete image tokens can serve as a world model with which a policy learns to play Atari games using only about two hours of game time per game. Its claims are limited to the paper's benchmark and to methods without lookahead search. It also gives a concrete recipe: 16 tokens per frame, a 512-entry vocabulary, a 20-step context and an imagination horizon of 20. The code and models are released, as the abstract states. The authors list scaling to harder tasks, learning policies from the world model's internal representations, and combining imagination with Monte Carlo tree search as open directions. The paper does not claim any particular later influence, and this lesson does not either.
Reading guide
Read the paper in this order. For each section, the prerequisites are listed.
- Section 1, Introduction. Needs Model-Based Reinforcement Learning for the learning-in-imagination idea, World Model for what a world model is, and Vector Quantization for the discrete autoencoders used by VQGAN and DALL-E.
- Section 2, Method, opening. Needs Markov Decision Process and Partially Observable Markov Decision Process for the POMDP notation in the first paragraph.
- Section 2.1, From image observations to tokens. Needs Vector Quantization for the nearest-neighbour rule, Convolutional Neural Network for the encoder and decoder, and Straight-Through Estimator for backpropagation through the choice.
- Section 2.2, Modeling dynamics. Needs Transformer for the architecture, Autoregressive Model for token-by-token prediction, and Cross-Entropy Loss for the transition and termination losses.
- Section 2.3, Learning in imagination. Needs Value Function for the value network, Policy Gradient for the REINFORCE objective, Actor-Critic Methods for how the two networks fit together, Entropy for the entropy bonus and Gradient Descent for training.
- Section 3, Experiments. Needs Monte Carlo Tree Search for the lookahead-search methods that appear in the comparison table.
- Appendix A, Models and hyperparameters. Needs Adam Optimizer for the optimiser settings.
Check yourself
QuestionRecall: how many tokens represent one frame in IRIS, and how large is the token vocabulary?Show answer
QuestionComputation: on Breakout the agent scores 83.7, a random policy scores 1.7 and a human scores 30.5. What is the human-normalized score, to two decimal places?Show answer
QuestionWhy: why does IRIS model 16 tokens per frame with a Transformer instead of predicting raw pixels?Show answer
QuestionApplied: you deploy an IRIS-style agent in a game where a rare event unlocks a new level. What failure does the paper's Frostbite result predict, and what would you change?Show answer
Sources
- Micheli, Alonso and Fleuret, Transformers are Sample-Efficient World Models (2022): arXiv:2209.00588
- IRIS code and models: github.com/eloialonso/iris
- van den Oord, Vinyals and Kavukcuoglu, Neural Discrete Representation Learning (2017): arXiv:1711.00937