Clockwork Variational Autoencoders

Vaibhav Saxena, Jimmy Ba, Danijar Hafner

Abstract

Video prediction requires capturing both fine-grained motion and long-term context. Standard models often struggle with long horizons due to error accumulation or the computational constraints of high-frequency processing. We present Clockwork Variational Autoencoders (CW-VAE), which utilize a temporal hierarchy where higher-level latent variables operate at slower clock speeds. This allows the model to efficiently represent stable, global features while lower levels handle rapid changes. Our experiments across diverse datasets, including a 1,000-frame Moving MNIST challenge, demonstrate that CW-VAE significantly outperforms existing state-of-the-art models in long-term accuracy and identity preservation.

Introduction

Predicting the future of a video is notoriously difficult because it requires understanding both immediate motion (like a person's step) and long-term context (where that person is walking). Existing models generally fall into two categories: temporally autoregressive models, which predict one frame at a time and suffer from massive error accumulation, and latent dynamics models, which predict transitions in a compressed space. However, even latent models typically operate at the same frequency as the input video. This makes it computationally expensive and mathematically difficult to "remember" information over hundreds of frames, as the model must process every intermediate step to reach the distant future.

Methods

The Clockwork VAE (CW-VAE) addresses these challenges by introducing a temporal hierarchy to the latent space. It builds upon the Recurrent State-Space Model (RSSM) but organizes latent variables into discrete levels.

  • Temporal Abstraction: Each level in the hierarchy runs at a different speed. For example, while the base level (Level 1) processes every frame, Level 2 might only "tick" every 6 frames, and Level 3 every 36 frames.
  • Top-Down Context: Higher (slower) levels provide context to the levels below them. Because they change slowly, they naturally learn to represent global, stable features of the scene.
  • Fixed Clock Speeds: Unlike previous models that attempt to learn when to transition, CW-VAE uses simple, fixed intervals. This simplicity facilitates training and proves surprisingly effective at partitioning information.
The hierarchical architecture of the Clockwork VAE. Higher levels provide top-down context to lower levels at fixed, slower intervals.

The model is trained using the Evidence Lower Bound (ELBO), balancing reconstruction accuracy with a KL-regularizer that encourages efficient use of the hierarchical structure. Higher levels pay a smaller "penalty" to store information because they tick less frequently, incentivizing the model to store long-term, stable information at the top of the hierarchy.

Experimental Setup

The model was evaluated on four diverse datasets to test the limits of sequence length:

  1. MineRL Navigate: A benchmark using Minecraft gameplay requiring 500-frame predictions through 3D worlds.
  2. KTH Action: A classic dataset of humans performing actions like walking or clapping.
  3. GQN Mazes: 3D maze navigation with randomized textures.
  4. Moving MNIST: Two digits bouncing within a frame, tested up to 1,000 frames.

Key Results

CW-VAE demonstrated a clear lead over strong baselines like RSSM, SVG, and VTA across all benchmarks. Quantitatively, CW-VAE achieved the best Mean Rank (2.25) across all datasets and metrics (SSIM, PSNR, LPIPS, and FVD).

Qualitatively, the model's ability to preserve identity is its most striking feature. In the 1,000-frame Moving MNIST test, CW-VAE was the only model that consistently remembered the identity of the digits until the end of the sequence, whereas baseline models often collapsed into artifacts or lost digit structure after a few hundred frames.

Long-term prediction on Moving MNIST up to 1,000 frames. Red 'X' marks indicate where baseline models fail to maintain digit identity or structure.

On the Minecraft benchmark, CW-VAE remained accurate for over 400 frames, while prior models failed or collapsed after roughly 150 frames. The model naturally partitions information: top levels learn global features (like wall textures), while fast-ticking lower levels handle ephemeral details (like specific camera positions).

Discussion and Future Work

While CW-VAE is a significant step forward for long-term prediction, some limitations remain. Currently, the model is trained on 100-frame sequences, meaning the highest levels may only "tick" a few times during training, potentially limiting their ability to learn complex transitions. Additionally, the use of relatively small convolutional networks can lead to slightly blurry predictions compared to GAN-based approaches. Future work will focus on scaling the architecture and developing better metrics for long-term "plausibility" where ground truth becomes one of many possible futures.

Summary updated

BibTeX
@inproceedings{saxena2021clockwork,
  author = {Vaibhav Saxena and Jimmy Ba and Danijar Hafner},
  title = {{Clockwork Variational Autoencoders}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure