Slot Structured World Models

Jonathan Collu, Riccardo Majellaro, Aske Plaat, Thomas M. MoerlandarXiv 2024

TL;DR

Slot Structured World Models (SSWM) combine the competitive attention of Slot Attention encoders with iterative Graph Neural Networks to better perceive and reason about object interactions. By successfully disentangling identical-looking objects and modeling multi-object "chain reaction" collisions, SSWM significantly outperforms previous state-of-the-art models in complex physical environments.

What Problem Does This Paper Address?

To build truly intelligent agents, machines need to understand the world as a collection of individual objects that interact with one another. Current state-of-the-art "structured world models," such as Contrastively Learned Structured World Models (C-SWM), attempt this by using a standard feedforward convolutional encoder to extract object features and a Graph Neural Network (GNN) to predict how those features change over time.

However, these models face a major hurdle: the binding problem. Standard feedforward encoders often fail to distinguish between multiple objects that look the same (e.g., two identical red circles). They might conflate these objects into a single feature map, making it impossible for the downstream GNN to model their individual interactions correctly. Furthermore, these architectures often have a hard-coded limit on the number of objects they can "see."

Methods

The authors introduce Slot Structured World Models (SSWM) to fix these representation gaps. The architecture consists of two main components:

  1. Object-Centric Encoder (Slot Attention): Instead of a simple feedforward pass, SSWM uses Slot Attention. This mechanism employs an iterative, competitive attention process where "slots" compete to explain parts of the input image. This competition naturally forces the model to bind individual objects to distinct slots, even if they have identical appearances.
  2. Iterative GNN Dynamics: To handle complex physics, the authors adapted the transition model. In environments where one object pushes another, which then pushes a third (a chain of collisions), a single round of GNN message-passing isn't enough. SSWM uses an Iterative GNN procedure (Algorithm 1) that runs multiple times per timestep to propagate "forces" through the latent graph.
Figure 2: Architectural design of Slot Structured World Models. Given an input image (left), we use a pretrained Slot Attention encoder to produce a set of object-centric embeddings (zt) that capture the objects (and background) in the scene. These latent embeddings are then fed together with the chosen action into an iterative GNN transition module (defined in Algorithm 1) to predict the change in the next latent state (∆zt). The graph-based transition model is trained to minimize the (object- wise) L2-norm between the latent prediction (zt + ∆zt) and the Slot Attention embedding of the true next state (zt+1).

The model is trained using an object-wise L2 loss in the latent space, comparing the predicted next state to the encoding of the actual next frame.

Datasets

The researchers evaluated their model on a new benchmark called Interactive Spriteworld.

  • Original Spriteworld: A common benchmark where sprites move but simply overlap when they touch.
  • Interactive Spriteworld: An extension introduced in this paper that adds simple physical rules. If the agent (a small white sprite) pushes an object into another, the second object is pushed away.

This environment is significantly more challenging because the model must represent not just position, but also the exact shape and size of objects to determine the precise moment of contact.

Key Insights and Ideas

  • Disentanglement is Essential for Dynamics: The paper demonstrates that if an encoder cannot separate identical objects, the dynamics model is doomed to fail when those objects interact. Slot Attention provides the "object-centric" bias needed to solve this.
  • Force Propagation via Iteration: The move from a standard GNN to an iterative one is a clever way to mimic physical causality. By iterating the GNN $K-1$ times (where $K$ is the number of slots), the model can "calculate" how a movement at one end of a chain affects objects at the other end.
  • Latent Quality vs. Loss: Interestingly, the baseline C-SWM could minimize its training loss effectively but failed to generalize to new scenes. This suggests that standard contrastive losses might allow models to find "shortcuts" to identify states without actually learning the underlying object properties like shape.
Figure 1: Comparison of object masks learned by C-SWM (baseline, top row) (Kipf et al., 2019) on Shapes 2D and SSWM (our method, bottom row) on Interactive Spriteworld. The left image of each row shows the input image, while the five images next to it show the learned object masks (encoder output) that enter the GNN. Top: The input image contains two duplicate objects (red circles and red triangles), which the C-SWM encoder cannot disentangle and instead conflates in a single embedding (for example, the two red circles end up in both the first and fourth embedding). These embeddings will make modeling of pairwise object interactions in the downstream GNN less effective. Bottom: In contrast, our SSWM method can disentangle the duplicate items in the input image (orange circles) into distinct slots, due to the object-centric competitive attention mechanism in the Slot Attention encoder. This allows for more effective modeling of object interaction in the downstream GNN, as we show in the Results section.

Key Results

SSWM consistently outperformed the C-SWM baseline across all metrics (Hits at Rank 1 and Mean Reciprocal Rank) and all test scenarios:

  • 1-Step Prediction: SSWM achieved near 100% accuracy on unseen instances.
  • Multi-Step Prediction: The gap between SSWM and the baseline widened as the prediction horizon increased. For 10-step predictions involving chains of collisions (the hardest task), SSWM maintained a 68.3% H@1 score, while C-SWM plummeted to 19.3%.
  • Qualitative Success: Decoded latent predictions show that SSWM accurately captures the motion of multiple objects being pushed in a chain, whereas baselines struggle to maintain object identity and shape.
Qualitative results showing SSWM's ability to predict multi-object interactions over 1, 5, and 10 steps.

Limitations and Future Work

  • Compounding Errors: Like all auto-regressive models, SSWM suffers from error accumulation over very long horizons (e.g., beyond 10 steps).
  • Fixed Slot Initialization: In the current experiments, the number of slots is fixed at inference time. While Slot Attention can theoretically handle a variable number of objects, the authors noted that training a flexible slot initialization distribution is a task for future work.
  • End-to-End Training: The current version uses a pre-trained encoder. The authors suggest that training the entire system end-to-end might further improve the quality of the learned representations for specific downstream tasks.
  • Reinforcement Learning: The ultimate goal is to use these structured world models for model-based RL, which remains an open area for testing.

Summary updated

BibTeX
@misc{collu2024slot,
  author = {Jonathan Collu and Riccardo Majellaro and Aske Plaat and Thomas M. Moerland},
  title = {{Slot Structured World Models}},
  year = {2024},
  eprint = {2402.03326},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.03326},
}
Figure