Object-Centric and Relational Worlds › Relations, Graphs, and Message Passing
World Models HandbookAll chapters Object-Centric and Relational Worlds › Relations, Graphs, and Message PassingOne section · Sections in this chapter4 / 11 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Once the scene is a set of objects, the natural language for how they influence each other is a graph. Objects are nodes; relations, known or learned, are edges. Graph representations give us a principled way to write dynamics that depend on which objects interact, not just on the global scene. The move from sets to graphs is the move from "there are things" to "these things affect each other in these ways," and it is the second half of the structured bet.
Graphs as a Representation
Formally, a graph-structured scene is a tuple : nodes with per-object states (position, velocity, pose, appearance summary), edges with per-relation attributes (distance, contact type, spring rest length, relative velocity), and optionally a global attribute describing scene-level context (gravity, table friction). The three levels of the tuple are worth keeping separate in your head, because different physical regularities live at different levels: forces between objects live on edges, intrinsic object behavior and damping live on nodes, and uniform fields and shared environment properties live in the global attribute. Battaglia and colleagues (2018) made the influential argument that this "graph network" block generalizes a large family of models, from interaction networks to transformers, and that the choice of graph is a statement of relational inductive bias: an assumption about which interactions can matter.
The bias is a commitment. A fully connected graph assumes any object may affect any other; a sparse spatial graph assumes locality. Getting this wrong can waste computation or omit relevant interactions. With objects, a complete graph has edge activations, so memory and compute grow quadratically even though a shared edge function keeps parameter count fixed. Sparse graphs are useful when their construction covers the interaction support.
The quadratic cost of the dense choice is easy to state and easy to see.
import numpy as np
n_values = np.arange(4, 41)
k_nn = 2
full_edges = n_values * (n_values - 1) / 2
k_regular_edges = n_values * k_nn / 2
At forty objects the dense graph carries nearly twenty times the edges of this ideal 2-regular graph. This analytic line is not the exact count of the union-symmetrized -nearest-neighbor builder used later: that data-dependent construction can contain between and undirected edges depending on reciprocal choices.
For systems whose direct interactions are local in space, a -nearest-neighbor or radius graph can be a cheap approximation when its edges cover the true interaction support. The risk is explicit: -nearest neighbors can omit contacts in dense regions or add irrelevant neighbors in sparse ones, while fixed-radius graphs omit long-range effects and cannot express mediated influence in one hop.
The Message-Passing Update
Many graph-based dynamics models use a variant of one update, applied one or more times. The recipe has three stages: compute a message per edge, aggregate messages per node, and update each node's state. For every edge from sender to receiver , an edge function computes a message:
Each node aggregates its incoming messages with a permutation-invariant reduction (sum, mean, max, or set attention with shared order-independent scoring):
and a node function produces the next node state:
where:
- , : the current states of sender node and receiver node
- : the attributes of the edge from sender to receiver
- : the learned edge function, shared across all edges
- : the message computed on the edge from sender to receiver
- : the set of nodes with an edge into node , the in-neighborhood of
- : a permutation-invariant reduction, including sum, mean, max, or order-independent set attention
- : node 's aggregated incoming message
- : the learned node function, shared across all nodes
- : the next state of node , one message-passing round later
A global update over aggregated node and edge summaries can weave in scene-level context. Three properties of this recipe carry the real weight:
- Permutation invariance of aggregation. Sum, mean, and max do not depend on neighbor order, so the same parameters can be applied to variable-size compatible graphs. Sum preserves the vector total: six equal, co-directed forces yield six times one force, while general force vectors can differ or cancel. Mean instead normalizes by degree.
- Parameter sharing across edges and nodes. One edge function is applied everywhere. A learned rule can transfer across pairs when relation types, feature semantics, and physical regimes match.
- Composition. After synchronous local rounds, information can travel up to hops. Dependence across a path requires at least its graph distance in rounds unless a global solver or nonlocal edge supplies a shortcut.
Transformer self-attention can also be viewed as message passing on a complete graph with attention-weighted aggregation. Key differences include initialization, normalization, iterative recurrent slot updates, exchangeability, and the decoder and training objective. Slot Attention allocates each input's unit weight across slots, creating competition that encourages a partition; standard attention normally lets each query normalize independently over keys. We develop the transformer side in Transformers and Neural State-Space Architectures.
Finally, a symmetry note. Absolute position can often be replaced by relative position and relative velocity , while retaining necessary invariant attributes such as mass, type, and spring rest length. When all inputs and operations respect translation symmetry and there are no position-dependent fields or boundaries, this makes translation invariance automatic. Rotation-equivariant architectures such as the equivariant graph networks of Satorras and colleagues (2021) further restrict the hypothesis class and can improve sample efficiency when that symmetry is valid on the evaluated task.