World Models, Joint-Embedding Predictive Architectures (JEPA), and Spatiotemporal Video Simulators in 2026: Ha & Schmidhuber V-M-C, DreamerV2/V3 RSSM, I-JEPA, V-JEPA, Genie 11B, and CogVideoX 3D Causal Diffusion

How do artificial intelligence systems progress from reactive token predictors and high-variance pixel-level reinforcement learners into internal world simulators capable of training policies entirely inside hallucinated latent dreams (Ha & Schmidhuber World Models), imagining 468 billion (468B) compact categorical states on a single GPU to master 55 Atari games (DreamerV2) and collect diamonds in Minecraft from scratch across 150+ tasks with a single fixed hyperparameter configuration (DreamerV3), predicting high-level semantic representations in abstract embedding space over $10\times$ more compute-efficiently than pixel-reconstructing Masked Autoencoders (I-JEPA), learning frozen spatiotemporal video backbones across 2 million videos via $\ell_1$ conditional median regression and ~90% multi-block tube masking (V-JEPA), extracting 8-button discrete latent action controllers unsupervised from 30,000 hours of unlabelled Internet video at 10.7B parameters (Genie), and generating 10-second continuous $768 \times 1360$ video worlds at 16 FPS via $8 \times 8 \times 4$ temporally causal 3D VAEs and Vision/Text Expert Adaptive LayerNorm (CogVideoX-5B)?

Every physical organism or autonomous agent that interacts with a dynamic 3D environment faces a fundamental computational bottleneck: raw sensory streams—such as high-definition video frames arriving at 16 to 60 frames per second—contain millions of correlated pixel values dominated by unpredictable, task-irrelevant surface textures (rustling leaves, water ripples, brick wall patterns, or sensor noise). Attempting to plan control trajectories or learn self-supervised world knowledge directly in raw pixel space hits three foundational mathematical and systems barriers:

  1. The Credit-Assignment Bottleneck and Model Exploitation in Learned Dynamics (arXiv:1803.10122v4): Model-free reinforcement learning (RL) algorithms struggle to optimize millions of neural network weights when scalar reward signals arrive only at the end of thousand-step episodes, typically restricting model-free controllers to $10^3$ to $10^6$ parameters (https://worldmodels.github.io/). Conversely, when an agent trains inside a deterministic learned dynamics model $f_\theta(z_t, a_t) \to \hat{z}_{t+1}$, the controller gains direct access to the internal hidden states of the simulator and rapidly discovers adversarial policies that exploit out-of-distribution flaws in the dynamics model—such as moving in specific patterns that extinguish enemy fireballs in VizDoom at low sampling temperatures ($\tau = 0.10$), achieving a near-perfect $2086 \pm 140$ virtual dream score that collapses to $193 \pm 58$ in the real environment (worse than a $210 \pm 108$ random policy; https://worldmodels.github.io/).
  2. Unimodal Gaussian Posterior Mismatch and Pixel-Space Imagination Overhead (arXiv:2010.02193v4): Early latent dynamics models (PlaNet, DreamerV1) parameterized stochastic environment states using diagonal Gaussian distributions $\mathcal{N}(\mu_\phi, \sigma_\phi^2 I)$. However, a unimodal Gaussian transition prior $p_\phi(\hat{z}t \mid h_t)$ mathematically cannot fit a multimodal mixture of Gaussian posteriors $\frac{1}{N}\sum_i q\phi(z_t \mid h_t, x_t^{(i)})$ across discrete state transitions (such as entering a new room, collecting an item, or discontinuous object collisions), while symmetric KL divergence regularizes the posterior toward an under-trained prior. Furthermore, reconstructing $64 \times 64$ or $224 \times 224$ pixel frames during policy rollouts wastes GPU memory bandwidth and restricts parallel trajectory lookahead (https://arxiv.org/html/2010.02193v4).
  3. Pixel-Level Entropy Capacity Waste vs. Representation Collapse (arXiv:2301.08243v3, arXiv:2404.08471v1): Generative masked autoencoders (MAE, VideoMAE, OmniMAE) force the decoder to predict every high-frequency pixel value of masked patches, squandering modeling capacity on stochastic local texture details while yielding low-semantic linear-probe representations unless fine-tuned end-to-end across hundreds of millions of samples. Conversely, invariance-based Joint-Embedding Architectures (SimCLR, DINO, iBOT) rely on hand-crafted view augmentations (random cropping, color jittering) that destroy geometric depth and object-count features (Clevr/Dist depth accuracy drops to 53.4% for DINO vs. 72.4%–75.0% for I-JEPA) and fail to transfer directly to temporally coherent video streams (https://arxiv.org/html/2301.08243v3).

Between 2018 and 2026, six landmark architectures systematically established the mathematical foundations of Latent World Models, Joint-Embedding Predictive Architectures (JEPA), and Spatiotemporal Video World Simulators:

  1. Recurrent V-M-C World Models & Temperature-Regulated Dream Training (World Models, Ha & Schmidhuber, arXiv:1803.10122v4): Decoupling visual perception and temporal dynamics from motor control by pairing a 4.35M–4.45M-parameter Convolutional VAE (V) ($64 \times 64 \times 3 \to z_t \in \mathbb{R}^{32}$ or $\mathbb{R}^{64}$) and a 422K–1.68M-parameter Mixture Density Network LSTM (MDN-RNN, M) modeling $P(z_{t+1}, d_{t+1} \mid a_t, z_t, h_t)$ with a minimalist 867-to-1,088-parameter linear Controller (C) $a_t = W_c[z_t \; h_t] + b_c$ evolved via CMA-ES. This architecture became the first known method to solve CarRacing-v0 ($906 \pm 21$ over 100 trials vs. $838 \pm 11$ leaderboard best and $343 \pm 18$ DQN) and demonstrated that training entirely inside a temperature-inflated latent dream ($\tau = 1.15$) prevents adversarial model cheating and transfers directly to real VizDoom: Take Cover at $1092 \pm 556$ survival steps (solving the 750-step threshold; https://worldmodels.github.io/).
  2. Recurrent State-Space Models (RSSM), $32 \times 32$ Discrete Categorical Latents, KL Balancing & Generalist World Models (DreamerV2 & DreamerV3, Hafner et al., arXiv:2010.02193v4, arXiv:2301.04104v2): Replacing Gaussian latents with 32 categorical variables of 32 classes each (a 1,024-bit sparse binary vector with 32 active bits, optimized via Straight-Through Gradients) and introducing asymmetric KL Balancing ($\alpha = 0.8$) so the transition prior $p_\phi(\hat{z}_t \mid h_t)$ learns $4\times$ faster than posterior regularization. Simulating 2,500 parallel latent trajectories ($H = 15$, $\lambda = 0.95$) without decoding pixels, DreamerV2 processes 468 billion (468B) imagined states across 200M Atari steps ($10,000\times$ more than the 50M real environment frames) on a single V100 GPU to achieve 2.15 Gamer Median (2.64 with schedules) and 0.28 Clipped Record Mean across 55 Atari games (beating IQN 1.29/0.21 and Rainbow 1.47/0.17; https://arxiv.org/html/2010.02193v4), while DreamerV3 masters 150+ tasks with a single fixed hyperparameter configuration and collects diamonds in Minecraft from scratch at 30M steps (17 days of playtime) (https://danijar.com/project/dreamerv3/).
  3. Image-Based Joint-Embedding Predictive Architectures (I-JEPA, Assran et al. & LeCun, arXiv:2301.08243v3, CVPR 2023): Eliminating both pixel decoders and hand-crafted view augmentations by predicting the abstract target-encoder representations $\mathbf{s}y(1), \dots, \mathbf{s}_y(M)$ of $M = 4$ large semantic target blocks (scale $0.15\text{–}0.20$, aspect ratio $0.75\text{–}1.5$, masked at the output of the EMA target encoder $f{\bar{\theta}}$) from a single spatially distributed context block (scale $0.85\text{–}1.0$, average visible ratio $0.25$). Multi-block masking boosts ImageNet-1% linear accuracy to 54.2% (vs. 20.2% single-block, 17.6% random, and 15.5% quadrant), while ViT-H/14 trains in <1,200 GPU hours (16 A100 GPUs in <72 hours)—converging in $5\times$ fewer iterations, running $>2.5\times$ faster than iBOT ViT-S/16, and achieving $>10\times$ the compute efficiency of MAE ViT-H/14—reaching 81.1% ImageNet-1K linear probe, 77.3% ImageNet-1% semi-supervised (ViT-H/16-448), and 72.4%–75.0% Clevr/Dist depth prediction (+19.0 points over DINO; https://arxiv.org/html/2301.08243v3).
  4. Video Joint-Embedding Predictive Architectures (V-JEPA, Bardes et al. & LeCun, arXiv:2404.08471v1): Extending non-generative feature prediction to $16 \times 16 \times 2$ 3D spatiotemporal video tokens across VideoMix2M (~2,000,000 public videos) using an $\ell_1$ regression loss $\|P_\phi(E_\theta(x), \Delta_y) - \operatorname{sg}(\overline{E}\theta(y))\|_1$ whose optimal predictor $P^\star(E\theta(x)) = \operatorname{median}(Y \mid E_\theta(x))$ drives the encoder gradient to minimize the Conditional Median Absolute Deviation (MAD) $\nabla_\theta \operatorname{MAD}(Y \mid E_\theta(x))$. Paired with ~90% multi-block spatiotemporal tube masking (union of 8 short-range 15%-area blocks and 2 long-range 70%-area blocks) and a learnable cross-attention Attentive Probe (+17.0 points on K400 and +16.1 points on SSv2 over average pooling), a frozen V-JEPA ViT-H/16 (630M params) trained for just 90K iterations (270M samples seen vs. 2,400M for OmniMAE) achieves 81.9%–82.0% on Kinetics-400, 72.2% on Something-Something-v2 (+21.6 points over DINOv2 ViT-g/14), 25.8 on AVA, and 77.9% on ImageNet-1K (https://arxiv.org/html/2404.08471v1).
  5. Unsupervised Generative Interactive Environments (Genie, Bruce et al., arXiv:2402.15391v1, Google DeepMind): Scaling a 10.7B-parameter (~11B) foundation world model across 6.8M 16-second clips (30,000 hours filtered from 55M clips / >200,000 hours of Internet 2D platformer videos at 10 FPS, $160 \times 90$) and 942B tokens on 256 TPUv5p accelerators (plus a 2.5B Robotics world model on ~339k RT-1/Kalashnikov episodes achieving FVD = 82.7). Genie interleaves linear-time $\mathcal{O}(T)$ spatial and causal temporal attention (ST-Transformer) across a 200M ST-ViViT video tokenizer (1,024 codes, cutting FVD from 272.7 C-ViViT and 114.5 ViT down to 81.4), a 300M raw-pixel Latent Action Model (LAM) that discovers a human-playable $|A| = 8$-code discrete action controller with zero ground-truth action labels ($\Delta_t\text{PSNR} = 1.91$ vs. $1.33$ token-input; matching oracle behavioral cloning on unseen CoinRun with just 200 expert samples), and a 10.1B MaskGIT dynamics model (https://arxiv.org/html/2402.15391v1).
  6. Temporally Causal 3D VAE & Expert-AdaLN Video Diffusion Simulators (CogVideoX, Yang et al., arXiv:2408.06072v3, ICLR 2025): Generating 10-second continuous videos (160 frames at 16 FPS, $768 \times 1360$ resolution) via CogVideoX-2B and CogVideoX-5B trained on ~35M filtered single-shot video clips + 2B images. By compressing videos along both space and time via an $8 \times 8 \times 4$ Temporally Causal 3D VAE (16 latent channels)—achieving 85.5 Flickering and 29.1 PSNR on WebVid vs. 92.4/28.5 for Open-Sora—and fusing concatenated T5 text and video tokens through Vision/Text Expert Adaptive LayerNorm (Expert AdaLN), 3D-RoPE ($3/8, 3/8, 2/8$ channel split), 3D Full Attention, Multi-Resolution Frame Pack, and Explicit Uniform Sampling, CogVideoX-5B reaches 69.5 Dynamic Quality, 3.36 GPT4o-MTScore, 96.8 VBench Human Action, 70.95 Multiple Objects, and defeats closed-source Kling in blind human evaluation across every category (2.74 vs. 2.17 total score; 0.667 vs. 0.561 Physics Simulation; https://arxiv.org/html/2408.06072v3).
📌 Key Takeaways & Empirical World Model / JEPA Benchmarks
  • ✓Ha & Schmidhuber V-M-C World Models & Dream Temperature $\tau$ (arXiv:1803.10122v4): Decoupling a 4.35M–4.45M ConvVAE (`V`) and a 422K–1.68M MDN-RNN (`M`) from an 867–1,088 parameter linear Controller (`C`) evolved via CMA-ES solves CarRacing-v0 with 906 ± 21 (vs. 632 ± 251 V-only, 652 ± 10 A3C, 343 ± 18 DQN). In VizDoom: Take Cover, low dream temperature ($\tau=0.10$) allows adversarial model exploitation (2086 virtual → 193 real), whereas stochastic dream inflation ($\tau=1.15$) prevents cheating and transfers at 1092 ± 556 real steps (vs. 820 ± 58 leaderboard).
  • ✓DreamerV2/V3 RSSM, 32×32 Categorical Latents & KL Balancing (arXiv:2010.02193v4, arXiv:2301.04104v2): Representing stochastic states as 32 categoricals of 32 classes (1,024-bit sparse vector) beat Gaussians on 42/55 Atari games, while asymmetric KL Balancing ($\alpha=0.8$) wins on 44/55 games. Simulating 2,500 parallel trajectories ($H=15$, 468B imagined states vs. 50M real inputs) yields 2.15 Gamer Median (2.64 scheduled) and 0.28 Clipped Record Mean on 55 Atari games (vs. IQN 1.29/0.21, Rainbow 1.47/0.17), while DreamerV3 spans 150+ tasks with fixed hyperparameters and collects Minecraft diamonds from scratch at 30M steps (17 days).
  • ✓I-JEPA Non-Generative Multi-Block Embedding Prediction (arXiv:2301.08243v3): Predicting $L_2$ patch embeddings of $M=4$ semantic target blocks (scale 0.15–0.20) from a single distributed context block (scale 0.85–1.0, 54.2% vs. 17.6% random masking on IN1K-1%) trains ViT-H/14 in <1,200 GPU hours (16 A100s in <72h, 5× fewer iterations, >10× more efficient than MAE ViT-H/14 and >2.5× faster than iBOT ViT-S/16), achieving 81.1% IN1K linear probe, 77.3% IN1K-1%, and 72.4%–75.0% Clevr/Dist depth (+19.0 pts over DINO).
  • ✓V-JEPA $\ell_1$ Conditional MAD Video Feature Prediction (arXiv:2404.08471v1): Pretraining on VideoMix2M (2M videos, 90K iterations, 270M samples seen) with ~90% multi-block spatiotemporal tube masking (8 short-range 15% + 2 long-range 70% blocks) and cross-attention Attentive Probing (+17.0 pts K400, +16.1 pts SSv2) enables a frozen 630M ViT-H/16 backbone to reach 81.9%–82.0% Kinetics-400, 72.2% Something-Something-v2 (+21.6 pts over DINOv2 ViT-g/14), 25.8 AVA, and 77.9% ImageNet-1K.
  • ✓Genie 10.7B Unsupervised Interactive World Model (arXiv:2402.15391v1): Trained on 6.8M 16s clips (30k hours filtered from 200k+ hours, 942B tokens on 256 TPUv5p), Genie combines a 200M ST-ViViT tokenizer (1,024 codes, FVD 81.4 vs. 272.7 C-ViViT), a 300M raw-pixel Latent Action Model ($|A|=8$ discrete actions, $\Delta_t\text{PSNR}=1.91$ vs. $1.33$ token-input), and a 10.1B MaskGIT dynamics model, matching oracle CoinRun BC with just 200 expert samples.
  • ✓CogVideoX-5B 3D Causal VAE & Expert-AdaLN Video Simulator (arXiv:2408.06072v3): An $8 \times 8 \times 4$ Temporally Causal 3D VAE (16 channels, 85.5 Flickering / 29.1 PSNR vs. Open-Sora 92.4 / 28.5) paired with Vision/Text Expert AdaLN, 3D-RoPE ($3/8, 3/8, 2/8$), and 3D Full Attention across 35M clips + 2B images generates 10s $768 \times 1360$ 16-FPS videos, achieving 69.5 Dynamic Quality, 3.36 GPT4o-MTScore, and beating closed-source Kling (2.74 vs. 2.17 total, 0.667 vs. 0.561 Physics Simulation).
468B States / 1 GPU
DreamerV2/V3 32×32 RSSM

32×32 categorical latents + KL balancing (α=0.8) imagine 10,000× more states than real frames and collect Minecraft diamonds at 30M steps (arXiv:2010.02193v4).

>10× vs MAE @ 81.1%
I-JEPA Multi-Block Prediction

ViT-H/14 trains in <1,200 GPU hours (<72h on 16 A100s) with 4 semantic target blocks, hitting 81.1% IN1K linear and 77.3% IN1K-1% (arXiv:2301.08243v3).

81.9% K400 / 72.2% SSv2
V-JEPA Frozen 630M ViT-H/16

L1 feature regression on VideoMix2M (2M videos, ~90% tube mask) + Attentive Probe beats DINOv2 by +21.6 pts on SSv2 motion (arXiv:2404.08471v1).

10.7B Genie & 5B 3D-DiT
Interactive & Causal Video Worlds

Genie 10.7B learns |A|=8 latent actions across 942B tokens (arXiv:2402.15391v1); CogVideoX-5B 8×8×4 3D VAE hits 29.1 PSNR and 2.74 human score (arXiv:2408.06072v3).


1. Recurrent Latent World Models (V-M-C), Mixture Density Dynamics, and Adversarial Dream Exploitation (Ha & Schmidhuber, arXiv:1803.10122v4)

In World Models (Recurrent World Models Facilitate Policy Evolution, arXiv:1803.10122v4, NeurIPS 2018, pp. 2451–2463; https://worldmodels.github.io/), David Ha and Jürgen Schmidhuber translated the cognitive neuroscience principle of predictive internal mental models—where a baseball batter swings at a 100 mph fastball using subconscious sensory predictions faster than visual signals can traverse the optic nerve—into a modular three-part neural architecture (V, M, and C).

Reparameterized Variational Autoencoder architecture mapping high-dimensional observations into Gaussian latent vectors

Reparameterized Variational Autoencoder architecture mapping high-dimensional observations into Gaussian latent vectors

Why did Ha and Schmidhuber strictly separate the unsupervised world model (V + M) from the reward-maximizing Controller (C)? Because backpropagation easily trains large neural networks of $10^7$ to $10^9$ parameters when provided with dense, differentiable unsupervised reconstruction and next-step prediction losses, whereas reinforcement learning algorithms are severely bottlenecked by the sparse credit assignment problem, restricting typical model-free policies to $10^3$ to $10^6$ parameters (https://worldmodels.github.io/). By absorbing almost all visual and temporal complexity into V and M via unsupervised GPU backpropagation, the Controller C shrinks to fewer than 1,100 parameters, allowing derivative-free evolution strategies (CMA-ES) to optimize C across parallel CPU workers without backpropagation through time.

1. Mathematical Formulation of the V-M-C Architecture

At each discrete time step $t$, the environment emits a high-dimensional RGB frame $x_t \in [0, 1]^{64 \times 64 \times 3}$ (resized to $64 \times 64$ pixels):

  1. Vision Model (V — Convolutional Variational Autoencoder, ConvVAE): A 4-layer stride-2 Convolutional encoder (ReLU activations) compresses $x_t$ into the parameters $\mu_t \in \mathbb{R}^{N_z}$ and $\sigma_t \in \mathbb{R}^{N_z}$ of a factored diagonal Gaussian posterior, from which a compact spatial latent vector $z_t \in \mathbb{R}^{N_z}$ is sampled (https://worldmodels.github.io/, Appendix): $$z_t \sim \mathcal{N}\big(\mu_t, \sigma_t^2 I\big), \qquad N_z = \begin{cases} 32 & \text{for } \texttt{CarRacing-v0}, \\ 64 & \text{for } \texttt{VizDoom: Take Cover}. \end{cases}$$ A symmetric 4-layer stride-2 deconvolutional decoder reconstructs $\hat{x}_t \in [0, 1]^{64 \times 64 \times 3}$, trained for 1 epoch over 10,000 random-policy rollouts using the sum of $L^2$ reconstruction distance and the Kullback-Leibler (KL) divergence toward $\mathcal{N}(0, I)$, which regularizes information capacity and keeps the decoder robust to imperfect latent vectors generated by M.
  2. Memory Model (M — Mixture Density Network + LSTM, MDN-RNN): While $z_t$ captures a static snapshot in time, the MDN-RNN compresses what happens over time by updating a recurrent LSTM hidden state $h_t$ and outputting the parameters of a Mixture of Gaussians distribution over the next latent vector $z_{t+1}$ (plus a binary termination event $d_{t+1} \in \{0, 1\}$ for VizDoom), scaled by an adjustable sampling temperature $\tau$ (https://worldmodels.github.io/): $$P(z_{t+1} \mid a_t, z_t, h_t) = \sum_{k=1}^{K} \pi_k(a_t, z_t, h_t) \, \mathcal{N}\Big(z_{t+1} \;\Big|\; \mu_k(a_t, z_t, h_t), \, \sigma_k^2(a_t, z_t, h_t) \cdot \tau\Big)$$ Why model $z_{t+1}$ as a Mixture of Gaussians when V encodes each frame as a single diagonal Gaussian? Because environments contain discrete stochastic branching events—such as whether a monster in VizDoom decides to launch a fireball or remain still (https://worldmodels.github.io/). Because M trains purely on pre-encoded sequences of $z_t \in \mathbb{R}^{32}$ or $\mathbb{R}^{64}$ without raw images, an entire 1,000-frame episode fits in large batches on a single P100 GPU.
  3. Controller Model (C — Single-Layer Linear Policy Optimized via CMA-ES): Rather than feeding the sampled future prediction $\hat{z}_{t+1}$ to the controller, C receives the concatenation of the current spatial latent $z_t$ and the LSTM hidden state $h_t$ (which already encapsulates the full predictive probability distribution of future states) and maps them linearly to motor action $a_t$ (https://worldmodels.github.io/): $$a_t = W_c \, \begin{bmatrix} z_t \\ h_t \end{bmatrix} + b_c$$ The parameter vector $[W_c, b_c]$ is evolved via Covariance-Matrix Adaptation Evolution Strategy (CMA-ES) on a 64-core CPU machine evaluating parallel environment rollouts.
Environment & ModuleV Model (ConvVAE) ParametersM Model (MDN-RNN) ParametersC Model (Linear Controller) ParametersLatent & Hidden Dimensions ($N_z$, LSTM Units, Gaussians $K$)
CarRacing-v0 (Feature Extraction)4,348,547422,368867 (1,443 with 40-unit $\tanh$ layer)$N_z = 32$, 256 LSTM units, $K = 5$ Gaussian mixtures, 3 continuous actions
VizDoom: Take Cover (Dream Training)4,446,9151,678,7851,088$N_z = 64$, 512 LSTM units, $K = 5$ Gaussian mixtures + binary $d_{t+1}$ death prediction

2. Solving CarRacing-v0 and the Reflexive Role of Predictive Memory $h_t$

In OpenAI Gym's top-down continuous control task CarRacing-v0 (steering left/right, acceleration, brake across randomly generated tracks), "solving" the environment requires achieving an average cumulative reward of 900 over 100 consecutive random trials (https://worldmodels.github.io/). When Ha and Schmidhuber handicapped the controller to observe only the spatial VAE representation $z_t$ ($a_t = W_c z_t + b_c$), the car wobbled on sharp corners and scored $632 \pm 251$ (improving to $788 \pm 141$ when adding a 40-unit $\tanh$ hidden layer with 1,443 parameters). Providing C with both $z_t$ and the predictive memory state $h_t$ stabilized high-speed cornering without explicit multi-step planning trees, achieving $906 \pm 21$ over 100 random trials (and $900.46$ over 1,024 random rollouts)—the first reported solution to solve CarRacing-v0:

  • DQN Baseline: $343 \pm 18$ average score over 100 random tracks (https://worldmodels.github.io/).
  • A3C (Continuous) & A3C (Discrete): $591 \pm 45$ and $652 \pm 10$ average scores.
  • Best Prior Gym Leaderboard (ceobillionaire): $838 \pm 11$ average score.
  • World Model (V only, $z_t$ input, 867 params / +40-unit hidden layer, 1,443 params): $632 \pm 251$ / $788 \pm 141$.
  • Full World Model (V + M, $[z_t \; h_t]$ input, 867 controller params): $906 \pm 21$ (Solved).

3. Training Inside Hallucinated Dreams (DoomRNN) and Temperature $\tau$ Anti-Cheat Regularization

Can an agent train 100% inside a hallucinated latent environment (DoomRNN) without touching the real game engine—and transfer its learned policy zero-shot back into reality? In VizDoom: Take Cover, the agent must dodge fireballs shot by monsters across a room for up to 2,100 time steps (~60 seconds), where surviving >750 time steps (~20 seconds) over 100 consecutive rollouts solves the task (https://worldmodels.github.io/). By wrapping the MDN-RNN M in an OpenAI gym.Env interface that steps entirely in $\mathbb{R}^{64}$ latent space ($z_t \to a_t \to (z_{t+1}, d_{t+1})$) without rendering pixels, training runs orders of magnitude faster than the 3D C++ game engine.

However, because C observes the internal hidden state $h_t$ of M, the evolutionary optimizer rapidly discovers adversarial policies that cheat the world model: at low sampling temperatures ($\tau = 0.10$, where M acts like a deterministic LSTM, or $\tau = 0.50$), the agent learns oscillatory movements that prevent the MDN-RNN from transitioning into Gaussian mixture modes where fireballs spawn—extinguishing fireballs mid-formation (https://worldmodels.github.io/). While this adversarial policy scores $2086 \pm 140$ in the virtual dream at $\tau = 0.10$, it fails catastrophically at $193 \pm 58$ in the actual VizDoom environment:

Sampling Temperature $\tau$ in DoomRNNScore in Virtual Dream Environment (Steps)Score in Actual VizDoom Environment (100 Trials)Dynamical & Policy Transfer Behavior (https://worldmodels.github.io/)
$\tau = 0.10$ (Nearly Deterministic)$2086 \pm 140$$193 \pm 58$Mode collapse; agent exploits M so monsters never shoot fireballs; fails worse than random policy in reality
$\tau = 0.50$ (Low Uncertainty)$2060 \pm 277$$196 \pm 50$Adversarial policy still extinguishes fireballs in M; catastrophic sim-to-real collapse
$\tau = 1.00$ (Standard Sampling)$1145 \pm 690$$868 \pm 511$Surpasses the 750-step solved threshold and beats the $820 \pm 58$ Gym Leaderboard
$\tau = 1.15$ (Optimal Nightmare Dream)$918 \pm 546$$1092 \pm 556$Higher virtual stochasticity blocks model exploitation; achieves peak real-world survival (+272 steps over leaderboard)
$\tau = 1.30$ (Extreme Uncertainty)$732 \pm 269$$753 \pm 139$Virtual world becomes overly chaotic; agent adopts conservative low-variance strategy that still solves the task (>750)
Random Policy / Gym LeaderboardN/A$210 \pm 108$ / $820 \pm 58$Reference real-environment baselines without world model dream training

2. Recurrent State-Space Models (RSSM), $32 \times 32$ Discrete Categorical Latents, KL Balancing, and Latent Imagination (Dreamer, DreamerV2 & DreamerV3)

While Ha and Schmidhuber's V-M-C architecture proved that policies could be evolved inside latent dreams on single-room tasks, scaling latent world models to beat state-of-the-art model-free reinforcement learning across all 55 Atari games (DreamerV2, Hafner et al., arXiv:2010.02193v4, ICLR 2021) and across 150+ diverse tasks including collecting diamonds in Minecraft from scratch (DreamerV3, Hafner et al., arXiv:2301.04104v2, Nature; https://danijar.com/project/dreamerv3/) required three fundamental architectural breakthroughs over V-M-C and DreamerV1 (arXiv:1912.01603v3):

  1. Replacing separate two-stage VAE + MDN-RNN training with an end-to-end Recurrent State-Space Model (RSSM) (20M trainable parameters) trained jointly on sequences of batch size $B = 50$ and length $L = 50$ ($\gamma = 0.999$).
  2. Replacing unimodal diagonal Gaussian latent variables with a vector of 32 discrete categorical variables of 32 classes each (a sparse binary vector of length 1,024 with 32 active bits), optimized via Straight-Through Gradients.
  3. Replacing derivative-free CMA-ES with analytic Actor-Critic $\lambda$-return optimization (1M parameters each) across 2,500 parallel imagined trajectories of horizon $H = 15$ on a single GPU.

1. The Six-Component Recurrent State-Space Model (RSSM) and Asymmetric KL Balancing ($\alpha = 0.8$)

In DreamerV2 (https://arxiv.org/html/2010.02193v4, Section 2.1, Equation 1), each $84 \times 84$ frame is downscaled to $64 \times 64$ pixels, and the world model maintains a compact model state combining a deterministic GRU recurrent state $h_t$ and a stochastic categorical state $z_t$ (posterior during perception, or $\hat{z}_t$ prior during imagination without images), parameterized by combined weights $\phi$ (ELU activations throughout):

$$\text{RSSM} \begin{cases} \text{Recurrent model:} & h_t = f_\phi(h_{t-1}, z_{t-1}, a_{t-1}) \\ \text{Representation model (Posterior):} & z_t \sim q_\phi(z_t \mid h_t, x_t) \\ \text{Transition predictor (Prior):} & \hat{z}t \sim p\phi(\hat{z}t \mid h_t) \end{cases} \qquad \begin{cases} \text{Image predictor:} & \hat{x}_t \sim p\phi(\hat{x}t \mid h_t, z_t) \\ \text{Reward predictor:} & \hat{r}_t \sim p\phi(\hat{r}t \mid h_t, z_t) \\ \text{Discount predictor:} & \hat{\gamma}_t \sim p\phi(\hat{\gamma}_t \mid h_t, z_t) \end{cases}$$

All six components are optimized jointly via the variational free energy (ELBO) objective (arXiv:2010.02193v4, Equation 2, where $\beta = 0.1$ for Atari and $\beta = 1.0$ for continuous control):

$$\mathcal{L}(\phi) \doteq \mathbb{E}{q\phi(z_{1:T} \mid a_{1:T}, x_{1:T})}\!\left[\sum_{t=1}^{T} \Big(-\ln p_\phi(x_t \mid h_t, z_t) - \ln p_\phi(r_t \mid h_t, z_t) - \ln p_\phi(\gamma_t \mid h_t, z_t) + \beta \operatorname{KL}\!\big[q_\phi(z_t \mid h_t, x_t) \;\big\|\; p_\phi(z_t \mid h_t)\big]\Big)\right]$$

Why did Hafner et al. introduce Discrete Categorical Latents and KL Balancing?

  • 32 Categoricals $\times$ 32 Classes ($1,024$-Bit Sparse Vector) vs. Diagonal Gaussians: In DreamerV2, $z_t$ is a vector of 32 categorical variables, each over 32 classes ($32^{32} = 2^{160}$ possible discrete configurations, flattened into a length-1,024 binary vector with 32 active bits). To backpropagate through discrete sampling, Algorithm 1 applies Straight-Through Gradients: sample = one_hot(draw(logits)) + probs - stop_grad(probs) where probs = softmax(logits) (https://arxiv.org/html/2010.02193v4, Section 2.1 & 3.2). Why do categorical latents outperform Gaussians on 42 out of 55 Atari games (losing on only 8, tied on 5)? First, a categorical transition prior $p_\phi(\hat{z}_t \mid h_t)$ can exactly fit the aggregate posterior across multimodal transitions because a mixture of categoricals is again a categorical, whereas a unimodal Gaussian prior cannot match a mixture of Gaussian posteriors. Second, the $32 / 1024$ sparsity enforces generalization and naturally captures non-smooth Atari transitions (entering a new room or defeated enemies disappearing; arXiv:2010.02193v4, Section 3.2).
  • KL Balancing ($\alpha = 0.8$, Algorithm 2): In standard symmetric KL divergence $\operatorname{KL}[q_\phi \| p_\phi]$, gradients simultaneously pull the prior $p_\phi$ toward the posterior $q_\phi$ and regularize the representation posterior $q_\phi$ toward an initially random, poorly trained transition prior $p_\phi$. DreamerV2 splits the KL term using stop-gradients (stop_grad / $\operatorname{sg}$) with asymmetric learning weights $\alpha = 0.8$ for the prior and $1 - \alpha = 0.2$ for the posterior (arXiv:2010.02193v4, Algorithm 2): $$\mathcal{L}{\text{KL-Bal}}(\phi) = \alpha \operatorname{KL}\!\Big[\operatorname{sg}\big(q\phi(z_t \mid h_t, x_t)\big) \;\Big\|\; p_\phi(z_t \mid h_t)\Big] + (1 - \alpha)\operatorname{KL}\!\Big[q_\phi(z_t \mid h_t, x_t) \;\Big\|\; \operatorname{sg}\big(p_\phi(z_t \mid h_t)\big)\Big]$$ Training the transition prior $4\times$ faster than posterior regularization outperforms symmetric KL on 44 out of 55 Atari tasks (lower on 6, tied on 5).

2. Latent Imagination MDP ($H = 15$, $\lambda = 0.95$) and Atari 55-Game / Minecraft Benchmarks

During behavior learning, the world model weights $\phi$ are frozen, the image decoder is bypassed completely, and the transition prior $p_\phi(\hat{z}t \mid \hat{z}{t-1}, \hat{a}_{t-1})$ rolls out 2,500 parallel imagined trajectories over horizon $H = 15$ on a single V100 GPU (arXiv:2010.02193v4, Section 2.2 & 3). Across 200M environment steps (50M real frames with action repeat 4, trained in under 10 days on 1 NVIDIA V100 GPU), DreamerV2 trains its actor and critic on 468 billion (468B) imagined compact states—$10,000\times$ more state transitions than real environment inputs!

The Critic $v_\xi(\hat{z}t)$ (updated toward a target network every 100 gradient steps) regresses recursively defined $\lambda$-returns $V_t^\lambda$ ($\lambda = 0.95$, Equation 4–5), while the Actor $p\psi(\hat{a}_t \mid \hat{z}_t)$ minimizes the hybrid Reinforce + Straight-Through Dynamics Backprop + Entropy objective (arXiv:2010.02193v4, Equation 4–6, using $\rho = 1, \eta = 10^{-3}$ for discrete Atari and $\rho = 0, \eta = 10^{-4}$ for continuous control):

$$V_t^\lambda \doteq \hat{r}t + \hat{\gamma}_t \begin{cases} (1 - \lambda) v\xi(\hat{z}{t+1}) + \lambda V{t+1}^\lambda & \text{if } t < H, \\ v_\xi(\hat{z}H) & \text{if } t = H, \end{cases} \qquad \mathcal{L}(\psi) \doteq \mathbb{E}{p_\phi, p_\psi}\!\left[\sum_{t=1}^{H-1} \Big(-\rho \ln p_\psi(\hat{a}t \mid \hat{z}_t)\operatorname{sg}\big(V_t^\lambda - v\xi(\hat{z}_t)\big) - (1 - \rho)V_t^\lambda - \eta \operatorname{H}\big[a_t \mid \hat{z}_t\big]\Big)\right]$$

Agent / Ablation Variant (arXiv:2010.02193v4, Table 1 & Table 2)Gamer Median (55 Atari Games @ 200M Steps)Gamer MeanHuman World Record MeanClipped Record Mean (Recommended Robust Metric)
DreamerV2 (Schedules / Standard Fixed)2.64 / 2.1510.45 / 11.330.43 / 0.440.28 / 0.28
IQN (Single-GPU Model-Free Distributional RL)1.298.850.210.21
Rainbow (Single-GPU Model-Free SoTA Baseline)1.479.120.170.17
C51 / DQN (Dopamine Baselines)1.09 / 0.657.70 / 2.840.15 / 0.120.15 / 0.12
Ablation Base Checkpoint: Full DreamerV21.6411.330.360.25
Ablation: No Reward Gradients (Image Gradients Only)1.686.180.370.24 (improves 15 tasks, ties 18!)
Ablation: No Discrete Latents (Gaussian Latents)1.083.710.240.19 (categorical wins 42/55 tasks)
Ablation: No KL Balancing (Symmetric KL)0.843.490.190.16 (KL balancing wins 44/55 tasks)
Ablation: No Image Gradients (Reward Gradients Only)0.040.310.010.01 (collapses on 51/55 tasks)

Notice the profound insight in Table 2 of DreamerV2 (https://arxiv.org/html/2010.02193v4): stopping image reconstruction gradients causes total collapse (0.25 $\to$ 0.01 Clipped Record Mean, degrading 51 of 55 games), whereas stopping reward gradients leaves world model representations virtually intact (0.25 $\to$ 0.24, and actually improves Gamer Median from 1.64 to 1.68 across 15 games)! Building on this foundation, DreamerV3 (arXiv:2301.04104v2, Nature; https://danijar.com/project/dreamerv3/) introduced symlog transformations, return normalization, and free-bits KL balancing to solve over 150 diverse tasks across domains with a single fixed hyperparameter configuration, becoming the first algorithm in AI history to collect diamonds in Minecraft from scratch directly from raw pixels and sparse rewards without human demonstrations or curricula (reaching its first diamond at 30M environment steps, equivalent to 17 days of continuous gameplay).


3. Energy-Based Joint-Embedding Predictive Architectures and Multi-Block Semantic Representation Prediction (I-JEPA, arXiv:2301.08243v3)

While DreamerV2 and DreamerV3 proved that predicting in compact latent space vastly outperforms pixel-space rollouts for control, Dreamer still trained a pixel-reconstruction decoder $-\ln p_\phi(x_t \mid h_t, z_t)$ to ground its latent representation—a limitation that DreamerV2 explicitly noted on Video Pinball, where the crucial ball occupies only a single pixel and receives negligible pixel-reconstruction gradient (https://arxiv.org/html/2010.02193v4, Section 3.1).

In Self-Supervised Learning from Images with a Joint-Embedding Predictive Architecture (I-JEPA) (arXiv:2301.08243v3, CVPR 2023, pp. 15619–15629; https://arxiv.org/html/2301.08243v3), Mahmoud Assran, Quentin Duval, Ishan Misra, Piotr Bojanowski, Pascal Vincent, Michael Rabbat, Yann LeCun, and Nicolas Ballas formalized Yann LeCun's Energy-Based Joint-Embedding Predictive Architecture (JEPA) for visual representation learning—eliminating both pixel/token generation decoders (MAE, BEiT) and hand-crafted multi-view data augmentations (SimCLR, DINO, iBOT, MSN).

1. The Three Energy-Based Self-Supervised Paradigms: JEA vs. Generative vs. JEPA

Within the framework of Energy-Based Models (EBMs), where an architecture assigns low scalar energy to compatible inputs $(\mathbf{x}, \mathbf{y})$ and high energy to incompatible inputs (arXiv:2301.08243v3, Section 2, Figure 2):

  1. Joint-Embedding Architectures (JEA — SimCLR, BYOL, DINO, iBOT): Force two augmented views $(\mathbf{x}, \mathbf{y})$ of the same image to produce identical embeddings. While effective for global class semantics, hand-crafted view augmentations (random cropping, color jittering, blurring) inject rigid inductive biases that destroy spatial geometry (e.g., object counting and depth estimation) and require processing multiple views per image.
  2. Generative Architectures (MAE, BEiT, SimMIM): Reconstruct a signal $\mathbf{y}$ directly in pixel or VQ-token space from a masked view $\mathbf{x}$ via a decoder conditioned on position tokens $\mathbf{z}$. Because every low-level pixel texture must be predicted, generative models waste vast compute (e.g., 1,600 epochs for MAE) and produce low-level representations that underperform in off-the-shelf linear probing (68.0% for MAE ViT-B/16 vs. 72.9% for I-JEPA ViT-B/16).
  3. Joint-Embedding Predictive Architectures (JEPA — I-JEPA): Predict the abstract representation $\mathbf{s}y$ of target signal $\mathbf{y}$ from the representation $\mathbf{s}_x$ of compatible context signal $\mathbf{x}$, using a predictor network $g\phi(\mathbf{s}_x, \mathbf{z})$ conditioned on spatial positional tokens $\mathbf{z}$ (arXiv:2301.08243v3, Section 2–3). Because the loss operates entirely in embedding space, the target encoder can discard unpredictable pixel-level background details while preserving both high-level semantics and local spatial geometry.

2. Multi-Block Semantic Masking and Asymmetric EMA Patch-Level $L_2$ Regression

Given an input image $\mathbf{y}$ partitioned into $N$ non-overlapping patches (arXiv:2301.08243v3, Section 3, Figure 3–4):

  1. Output-Masked Target Blocks ($M = 4$, Scale $0.15\text{–}0.20$): The entire unmasked image $\mathbf{y}$ is first passed through the EMA target-encoder $f_{\bar{\theta}}$ to produce full contextualized patch embeddings $\mathbf{s}y = \{\mathbf{s}{y_1}, \dots, \mathbf{s}{y_N}\}$. Then, $M = 4$ possibly overlapping target blocks $B_1, \dots, B_4$ are randomly sampled from the output representations $\mathbf{s}_y(i) = \{\mathbf{s}{y_j}\}{j \in B_i}$ with random scale in $(0.15, 0.20)$ and aspect ratio in $(0.75, 1.5)$. Crucially, masking at the output of $f{\bar{\theta}}$ (rather than its input) guarantees that target representations encode full global semantic context.
  2. Spatially Distributed Context Block ($B_x$, Scale $0.85\text{–}1.0$, Visible Ratio $\sim 0.25$): A single large block is sampled with scale in $(0.85, 1.0)$ and unit aspect ratio, and all patches overlapping with the 4 target blocks $\bigcup_{i=1}^4 B_i$ are removed to form the sparse context mask $B_x$ (leaving an average of 25% (0.25) of the image patches visible). The context encoder $f_\theta$ processes only the visible context patches $\mathbf{x} = \{x_j\}{j \in B_x}$ to produce $\mathbf{s}_x = \{\mathbf{s}{x_j}\}_{j \in B_x}$.
  3. Narrow ViT Predictor $g_\phi$ and $L_2$ Embedding Loss: For each target block $i \in \{1, \dots, M\}$, the narrow ViT predictor $g_\phi$ takes the context embeddings $\mathbf{s}x$ concatenated with shared learnable mask tokens $\{\mathbf{m}_j\}{j \in B_i}$ (each shifted by the target patch's 2D positional embedding) and predicts $\hat{\mathbf{s}}y(i) = \{\hat{\mathbf{s}}{y_j}\}{j \in B_i} = g\phi(\mathbf{s}x, \{\mathbf{m}_j\}{j \in B_i})$, minimizing the average patch-level squared $L_2$ distance (arXiv:2301.08243v3, Section 3): $$\mathcal{L}{\text{I-JEPA}}(\theta, \phi) = \frac{1}{M}\sum{i=1}^{M} D\big(\hat{\mathbf{s}}y(i), \mathbf{s}_y(i)\big) = \frac{1}{M}\sum{i=1}^{M}\sum_{j \in B_i} \big\|\hat{\mathbf{s}}{y_j} - \mathbf{s}{y_j}\big\|_2^2$$ while target-encoder weights $\bar{\theta}$ update via an Exponential Moving Average (EMA) of $\theta$ to prevent representation collapse.

Why is Multi-Block Masking non-negotiable for I-JEPA? In Table 6 of arXiv:2301.08243v3 (evaluating ViT-B/16 pretrained for 300 epochs on ImageNet-1K 1% linear evaluation), multi-block masking (4 target blocks at scale 0.15–0.20, context complement ratio 0.25) achieves 54.2% Top-1 accuracy—more than doubling or tripling single-block masking (Block(0.6), ratio 0.4 $\to$ 20.2%), random patch masking (Random(0.6), ratio 0.4 $\to$ 17.6%), and rasterized quadrant masking (3 quadrants predicted from 1 quadrant, ratio 0.25 $\to$ 15.5%)!

3. >10&times; Compute Efficiency over MAE and Empirical Benchmarks Across Semantic & Geometric Tasks

Because I-JEPA processes only a single view of ~25% visible context patches through $f_\theta$ and predicts in semantic representation space, it converges in roughly $5\times$ fewer iterations than pixel-reconstructing MAE (despite a minor 7% per-iteration target-encoding overhead). Pretraining ViT-H/14 on ImageNet-1K requires under 1,200 GPU hours (16 NVIDIA A100 GPUs in under 72 hours for 300 epochs)—making I-JEPA ViT-H/14 over $10\times$ more compute-efficient than MAE ViT-H/14 (1,600 epochs) and over $2.5\times$ faster than even a small ViT-S/16 pretrained with view-augmented iBOT (arXiv:2301.08243v3, Section 1 & Section 7, Figure 5):

Method & Augmentation Regime (arXiv:2301.08243v3, Tables 1–5)Architecture & Pretraining EpochsImageNet-1K Linear Probe Top-1 (%)ImageNet-1% Semi-Supervised Top-1 (%)Transfer Linear: CIFAR100 / Places205 / iNat18 (%)Local Geometry Linear: Clevr/Count & Clevr/Dist (%)
MAE (Pixel Reconstruction, No View Aug.)ViT-B/16 / ViT-L/16 (1600 ep)68.0% / 76.0%— / 67.1%——
MAE (Pixel Reconstruction, No View Aug.)ViT-H/14 (1600 ep)77.2%71.5%77.3% / 55.0% / 32.9%90.5% / 72.4%
data2vec (Online Feature Target, No View Aug.)ViT-L/16 (1600 ep)77.3%73.3%81.6% / 54.6% / 28.1%85.3% / 71.3%
CAE (Context Autoencoder, No View Aug.)ViT-B/16 / ViT-L/16 (1600 ep)70.4% / 78.1%———
I-JEPA (Embedding Prediction, No View Aug.)ViT-B/16 / ViT-L/16 (600 ep)72.9% / 77.5%— / 69.4%——
I-JEPA (Embedding Prediction, No View Aug.)ViT-H/14 (300 ep, <1200 GPU-h)79.3%73.3%87.5% / 58.4% / 47.6%86.7% / 72.4%
I-JEPA (High-Resolution / IN22K Scaled)ViT-H/16-448 (300 ep) / IN22K ViT-H/1481.1%77.3%89.5% / 57.8% / 50.5% (55.3% ViT-G/16)88.6% / 75.0% (IN22K ViT-H/14)
DINO (Hand-Crafted Multi-View Augmentations)ViT-B/8 (300 ep)80.1%70.0%84.9% / 57.9% / 55.9%86.6% / 53.4% (-19.0 pts on depth!)
iBOT (Multi-View Aug. + Patch Tokenizer)ViT-L/16 (250 ep) / ViT-B/16 (400 ep)81.0%69.7% (ViT-B/16)88.3% / 60.4% / 57.3%85.7% / 62.8% (-9.6 pts on depth!)
MSN / BYOL / SimCLR v2 (Multi-View Aug.)ViT-B/4 (300) / RN200 2x / RN152 2x— / — / 79.1%75.7% / 71.2% / 70.2%——

4. Spatiotemporal Video Feature Prediction, Conditional Median Absolute Deviation (MAD), and Attentive Probing (V-JEPA, arXiv:2404.08471v1)

Can a vision model learn versatile representations for both dynamic motion understanding and static appearance recognition purely from unlabelled video—without pretrained image encoders, text captions, negative contrastive examples, pixel reconstruction, or human annotations? In Revisiting Feature Prediction for Learning Visual Representations from Video (V-JEPA) (arXiv:2404.08471v1, Meta FAIR 2024; https://arxiv.org/html/2404.08471v1), Adrien Bardes, Quentin Garrido, Jean Ponce, Xinlei Chen, Michael Rabbat, Yann LeCun, Mahmoud Assran, and Nicolas Ballas generalized I-JEPA to 3D spatiotemporal video clips across VideoMix2M (~2,000,000 videos).

Reinforcement learning and predictive neural architecture feedback loop diagram

Reinforcement learning and predictive neural architecture feedback loop diagram

1. $\ell_1$ Regression Objective and the Conditional Median Absolute Deviation (MAD) Theorem

In V-JEPA (https://arxiv.org/html/2404.08471v1, Section 3.1, Equation 1), given a masked video context region $x$ and target region $y$ with spatiotemporal positional specification $\Delta_y$, the $x$-encoder $E_\theta(\cdot)$, EMA target $y$-encoder $\overline{E}\theta(\cdot)$, and narrow 12-layer predictor $P\phi(\cdot)$ ($d = 384$) minimize the $\ell_1$ feature distance (which Bardes et al. found significantly more stable for video pretraining than $\ell_2$):

$$\underset{\theta, \phi}{\operatorname{minimize}} \;\; \Big\|P_\phi\big(E_\theta(x), \Delta_y\big) - \operatorname{sg}\big(\overline{E}_\theta(y)\big)\Big\|_1$$

Why does this asymmetric $\ell_1$ objective avoid collapse without negative examples? Let $Y = \overline{E}_\theta(y)$ denote the target representation random variable. As proven in Section 3.1 of arXiv:2404.08471v1, the functional minimizer of the $\ell_1$ risk is the conditional median:

$$P^\star\big(E_\theta(x)\big) = \underset{P}{\operatorname{argmin}}\; \big\|P(E_\theta(x)) - Y\big\|1 = \operatorname{median}\big(Y \mid E\theta(x)\big)$$

Substituting $P^\star(E_\theta(x))$ back into the objective shows that the expected encoder gradient equals the gradient of the Conditional Median Absolute Deviation (MAD) of $Y$ given $E_\theta(x)$:

$$\nabla_\theta \, \mathbb{E}\big\|P^\star(E_\theta(x)) - Y\big\|1 = \nabla\theta \operatorname{MAD}\big(Y \mid E_\theta(x)\big)$$

Therefore, whenever the EMA update keeps the predictor $P_\phi$ close to optimal ($P^\star$), the encoder $E_\theta(x)$ is mathematically forced to extract maximal predictive information about the video to minimize the conditional dispersion $\operatorname{MAD}(Y \mid E_\theta(x))$ of future and masked spatiotemporal regions!

2. 3D Spatiotemporal Tokenization, ~90% Multi-Block Tube Masking, and Attentive Probing

To prevent information leakage across temporally redundant video frames (arXiv:2404.08471v1, Section 3.2–3.4 & Section 4):

  1. $16 \times 16 \times 2$ Spatiotemporal Tube Tokens on VideoMix2M: Each video clip comprises 16 frames sampled with a frame-skip of 4 (~3-second clips at $224 \times 224$ or $384 \times 384$ resolution), partitioned into a 3D grid of $L$ spatiotemporal patches of size $16 \times 16$ pixels spanning 2 consecutive frames. VideoMix2M combines HowTo100M (HT), Kinetics-400/600/700 (K710), and Something-Something-v2 (SSv2) (validation overlaps removed) into ~2,000,000 videos, trained for 90,000 iterations at batch size 3,072 (2,400 for ViT-H/16-384), seeing only 270M samples (versus 410M for VideoMAE, 770M for Hiera, and 2,400M for OmniMAE).
  2. ~90% Multi-Block Spatiotemporal Masking (Short-Range + Long-Range): Spatial blocks (aspect ratio in $(0.75, 1.5)$) are repeated across the entire temporal dimension of the 16-frame clip, combining short-range masks (union of 8 randomly sampled blocks covering 15% of each frame) and long-range masks (union of 2 randomly sampled blocks covering 70% of each frame), yielding an average masking ratio of ~90%. In Table 4 (ViT-L/16 on K710+SSv2, single center view), 3D multi-block masking reaches 72.9% K400 / 67.4% SSv2 / 72.8% IN1K, defeating causal multi-block[12] (71.9% / 63.6% / 72.2%), causal multi-block[6] (61.3% / 49.8% / 66.9%), and random-tube[0.9] (51.5% / 46.4% / 55.6%).
  3. Feature Prediction vs. Pixel Prediction & Attentive Probing (+17.0 / +16.1 Points): Because Equation 1 is unnormalized, frozen V-JEPA features do not necessarily lie in a linearly average-poolable subspace. Replacing average pooling with an Attentive Probe (a learnable cross-attention layer with a query token, residual connection, 2-layer GeLU MLP, LayerNorm, and linear classifier) jumps frozen ViT-L/16 single-view accuracy by +17.0 points on K400 (56.7% $\to$ 73.7%) and +16.1 points on SSv2 (50.1% $\to$ 66.2%) (Table 3). Under identical VideoMix2M training (Table 1), feature prediction outperforms pixel prediction across every benchmark (73.7% vs. 68.6% on K400, 66.2% vs. 66.0% on SSv2, 74.8% vs. 73.3% on IN1K, and 85.6% vs. 85.4% K400 fine-tuning).
Model & Pretraining Objective (arXiv:2404.08471v1, Tables 5 & 6)Backbone & ParametersPretraining Data & Samples SeenFrozen K400 Appearance (%)Frozen SSv2 Motion (%)Frozen AVA Localization (mAP)Frozen Static Images: IN1K / Places205 / iNat21 (%)
I-JEPA (Static Image Feature Prediction)ViT-H/16-512 (630M)IN22K79.7%50.0%19.884.4% / 66.5% / 85.7%
OpenCLIP (Image-Text Contrastive)ViT-G/14 (1,800M)LAION81.8%34.8%23.285.3% / 70.2% / 83.6%
DINOv2 (Image Self-Distillation)ViT-g/14 (1,100M)LVD-142M83.4%50.6%24.386.2% / 68.4% / 88.8%
OmniMAE (Pixel Reconstruction)ViT-L/16 / ViT-H/16 (630M)2,400M seen (IN1K+SSv2)65.6% / 71.4%60.6% / 65.4%14.4 / 16.075.1% / 76.3% (IN1K)
VideoMAE (Video Pixel Reconstruction)ViT-L/16 (410M) / ViT-H/16 (630M)K400 (400K iter)77.8% / 79.8%65.5% / 66.2%21.6 / 20.771.1% / 72.3% (IN1K)
VideoMAEv2 (Dual-Mask Pixel Recon.)ViT-g/14 (1,100M)Un.Hybrid71.2%61.2%12.971.4% / 60.6% / 68.3%
Hiera (Hierarchical Pixel Recon.)Hiera-L (770M) / Hiera-H (670M)K400 (1,500K iter)75.5% / 77.0%64.2% / 64.7%15.8 / 17.568.9% / 71.4% (IN1K)
V-JEPA (Video $\ell_1$ Feature Prediction)ViT-L/16 (200M)VideoMix2M (270M seen, 90K iter)80.8% (85.6% ft)69.5% (75.1% ft)25.674.8% / 60.3% / 67.8%
V-JEPA (Video $\ell_1$ Feature Prediction)ViT-H/16 (630M)VideoMix2M (2M videos)82.0%71.4%25.875.9% / 61.7% / 67.9%
V-JEPA 384 (Video $\ell_1$ Feature Prediction)ViT-H/16-384 (630M)VideoMix2M (2M videos)81.9%72.2%25.077.4% (77.9%) / 62.8% / 72.6%

5. Unsupervised Generative Interactive Environments, ST-ViViT Tokenizers, and 8-Code Latent Action Models (Genie 11B, arXiv:2402.15391v1)

Classical world models (World Models, DreamerV2/V3) require ground-truth action labels $a_t$ recorded alongside every video frame during data collection, while passive video models (VideoMAE, V-JEPA) process unlabelled Internet videos without frame-by-frame action controllability. In Genie: Generative Interactive Environments (arXiv:2402.15391v1, Google DeepMind 2024; https://arxiv.org/html/2402.15391v1), Jake Bruce, Michael Dennis, Ashley Edwards, Jack Parker-Holder, Yuge Shi, Tim Rocktäschel, and colleagues bridged this divide by introducing the first action-controllable foundation world model (10.7B / ~11B parameters) trained 100% unsupervised from unlabelled Internet videos without any action or text annotations.

1. Linear-Complexity Spatiotemporal Transformers (ST-Transformer) and the Three Genie Modules

Because full 3D self-attention over $O(10^4)$ video tokens scales quadratically with frame count $T$, Genie employs a memory-efficient Spatiotemporal Transformer (ST-Transformer) across all three of its components (arXiv:2402.15391v1, Section 2, Figure 2–6): each of the $L$ spatiotemporal blocks interleaves a spatial self-attention layer (attending over $1 \times H \times W$ tokens within a single frame) and a causal temporal self-attention layer (attending over $T \times 1 \times 1$ tokens across time steps with a causal mask), followed by a single post-temporal feed-forward network (FFW) (omitting the post-spatial FFW to dedicate parameter budget to model depth and width). Consequently, the dominating spatial attention cost scales linearly $\mathcal{O}(T)$ with frame count:

  1. Spatiotemporal Video Tokenizer (ST-ViViT, 200M Parameters): An ST-Transformer VQ-VAE (patch size 4, sequence length $T = 16$ at 10 FPS) compresses raw video frames $\mathbf{x}{1:T} \in \mathbb{R}^{T \times H \times W \times C}$ into discrete token grids $\mathbf{z}{1:T} \in \mathbb{I}^{T \times D}$ using a codebook of 1,024 unique codes (embedding dimension 32). In Table 3 (205M params, patch size 10), ST-ViViT achieves FVD = 81.4 and controllability $\Delta_t\text{PSNR} = 1.66$ in 0.9 GB memory, outperforming spatial-only ViT (230M, 0.3 GB, FVD = 114.5, $\Delta_t\text{PSNR} = 1.39$) and full quadratic C-ViViT (225M, 1.6 GB, FVD = 272.7, $\Delta_t\text{PSNR} = 1.37$, which severely overfits).
  2. Unsupervised Latent Action Model (LAM, 300M Parameters): To infer controllable actions between consecutive frames without ground-truth labels, a causal ST-Transformer encoder processes all past raw pixel frames $\mathbf{x}{1:t}$ plus the future frame $x{t+1}$ (patch size 16) and quantizes the inter-frame transition into a tiny VQ-VAE codebook of $|A| = 8$ discrete latent actions $\tilde{a}t \in \{0, 1, \dots, 7\}$ (embedding dimension 32). A causal decoder reconstructs $\hat{x}{t+1}$ from $(\mathbf{x}{1:t}, \tilde{\mathbf{a}}{1:t})$ purely to provide training supervision; at inference time, the entire LAM encoder/decoder is discarded except for the 8-vector VQ codebook, allowing a human user or agent to step through the world frame-by-frame using 8 discrete controller buttons! Crucially, feeding raw pixels $\mathbf{x}{1:T}$ into the LAM outperforms feeding VQ tokens $\mathbf{z}{1:T}$ (Table 2), boosting controllability $\Delta_t\text{PSNR}$ ($t = 4$): $$\Delta_t\text{PSNR} = \operatorname{PSNR}\big(x_t, \hat{x}t(\tilde{\mathbf{a}}{1:t}^{\text{GT}})\big) - \operatorname{PSNR}\big(x_t, \hat{x}t'(\tilde{\mathbf{a}}{1:t}^{\text{rand}})\big)$$ from 1.33 to 1.91 on Platformers (2.3B vs. 2.5B, FVD 38.8 vs. 40.1) and from 1.65 to 2.07 while cutting FVD from 257.8 to 136.4 on the 1B Robotics model (arXiv:2402.15391v1, Section 3 & Section 3.4).
  3. MaskGIT Autoregressive Dynamics Model (10.1B Parameters): Conditioned on past discrete video tokens $\mathbf{z}{1:t-1}$ and additive stop-gradient latent action embeddings $\operatorname{sg}(\tilde{\mathbf{a}}{1:t-1})$ (which outperform concatenated action tokens), a decoder-only causal ST-Transformer predicts next-frame tokens $\hat{\mathbf{z}}_{2:T}$ via cross-entropy loss under a uniform Bernoulli token masking rate in $[0.5, 1.0]$, stabilized with bfloat16 and Query-Key Normalization (QK-norm). At inference, each frame is sampled via 25 iterative MaskGIT steps at temperature 2.

2. Scaling from 40M to 10.7B Parameters Across 942B Tokens and Action-Free Robotics Transfer

Genie was trained on 6.8M 16-second video clips (30,000 hours) at 10 FPS ($160 \times 90$ resolution), filtered from 55M clips (>200,000 hours) of publicly available 2D platformer gameplay videos (arXiv:2402.15391v1, Section 3). After verifying monotonic loss reduction across model sizes (40M to 2.7B) and batch sizes (128, 256, 448 = 1.9M, 3.8M, 6.6M tokens), DeepMind trained the flagship 10.1B dynamics model (10.7B total parameters with the 200M tokenizer and 300M LAM) at batch size 512 for 125,000 steps on 256 TPUv5p accelerators across 942 billion (942B) tokens:

  • Out-of-Distribution (OOD) World Creation & 3D Parallax: Prompted with a single unseen Imagen2 synthetic image, a hand-drawn paper sketch, or a real-world photograph, Genie 10.7B turns the static image into an interactive world where latent actions consistently move the character, deform physical objects (such as bags of chips), and emulate multi-layer 3D parallax scrolling (arXiv:2402.15391v1, Section 3.2, Figures 9–11).
  • 2.5B Action-Free Robotics World Model (FVD = 82.7): Trained on ~130k RT-1 robot demonstrations + 209k Kalashnikov et al. real-robot episodes + simulation data with all action labels stripped, a 2.5B Genie Robotics model achieves a test FVD of 82.7 and discovers semantically consistent 3D arm actions (down, up, left) and object contact deformations purely from pixels (arXiv:2402.15391v1, Section 3 & 3.2).
  • 200-Shot Behavioral Cloning on Unseen CoinRun: By labeling expert videos from the unseen procedural RL environment CoinRun with Genie's frozen LAM and learning a lightweight latent-to-real action mapping ($a_t \mapsto \tilde{a}_t$ without observation access), the LAM-based policy matches the upper-bound ground-truth expert action oracle using as few as 200 expert adaptation samples (arXiv:2402.15391v1, Section 3.3, Figure 14).

6. Temporally Causal 3D VAEs, Expert Adaptive LayerNorm, 3D-RoPE, and Full Spatiotemporal Diffusion Transformers (CogVideoX, arXiv:2408.06072v3)

While Genie tokenizes $160 \times 90$ videos into discrete VQ codes for 10-FPS interactive control, generating photometrically continuous, long-duration high-definition video worlds (10 seconds / 160 frames at 16 FPS and $768 \times 1360$ resolution) with complex multi-object physical dynamics requires continuous latent Diffusion Transformers (DiTs). In CogVideoX: Text-to-Video Diffusion Models with An Expert Transformer (arXiv:2408.06072v3, ICLR 2025; https://arxiv.org/html/2408.06072v3), Zhuoyi Yang, Jiayan Teng, Wendi Zheng, Ming Ding, Jie Tang, and colleagues at Tsinghua University and Zhipu AI resolved the flickering, motion-disconnect, and modality-alignment bottlenecks of prior video diffusion models across CogVideoX-2B and CogVideoX-5B.

1. Temporally Causal 3D VAE ($8 \times 8 \times 4$ Compression) with Context Parallelism

Why do video diffusion models built on 2D image VAEs (SDXL $8 \times 8 \times 1$ compression) suffer from severe frame-to-frame flickering and prohibitive token counts? Because encoding frames independently ignores temporal correlation and produces massive sequences. CogVideoX introduces a symmetric Temporally Causal 3D Convolutional VAE (arXiv:2408.06072v3, Section 2.1, Figure 4) that compresses video tensors $T \times H \times W \times 3$ by $8 \times 8 \times 4$ (Variant B, 16 latent channels):

  • Temporally Causal Padding & Low-Overhead Context Parallelism: All temporal convolution padding of length $k - 1$ (where $k$ is the temporal kernel size) is placed strictly at the beginning of the temporal axis so future frames never leak into past or present latent representations. During multi-GPU encoding of long 161-frame videos, temporal context parallelism requires each GPU rank to send only a tiny boundary segment of length $k - 1$ to the next rank (arXiv:2408.06072v3, Figure 4b).
  • Two-Stage Training ($17 \to 161$ Frames) & WebVid Benchmark Victory: Trained first on 17-frame $256 \times 256$ clips (at 8 or 16 FPS) and fine-tuned via context parallelism on 161-frame videos using a weighted sum of $L_1$ reconstruction, LPIPS perceptual, KL regularization, and a delayed 3D GAN discriminator loss, CogVideoX's 3D VAE reduces adjacent-frame $L_1$ Flickering from 93.2 (SDXL 2D VAE $8 \times 8 \times 1$, 4 ch, 28.4 PSNR) down to 86.3 at 28.7 PSNR (Variant B, 16 ch; Variant C with 32 ch reaches 30.5 PSNR, whereas overly aggressive $16 \times 16 \times 8$ compression drops PSNR to 27.9 and stalls diffusion convergence; Table 1). On the WebVid validation benchmark (Table 2), CogVideoX's 3D VAE achieves 85.5 Flickering and 29.1 PSNR, decisively outperforming Open-Sora (92.4 Flickering, 28.5 PSNR) and Open-Sora-Plan (90.2 Flickering, 27.6 PSNR).

2. Expert Transformer: Vision/Text Expert AdaLN, 3D-RoPE ($3/8, 3/8, 2/8$), 3D Full Attention & Explicit Uniform Sampling

After patchifying the 3D VAE latents into $z_{\text{vision}}$ (of length $\frac{T}{q}\cdot\frac{H}{p}\cdot\frac{W}{p}$, repeating the first frame when $q > 1$ to support joint image-video training) and encoding prompts via T5 into $z_{\text{text}}$, CogVideoX concatenates $[z_{\text{text}} \; ; \; z_{\text{vision}}]$ along the sequence dimension and processes them through a stack of Expert Transformer blocks (arXiv:2408.06072v3, Section 2.2 & Section 3):

  1. Vision Expert AdaLN & Text Expert AdaLN vs. Dual-Stream MMDiT: Because T5 text embeddings and 3D VAE visual latents have vastly different feature distributions and numerical scales, CogVideoX modulates each modality independently using diffusion timestep $t$ via dedicated Vision Expert Adaptive LayerNorm and Text Expert Adaptive LayerNorm parameters while sharing the primary Transformer weights. In Figure 8a/8d ablations (500 WebVid test videos), Expert AdaLN significantly outperforms both standard shared AdaLN and dual-stream MMDiT (Esser et al., 2024) at equal parameter count—eliminating the need for two separate modality Transformers (arXiv:2408.06072v3, Section 4.1).
  2. 3D-RoPE Extrapolation ($3/8, 3/8, 2/8$ Channel Split) & Multi-Resolution Frame Pack: Each latent token coordinate $(x, y, t)$ receives independent 1D Rotary Position Embeddings (RoPE) occupying $3/8$, $3/8$, and $2/8$ of the hidden state channels, concatenated along the channel dimension and adapted across variable resolutions ($256\text{px} \to 512\text{px} \to 768\text{px}$ progressive training with $v$-prediction and Zero-SNR) via table extrapolation rather than interpolation to preserve high-frequency visual sharpness. Variable-length videos and single-frame images are packed into uniform-shape batches via Multi-Resolution Frame Pack (arXiv:2408.06072v3, Section 2.2 & 3.1).
  3. 3D Full Attention vs. Collapsed 2D+1D Separated Attention: Prior models (Make-A-Video, AnimateDiff) separate spatial (2D) and temporal (1D) attention, which prevents a fast-moving object (such as a person's head displaced diagonally between frame $i$ and frame $i+1$) from directly attending to its previous position except through indirect background tokens (Figure 5). Replacing 3D Full Attention (accelerated via FlashAttention) with separated 2D+1D attention causes severe FVD degradation and training collapse at the 5B scale (arXiv:2408.06072v3, Section 2.2 & 4.1).
  4. Explicit Uniform Timestep Sampling & 35M Dense-Recaptioned Clips: Standard data-parallel diffusion training samples $t \sim \mathcal{U}(1, T)$ independently per GPU rank, causing high loss variance across ranks. CogVideoX partitions $[1, T]$ into $n$ disjoint intervals across the $n$ data-parallel ranks so rank $r$ samples uniformly within its assigned interval, lowering diffusion loss across all timesteps (Section 3.3). Training uses ~35M filtered single-shot video clips (averaging ~6s, screened by 6 Video-LLaMA negative-label filters trained on 20,000 labeled videos plus optical-flow and aesthetic thresholds, and densely recaptioned via Panda70M $\to$ CogVLM frame captions $\to$ GPT-4 / fine-tuned Llama-2 $\to$ end-to-end CogVLM2-Caption on Llama-3) plus 2B filtered images from LAION-5B and COYO-700M (arXiv:2408.06072v3, Section 3.4).
Video Generation Model (arXiv:2408.06072v3, Table 3 & Table 4)VBench Human ActionVBench SceneVBench Dynamic DegreeVBench Multiple ObjectsDynamic Quality (Liao et al.)GPT4o-MTScore (Metamorphic)Blind Human Eval vs. Kling: Physics / Total Score
Runway Gen-2 (Closed Commercial)89.248.9118.8955.4743.62.62—
Pika (Closed Commercial)88.044.8037.2246.6952.12.48—
OpenSora V1.2 (Open DiT)85.842.4747.2258.4163.72.52—
VideoCrafter-2.0 / Show-195.0 / 95.655.29 / 47.0342.50 / 44.4440.66 / 45.4743.6 / 57.72.68 / ——
T2V-Turbo / LaVie-295.2 / 96.455.58 / 49.5949.17 / 31.1154.65 / 64.88—— / 2.46—
Kling (2024.7 Closed Flagship)——————0.561 Physics / 0.638 Sensory / 0.367 Instr. / 2.17 Total
CogVideoX-2B (Open 3D-VAE Expert DiT)96.655.3566.3957.6857.73.09—
CogVideoX-5B (Open 3D-VAE Expert DiT)96.855.4462.2270.9569.53.360.667 Physics / 0.722 Sensory / 0.495 Instr. / 2.74 Total

7. Unified Architectural Comparison & Reference PyTorch Implementation of Latent World Models and JEPA Predictors

To synthesize how world models and joint-embedding predictive architectures evolved from 2018 to 2026, the table below compares their state representations, predictive objectives, collapse-prevention mechanisms, and empirical scaling milestones:

Architecture & Primary SourceLatent Representation & TokenizationPredictive Dynamics / Self-Supervised ObjectiveCollapse & Exploitation Prevention MechanismFlagship Scale & Primary Empirical Benchmark
World Models (V-M-C) (arXiv:1803.10122v4)ConvVAE diagonal Gaussian $z_t \in \mathbb{R}^{32}$ or $\mathbb{R}^{64}$ from $64 \times 64 \times 3$ RGB framesMDN-RNN (256–512 LSTM units, $K=5$ Gaussian mixtures) modeling $P(z_{t+1}, d_{t+1} \mid a_t, z_t, h_t)$VAE Gaussian prior KL + MDN-RNN sampling temperature inflation ($\tau = 1.15$) during dream training4.77M–6.13M total params (867–1,088 C params); 906 &plusmn; 21 CarRacing-v0, 1092 &plusmn; 556 VizDoom dream transfer
DreamerV2 / DreamerV3 (arXiv:2010.02193v4, arXiv:2301.04104v2)RSSM: deterministic GRU $h_t$ + 32 categoricals $\times$ 32 classes ($1,024$-bit sparse vector)Joint ELBO (image, reward, discount log-losses) + $H=15$ latent imagination ($\lambda=0.95$ returns)Asymmetric KL Balancing ($\alpha = 0.8$) + Straight-Through Gradients (V3 adds symlog & free bits)22M params (Atari), 468B imagined states on 1 V100 GPU; 2.15/2.64 Atari Gamer Median; V3 150+ tasks & Minecraft diamond @ 30M steps
I-JEPA (arXiv:2301.08243v3)Unmasked ViT patch embeddings $\mathbf{s}y$ from EMA target encoder $f{\bar{\theta}}$Patch-level $L_2$ regression of $M=4$ output-masked semantic target blocks ($0.15\text{–}0.20$ scale)Asymmetric context/target encoders + EMA target update + multi-block semantic masking (ratio $0.25$)ViT-H/14 & ViT-H/16-448 (630M) in <1,200 GPU-h (>10&times; vs MAE); 81.1% IN1K linear, 77.3% IN1K-1%, 75.0% Clevr/Dist
V-JEPA (arXiv:2404.08471v1)3D spatiotemporal tube tokens ($16 \times 16 \times 2$ frames) across 16-frame clipsPatch-level $\ell_1$ feature regression via 12-layer narrow predictor ($d=384$) conditioned on $\Delta_y$EMA target encoder $\overline{E}\theta$ + stop-grad minimizing Conditional MAD $\nabla\theta \operatorname{MAD}(Y \mid E_\theta(x))$ + ~90% tube maskViT-H/16-384 (630M) on VideoMix2M (2M videos, 270M seen); 81.9%–82.0% K400, 72.2% SSv2, 25.8 AVA, 77.9% IN1K
Genie (arXiv:2402.15391v1)ST-ViViT VQ-VAE (200M params, patch 4, 1,024 codes, $d=32$) + raw-pixel LAM (**$A=8$ codes**)Autoregressive MaskGIT cross-entropy over next-frame tokens $\hat{\mathbf{z}}{2:T}$ with additive latent actions $\tilde{\mathbf{a}}{1:T-1}$Tight VQ action bottleneck ($A=8$) + stop-grad additive action embeddings + QK-norm & Bernoulli $[0.5, 1.0]$ mask10.7B params (10.1B dynamics) on 30k hours (6.8M clips, 942B tokens, 256 TPUv5p); 81.4 FVD tokenizer, 200-shot CoinRun BC
CogVideoX (arXiv:2408.06072v3)Temporally Causal 3D VAE ($8 \times 8 \times 4$ compression, 16 channels) + T5 text embeddingsContinuous latent diffusion ($v$-prediction, Zero-SNR) with 3D Full Attention & 3D-RoPE ($3/8, 3/8, 2/8$)Temporally causal padding + Vision/Text Expert AdaLN + Explicit Uniform Timestep Sampling across ranksCogVideoX-2B & 5B on 35M clips + 2B images (10s, 16 FPS, $768 \times 1360$); 85.5 Flickering / 29.1 PSNR, 69.5 Dynamic Quality, 2.74 vs 2.17 Kling

Below is a clean, self-contained PyTorch reference implementation demonstrating the three core mathematical primitives derived above:

  1. DreamerV2's $32 \times 32$ Categorical Straight-Through Sampler and Asymmetric KL Balancing ($\alpha = 0.8$) (arXiv:2010.02193v4, Algorithms 1 & 2).
  2. V-JEPA's $\ell_1$ Conditional MAD Feature Predictor with EMA Stop-Gradient Target Regression (arXiv:2404.08471v1, Equation 1).
  3. CogVideoX's Modality-Decoupled Vision/Text Expert Adaptive LayerNorm (Expert AdaLN) (arXiv:2408.06072v3, Section 2.2).
from __future__ import annotations

import torch
import torch.nn as nn
import torch.nn.functional as F

def dreamer_categorical_straight_through(logits: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]:
    """Sample 32x32 discrete categorical latents with Straight-Through Gradients (arXiv:2010.02193v4 Alg. 1).

    Args:
        logits: Unnormalized logits of shape (batch_size, num_categoricals=32, num_classes=32).

    Returns:
        Tuple of (flattened_sparse_sample, probs) where flattened_sparse_sample has shape
        (batch_size, 1024) with 32 active bits and carries gradients of softmax(logits).
    """
    probs = F.softmax(logits, dim=-1)
    flat_probs = probs.reshape(-1, probs.shape[-1])
    indices = torch.multinomial(flat_probs, num_samples=1).squeeze(-1)
    one_hot = F.one_hot(indices, num_classes=probs.shape[-1]).to(probs.dtype).reshape_as(probs)
    # Straight-through estimator: forward value is discrete one_hot, backward gradient is d(probs)
    sample = one_hot + probs - probs.detach()
    return sample.flatten(start_dim=-2), probs

def dreamer_kl_balancing_loss(
    posterior_logits: torch.Tensor,
    prior_logits: torch.Tensor,
    alpha: float = 0.8,
) -> torch.Tensor:
    """Compute asymmetric KL Balancing loss for RSSM discrete categorical latents (arXiv:2010.02193v4 Alg. 2).

    Trains the transition prior 4x faster (alpha=0.8) than regularizing the representation posterior (1-alpha=0.2).
    """
    post_dist = torch.distributions.Independent(
        torch.distributions.OneHotCategoricalStraightThrough(logits=posterior_logits), 1
    )
    post_dist_sg = torch.distributions.Independent(
        torch.distributions.OneHotCategoricalStraightThrough(logits=posterior_logits.detach()), 1
    )
    prior_dist = torch.distributions.Independent(
        torch.distributions.OneHotCategoricalStraightThrough(logits=prior_logits), 1
    )
    prior_dist_sg = torch.distributions.Independent(
        torch.distributions.OneHotCategoricalStraightThrough(logits=prior_logits.detach()), 1
    )
    kl_prior = torch.distributions.kl_divergence(post_dist_sg, prior_dist)
    kl_post = torch.distributions.kl_divergence(post_dist, prior_dist_sg)
    return (alpha * kl_prior + (1.0 - alpha) * kl_post).mean()

def vjepa_l1_feature_loss(
    predicted_target_embeddings: torch.Tensor,
    ema_target_embeddings: torch.Tensor,
) -> torch.Tensor:
    """Compute V-JEPA L1 feature prediction objective (arXiv:2404.08471v1 Eq. 1).

    Under L1 regression, the optimal predictor estimates the conditional median median(Y | E_theta(x)),
    and the encoder gradient minimizes the conditional Median Absolute Deviation MAD(Y | E_theta(x)).
    """
    return F.l1_loss(predicted_target_embeddings, ema_target_embeddings.detach())

class CogVideoXExpertAdaLN(nn.Module):
    """Vision and Text Expert Adaptive LayerNorm for concatenated multimodal sequences (arXiv:2408.06072v3 Sec. 2.2)."""

    def __init__(self, hidden_dim: int, timestep_embed_dim: int) -> None:
        super().__init__()
        self.vision_norm = nn.LayerNorm(hidden_dim, elementwise_affine=False, eps=1e-6)
        self.text_norm = nn.LayerNorm(hidden_dim, elementwise_affine=False, eps=1e-6)
        # Independently modulate scale (gamma) and shift (beta) for text and vision feature subspaces
        self.vision_modulation = nn.Sequential(
            nn.SiLU(),
            nn.Linear(timestep_embed_dim, 2 * hidden_dim),
        )
        self.text_modulation = nn.Sequential(
            nn.SiLU(),
            nn.Linear(timestep_embed_dim, 2 * hidden_dim),
        )

    def forward(
        self,
        concat_seq: torch.Tensor,
        t_emb: torch.Tensor,
        num_text_tokens: int,
    ) -> torch.Tensor:
        """Apply modality-specific Expert AdaLN to [z_text ; z_vision] sequence."""
        z_text = concat_seq[:, :num_text_tokens, :]
        z_vision = concat_seq[:, num_text_tokens:, :]

        t_gamma, t_beta = self.text_modulation(t_emb).unsqueeze(1).chunk(2, dim=-1)
        v_gamma, v_beta = self.vision_modulation(t_emb).unsqueeze(1).chunk(2, dim=-1)

        out_text = self.text_norm(z_text) * (1.0 + t_gamma) + t_beta
        out_vision = self.vision_norm(z_vision) * (1.0 + v_gamma) + v_beta
        return torch.cat([out_text, out_vision], dim=1)

if __name__ == "__main__":
    torch.manual_seed(42)
    # 1. Verify DreamerV2 32x32 Categorical Straight-Through & KL Balancing (alpha=0.8)
    post_logits = torch.randn(4, 32, 32, requires_grad=True)
    prior_logits = torch.randn(4, 32, 32, requires_grad=True)
    z_sparse, _ = dreamer_categorical_straight_through(post_logits)
    kl_bal = dreamer_kl_balancing_loss(post_logits, prior_logits, alpha=0.8)
    assert z_sparse.shape == (4, 1024) and torch.all(z_sparse.sum(dim=-1) == 32.0)

    # 2. Verify V-JEPA L1 Feature Regression Loss
    pred_feats = torch.randn(4, 128, 384, requires_grad=True)
    target_feats = torch.randn(4, 128, 384)
    loss_vjepa = vjepa_l1_feature_loss(pred_feats, target_feats)

    # 3. Verify CogVideoX Vision/Text Expert AdaLN
    expert_adaln = CogVideoXExpertAdaLN(hidden_dim=512, timestep_embed_dim=256)
    seq = torch.randn(2, 226 + 1024, 512)
    t_cond = torch.randn(2, 256)
    modulated_seq = expert_adaln(seq, t_cond, num_text_tokens=226)
    assert modulated_seq.shape == seq.shape
    print(f"Verified 32x32 Sparse State: {z_sparse.shape} | KL-Bal: {kl_bal.item():.4f} | V-JEPA L1: {loss_vjepa.item():.4f}")

8. Frequently Asked Questions (FAQ): World Models, JEPA, and Video Simulators

Why do policies trained inside a deterministic learned world model fail when transferred to the real environment, and how did Ha & Schmidhuber solve this? When a controller C optimizes cumulative reward inside an approximate learned dynamics model M while observing M's internal hidden states $h_t$, the optimizer acts as an adversary looking for out-of-distribution loopholes in M's transition dynamics (https://worldmodels.github.io/). In VizDoom: Take Cover, at near-deterministic sampling temperature $\tau = 0.10$, CMA-ES discovered an oscillatory movement policy that prevented the MDN-RNN from transitioning into Gaussian mixture modes where fireballs are launched—achieving a near-perfect $2086 \pm 140$ virtual dream score that collapsed to $193 \pm 58$ in the real environment (worse than a $210 \pm 108$ random policy). By modeling transitions with a stochastic Mixture of Gaussians and inflating the dream sampling temperature to $\tau = 1.15$, the virtual nightmare environment becomes noisier and harder to exploit, enabling the dream-trained policy to transfer zero-shot to the real VizDoom engine at $1092 \pm 556$ time steps (far surpassing the 750-step solved threshold and the $820 \pm 58$ Gym Leaderboard).

Why did DreamerV2 replace continuous Gaussian latent variables with 32 discrete categorical variables of 32 classes each? In DreamerV2 (https://arxiv.org/html/2010.02193v4, Section 2.1 & 3.2), representing the stochastic state $z_t$ as 32 categorical variables with 32 classes each (a sparse binary vector of length 1,024 with 32 active bits, optimized via Straight-Through Gradients) outperformed diagonal Gaussian latents on 42 out of 55 Atari games (increasing Clipped Record Mean from 0.19 to 0.25 and Gamer Median from 1.08 to 1.64 in Table 2 ablations). Mathematically, a categorical transition prior $p_\phi(\hat{z}_t \mid h_t)$ can exactly fit the aggregate posterior across multimodal events because a mixture of categorical distributions is again a categorical distribution, whereas a unimodal Gaussian prior cannot match a mixture of Gaussian posteriors. Additionally, $32/1024$ sparse binary activations provide a natural inductive bias for discontinuous visual events (such as entering new rooms or items disappearing) while avoiding reparameterization gradient scaling instabilities.

Why does I-JEPA mask the output of the target encoder rather than its input, and why is multi-block masking required? In I-JEPA (https://arxiv.org/html/2301.08243v3, Section 3 & Section 9, Table 6), the full unmasked image $\mathbf{y}$ is first processed by the EMA target encoder $f_{\bar{\theta}}$ to compute full contextualized patch embeddings $\mathbf{s}y$, and only then are $M = 4$ target blocks (scale $0.15\text{–}0.20$, aspect ratio $0.75\text{–}1.5$) extracted from the output representations. If the input to the target encoder were masked first, the target representations would lack global semantic context from surrounding image regions. Simultaneously, removing those 4 target blocks from a large context block (scale $0.85\text{–}1.0$, leaving an average visible context ratio of 0.25) forces the predictor $g\phi$ to infer large semantic object parts rather than interpolating local edges—boosting ImageNet-1% linear accuracy to 54.2% compared to 20.2% for single-block masking, 17.6% for random patch masking, and 15.5% for rasterized quadrant masking.

How does V-JEPA prevent representation collapse without contrastive negative samples or pixel reconstruction, and why is Attentive Probing necessary? V-JEPA (https://arxiv.org/html/2404.08471v1, Section 3.1 & Section 4.3) minimizes the $\ell_1$ distance $\|P_\phi(E_\theta(x), \Delta_y) - \operatorname{sg}(\overline{E}\theta(y))\|_1$ between the predictor output and a stop-gradient Exponential Moving Average (EMA) target encoder. Under $\ell_1$ loss, the optimal predictor computes the conditional median $P^\star(E\theta(x)) = \operatorname{median}(Y \mid E_\theta(x))$, and the expected gradient with respect to the encoder $\theta$ equals the gradient of the Conditional Median Absolute Deviation (MAD), $\nabla_\theta \operatorname{MAD}(Y \mid E_\theta(x))$. Because the EMA target encoder evolves slowly while $P_\phi$ stays near-optimal, the encoder $E_\theta$ must capture maximal predictive information about the video to minimize conditional target dispersion. Furthermore, because the $\ell_1$ prediction objective is unnormalized, frozen V-JEPA token features are not organized for simple linear average pooling; using a learnable cross-attention Attentive Probe improves frozen ViT-L/16 single-view accuracy by +17.0 points on Kinetics-400 (56.7% $\to$ 73.7%) and +16.1 points on Something-Something-v2 (50.1% $\to$ 66.2%).

How does Genie learn frame-level action controllability from unlabelled Internet videos without any ground-truth action annotations? In Genie (https://arxiv.org/html/2402.15391v1, Section 2.1 & Section 3.4), a 300M-parameter causal ST-Transformer Latent Action Model (LAM) observes all previous raw pixel frames $\mathbf{x}{1:t}$ together with the next frame $x{t+1}$ and compresses the inter-frame change through a Vector-Quantized (VQ-VAE) bottleneck constrained to a vocabulary of just $|A| = 8$ discrete latent action codes (embedding dimension 32). Because the LAM decoder only receives $(\mathbf{x}{1:t}, \tilde{\mathbf{a}}{1:t})$ to reconstruct $\hat{x}_{t+1}$, the discrete code $\tilde{a}_t \in \{0, \dots, 7\}$ must capture the primary controllable motion between frames. At inference time, the LAM encoder and decoder are discarded, and users or agents index directly into the 8-code VQ codebook to drive the 10.1B MaskGIT dynamics model frame by frame. Crucially, feeding raw pixels rather than VQ video tokens into the LAM preserves fine motion dynamics, increasing controllability $\Delta_t\text{PSNR}$ from 1.33 to 1.91 on Platformers and from 1.65 to 2.07 (while cutting FVD from 257.8 to 136.4) on Robotics.

Why does CogVideoX use an $8 \times 8 \times 4$ Temporally Causal 3D VAE and 3D Full Attention instead of a 2D VAE and separated 2D+1D attention? In CogVideoX (https://arxiv.org/html/2408.06072v3, Section 2.1, Section 2.2 & Section 4.1), 2D image VAEs (SDXL $8 \times 8 \times 1$) encode each video frame independently, causing severe frame-to-frame luminance flickering (93.2 $L_1$ Flickering) and long token sequences. CogVideoX's $8 \times 8 \times 4$ Temporally Causal 3D VAE (16 latent channels) compresses video across both space and time while placing all temporal padding at the start of the convolution window to prevent future frame leakage, achieving 85.5 Flickering and 29.1 PSNR on WebVid (beating Open-Sora at 92.4 / 28.5 and Open-Sora-Plan at 90.2 / 27.6). Inside the diffusion backbone, separated 2D spatial + 1D temporal attention prevents a fast-moving object at coordinate $(x_2, y_2)$ in frame $i+1$ from directly attending to its previous position $(x_1, y_1)$ in frame $i$, causing training instability and collapse at the 5B scale; 3D Full Attention (paired with 3D-RoPE $3/8, 3/8, 2/8$ and Vision/Text Expert AdaLN) enables direct all-to-all spatiotemporal correspondence across 10-second (160-frame) $768 \times 1360$ videos.


9. Primary Technical Sources & Foundations

  1. David Ha & Jürgen Schmidhuber — World Models (Recurrent World Models Facilitate Policy Evolution, NeurIPS 2018, pp. 2451–2463 / arXiv:1803.10122v4 Interactive Paper): https://worldmodels.github.io/
  2. David Ha & Jürgen Schmidhuber — World Models (arXiv:1803.10122 Abstract & Metadata Repository): https://arxiv.org/abs/1803.10122
  3. Danijar Hafner, Timothy Lillicrap, Mohammad Norouzi, Jimmy Ba — Mastering Atari with Discrete World Models (DreamerV2) (ICLR 2021 / arXiv:2010.02193v4 Full Experimental HTML): https://arxiv.org/html/2010.02193v4
  4. Danijar Hafner, Timothy Lillicrap, Jimmy Ba, Mohammad Norouzi — Dream to Control: Learning Behaviors by Latent Imagination (DreamerV1) (ICLR 2020 / arXiv:1912.01603): https://arxiv.org/abs/1912.01603
  5. Danijar Hafner, Jurgis Pasukonis, Jimmy Ba, Timothy Lillicrap — Mastering Diverse Domains through World Models (DreamerV3) (Nature / arXiv:2301.04104v2): https://arxiv.org/abs/2301.04104
  6. Danijar Hafner et al. — DreamerV3 Official Research Project Page & Minecraft Diamond Benchmarks: https://danijar.com/project/dreamerv3/
  7. Mahmoud Assran, Quentin Duval, Ishan Misra, Piotr Bojanowski, Pascal Vincent, Michael Rabbat, Yann LeCun, Nicolas Ballas — Self-Supervised Learning from Images with a Joint-Embedding Predictive Architecture (I-JEPA) (CVPR 2023, pp. 15619–15629 / arXiv:2301.08243v3 Full Experimental HTML): https://arxiv.org/html/2301.08243v3
  8. Mahmoud Assran et al. & Yann LeCun — I-JEPA CVPR 2023 Open Access Proceedings Page: https://openaccess.thecvf.com/content/CVPR2023/html/Assran_Self-Supervised_Learning_From_Images_With_a_Joint-Embedding_Predictive_Architecture_CVPR_2023_paper.html
  9. Adrien Bardes, Quentin Garrido, Jean Ponce, Xinlei Chen, Michael Rabbat, Yann LeCun, Mahmoud Assran, Nicolas Ballas — Revisiting Feature Prediction for Learning Visual Representations from Video (V-JEPA) (Meta FAIR 2024 / arXiv:2404.08471v1 Full Experimental HTML): https://arxiv.org/html/2404.08471v1
  10. Jake Bruce, Michael Dennis, Ashley Edwards, Jack Parker-Holder, Yuge Shi, Edward Hughes, Matthew Lai, Aditi Mavalankar, Tim Rocktäschel et al. — Genie: Generative Interactive Environments (Google DeepMind 2024 / arXiv:2402.15391v1 Full Experimental HTML): https://arxiv.org/html/2402.15391v1
  11. Zhuoyi Yang, Jiayan Teng, Wendi Zheng, Ming Ding, Shiyu Huang, Jiazheng Xu, Yuanming Yang, Wenyi Hong, Xiaotao Gu, Yuxiao Dong, Jie Tang et al. — CogVideoX: Text-to-Video Diffusion Models with An Expert Transformer (ICLR 2025, Tsinghua University & Zhipu AI / arXiv:2408.06072v3 Full Experimental HTML): https://arxiv.org/html/2408.06072v3
🔗 Share Post

Reading next story...

Back to Feed