Learning Graph Cellular Automata

Daniele Grattarola, Lorenzo Livi, Cesare Alippi

Introduction

This paper generalizes the concept of Neural Cellular Automata (NCA) from regular grids to arbitrary, irregular graphs using Graph Neural Networks (GNNs). By introducing Graph Neural Cellular Automata (GNCA), the authors demonstrate that GNNs can successfully learn local transition rules that drive complex, emergent global behaviors across discrete, continuous, and dynamic graph structures.

The Challenge: Moving Beyond the Grid

Traditional Cellular Automata (CA), like Conway's Game of Life, operate on regular lattices (e.g., 2D grids) where every cell has a fixed number of neighbors. Recently, researchers have successfully used Convolutional Neural Networks (CNNs) to learn the transition rules of these grid-based CAs.

However, most real-world distributed systems—such as flocking birds, social networks, or cyber-physical systems (like autonomous vehicle fleets)—do not exist on neat grids. They exist on irregular, sometimes dynamic, graphs. The authors tackle the challenge of extending NCA to these irregular domains. They ask: Can we use Graph Neural Networks to learn the local interaction rules of a Graph Cellular Automaton (GCA) to achieve a desired global state or simulate a complex multi-agent system?

Methods: Graph Neural Cellular Automata

The authors propose the Graph Neural Cellular Automaton (GNCA). They build on the mathematical parallel that just as CNNs are perfectly suited for grid-based CAs, GNNs are the natural fit for GCAs.

GNCA Architecture

The GNCA architecture consists of three main differentiable blocks:

  1. Pre-processing MLP: Transforms the current state of a node into a latent representation.
  2. Message-Passing Layer: Aggregates information from neighboring nodes. This step can incorporate edge attributes (e.g., distance or direction) to allow for anisotropic rules, meaning a cell can treat different neighbors differently.
  3. Post-processing MLP: Takes the aggregated messages and the node's current state to compute the node's state for the next time step.

To train the GNCA to converge to a specific target state, the authors use Backpropagation Through Time (BPTT). To ensure the system remains stable once it reaches the target (and doesn't just immediately diverge), they employ a state cache (replay memory) during training. This forces the network to practice applying its rules to states it has already generated, encouraging the creation of stable attractors.

Experimental Domains

The authors evaluate GNCA on three distinct simulated environments rather than traditional static datasets:

  1. Voronoi Tessellation (Static/Discrete): A binary-state GCA defined on the Delaunay triangulation of 1,000 random 2D points.
  2. Boids Algorithm (Dynamic/Continuous): A classic multi-agent flocking simulation with 100 agents. The graph is dynamic (edges are based on a fixed-radius neighborhood that changes as boids move), and states are continuous (position and velocity).
  3. Geometric Point Clouds (Target Convergence): Several geometric graphs from the PyGSP library, including a 2D grid, the Stanford bunny, the Minnesota road network, the PyGSP logo, and a Swiss roll manifold. The target states are the 2D or 3D coordinates of the nodes.

Key Insights and Results

Theoretical and Structural Insights

  • GNNs are Universal GCA Approximators: The authors show that their GNCA architecture is expressive enough to represent any arbitrary GCA with a finite and discrete state space, and they conjecture it extends to continuous state spaces as well.
  • Minimal Implementations Exist: For known rules (like a density-based threshold rule), the GNCA doesn't need to be a massive black box. The authors demonstrate that the rule can be perfectly distilled into a tiny network (e.g., an MLP with just 2 hidden neurons mimicking an XOR gate).
  • Local Rules Yield Global Coordination: In the point cloud experiments, the GNCA successfully learns local message-passing rules that cause a randomly initialized jumble of nodes to self-organize into complex global shapes (like the Stanford bunny), proving that emergent global coordination can be learned end-to-end.

Empirical Performance

Training Results Source, p. 5

Training Results
  • Voronoi GCA: The GNCA quickly reaches ~100% validation accuracy in predicting the next discrete state. When left to evolve autonomously, it maintains a robust approximation of the true system's entropy without diverging.
  • Boids Flocking: The model achieves a test error on the order of $10^{-7}$. While tiny errors in continuous spaces inevitably accumulate—meaning the GNCA's exact trajectory eventually diverges from the ground truth—the macroscopic behavior is successfully captured. The learned GNCA matches the true system's complexity metrics closely (Sample Entropy: 0.0302 vs 0.0369; Correlation Dimension: 1.30 vs 1.31) and visually replicates flocking and boundary-avoidance.
  • Target Convergence: The GNCA successfully morphs initial states into the target geometric graphs, achieving Mean Squared Errors (MSE) between $10^{-4}$ and $10^{-6}$. Interestingly, depending on the number of steps ($t$) used during BPTT training, the GNCA learns either a stable fixed-point attractor or a stable periodic orbit that oscillates around the target.

Limitations and Future Work

  • Error Accumulation: In continuous state spaces (like the Boids simulation), tiny prediction errors compound over time. The GNCA cannot perfectly imitate the exact micro-trajectory of the true system indefinitely.
  • Computational Cost: Using Backpropagation Through Time (BPTT) with GNNs is highly memory and compute-intensive, especially for large or densely connected graphs.
  • Interpretability: Like many deep learning models, the learned transition rules are currently black boxes, making it difficult to extract the exact physical or logical rules the GNCA has discovered.
  • Future Directions: The authors suggest exploring higher-order neighborhoods (e.g., Lenia-style CAs), experimenting with different training time horizons to discover novel dynamical patterns, and applying GNCA to real-world complex systems like epidemiological spreads or social networks.

Summary updated

BibTeX
@inproceedings{grattarola2021learning,
  author = {Daniele Grattarola and Lorenzo Livi and Cesare Alippi},
  title = {{Learning Graph Cellular Automata}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=H2Vl40HAFSB},
}
Figure