Variational Causal Dynamics: Discovering Modular World Models from Interventions

Anson Lei, Bernhard Schölkopf, Ingmar Posner

Abstract

Latent world models allow agents to reason about complex environments with high-dimensional observations. However, adapting to new environments and effectively leveraging previous knowledge remain significant challenges. We present Variational Causal Dynamics (VCD), a structured world model that exploits the invariance of causal mechanisms across environments to achieve fast and modular adaptation. By causally factorising a transition model, VCD is able to identify reusable components across different environments. This is achieved by combining causal discovery and variational inference to learn a latent representation and transition model jointly in an unsupervised manner. Specifically, we optimise the evidence lower bound jointly over a representation model and a transition model structured as a causal graphical model. In evaluations on simulated environments with state and image observations, we show that VCD is able to successfully identify causal variables, and to discover consistent causal structures across different environments. Moreover, given a small number of observations in a previously unseen, intervened environment, VCD is able to identify the sparse changes in the dynamics and to adapt efficiently. In doing so, VCD significantly extends the capabilities of the current state-of-the-art in latent world models while also comparing favourably in terms of prediction accuracy.

Introduction

Deep reinforcement learning agents increasingly rely on "world models" to predict future states and plan actions. However, most contemporary world models, such as the Recurrent State Space Model (RSSM), are monolithic. They utilize a single, large neural network to represent the entirety of an environment's transition dynamics. This entanglement of physical properties makes adaptation difficult; a minor change in environment physics—such as a change in surface friction or object mass—requires retraining the entire network to avoid catastrophic interference.

In contrast, humans adapt quickly because we perceive the world as a collection of modular, independent causal mechanisms. We can recognize which specific physical rule has changed while keeping the rest of our internal model intact. Variational Causal Dynamics (VCD) aims to bridge this gap by bringing modular, causal reasoning to latent world models.

Methodology: Variational Causal Dynamics

VCD structures the transition model as a Causal Graphical Model (CGM), moving away from monolithic architectures toward a system of independent, reusable components. The framework is built upon several key pillars:

Independent Causal Mechanisms (ICM)

Following the ICM principle, VCD assumes that the generative process of a system is composed of autonomous modules. Instead of a single transition function, VCD learns a separate conditional distribution for each dimension of the latent space. This factorization allows the model to isolate specific physical behaviors.

Overview of the VCD training and rollout pipeline, highlighting the modular VCD transition block.

Differentiable Causal Discovery

To determine the relationships between these latent variables, VCD incorporates techniques from Differentiable Causal Discovery with Interventional data (DCDI). It learns a sparse adjacency matrix—a causal graph—that dictates which latent variables serve as "parents" for others during a transition. This graph is learned end-to-end alongside the latent representation.

Joint Variational Learning

Crucially, VCD does not require pre-defined abstract variables. It learns the latent representation and the causal structure simultaneously by optimizing an Evidence Lower Bound (ELBO) augmented with sparsity regularizers. This sparsity acts as a "disentanglement engine": to achieve a sparse causal graph, the model is incentivized to align its latent dimensions with the actual independent physical variables of the system.

The transition model structured as a causal graphical model, where actions and latent variables influence future states through a factorized transition function.

Experimental Evaluation

The model was evaluated on a simulated 2D multi-body system featuring four particles interacting via springs and electrostatic forces. The researchers tested VCD on two types of data: mixed-state observations (affine transformations of ground-truth positions) and raw 128x128 RGB images. To test adaptation, 18 different interventions were introduced, such as removing springs, altering masses, or constraining movement to specific axes.

Results and Discussion

Superior Disentanglement and Accuracy

VCD achieved significantly higher Mean Correlation Coefficient (MCC) scores than the RSSM baseline (e.g., 0.975 vs. 0.728 in mixed-state tasks). This indicates that VCD learns a much cleaner mapping to the underlying physical variables. Furthermore, visualizations confirmed that VCD correctly identifies which latent dimensions correspond to specific particles and their coordinates.

Rapid Modular Adaptation

By identifying the "Sparse Mechanism Shift" (the specific rules that changed between environments), VCD avoids the slow relearning typical of black-box models. In unseen environments, VCD adapted to new physical constraints using as few as 1 to 10 trajectories, whereas baseline models required hundreds of trajectories to reach comparable accuracy.

Conclusion

Variational Causal Dynamics represents a significant step toward more robust and adaptable world models. By combining causal discovery with variational inference, it learns modular representations that mirror the independent mechanisms of the physical world. While current limitations include the assumption of static graphs and challenges in scaling to highly complex visual scenes, VCD provides a powerful framework for building agents that can reason about and adapt to a changing world.

Summary updated

BibTeX
@article{lei2023variational,
  author = {Anson Lei and Bernhard Schölkopf and Ingmar Posner},
  title = {{Variational Causal Dynamics: Discovering Modular World Models from Interventions}},
  journal = {Accepted by TMLR},
  year = {2023},
  url = {https://openreview.net/forum?id=V9tQKYYNK1},
}
Figure