Generalization over different cellular automata rules learned by a deep feed-forward neural network

Marcel Aach, Jens Henrik Göbbert, Jenia JitsevarXiv 2021 · OpenReview

TL;DR

This paper investigates the generalization capabilities of deep neural networks by training them to predict the next state of cellular automata (CA) based on observed trajectories. The authors demonstrate that a convolutional neural network can learn complex CA rules and generalize to unseen configurations, even to some extent for rules and neighborhood sizes not encountered during training. This work highlights the potential of CA as a benchmark for testing AI generalization.

What Problem Does This Paper Address?

A fundamental challenge in machine learning, particularly with deep learning models, is their ability to generalize beyond the specific data they were trained on. Models often become "overfitted" to the training distribution, performing poorly when faced with slightly different conditions or entirely new data. This paper tackles this generalization problem by using cellular automata (CA) as a testbed. CA are discrete dynamical systems with simple, local rules that can produce incredibly complex and emergent behavior. By training a neural network to predict CA states and then testing it on CA rules and configurations it hasn't seen before, the researchers can systematically probe the limits of the network's generalization abilities.

Methods

The authors employ a deep convolutional neural network architecture inspired by state-of-the-art models like SegNet, ResNet, and U-Net. This architecture features an encoder-decoder structure with short and long-range skip connections. The encoder processes the input CA states to extract features and compress them into a latent space, while the decoder uses this information to predict the next CA state. The network is trained using a binary cross-entropy loss function. To improve gradient flow and combat the degradation problem in deep networks, they incorporate both identity and convolutional skip connections from ResNet, as well as a concatenative long-range skip connection from the input to the decoder output. The input to the network consists of four consecutive time steps of the CA, and the output is the fifth time step.

Datasets

The study utilizes datasets generated from modified versions of John Conway's Game of Life. The modifications involve:

  • Rule Modifications: Randomly sampling integer numbers for cell birth and survival conditions, creating a large variety of transition rules.
  • Neighborhood Modifications: Varying the size of the Moore neighborhood (e.g., 3x3, 5x5, 7x7, 9x9) that influences a cell's state.

The experiments are structured across several "levels of generalization":

  • Simple Generalization: Training and testing on the same set of rules and neighborhood sizes (3x3).
  • Level 1 Generalization: Training on rules with 3x3, 5x5, and 7x7 neighborhoods, and testing on unseen configurations from these same rules.
  • Level 2 Generalization: Training on rules with 3x3, 5x5, and 7x7 neighborhoods, and testing on unseen configurations generated by 30 different randomly generated rules.
  • Level 3 Extrapolation: Training on 3x3, 5x5, and 7x7 neighborhoods, and testing on rules with a larger 9x9 neighborhood.
  • Level 3 Interpolation: Training on 3x3, 5x5, and 9x9 neighborhoods, and testing on 7x7 neighborhoods.

Key Insights and Ideas

  • CA as a Powerful Generalization Benchmark: The paper strongly advocates for CA as an excellent platform to test AI generalization due to the ease of generating diverse rule sets and the emergent complexity of their behavior.
  • Deep Networks Can Learn Abstract Rules: The results suggest that deep convolutional networks can indeed learn the underlying transition rules of CA, not just memorize specific patterns.
  • Skip Connections are Crucial: The inclusion of both short-range residual and long-range concatenative skip connections significantly improves performance and mitigates the degradation problem in deep networks.
  • Interpolation vs. Extrapolation: The network performs better when interpolating between known neighborhood sizes (Level 3 Interpolation) than when extrapolating to entirely new ones (Level 3 Extrapolation), indicating a limit to its generalization capabilities.
  • "Static" and "Alternating" Rules are Easy: The network achieves very high accuracy on simple "static" rules (where states change minimally) and "alternating" rules (where states flip predictably), suggesting it can identify and exploit simple patterns.

Key Results

  • High Accuracy on Simple Generalization: For simple generalization (same rules, 3x3 neighborhood), the network achieved an average accuracy of 98.49%.
  • Good Performance on Level 1 Generalization: With diverse rules and larger neighborhoods (3x3, 5x5, 7x7), accuracy remained high at 92.19%.
  • Significant Drop in Level 2 and 3: For Level 2 generalization (unseen rules), accuracy dropped to 77.65%. Level 3 extrapolation saw accuracy fall to 70.50%, while Level 3 interpolation was slightly better at 77.49%.
  • Baseline Accuracy: The random guess baseline accuracy is around 51%, highlighting that even the lower generalization results are significantly better than random.
  • Neighborhood Size Impact: Accuracy decreases as neighborhood size increases, with 3x3 neighborhoods yielding the highest accuracy (98%), followed by 5x5 (93%), and 7x7 (88%).

Limitations and Future Work

  • Limited Neighborhood Shapes: The study exclusively used the square Moore neighborhood. Future work could explore other neighborhood shapes and investigate how well networks can extract global rules rather than just local ones.
  • Fully Convolutional Architecture: The authors note that a dense layer in the latent space hindered convergence, suggesting that the fully convolutional structure, emphasizing local operations, is important. However, they speculate that recurrent or transformer architectures might improve performance and extend the tractable time horizon for predictions.
  • Extracting Rules Explicitly: An interesting future direction is to explore if the network can extract the CA rules directly in an explicit, symbolic form (e.g., Born/Stay notation) from the latent space, which would enable more systematic analysis of prediction failures.
  • Broader Applications: The paper suggests that CA, combined with learning networks, could serve as powerful simulators for complex phenomena in biology and physics, offering a way to test AI's ability to learn latent laws from raw observations.

Summary updated

BibTeX
@misc{aach2021generalization,
  author = {Marcel Aach and Jens Henrik Göbbert and Jenia Jitsev},
  title = {{Generalization over different cellular automata rules learned by a deep feed-forward neural network}},
  year = {2021},
  eprint = {2103.14886},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.14886},
}
Figure