NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Temporal Predictive Coding For Model-Based Planning In Latent Space

Tung D. Nguyen, Rui Shu, Tuan Pham, Hung Bui, Stefano Ermon

Introduction

Standard model-based reinforcement learning (MBRL) often fails in complex environments because it tries to reconstruct every pixel, including distracting backgrounds. Reinforcement learning (RL) from high-dimensional pixels is notoriously sample-inefficient. To solve this, model-based approaches like Dreamer learn a "world model"—a compact latent representation of the environment—and then plan within that space.

However, most world models rely on reconstruction-based objectives: they try to learn an encoder and decoder that can perfectly recreate the original image. The problem is that in the real world, most pixels are "nuisance" information. If you are training a robot to pick up a cup in a busy kitchen, the movement of people in the background is irrelevant to the task. A reconstruction loss forces the model to waste its limited capacity trying to model those people, often at the expense of the task-relevant cup.

This paper introduces Temporal Predictive Coding (TPC), a method that learns to ignore "nuisance" information by focusing only on elements of the environment that are predictable over time, leading to much more robust planning in noisy, real-world-like settings.

Methods: From Reconstruction to Prediction

The authors propose a shift from reconstruction to prediction. Instead of asking "What does the current frame look like?", the model asks "What information from the past helps me predict the future?"

Key components of their approach include:

  • Temporal Predictive Coding (TPC): Using an information-theoretic objective, the model maximizes the mutual information between the past trajectory (latent states and actions) and the future latent state. This is implemented via a contrastive loss (InfoNCE), where the model must distinguish the "correct" future state from a set of "negative" samples from other trajectories.
  • Recurrent State Space Model (RSSM): They integrate TPC into a recurrent architecture that maintains a deterministic hidden state ($h_t$) and a stochastic latent state ($s_t$).
  • Dynamics Consistency: To ensure the learned world model is actually useful for planning, they add a consistency loss that encourages the latent dynamics model to accurately predict the next latent code.
  • Preventing Map Collapse: Purely contrastive models can sometimes "collapse," where the encoder maps every observation to the same point to achieve perfect consistency. The authors prevent this by adding a variant of Static Predictive Coding (SPC), which ensures the latent space remains spread out and representative of the input.
Graphical model of Temporal Predictive Coding (TPC)

Datasets and Key Insights

The model was evaluated on the DeepMind Control (DMC) Suite, a standard benchmark for continuous control. To test robustness, the authors created two challenging variants:

  1. Natural Background DMC: The standard static backgrounds are replaced with dynamic, complex videos from the Kinetics dataset (e.g., driving, people dancing).
  2. Random Background DMC: The background changes completely at every single time step, creating a scenario where only the agent itself is temporally predictable.

Predictability as a Filter

The core insight of TPC is that task-relevant information (like the agent's body or the object it's manipulating) is usually temporally predictable and influenced by actions. Nuisance information (like a noisy background) is often either unpredictable or independent of the agent's actions. By optimizing for temporal prediction, the model automatically filters out the noise.

The Reconstruction Trap

The paper demonstrates that reconstruction is actually a liability in complex scenes. While reconstruction-based models like Dreamer try to recreate the background and lose the agent in the process, TPC's latent space ignores the background entirely, focusing its fidelity on the agent. Furthermore, the authors prove that temporal contrast is superior to previous "static" contrastive objectives because it specifically targets the dynamics needed for planning.

Key Results

  • Standard Setting: TPC is competitive with state-of-the-art models like Dreamer, proving that you don't lose performance in simple environments by ditching reconstruction.
  • Natural Backgrounds: This is where TPC shines. While Dreamer fails to achieve any meaningful reward in these complex settings, TPC maintains high performance, significantly outperforming other robust baselines like CVRL and DBC.
Performance of TPC vs. baselines on Natural Backgrounds
  • Visual Evidence: In the "Random Background" experiment, the authors trained a decoder just to see what the latents "saw." TPC's reconstructions showed a clear agent against a grey blur, while Dreamer's reconstructions were a mess of background noise where the agent was invisible.

Limitations and Future Work

While highly effective, TPC has a few limitations:

  • Small Signal-to-Noise Ratio: TPC still struggles on tasks like Hopper Hop or Cup Catch when the background is very complex. In these cases, the agent is so small relative to the screen that the model has difficulty "finding" the predictable signal amidst the noise.
  • Predictable Nuisances: Theoretically, if a background distractor is also highly predictable (like a clock on the wall), TPC might still encode it. The authors suggest that the finite capacity of the neural network might naturally prioritize the "easiest" or most "usable" predictable information (the agent), but this remains an area for deeper theoretical study.

Summary updated

BibTeX
@inproceedings{nguyen2021temporal,
  author = {Tung D. Nguyen and Rui Shu and Tuan Pham and Hung Bui and Stefano Ermon},
  title = {{Temporal Predictive Coding For Model-Based Planning In Latent Space}},
  booktitle = {International Conference on Machine Learning},
  year = {2021},
  url = {https://openreview.net/forum?id=iHM5vf5tgyG},
}
Figure