
===== PDF PAGE 1 =====
   Accurate and Efficient World Modeling with Masked Latent Transformers


                                              Maxime Burchi 1 Radu timofte 1


                          Abstract                                   80% Crafter Achievements Score (10M environment steps)
                                                                                 Learn agent from reconstructed images
       The Dreamer algorithm has recently obtained                               Spatial and temporal world model state                                                58.1
                                                                     60%         Temporal-only world model state
       remarkable performance across diverse environ-                                                                                                   50.5
                                                                                                        39.6                      42.5
       ment domains by training powerful agents with                 40%         34.9
       simulated trajectories. However, the compressed
       nature of its world model’s latent space can re-
                                                                     20%
       sult in the loss of crucial information, negatively            0%                                           L
                                                                                           3M                   3X                    S )                    an s          LD
       affecting the agent’s performance. Recent ap-                                erV                   erV                     -IRI2024              Huxmpert       ERA s)
                                                                             rea
                                                                                 m                       m                          L                    E           EM (Our
       proaches, such as ∆-IRIS and DIAMOND, ad-                            D                       Drea                      (IC M
       dress this limitation by training more accurate
                                                                       45    Collected Frames Per Second (FPS on RTX 3090)
       world models. However, these methods require                                 38
       training agents directly from pixels, which re-
       duces training efficiency and prevents the agent                30                                                                                             27
                                                                                                                 23
       from benefiting from the inner representations
       learned by the world model. In this work, we                    15                                                                          12
       propose an alternative approach to world model-
       ing that is both accurate and efficient. We intro-               0                       M                            XL                                           LD
       duce EMERALD (Efficient MaskEd latent tRAns-                                    erV3                            rV3                          S )
                                                                                                                                                -IRI2024              ERA s)
                                                                                    am                           am
                                                                                                                    e                                               EM (Our
       former worLD model), a world model using a                               Dre                          Dre                             (ICML
       spatial latent state with MaskGIT predictions to
       generate accurate trajectories in latent space and            Figure 1: Achievements score and collected Frames Per
       improve the agent performance. On the Crafter                 Second (FPS) of recently published model-based methods
       benchmark, EMERALD achieves new state-of-                     on the Crafter benchmark. EMERALD is the first method to
       the-art performance, becoming the first method to             exceed the performance of human experts on the benchmark.
       surpass human experts performance within 10M                  The world model uses a spatial latent state with MaskGIT
       environment steps. Our method also succeeds to                predictions to improve performance and training efficiency.
       unlock all 22 Crafter achievements at least once              ∆-IRIS proposed an accurate world model but suffers from
       during evaluation.                                            lower training efficiency due to autoregressive decoding in
                                                                     latent space and agent learning from reconstructed images.

1. Introduction
Model-based reinforcement learning has attracted increasing          as function approximations. World models (Sutton, 1991;
research attention in recent years (Hafner et al., 2019; 2020;       Ha & Schmidhuber, 2018) summarize the experience of an
2021; 2023; Schrittwieser et al., 2020). The growing com-            agent into a predictive function that can be used instead of
putational capabilities of hardware systems have allowed re-         the real environment to learn complex behaviors. Having
searchers to make significant progress, training world mod-          access to a model of the environment enables the agent to
els from high-dimensional observations like videos (Yan              simulate multiple plausible trajectories in parallel, improv-
et al., 2023) using deep neural networks (LeCun et al., 2015)        ing generalization, sample efficiency, and decision-making
   1                                                                 via planning.
     Computer Vision Lab, CAIDAS & IFI, University of
Würzburg, Germany. Correspondence to: Maxime Burchi                 Among these approaches, the Dreamer algorithm (Hafner
<maxime.burchi@uni-wuerzburg.de>.                                    et al., 2020; 2021; 2023) has achieved remarkable perfor-
Proceedings of the 42 nd International Conference on Machine         mance in various environments by training a world model
Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025          to generate imaginary trajectories in latent space. However,
by the author(s).                                                    while the world model has no difficulty in simulating simple

                                                                 1


===== PDF PAGE 2 =====
                          Accurate and Efficient World Modeling with Masked Latent Transformers




                       (a) EMERALD                                                        (b) DreamerV3 (M)

Figure 2: Comparison of EMERALD image reconstruction with DreamerV3. We show the 5 frames with highest recon-
struction error among a batch of 1024 test observations. The top row indicates original images, the middle row shows
reconstructed images and the bottom row shows reconstruction error. We observe that EMERALD achieves near-perfect
reconstruction, with errors resulting mostly from player orientation and textures. DreamerV3 fails to perceive crucial details
like diamonds and skeleton arrows, which diminishes the agent’s perception capacity and negatively impacts its performance.


visual environments such as DeepMind Control (Tassa et al.,          approach was later adapted by TECO (Yan et al., 2023),
2018) tasks or Atari games (Bellemare et al., 2013), some            demonstrating that MaskGIT-based latent space predictions
inaccuracies appear when modeling more complex environ-              could enable powerful video generation models. Inspired
ments like Crafter (Hafner, 2022) and MineRL (Guss et al.,           by these advances, we apply MaskGIT to model-based re-
2019). As shown in Figure 2b, the world model has diffi-             inforcement learning, allowing the agent to better perceive
culty perceiving important details on Crafter. This failure to       crucial environment details while improving decoding effi-
learn accurate representations for the agent leads to a lower        ciency. Furthermore, the agent benefits from internal repre-
performance.                                                         sentations learned by the world model, such as long-term
                                                                     memory, enabling it to track important objects and effec-
To remedy this problem, recent approaches have proposed
                                                                     tively map the environment. As shown in Figure 1, EMER-
more accurate world models. ∆-IRIS (Micheli et al., 2024)
                                                                     ALD sets a new record on the Crafter benchmark, being the
proposed to encode stochastic deltas for changes in the ob-
                                                                     first method to exceed human experts performance within
servation. Concurrently, DIAMOND (Alonso et al., 2024)
                                                                     10M environment steps with a score of 58.1%. Our method
proposed a diffusion-based world model using a U-Net ar-
                                                                     also succeeds to unlock all 22 Crafter achievements at least
chitecture. Both of these approaches proposed new world
                                                                     once during evaluation. Additionally, we report results on
model alternatives to improve the reconstruction quality of
                                                                     the commonly used Atari 100k benchmark (Kaiser et al.,
generated trajectories and increase the agent performance.
                                                                     2020) to demonstrate the general efficacy of EMERALD on
However, they also require learning the agent from recon-
                                                                     Atari games that do not necessarily require the use of spatial
struction images, which impact learning efficiency and does
                                                                     latents to achieve near perfect reconstruction.
not allow the agent to benefit from inner representations
learned by the world model such as long-term memory.
This significantly limits the potential of such methods for          2. Related Works
perception and training efficiency.
                                                                     2.1. Model-based Reinforcement Learning
In this work, we propose an alternative approach to world
                                                                     Model-based reinforcement learning approaches use a
modeling that is both accurate and efficient. We intro-
                                                                     model of the environment to simulate agent trajectories,
duce EMERALD, a Transformer model-based reinforce-
                                                                     improving generalization, sample efficiency, and decision-
ment learning algorithm using a spatial latent state with
                                                                     making via planning. Following the success of deep neural
MaskGIT predictions to generate accurate trajectories in
                                                                     networks for learning function approximations, researchers
latent space and improve the agent performance. Origi-
                                                                     proposed to learn world models using gradient backpropa-
nally designed for vector-quantized image generation (Van
                                                                     gation, allowing the development of powerful agents with
Den Oord et al., 2017), MaskGIT (Chang et al., 2022) im-
                                                                     limited data. One of the earliest model-based algorithms
proves decoding speed and generation quality compared to
                                                                     applied to image data is SimPLe (Kaiser et al., 2020), which
autoregressive sequential decoding (Esser et al., 2021). This
                                                                     proposed a world model for Atari games in pixel space using

                                                                 2


===== PDF PAGE 3 =====
                          Accurate and Efficient World Modeling with Masked Latent Transformers

Table 1: Comparison between EMERALD and other recent model-based approaches. Latent (zt ) refers to image latent
representations carrying spatial information while hidden (ht ) refers to world model hidden state carrying temporal
information. EMERALD uses a spatial latent state to improve world model accuracy. It also trains the agent in latent space
to increase efficiency and benefit from world model inner representations. Efficient decoding is performed using MaskGIT.

        Attributes               IRIS           DreamerV3               ∆-IRIS         DIAMOND          EMERALD (Ours)
      World Model            Transformer           GRU                Transformer         U-Net            Transformer
         Tokens             Latent (4 × 4)         Latent            Latent (2 × 2)        N/A            Latent (4 × 4)
  Latent Representation       VQ-VAE          Categorical-VAE          VQ-VAE              N/A          Categorical-VAE
        Decoding              Sequential            N/A                Sequential         EDM               MaskGIT
    Agent State (st )           Image          Latent, hidden            Image            Image       Latent (4 × 4), hidden


a convolutional autoencoder architecture. The world model           ages into discrete tokens and an autoregressive Transformer
predicts future frames and environment rewards based on             to predict future tokens. TransDreamer (Chen et al., 2021)
past observations and selected actions, enabling the training       proposed to replace Dreamer’s RSSM with a Transformer
of a Proximal Policy Optimization (PPO) agent (Schulman             State-Space Model (TSSM) using masked self-attention to
et al., 2017) with simulated trajectories.                          imagine future trajectories. TWM (Robine et al., 2023)
                                                                    (Transformer-based World Model) proposed a similar ap-
Concurrently, PlaNet (Hafner et al., 2019) introduced a Re-
                                                                    proach, encoding states, actions and rewards as distinct
current State-Space Model (RSSM) incorporating Gated
                                                                    successive input tokens for the autoregressive Transformer.
Recurrent Units (GRUs) (Cho et al., 2014) to learn a world
                                                                    More recently, STORM (Zhang et al., 2024) achieved results
model in latent space, planning using model predictive con-
                                                                    comparable to DreamerV3 with better training efficiency on
trol. PlaNet learns a convolutional variational autoencoder
                                                                    the Atari 100k benchmark.
(VAE) (Kingma & Welling, 2014) with a pixel reconstruc-
tion loss to encode observations into stochastic state repre-
sentations. The RSSM then predicts future stochastic states         2.2. Accurate World Modeling in Pixel Space
and environment rewards based on previous stochastic and            Another line of work focuses on designing accurate world
deterministic recurrent states. Following the success of            models to train agents from reconstructed trajectories in
PlaNet on DeepMind Visual Control tasks, Dreamer (Hafner            pixel space. Analogously to SimPLe, the agent’s policy
et al., 2020) improved the algorithm by learning an actor           and value functions are trained from image reconstruction
and a value network from the world model hidden repre-              instead of world model hidden state representations. This
sentations. DreamerV2 (Hafner et al., 2021) extended the            requires learning auxiliary encoder networks for the policy
algorithm to Atari games, replacing Gaussian latents by cat-        and value functions. Micheli et al. (2024) proposed ∆-
egorical latent states using straight-through gradients (Ben-       IRIS, encoding stochastic deltas between time steps using
gio et al., 2013) to improve performance. Lastly, Dream-            previous action and image as conditions for the encoder and
erV3 (Hafner et al., 2023) mastered diverse domains us-             decoder. This increased VQ-VAE compression ratio and
ing the same hyper-parameters with a set of architectural           image reconstruction capabilities, achieving state-of-the-art
changes to stabilize learning across tasks. The agent uses          performance on the Crafter (Hafner, 2022) benchmark.
symlog predictions for the reward and value function to
address the scale variance across domains. The networks             Meanwhile, DIAMOND (Alonso et al., 2024) introduced a
also employ layer normalization (Ba et al., 2016) to im-            diffusion-based (Sohl-Dickstein et al., 2015) world model
prove robustness and performance while scaling to larger            with EDM decoding (Karras et al., 2022) to generate high-
model sizes. It stabilizes policy learning by normalizing           quality trajectories and improve the agent performance. The
the returns and value function using an Exponential Moving          paper demonstrated that diffusion can successfully be ap-
Average (EMA) of the returns percentiles. With these modi-          plied to world modeling, requiring as few as 3 denoising
fications, DreamerV3 outperformed specialized model-free            steps for imagination. The method was evaluated on the
and model-based algorithms in a wide range of benchmarks.           Atari 100k benchmark showing better reconstruction quality
                                                                    and improved performance compared to DreamerV3. How-
Concurrent approaches have proposed to use a Transformer-           ever, it was not applied to a memory-demanding benchmark
based world model to improve the hidden representations             like Crafter that requires both good memory and visual per-
and memory capabilities compared to RNNs. IRIS (Micheli             ception to achieve strong results. The authors disclosed
et al., 2023) first proposed a world model composed of a            that initial experiments on the Crafter benchmark did not
VQ-VAE (Van Den Oord et al., 2017) to convert input im-             achieve good performance due to the absence of an effective


                                                                3


===== PDF PAGE 4 =====
                                              Accurate and Efficient World Modeling with Masked Latent Transformers




                                                   Rew              Cont                                                                                Critic             Actor
                           Spatial MaskGIT                                                                                           Spatial MaskGIT
                                                  Network          Network                                                                             Network            Network



                           Latent                                                                                                   Latent
                            Dec                                                                                                      Dec




   Cached Keys                                                                                                        Cached Keys
    and Values                                Temporal Masked Transformer Network                                      and Values              Temporal Masked Transformer Network



                           Latent                              Latent                         Latent                                Latent                       Latent              Latent
                            Enc                                 Enc                            Enc                                   Enc                          Enc                 Enc




                 Encoder            Decoder          Encoder            Decoder     Encoder            Decoder                      Encoder




                                       (a) World Model Learning                                                                         (b) Actor-Critic Learning

Figure 3: Efficient masked latent Transformer-based world model. EMERALD uses a spatial latent state zt and a temporal
hidden state ht to model the environment accurately and effectively. The world model predictions are made using a spatial
MaskGIT predictor network to increase decoding speed while maintaining accuracy. Actor-critic learning is performed by
imagining trajectories in latent space which allows the agents to benefit from world model inner representations.


memory module for the world model. We find that DIA-                                                         Inspired by the success of MaskGIT and similar approaches
MOND has difficulties predicting future frames in Crafter,                                                   such as draft-and-revise (Lee et al., 2022) for image gener-
generating hallucinations. In this work, we propose to im-                                                   ation, Yan et al. (2023) proposed TECO (Temporally Con-
prove performance and training efficiency by learning an                                                     sistent Video Transformer). TECO is a video generation
accurate world model in latent space. Table 1 compares the                                                   model using MaskGIT with draft-and-revise decoding to
architectural details of recent model-based approaches with                                                  predict future frames in latent space. They showed that us-
our proposed method.                                                                                         ing a MaskGit prior allows for not just faster but also higher
                                                                                                             quality sampling compared to an autoregressive sequential
2.3. Scheduled MaskGIT Predictions in Latent Space                                                           prior. Using a pre-trained VQ-GAN (Esser et al., 2021) vec-
                                                                                                             tor quantizer, the algorithm demonstrated strong memory
Parallel tokens prediction with refinements was intro-                                                       capabilities and generation quality. In this work, we propose
duced by MaskGIT (Masked Generative Image Trans-                                                             to apply MaskGIT to model-based reinforcement learning.
former) (Chang et al., 2022) as an alternative to sequen-                                                    We train a world model that is both accurate and efficient
tial decoding for vector quantized image generation (Van                                                     without requiring pre-trained discrete representations.
Den Oord et al., 2017; Ramesh et al., 2021; Esser et al.,
2021). MaskGIT proposed to replace autoregressive de-                                                        Meanwhile, the use of MaskGIT as prior for model-based
coding with scheduled parallel decoding of masked tokens                                                     reinforcement learning was concurrently explored by GIT-
to improve generation quality and significantly decrease                                                     STORM (Meo et al., 2024). GIT-STORM proposed to ap-
decoding time. During training, the method samples de-                                                       ply MaskGIT decoding using a draft-and-revise strategy
coding times τ ∈ [0, 1) uniformly. It proceeds to mask                                                       to the recently proposed STORM model. However, we
N = ⌊γHW ⌋ tokens where γ = cos( π2 τ ) follows a cosine                                                     note that the motivation behind GIT-STORM is different
schedule and H and W correspond to the height and width                                                      from our work: Similarly to image and video generation
of the latent space in tokens. At decoding time, the model                                                   works (Chang et al., 2022; Yan et al., 2023), EMERALD
is sampled to progressively predict all the tokens. This is                                                  uses MaskGIT as an alternative to sequential token decod-
done by selecting the most probable tokens and masking the                                                   ing in order to improve decoding efficiency for spatial la-
remaining tokens for the next decoding step.                                                                 tent spaces. In contrast, the GIT-STORM paper applied
                                                                                                             MaskGIT to the vector latent space of STORM in order to

                                                                                                        4


===== PDF PAGE 5 =====
                                   Accurate and Efficient World Modeling with Masked Latent Transformers
                           W

                     G




                 H

Autoregressive
Sequential
Decoding




                         t=0         t = 64      t = 128     t = 192        t = 256      t = 320      t = 384        t = 448        t = 512
                               W

                     G




                 H

Scheduled
Parallel
Decoding




                         t=0          t=1         t=2         t=3            t=4          t=5          t=6            t=7            t=8


Figure 4: Comparison of scheduled parallel decoding in EMERALD vs. autoregressive sequential decoding used by IRIS
and ∆-IRIS. We illustrate the H × W × G latent space of our method with only 4 of the 32 groups for better clarity.
Sequential decoding predicts one token at a time, significantly impacting efficiency. In contrast, EMERALD uses parallel
predictions with scheduled refinements, reducing decoding time while preserving the coherence of predicted tokens.


improve the quality of sampling. Key differences also lie in               3.1. World Model Overview
the architecture of the MaskGIT network. GIT-STORM per-
                                                                           Analogously to the Dreamer algorithm (Hafner et al., 2023)
forms attention on the 32 feature tokens of the vector latent
                                                                           and other recent approaches learning a world model in latent
space while EMERALD first concatenates the tokens along
                                                                           space (Robine et al., 2023; Zhang et al., 2024), we encode
the feature dimension and performs attention on spatial posi-
                                                                           input image observations ot into hidden representations us-
tions similarly to the original MaskGIT paper (Chang et al.,
                                                                           ing a convolutional VAE with categorical latents. To balance
2022).
                                                                           prediction accuracy and efficiency, our world model adopts
                                                                           a carefully designed architecture with spatial latent states
3. Method                                                                  zt and temporal hidden states ht . The spatial latent states
                                                                           are first projected into temporal feature vectors for efficient
We introduce EMERALD, a Transformer model-based re-
                                                                           processing by the world model. A temporal Transformer
inforcement learning algorithm using a spatial latent state
                                                                           network with masked self-attention then generates the tem-
with MaskGIT predictions to generate accurate trajectories
                                                                           poral hidden states ht by modeling long-range dependencies.
in latent space and improve the agent performance. EMER-
                                                                           These temporal states are subsequently projected back into
ALD can be separated into three main components: The
                                                                           spatial features for MaskGIT predictions. The trainable
Transformer world model that learns to simulate the envi-
                                                                           components of the world model are the following:
ronment in latent space. A critic network that learns to
estimate the sum of future rewards. And an actor network                       Encoder Network:            zt ∼ qϕ (zt | ot )
that learns to select actions that maximize future rewards
estimated by the critic network. Each component is trained                     Transformer Network:        ht = fϕ (z1:t−1 , a1:t−1 )
concurrently by sampling trajectories from a replay buffer                     MaskGIT Predictor:          ẑt ∼ pϕ (ẑt | ht , ztmask )
                                                                                                                                              (1)
of past experiences. This section describes the architecture                   Decoder Network:            ôt ∼ pϕ (ôt | ht , zt )
and optimization process of our proposed masked latent                         Reward Predictor:           r̂t ∼ pϕ (r̂t | ht , zt )
Transformer world model. Additionally, we provide a brief                      Continue Predictor:         ĉt ∼ pϕ (ĉt | ht , zt )
overview of the imagination process for actor-critic learning.
Figure 3 provides a visual overview of world model learn-                  The spatial latent states and temporal hidden states are com-
ing and imagination process during the actor-critic learning               bined to form the world model state st = [zt , ht ], which
phase.                                                                     integrates both spatial and temporal information. Latent
                                                                           state predictions are made using a spatial MaskGIT network,

                                                                       5


===== PDF PAGE 6 =====
                          Accurate and Efficient World Modeling with Masked Latent Transformers

while separate networks predict the environment reward r̂t                                       start
                                                                                         1.0                                            ( ) = cos(2 )
and episode continuation ĉt .                                                                                     1st step
                                                                                         0.8




                                                                     Mask schedule ( )
Encoder Network While previous approaches project
encoder features to a compressed vector latent space to                                  0.6
simplify world model predictions, our method leverages                                                                             2nd step
a spatial latent space to improve world model accuracy                                   0.4
and the agent performance. The spatial feature represen-
tations are first projected to categorical distribution logits                           0.2
l ∈ RH×W ×D , which are then reorganized into multiple fea-
                                                                                                                                                        3rd step
ture groups G for sampling. Instead of representing entire                               0.0
latent vector with a single embedding, the token represen-                                     0.0       0.2       0.4     0.6            0.8      1.0
tations combine embeddings from multiple feature groups.                                                         Decoding time
This grouping mechanism was originally used by Dream-
erV2 (Hafner et al., 2021) to improve training stability using        Figure 5: Cosine mask schedule. During training, we uni-
a flexible latent representation. We sample discrete stochas-         formly sample decoding times τ between 0 and 1. During
tic states zt ∈ RH×W ×G×(D/G) from the encoder, which                 imagination, the world model samples all masked tokens
serves as spatial latent states for our world model.                  and refines N = ⌊γHW G⌋ tokens with lower probability.
                                                                      We illustrate the schedule used for S = 3 decoding steps.
The use of a spatial latent space allows to effectively im-
prove the accuracy of the world model without significantly
increasing the amount of trainable parameters. The world               minimizing the KL divergence with the unmasked latent
model stochastic state capacity can also be increased by               state as follows:
using a larger number of groups and/or token dimensions.
                                                                         Lmask = KL sg(qϕ (zt | ot )) || pϕ (ẑt | ht , ztmask ) (2)
                                                                                                                               
However, this results in a significantly larger number of
parameters due to linear projections. In contrast, the spatial
                                                                      We use the stop gradient operator sg(·) to prevent the gradi-
latent space benefits from weight sharing, which provides a
                                                                      ents of targets from being backpropagated.
useful position bias for the world model.
                                                                       In order to stabilize learning, the predictor also uses a dy-
Temporal Masked Transformer Network EMERALD                            namics loss with regularization (Hafner et al., 2023). A
uses a Transformer State-Space Model (TSSM) (Chen et al.,              linear layer is optimized to predict the target latent states
2021) to learn long-range memory dependencies and pre-                 from upsampled hidden states. This allows to guide the
dict future observations more accurately. The Transformer              predictions of the MaskGIT predictor in early training. The
network uses masked self-attention with relative positional            regularization terms stabilize learning by training the en-
encodings (Dai et al., 2019), which simplifies the use of the          coder representations to become more predictable. Both
world model during imagination and evaluation. We also use             loss terms are scaled with loss weights βdyn = 0.5 and βreg
truncated backpropagation through time (TBTT) (Pašukonis              = 0.1, respectively:
et al., 2023) to preserve information over time. This requires                                                                             
the sampling of training trajectories sequentially in order                              Ldyn = βdyn KL sg(qϕ (zt | ot )) || pϕ (ẑt | ht )
                                                                                                                                                             (3)
to access past memory, passing cached attention keys and
                                                                                                                                           
                                                                                              + βreg KL qϕ (zt | ot ) || sg(pϕ (ẑt | ht ))
values from one batch to the next. The Transformer net-
work outputs hidden states ht ∈ RT ×D , carrying temporal
                                                                       Decoder Network The decoder network receives both
information.
                                                                       spatial latent states zt and temporal hidden states ht as
                                                                       inputs. This helps the encoder to learn more compressed
Spatial MaskGIT Predictor The MaskGIT predictor net-                   representations by conditioning on past context. The two
work uses a Transformer architecture with spatial attention            representations are projected and concatenated along the
to model relationships between spatial tokens. After spatial           channel dimension for decoding. The reconstruction loss
upsampling by the latent decoder network, the temporal hid-            Lrec learns hidden representations for the world model by
den states serve as conditioning inputs to accurately predict          reconstructing input visual observations ot as follows:
the next spatial tokens. To train the MaskGIT predictor, we
uniformly sample decoding times τ ∈ [0, 1) and use a cosine                                                    Lrec = ||ôt − ot ||22                        (4)
schedule to mask N = ⌊γHW G⌋ tokens from the latent
space: ztmask = zt ⊙ mt with mask m ∈ {0, 1}H×W ×G .                   Reward and Continuation Predictors Lrew and Lcon
The MaskGIT predictor learns to predict masked tokens by               train the world model to predict environment rewards and

                                                                 6


===== PDF PAGE 7 =====
                                      Accurate and Efficient World Modeling with Masked Latent Transformers

                                       EMERALD           Human Experts               Delta-IRIS           DreamerV3-XL
      Success Rate (%)   100                                                                                                             100




                                                                                                                      Success Rate (%)
                          10                                                                                                             75
                           1                                                                                                             50
                          0.1                                                                                                            25
                         0.01                                                                                                             0



                       fea el d
                     Co ct Sa Iron




                         Pla urna rd
                  De olle t Sto g


                                 om n

                       Ir t w
                ke Ir ick t
              Ma ke S ne P word


                    Pla ood kaxe



                         Pla e Sto nt

                                    Up
                      Co Diam oal
                               ct nd
                       lle ct k


                     fe ct ne




                              ce ne
                                a bie


               Ma Sto on S axe


                      W Pic rd




                             Wa Table
               Ma Woone S axe



                        Pla e P ce




                                                                                                                                               ore
              Ma Make on P Plan
                   Co olle Drin



                   De at Sk Woo
                      C ec lin


                             t Z eto

                   ke Ea t Co




                         ce Swo

                             c la
                  ke d wo
                           lle o
                        ct t C




                                                                                                                                           Sc
                                 ke
                 ke to ick
                          ll p
                    lle lec




                              F
                              E




                              c
                 Co Col


                         C




               Ma
Figure 6: Achievements success rates over 256 evaluation episodes after training 10M environment steps. EMERALD
succeeds to solve all achievements at least once. Our method also achieves new state-of-the-art performance, becoming the
first method to surpass human experts performance in terms of achievements score.


episode continuation flags, which are used to compute                        4. Experiments
the returns of imagined trajectories during the imagination
phase. We adopt the symlog cross-entropy loss from Dream-                    In this section, we describe our experiments on the Crafter
erV3 (Hafner et al., 2023), which scales and transforms                      benchmark. We show the results obtained by EMERALD
rewards into twohot encoded targets to ensure robust learn-                  in Table 2. We also perform an ablation study on the world
ing across games with different reward magnitudes:                           model architecture in section 4.3. Finally, we analyze the
                                                                             impact of the number of decoding steps on world model
                          Lrew = SymlogCrossEnt(r̂t , rt )        (5a)       predictions in section 4.4. Additional comparison on the
                          Lcon = BinaryCrossEnt(ĉt , ct )        (5b)       Atari 100k benchmark with other model-based methods can
                                                                             be found in the appendix A.7.
Complete Training Objective Given an input batch con-
taining B sequences of T image observations o1:T , actions                   4.1. Crafter Benchmark
a1:T , rewards r1:T , and episode continuation flags c1:T ,
the world model parameters (ϕ) are optimized to minimize                     The Crafter benchmark was proposed in Hafner (2022) to
the following loss function:                                                 evaluate a wide range of general abilities within a single en-
                                                                             vironment. Crafter is inspired by the video game Minecraft.
                           T
                    1 Xh                               i                     It features visual inputs, a discrete action space of 17 dif-
 L(ϕ) =                   Lmask +Ldyn +Lrew +Lcon +Lrec (6)                  ferent actions and non-deterministic environment dynamics.
                    T t=1
                                                                             The goal of the agent is to achieve as many achievements
3.2. World Model Imagination Process                                         as possible among a list of 22 achievements1 . The bench-
                                                                             mark evaluates the capacity of the agent to use long-term
The agent critic and actor networks are trained with imagi-                  memory and accurate visual perception to collect resources
nary trajectories generated from the world model. Learning                   and craft items while surviving in a hostile environment.
takes place entirely in latent space, which allows the agent                 The agents receive a single reward of +1 for each unlocked
to process large batch sizes and increase generalization. We                 achievement. It also perceives a reward of -0.1 for every
flatten the model states of the sampled sequences along the                  health point lost and a reward of +0.1 for every health point
batch and time dimensions to generate B img = B × T sam-                     that is regenerated. The benchmark compares the achieve-
ple trajectories using the world model. The self-attention                   ments score, which is computed as the geometric mean of
keys and values features computed during the world model                     success rates for all 22 achievements. This metric prioritizes
training phase are cached to be reused during the agent be-                  general agents that unlock a wide range of achievements
havior learning phase and preserve past context. As shown                    over those that unlock a small number of achievements very
in Figure 3b, the world model imagines H = 15 steps into                     frequently. The mean episode return can also be used to
the future using the Transformer network and the dynamics                                                    PN                           
                                                                                1                         1
network head, selecting actions by sampling from the actor                          Score (%) = exp       N    i=1 ln(1 + si )                 − 1, where si ∈
network categorical distribution. We detail the behavior                     [0; 100] are the N = 22 achievement success rates.
learning process in more detail in the appendix A.6.

                                                                         7


===== PDF PAGE 8 =====
                         Accurate and Efficient World Modeling with Masked Latent Transformers




Figure 7: Impact of the number of decoding steps on world model prediction accuracy and efficiency. The randomness of the
Crafter environment requires the world model to make refinements on the predicted tokens to avoid the sampling of tokens
with contradictory representations. White rectangle boundaries show hallucinations due to incoherent predictions made
during imagination. We use S = 3 decoding steps during imagination to achieve good prediction accuracy and efficiency.


directly compare the metric optimized during training.             at least once when evaluating on 256 episodes. The agent
                                                                   progressively learns to master all levels of the technology
Table 2: Crafter benchmark comparison (10M env frames).            tree, leading to the collection of diamonds.
We show achievement scores and environment mean returns
aggregated over 5 different seeds. Following Micheli et al.        4.3. Ablation Study
(2024), we also compute FPS as the total number of envi-
ronment frames collected divided by the training duration.         We study the impact of using spatial latent states and a
                                                                   Transformer-based world model on performance and train-
                                                                   ing efficiency. Table 3 shows the performance obtained by
Method               Score (%)    Return      #Params FPS
                                                                   each ablation, applying one modification at a time. We first
Human Experts           50.5     14.3 ± 2.3       -       -        experiment replacing the DreamerV3 vector latent space
DreamerV3 (M)           34.9     14.0 ± 0.4     37M      38        by a spatial latent space with MaskGIT predictions. We
DreamerV3 (XL)          39.6     15.4 ± 0.1    200M      23        find that the use of a spatial latent state significantly helps
∆-IRIS                  42.5     16.1 ± 0.1     25M      12        to reduce reconstruction error and increase performance.
EMERALD (Ours)          58.1     16.8 ± 0.6    30M       27        This improves world model accuracy by encoding important
                                                                   environment details for the agent in the latent space. We
                                                                   then compare the use of a Transformer-based world model
4.2. Results                                                       with masked self-attention with the recurrent-based world
                                                                   model of DreamerV3. We find that attention helps to further
Table 2 compares the performance of EMERALD with ∆-
                                                                   improve performance by conditioning representations on
IRIS and DreamerV3 on the Crafter benchmark after train-
                                                                   a longer context. The capacity of self-attention to model
ing 10M environment steps. We show achievements scores,
                                                                   temporal relationships without recurrence makes the Trans-
mean episode returns and total number of parameters. Anal-
                                                                   former architecture highly effective at capturing historical
ogously to Micheli et al. (2024), we also compare the num-
                                                                   context. The use of a Transformer-based architecture also
ber of collected Frames Per Second (FPS) using a single
                                                                   improves training efficiency by not requiring recurrent pro-
RTX 3090 GPU for training. EMERALD achieves a score
                                                                   cessing of hidden states during the world model forward.
of 58.1%, being the first algorithm to exceed human experts
performance on the benchmark. EMERALD’s enhanced
perception enables the agent to detect objects and enemies         4.4. Choice of the number of decoding steps
more effectively, leading to increased survival time and im-       While parallel predictions allow the world model to signifi-
proved performance. Our method also benefits from reduced          cantly reduce decoding time, this can also generate unclear
training time compared to ∆-IRIS and DreamerV3 XL. The             predictions with unmatching sets of tokens. The random-
MaskGIT prior reduces decoding time during imagination             ness of the Crafter environment requires the world model
while preserving the coherence of predicted tokens. Figure 6       to make refinements on the predicted tokens to avoid the
compares the success rates of individual achievements. We          sampling of tokens with contradictory representations. To
find that EMERALD successfully solves all achievements

                                                               8


===== PDF PAGE 9 =====
                           Accurate and Efficient World Modeling with Masked Latent Transformers

Table 3: Ablation study on world model architecture and latent space size (10M environment frames). We compare model
performance, training efficiency and reconstruction quality. The performance metrics are aggregated over 5 seeds.

 World Model Architecture        Latent Space Size     MaskGIT         Score (%)      Return      #Params     FPS     Pixel L2 loss
   DreamerV3 (M) RSSM                   32                No              34.9      14.0 ± 0.4      37M        38       0.000522
   DreamerV3 (S) RSSM               4 × 4 × 32            Yes             40.4      15.8 ± 0.1      28M        20       0.000231
                                        32                No              31.8      13.1 ± 0.5      30M        44       0.000890
     EMERALD TSSM
                                    4 × 4 × 32            Yes             58.1      16.8 ± 0.6      30M        27       0.000241


                                                                       duration, which impacts training efficiency. We performed
                                                                       a corresponding ablation to study the impact of the number
                                                                       of imagination decoding steps on final performance over 5
                                                                       seeds. Table 4 shows the impact on final performance when
                                                                       using different numbers of decoding steps for imagination.
                                                                       We find that the decrease of prediction accuracy has a notice-
                                                                       able impact on final performance. The decrease of average
                                                                       accuracy in world model predictions leads to the generation
                                                                       of less accurate trajectories for the actor and critic networks.
                                                                       Our experiments using 3 and 8 decoding steps achieves
                                                                       higher returns and achievement scores compared to using a
                                                                       single decoding step or a simple linear head for prediction.


                                                                       Table 4: Impact of the number of world model decoding
Figure 8: World model prediction accuracy. We show the to-             steps S on final performance and training efficiency.
ken prediction accuracy for world model rollout aggregated
over 5 seeds for several numbers of decoding steps.
                                                                          #Decoding Steps        Score (%)      Return       FPS
                                                                            No MaskGIT             51.6       16.1 ± 0.7      33
avoid incoherent predictions, we follow MaskGIT by using                     S = 1 step            53.8       16.1 ± 0.5      33
multiple decoding steps during the imagination phase. Fig-                   S = 3 steps           58.1       16.8 ± 0.6      27
ure 7 shows the impact of the number of decoding steps on                    S = 8 steps           55.1       16.5 ± 0.6      23
prediction quality. We find that using a single decoding step,
without revising the prediction, can generate blurry predic-
tions. These unmatching representations in latent space
cause the world model to make incoherent predictions for               5. Conclusion
successive time steps. Using a small number of decoding
                                                                       We propose EMERALD, a Transformer model-based rein-
steps helps to revise the prediction and limit this effect while
                                                                       forcement learning algorithm using a spatial latent state with
maintaining good prediction efficiency. Therefore, we set
                                                                       MaskGIT predictions to generate accurate trajectories in la-
S = 3 decoding steps in our experiments.
                                                                       tent space and improve the agent performance. EMERALD
Figure 8 shows the average accuracy of predictions for dif-            achieves new state-of-the-art performance on the Crafter
ferent numbers of decoding steps at imaginations time (No              benchmark with a budget of 10M environment steps, becom-
MaskGIT designates predictions made by the linear head                 ing the first method to exceed human experts performance.
learned by the dynamics loss Ldyn ). The accuracy is aver-             We study the impact of latent space size and find that the use
aged of the 5 EMERALD seeds and computed by comparing                  of a spatial latent state helps the world model to perceive en-
the target future states with predicted states during rollout,         vironment details that are crucial to the agent. Additionally,
conditioned on the correct sequence of future actions. We              we demonstrate that a Transformer-based architecture out-
find that using less than 3 decoding steps during imagination          performs a recurrent-based approach by leveraging attention
results in a drop of accuracy. We also compare the rollout             to model long-range dependencies more effectively. Based
time in seconds required to imaginate 15 time steps in the             on these findings, we hope this work will inspire researchers
future. Using a larger number of decoding steps can lead to            to further explore the impact of masked latent world models
a small increase in accuracy but also results in longer rollout        in more complex environments, such as Minecraft.

                                                                   9


===== PDF PAGE 10 =====
                          Accurate and Efficient World Modeling with Masked Latent Transformers

Acknowledgments                                                        Esser, P., Rombach, R., and Ommer, B. Taming transformers
                                                                         for high-resolution image synthesis. In Proceedings of the
This work was partly supported by The Alexander von Hum-                 IEEE/CVF Conference on Computer Vision and Pattern
boldt Foundation (AvH).                                                  Recognition, pp. 12873–12883, 2021.

Impact Statement                                                       Guss, W. H., Codel, C., Hofmann, K., Houghton, B., Kuno,
                                                                         N., Milani, S., Mohanty, S., Liebana, D. P., Salakhutdi-
The development of autonomous agents for real-world ap-                  nov, R., Topin, N., et al. The minerl 2019 competition
plications introduces various safety and environmental con-              on sample efficient reinforcement learning using human
cerns. In real-world scenarios, an agent might cause harm                priors. arXiv preprint arXiv:1904.10079, 2019.
to individuals and damage to its surroundings during both
training and deployment. Although using world models dur-              Ha, D. and Schmidhuber, J. Recurrent world models facil-
ing training can mitigate these risks by allowing policies to            itate policy evolution. Advances in Neural Information
be learned through simulation, some risks may still persist.             Processing Systems, 31, 2018.
This statement aims to inform users of these potential risks           Hafner, D. Benchmarking the spectrum of agent capabilities.
and emphasize the importance of AI safety in the application             In International Conference on Learning Representations,
of autonomous agents to real-world scenarios.                            2022.
                                                                       Hafner, D., Lillicrap, T., Fischer, I., Villegas, R., Ha, D.,
References                                                               Lee, H., and Davidson, J. Learning latent dynamics for
Alonso, E., Jelley, A., Micheli, V., Kanervisto, A., Storkey,            planning from pixels. In International Conference on
  A. J., Pearce, T., and Fleuret, F. Diffusion for world mod-           Machine Learning, pp. 2555–2565. PMLR, 2019.
  eling: Visual details matter in atari. Advances in Neural
                                                                       Hafner, D., Lillicrap, T., Ba, J., and Norouzi, M. Dream
  Information Processing Systems, 37:58757–58791, 2024.
                                                                         to control: Learning behaviors by latent imagination. In
Ba, J. L., Kiros, J. R., and Hinton, G. E. Layer normalization.          International Conference on Learning Representations,
  arXiv preprint arXiv:1607.06450, 2016.                                 2020.
Bellemare, M. G., Naddaf, Y., Veness, J., and Bowling, M.              Hafner, D., Lillicrap, T., Norouzi, M., and Ba, J. Master-
  The arcade learning environment: An evaluation plat-                   ing atari with discrete world models. In International
  form for general agents. Journal of artificial intelligence            Conference on Learning Representations, 2021.
  research, 47:253–279, 2013.
                                                                       Hafner, D., Pasukonis, J., Ba, J., and Lillicrap, T. Mastering
Bengio, Y., Léonard, N., and Courville, A. Estimating or                diverse domains through world models. arXiv preprint
  propagating gradients through stochastic neurons for con-              arXiv:2301.04104, 2023.
  ditional computation. arXiv preprint arXiv:1308.3432,
  2013.                                                                Kaiser, L., Babaeizadeh, M., Milos, P., Osinski, B., Camp-
                                                                         bell, R. H., Czechowski, K., Erhan, D., Finn, C., Koza-
Chang, H., Zhang, H., Jiang, L., Liu, C., and Freeman,                   kowski, P., Levine, S., et al. Model-based reinforcement
  W. T. Maskgit: Masked generative image transformer. In                 learning for atari. In International Conference on Learn-
  Proceedings of the IEEE/CVF Conference on Computer                     ing Representations, 2020.
  Vision and Pattern Recognition, pp. 11315–11325, 2022.
                                                                       Karras, T., Aittala, M., Aila, T., and Laine, S. Elucidating
Chen, C., Yoon, J., Wu, Y.-F., and Ahn, S. Transdreamer:                 the design space of diffusion-based generative models.
  Reinforcement learning with transformer world models.                 Advances in Neural Information Processing Systems, 35:
  In Deep RL Workshop NeurIPS 2021, 2021.                                26565–26577, 2022.
Cho, K., van Merrienboer, B., Gulcehre, C., Bougares, F.,              Kingma, D. P. and Welling, M. Auto-encoding variational
  Schwenk, H., and Bengio, Y. Learning phrase represen-                  bayes. In International Conference on Learning Repre-
  tations using rnn encoder-decoder for statistical machine              sentations, 2014.
  translation. In Conference on Empirical Methods in Nat-
  ural Language Processing (EMNLP 2014), 2014.                         LeCun, Y., Bengio, Y., and Hinton, G. Deep learning. nature,
                                                                         521(7553):436–444, 2015.
Dai, Z., Yang, Z., Yang, Y., Carbonell, J. G., Le, Q., and
  Salakhutdinov, R. Transformer-xl: Attentive language                 Lee, D., Kim, C., Kim, S., Cho, M., and HAN, W. S. Draft-
  models beyond a fixed-length context. In Proceedings of                and-revise: Effective image generation with contextual rq-
  the 57th Annual Meeting of the Association for Computa-                transformer. Advances in Neural Information Processing
  tional Linguistics, pp. 2978–2988, 2019.                               Systems, 35:30127–30138, 2022.

                                                                  10


===== PDF PAGE 11 =====
                          Accurate and Efficient World Modeling with Masked Latent Transformers

Meo, C., Lica, M., Ikram, Z., Nakano, A., Shah, V., Di-               Van Den Oord, A., Vinyals, O., et al. Neural discrete rep-
 dolkar, A. R., Liu, D., Goyal, A., and Dauwels, J. Masked              resentation learning. Advances in Neural Information
 generative priors improve world models sequence mod-                   Processing Systems, 30, 2017.
 elling capabilities. arXiv preprint arXiv:2410.07836,
 2024.                                                                Wang, S., Liu, S., Ye, W., You, J., and Gao, Y. Efficientzero
                                                                       v2: Mastering discrete and continuous control with lim-
Micheli, V., Alonso, E., and Fleuret, F. Transformers are              ited data. In International Conference on Machine Learn-
 sample-efficient world models. In International Confer-               ing, pp. 51041–51062. PMLR, 2024.
 ence on Learning Representations, 2023.
                                                                      Williams, R. J. Simple statistical gradient-following algo-
Micheli, V., Alonso, E., and Fleuret, F. Efficient world mod-          rithms for connectionist reinforcement learning. Machine
 els with context-aware tokenization. In International Con-            learning, 8:229–256, 1992.
 ference on Machine Learning, pp. 35623–35638. PMLR,
 2024.                                                                Yan, W., Hafner, D., James, S., and Abbeel, P. Temporally
                                                                        consistent transformers for video generation. In Inter-
Pašukonis, J., Lillicrap, T. P., and Hafner, D. Evaluating             national Conference on Machine Learning, pp. 39062–
  long-term memory in 3d mazes. In International Confer-                39098. PMLR, 2023.
  ence on Learning Representations, 2023.
                                                                      Zhang, W., Wang, G., Sun, J., Yuan, Y., and Huang, G.
Ramesh, A., Pavlov, M., Goh, G., Gray, S., Voss, C., Rad-               Storm: Efficient stochastic transformer based world mod-
  ford, A., Chen, M., and Sutskever, I. Zero-shot text-                 els for reinforcement learning. Advances in Neural Infor-
  to-image generation. In International Conference on                   mation Processing Systems, 36, 2024.
  Machine Learning, pp. 8821–8831. PMLR, 2021.

Robine, J., Höftmann, M., Uelwer, T., and Harmeling, S.
  Transformer-based world models are happy with 100k
  interactions. In International Conference on Learning
  Representations, 2023.

Schrittwieser, J., Antonoglou, I., Hubert, T., Simonyan, K.,
  Sifre, L., Schmitt, S., Guez, A., Lockhart, E., Hassabis,
  D., Graepel, T., et al. Mastering atari, go, chess and shogi
  by planning with a learned model. Nature, 588(7839):
  604–609, 2020.

Schulman, J., Wolski, F., Dhariwal, P., Radford, A., and
  Klimov, O. Proximal policy optimization algorithms.
  arXiv preprint arXiv:1707.06347, 2017.

Schwarzer, M., Ceron, J. S. O., Courville, A., Bellemare,
  M. G., Agarwal, R., and Castro, P. S. Bigger, better,
  faster: Human-level atari with human-level efficiency.
  In International Conference on Machine Learning, pp.
  30365–30380. PMLR, 2023.

Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and
  Ganguli, S. Deep unsupervised learning using nonequi-
  librium thermodynamics. In International Conference on
  Machine Learning, pp. 2256–2265. PMLR, 2015.

Sutton, R. S. Dyna, an integrated architecture for learning,
  planning, and reacting. ACM Sigart Bulletin, 2(4):160–
  163, 1991.

Tassa, Y., Doron, Y., Muldal, A., Erez, T., Li, Y., Casas, D.
  d. L., Budden, D., Abdolmaleki, A., Merel, J., Lefrancq,
  A., et al. Deepmind control suite. arXiv preprint
  arXiv:1801.00690, 2018.

                                                                 11


===== PDF PAGE 12 =====
                         Accurate and Efficient World Modeling with Masked Latent Transformers

A. Appendix
A.1. Latent Space Comparison




                                             (a) DreamerV3’s Vector Latent Space




                                             (b) EMERALD’s Spatial Latent Space

Figure 9: Comparison between the standard DreamerV3 vector latent space and EMERALD spatial latent space. We
illustrate the size of each grouped latent space in tokens, where each token is of dimension D/G. The compressed nature of
the DreamerV3 vector latent space zt ∈ RG×(D/G) can result in the loss of crucial information, negatively impacting the
agent’s performance. In contrast, the use of a spatial latent state zt ∈ RH×W ×G×(D/G) improves world model accuracy and
provides further information to the agent.




                            MLP                                               Spatial MaskGIT        Masking




                           Latent                                             Latent
                            Dec                                                Dec




                   (a) MLP Head Prediction                                             (b) MaskGIT Decoding

Figure 10: Comparison between standard MLP head and MaskGIT for decoding. The MLP head is very efficient and samples
predictions without refinements, which can lead to ambiguous predictions with tokens having unmatching representations.
MaskGIT limits this effect by progressively sampling and refining the prediction to avoid incoherent representations.




                                                             12


===== PDF PAGE 13 =====
                        Accurate and Efficient World Modeling with Masked Latent Transformers

A.2. Success Rates Comparison

               Table 5: Success rates of each method on the Crafter benchmark (10M environment steps).

       Achievement            Human Experts     DreamerV3 (M)      DreamerV3 (XL)     ∆-IRIS    EMERALD
       Collect Coal                86.0%             77.3%              86.8%          90.6%       91.6%
       Collect Diamond             12.0%              0.0%               0.0%           0.0%        0.5%
       Collect Drink               92.0%             93.0%              96.2%          98.4%       95.8%
       Collect Iron                53.0%             12.1%              32.6%          76.6%       71.2%
       Collect Sapling             67.0%             86.3%              97.0%          96.9%       99.9%
       Collect Stone              100.0%             95.4%              98.2%          98.4%       97.9%
       Collect Wood               100.0%             99.9%              99.9%         100.0%       99.8%
       Defeat Skeleton             31.0%             50.5%              74.3%          81.3%       82.3%
       Defeat Zombie               84.0%             87.6%              92.4%          96.9%       92.3%
       Eat Cow                     89.0%             84.1%              94.9%          98.4%       90.5%
       Eat Plant                    8.0%              0.4%               0.8%           0.0%        0.1%
       Make Iron Pickaxe           26.0%              0.0%               0.0%           0.0%       41.5%
       Make Iron Sword             22.0%              0.0%               0.0%           1.6%       41.6%
       Make Stone Pickaxe          78.0%             72.0%              84.2%          95.3%       93.7%
       Make Stone Sword            78.0%             80.3%              91.0%          95.3%       83.5%
       Make Wood Pickaxe          100.0%             96.5%              98.6%          98.4%       99.2%
       Make Wood Sword             45.0%             90.0%              96.9%         98.4%        98.8%
       Place Furnace               32.0%             90.0%              96.0%          95.3%       96.2%
       Place Plant                 24.0%             86.3%              97.0%          96.9%       99.9%
       Place Stone                 90.0%             94.8%              98.2%          98.4%       97.4%
       Place Table                100.0%             99.3%              99.9%          98.4%       99.4%
       Wake Up                     73.0%             92.2%              98.0%         89.1%        92.2%
       Score                       50.5%             34.9%              39.6%          42.5%       58.1%




                                                         13


===== PDF PAGE 14 =====
                              Accurate and Efficient World Modeling with Masked Latent Transformers

A.3. Crafter Achievement Curves

                   Reward               1500
                                                          Length                                Collect Coal                      Collect Diamond
      20                                                                                                               2
                                                                                   20
                                        1000
      10                                                                                                               1
                                        500                                        10
       0                                  0                                        0                                   0
           0.0        0.5         1.0          0.0          0.5         1.0             0.0         0.5         1.0         0.0         0.5         1.0
                                 1e7                                   1e7                                     1e7                                 1e7
                 Collect Drink                          Collect Iron                          Collect Sampling                     Collect Stone
                                         15
     300                                                                                                              100
                                                                                   20
     200                                 10
                                                                                   10                                 50
     100                                  5
       0                                  0                                        0                                   0
           0.0        0.5         1.0          0.0          0.5         1.0             0.0         0.5         1.0         0.0         0.5         1.0
                                 1e7                                   1e7                                     1e7                                 1e7
                 Collect Wood                        Defeat Skeleton                          Defeat Zombie                          Eat Cow
                                         15
      40                                                                           10                                 10
                                         10
      20                                                                           5                                   5
                                          5
       0                                  0                                        0                                   0
           0.0        0.5         1.0          0.0          0.5         1.0             0.0         0.5         1.0         0.0         0.5         1.0
                                 1e7                                   1e7                                     1e7                                 1e7
                  Eat Plant                          Make Iron Pickaxe                        Make Iron Sword                Make Stone Pickaxe
       2                                  6
                                                                                   4
                                          4
       1                                                                                                              10
                                          2                                        2

       0                                  0                                        0                                   0
           0.0        0.5         1.0          0.0          0.5         1.0             0.0         0.5         1.0         0.0         0.5         1.0
                                 1e7                                   1e7                                     1e7                                 1e7
             Make Stone Sword                    Make Wood Pickaxe                        Make Wood Sword                          Place furnace
                                         10                                                                           20
      10                                                                           10
       5                                  5                                        5                                  10

       0                                  0                                        0                                   0
           0.0        0.5         1.0          0.0          0.5         1.0             0.0         0.5         1.0         0.0         0.5         1.0
                                 1e7                                   1e7                                     1e7                                 1e7
                 Place Plant                           Place Stone                              Place Table                          Wake Up
      10
                                         75                                        10                                 15

       5                                 50                                                                           10
                                                                                   5
                                         25                                                                            5
       0                                  0                                        0                                   0
           0.0        0.5         1.0          0.0          0.5         1.0             0.0         0.5         1.0         0.0         0.5         1.0
                                 1e7                                   1e7                                     1e7                                 1e7

                            Figure 11: Achievement counts of EMERALD with shaded min and max.




                                                                              14


===== PDF PAGE 15 =====
                        Accurate and Efficient World Modeling with Masked Latent Transformers

A.4. Model Architecture

Table 6: Architecture of the encoder and decoder networks. The size of submodules is omitted and can be derived from
output shapes. We use layer normalization (LN) and a SiLU activation layer inside residual blocks.

                                                                    Decoder submodules                Output shape
                                                                    Input latent state (zt )         4 × 4 × 32 × 32
     Encoder submodules                   Output shape
                                                                    Reshape (label as xz )            4 × 4 × 1024
     Input image (ot )                    64 × 64 × 3
                                                                    Input hidden state (ht )              512
     Conv strided                        32 × 32 × 32
                                                                    Linear + Reshape                  4 × 4 × 128
     Residual block                      32 × 32 × 32
                                                                    Conv (label as xh )               4 × 4 × 256
     Conv strided                        16 × 16 × 64
     Residual block                      16 × 16 × 64               Concat xz and xh                  4 × 4 × 1280
     Conv strided                         8 × 8 × 128               Conv                               4 × 4 × 256
     Residual block                       8 × 8 × 128               Residual block                     4 × 4 × 256
     Conv strided                         4 × 4 × 256               Conv transposed                    8 × 8 × 128
     Residual block                       4 × 4 × 256               Residual block                     8 × 8 × 128
     Conv                                4 × 4 × 1024               Conv transposed                   16 × 16 × 64
     Reshape + Softmax                  4 × 4 × 32 × 32             Residual block                    16 × 16 × 64
     Sample + One Hot (outputs zt )     4 × 4 × 32 × 32             Conv transposed                   32 × 32 × 32
                                                                    Residual block                    32 × 32 × 32
                                                                    Conv transposed (outputs ôt )     64 × 64 × 3


Table 7: Transformer network. The latent states z0:T −1 and one-hot encoded actions a0:T −1 ∈ RT ×A are combined using
an action mixer network (Zhang et al., 2024). The features are processed by the Transformer network to compute temporal
hidden states h1:T .

                                  Submodule                 Module alias         Output shape
                         Inputs latent states (z0:T −1 )                    T × 4 × 4 × 32 × 32
                              Reshape + Conv               Latent Encoder     T × 4 × 4 × 128
                               Flatten + Linear                                   T × 512
                           Concat actions (a0:T −1 )                           T × (512 + A)
                            Linear + LN + SiLU             Action Mixer           T × 512
                                Linear + LN                                       T × 512
                         Transformer block × K              Transformer
                                                                                   T × 512
                        Outputs hidden states (h1:T )        Network




                                                             15


===== PDF PAGE 16 =====
                         Accurate and Efficient World Modeling with Masked Latent Transformers

Table 8: MaskGIT predictor. The latent states zt are masked and concatenated with spatial hidden states. The features are
processed by the Transformer network to predict masked tokens ẑt .

                                   Submodule                     Module alias       Output shape
                             Inputs hidden states (ht )                                 512
                                Linear + Reshape             Latent Decoder         4 × 4 × 128
                                       Conv                                         4 × 4 × 256
                        Concat masked latent states (zt )                          4 × 4 × 1536
                               Flatten + Linear             Latent Embedding         16 × 256
                            Add pos embeddings                                       16 × 256
                          Transformer block × Kmask                                   16 × 256
                                    Linear                        MaskGIT            16 × 1024
                              Reshape + Softmax                   Predictor       4 × 4 × 32 × 32
                         Sample + One Hot (outputs ẑt )                          4 × 4 × 32 × 32


Table 9: World model predictors and actor-critic networks architecture. Each network first projects spatial latent states zt
into feature vectors for concatenation with hidden states ht . Each Linear layer is followed by a layer normalization and
SiLU activation except for the last layer which outputs distribution logits.

      Predictor submodules           Output shape
      Inputs latent states (zt )   4 × 4 × 32 × 32          Network               Output dim      Output Distribution
      Reshape + Conv                 4 × 4 × 128
                                                            Reward predictor          255          Symlog Discrete
      Flatten + Linear                   512
                                                            Continue predictor         1              Bernoulli
      Concat hidden states (ht )        1024
                                                            Critic network            255          Symlog Discrete
      Linear + LN + SiLU                 512
                                                            Actor network              A          One hot Categorical
      Linear + LN + SiLU                 512
      Linear prediction layer        Output dim




                                                            16


===== PDF PAGE 17 =====
                    Accurate and Efficient World Modeling with Masked Latent Transformers

A.5. Model Hyperparameters

                                    Table 10: EMERALD hyper-parameters.

                             Hyperparameter                             Value

                             General
                             Image resolution                          64 × 64
                             Batch size (B)                               16
                             Sequence length (T)                          64
                             Optimizer                                  Adam
                             Environment parallel instances               16
                             Collected frames per training Step           16
                             Replay buffer capacity                      1M

                             World model
                             Latent space size (H × W × G)            4 × 4 × 32
                             Number categories per group                  32
                             Temporal Transformer blocks                  4
                             Temporal Transformer width                  512
                             Spatial MaskGIT blocks                       2
                             Spatial MaskGIT width                       256
                             Number of attention heads                    8
                             Dropout probability                          0.1
                             Attention context length                     64
                             Learning rate                               10−4
                             Gradient clipping                           1000

                             Actor-critic
                             Imagination horizon (H)                      15
                             Number of decoding steps (S)                 3
                             Return discount                            0.997
                             Return lambda                               0.95
                             Critic EMA Decay                            0.98
                             Return normalization Momentum               0.99
                             Actor entropy Scale                       3 · 10−4
                             Learning rate                             3 · 10−5
                             Gradient clipping                           100




                                                         17


===== PDF PAGE 18 =====
                         Accurate and Efficient World Modeling with Masked Latent Transformers

A.6. Actor Critic Learning
Analogously to world model predictor networks, the actor and critic networks are designed as simple MLPs with a projection
layer for the spatial latent states. The two network have parameter vectors (θ) and (ψ), respectively.

                                            Actor Network:                  at ∼ πθ (at |st )
                                                                                                                         (7)
                                            Critic Network:                 vt ∼ Vψ (vt |st )

Critic Learning Following DreamerV3, the critic network learns to minimize the symlog cross-entropy loss with
discretized λ-returns obtained from imagined trajectories with rewards and episode continuation flags predicted by the world
model:                                                                  
                                                                     λ
                        Rtλ = r̂t+1 + γĉt+1 (1 − λ)Vψ (st+1 ) + λRt+1           λ
                                                                                RH+1  = Vψ (sH+1 )                       (8)

The critic does not use a target network but relies on its own predictions for estimating rewards beyond the prediction
horizon. This requires stabilizing the critic by adding a regularizing term toward the outputs of its own EMA network Vψ′ .
Equation 9 defines the critic network loss:
                                     H
                                  1 Xh                                                          i
                                        SymlogCrossEnt vt , Rtλ + SymlogCrossEnt vt , Vψ′ (st )
                                                               
                  Lcritic (ψ) =                                                                                          (9)
                                  H t=1
                                              discrete returns regression                   critic EMA regularizer


Actor Learning The actor network learns to select actions that maximize the predicted returns using Reinforce (Williams,
1992) while maximizing the policy entropy to ensure sufficient exploration during both data collection and imagination. The
actor network loss is defined as follows:
                                             H
                                          1 Xh                                                 i
                           Lactor (θ) =         − sg(Aλt ) log πθ (at | st ) − ηH πθ (at | st )                        (10)
                                          H t=1
                                                                 reinforce                entropy regularizer

                           
Where Aλt = R̂tλ − Vψ (st ) / max(1, S) defines advantages computed using normalized returns. The returns are scaled
using exponentially moving average statistics of their 5th and 95th batch percentiles to ensure stable learning across all
Atari games:
                             S = EMA(Per(Rtλ , 95) − Per(Rtλ , 5), momentum = 0.99)                                  (11)




                                                                   18


===== PDF PAGE 19 =====
                           Accurate and Efficient World Modeling with Masked Latent Transformers

A.7. Atari 100k Benchmark
The commonly used Atari 100k benchmark was proposed in Kaiser et al. (2020) to evaluate reinforcement learning agents
on Atari games in low data regime. The benchmark includes 26 Atari games with a budget of 400k environment frames,
amounting to 100k interactions between the agent and the environment using the default action repeat setting. This amount
of environment steps corresponds to about two hours (1.85 hours) of real-time play, representing a similar amount of time
that a human player would need to achieve reasonably good performance.
We evaluate our method on the benchmark to assess EMERALD’s performance on environments that do not necessarily
require the use of spatial latents to achieve near perfect reconstruction. We also demonstrate improved training efficiency
compared to ∆-IRIS and DIAMOND. Following preceding works, we use human-normalized metrics and compare the
mean and median returns across all 26 games. The human-normalized scores are computed for each game using the scores
                                                                                              agent score−random score
achieved by a human player and the scores obtained by a random policy: normed score = human          score−random score .

The current state-of-the-art is held by EfficientZero V2 (Wang et al., 2024), which uses Monte-Carlo Tree Search to select
the best action at every time step. Another recent notable work is BBF (Schwarzer et al., 2023), a model-free agent using
learning techniques that are orthogonal to our work such as periodic network resets and hyper-parameters annealing to
improve performance. In this work, to ensure fair comparison, we compare our method with model-based approaches that
do not utilize look-ahead search techniques.
We compare EMERALD with Diamond (Alonso et al., 2024), ∆-IRIS (Micheli et al., 2024) and DreamerV3 (Hafner
et al., 2023) as well as other model-based approaches like STORM (Zhang et al., 2024), IRIS (Micheli et al., 2023) and
SimPLe (Kaiser et al., 2020). We find that EMERALD achieves comparable aggregated performance as ∆-IRIS and
Diamond while offering higher training efficiency. When using a RTX 3090 GPU for training, EMERALD requires only 17
hours to reach 400k environment steps on the Breakout game while ∆-IRIS and DIAMOND need 27 hours and 75 hours,
respectively.

Table 11: Agent scores and human-normalized metrics on the 26 games of the Atari 100k benchmark. We show average
scores over 5 seeds. Bold numbers indicate best performing method for each game.

       Game                Random   Human   SimPLe   TWM      IRIS   DreamerV3   STORM    ∆-IRIS   DIAMOND    EMERALD
       Alien                  228    7128      617     675     420         959      984      391        744        651
       Amidar                   6    1720       74     122     143         139      205       64        226        129
       Assault                222     742      527     683    1524         706      801     1123       1526        798
       Asterix                210    8503     1128    1116     854         932     1028     2492       3698       1045
       Bank Heist              14     753       34     467      53         649      641     1148         20        927
       Battle Zone           2360   37188     4031    5068   13074       12250    13540    11825       4702      15800
       Boxing                   0      12        8      78      70          78       80       70         87         71
       Breakout                 2      30       16      20      84          31       16      302        133         62
       Chopper Command        811    7388      979    1697    1565         420     1888     1183       1370        990
       Crazy Climber        10780   35829    62584   71820   59324       97190    66776    57854      99168      75380
       Demon Attack           152    1971      208     350    2034         303      165      533        288        498
       Freeway                  0      30       17      24      31           0       34       31         33         31
       Frostbite               65    4335      237    1476     259         909     1316      279        274        221
       Gopher                 258    2412      597    1675    2236        3730     8240     6445       5898      14702
       Hero                  1027   30826     2657    7254    7037       11161    11044     7049       5622       7655
       James Bond              29     303      100     362     463         445      509      309        427        195
       Kangaroo                52    3035       51    1240     838        4098     4208     2269       5382       8780
       Krull                 1598    2666     2205    6349    6616        7782     8413     5978       8610       7600
       Kung Fu Master         258   22736    14862   24555   21760       21420    26182    21534      18714      22822
       Ms Pacman              307    6952     1480    1588     999        1327     2673     1067       1958       1710
       Pong                   –21      15       13      19      15          18       11       20         20         20
       Private Eye             25   69571       35      87     100         882     7781      103        114        100
       Qbert                  164   13455     1289    3331     746        3405     4522     1444       4499       1245
       Road Runner             12    7845     5641    9107    9615       15565    17564    10414      20673       6620
       Seaquest                68   42055      683     774     661         618      525      827        551        468
       Up N Down              533   11693     3350   15982    3546        7600     7985     4072       3856       5227
       # Superhuman             0     N/A        1      8      10            9      10        11         11         11
       Normed Mean (%)          0     100       33     96     105          112     127       139        146        134
       Normed Median (%)        0     100       13     51      29           49      58        53         37         51




                                                              19
