Factorizing Declarative and Procedural Knowledge in Structured, Dynamical Environments

Anirudh Goyal, Alex Lamb, Phanideep Gampa, Philippe Beaudoin, Charles Blundell, Sergey Levine, Yoshua Bengio, Michael Curtis Mozer

In the world of deep learning, we often treat neural networks as "black boxes" with monolithic hidden states. While powerful, these models frequently struggle with systematicity: the ability to apply a learned rule (like how a ball bounces or an enemy moves) consistently across different objects in a scene.

A paper presented at ICLR 2021, Factorizing Declarative and Procedural Knowledge in Structured, Dynamical Environments, introduces a novel architecture called SCOFF to solve this limitation. By borrowing concepts from cognitive science and object-oriented programming, the authors demonstrate how we can build AI that understands the world as a collection of distinct entities governed by shared rules.

TL;DR

SCOFF (Schema / Object-File Factorization) is a recurrent neural network architecture that separates declarative knowledge (the state of an object) from procedural knowledge (the rules of how objects behave). By using attention mechanisms to match objects to shared "schemata," the model achieves superior generalization and interpretability in complex, dynamic environments like video games and physics simulations.

The Problem with Monolithic Hidden States

Standard recurrent networks, such as LSTMs or GRUs, store everything they know in one large, continuous vector. If a model is watching a video game with two identical enemies, it might correctly predict the path of one but fail on the other because it hasn't "factorized" the knowledge. It fails to realize that the rule for movement is exactly the same, even if the positions are different.

This lack of systematicity makes models brittle. They require massive amounts of data to learn that the same laws of physics apply to every object in a scene. The authors aim to bridge this gap by enforcing a structural "separation of concerns."

Methods: The SCOFF Architecture

The authors propose SCOFF, which treats the hidden state not as a single vector, but as a set of distinct Object Files (OFs). The architecture operates in four primary steps:

SCOFF Architecture: The model processes an image through a CNN, uses spatial attention to populate Object Files, and applies shared Schemata to update their states.
  1. Encoder: A Convolutional Neural Network (CNN) processes the input image into a deep embedding that preserves spatial information.
  2. Spatial Attention: Each Object File "competes" for regions of the input. An OF representing a specific ghost in a game of PacMan will use attention to "look" only at that specific ghost.
  3. Schema Selection & Update: This is the core innovation. Instead of having internal weights, each OF selects a Schema (a set of shared procedural rules) to update its state. This selection is done using a Gumbel-Softmax distribution, allowing for "hard" categorical choices that remain differentiable during training.
  4. Communication: OFs can pass messages to one another (e.g., to handle collisions or interactions), again using an attention mechanism.

This design closely mirrors Object-Oriented Programming (OOP): Object Files act as instances of a class, while Schemata act as the methods that operate on those instances.

Key Insights and Interpretability

SCOFF introduces several critical advantages over traditional RNNs:

  • Types vs. Tokens: SCOFF explicitly handles the distinction between types (the general category or schema) and tokens (the specific instance or object file). This is a fundamental concept in human cognition that most AI models ignore.
  • Exchangeability: Because the Object Files are placeholders and the Schemata are shared, the model's behavior is independent of which "slot" an object occupies. This leads to significantly better "out-of-distribution" generalization.
  • Interpretability: You can actually "see" what the model is thinking. By looking at which schema is active for a specific Object File, researchers can identify if the model has correctly categorized an object's behavior.
Interpretability in SCOFF: The model maps specific objects (Object Files A-E) in a PacMan environment to shared behavioral rules (Schemata) like 'PacMan', 'Normal Ghost', or 'Scared Ghost'.

For example, in a PacMan environment, the model learns to dynamically assign a "Normal Ghost" schema or a "Scared Ghost" schema to different enemy entities based on the game state, providing a transparent window into its decision-making process.

Datasets and Key Results

The model was evaluated on several benchmarks designed to test physical reasoning and modularity, including synthetic video of moving balls, the BabyAI grid-world, and the IntPhys (Intuitive Physics) benchmark.

  • Superior Generalization: In the BabyAI maze task, SCOFF reached its goal in 82% of trials, significantly outperforming a standard GRU baseline (56%).
  • Long-term Accuracy: On the Bouncing Balls dataset, SCOFF's error rate for 30-step-ahead predictions was dramatically lower than both standard RNNs and other modular architectures like RIMs (Recurrent Independent Mechanisms).
  • Physics Intuition: SCOFF outperformed state-of-the-art models on the IntPhys benchmark, showing a better "understanding" of when objects should disappear or change shape.
  • Efficiency: Because it uses block-sparse structures and shared parameters, SCOFF often requires fewer total parameters than the modular models it competes against.

Limitations and Future Work

While SCOFF is a major step forward, the authors note a few areas for growth. The current model assumes a fixed number of Object Files; integrating more advanced, unsupervised entity discovery (like MONet or Slot Attention) could make the model more flexible for complex real-world scenes. Additionally, scaling this architecture from simple environments to high-resolution, "in-the-wild" video remains an ongoing challenge.

Reference: Goyal, A., Lamb, A., Gampa, P., Beaudoin, P., Levine, S., Blundell, C., Bengio, Y., & Mozer, M. (2021). Factorizing Declarative and Procedural Knowledge in Structured, Dynamical Environments. Published as a conference paper at ICLR 2021.

Summary updated

BibTeX
@inproceedings{goyal2021factorizing,
  author = {Anirudh Goyal and Alex Lamb and Phanideep Gampa and Philippe Beaudoin and Charles Blundell and Sergey Levine and Yoshua Bengio and Michael Curtis Mozer},
  title = {{Factorizing Declarative and Procedural Knowledge in Structured, Dynamical Environments}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure