Simple cellular automata (CAs) can be computationally universal, but their rules are designed by hand. We train Neural Cellular Automata (NCAs), which learn a local update rule by gradient descent, to compute exact digital logic. Bits are encoded as clusters of cells on a 2D grid, and a result reaches the output only by propagating through intermediate cells. One model is trained per task: logic gates, 4- and 8-bit ripple-carry adders, and a preliminary 8-bit arithmetic logic unit (ALU). All gate and adder models reach 100% bit correctness in 10 of 10 seeds, and exhaustive tests over all input pairs find at most 1 error in 256 (4-bit) and 7 in 65,536 (8-bit). Adders trained on operands of up to 3 bits generalize to 8 bits. The adders propagate the carry as a wave, with a delay of about 3.5 steps per bit of the carry chain. Outputs are correct only within the trained rollout length.
Figures & tables
Fig. 1 : Convergence on the single-gate task for alive-masking thresholds 0.0 and 0.1 (rows; at 0.3 no run converged), weight initialization (columns), fire rate and kernel size. Darker blue means faster convergence: 1.0 is convergence within the first 2000 steps, 0.0 is no convergence.
Task
Seeds
Convergence steps
Final bits
AND
10
49±±35
1.00±0.00
NAND
10
45±±21
1.00±0.00
NOR
10
35±±12
1.00±0.00
OR
10
54±±36
1.00±0.00
XNOR
10
67±±23
1.00±0.00
XOR
10
85±±42
1.00±0.00
TABLE I : Multi-seed convergence results for logic gate, adder, and ALU experiments. Convergence steps are optimization steps to first reach 100% bit correctness. Every gate and adder value is the mean over 10 seeds per task, and “ ± ” is the population standard deviation (ddof =0 ) across those seeds; the ALU is a single non-converged run and is not seed-averaged. Final bits are correct output bits on the last rollout frame out of a per-task maximum of 1 (gates, majority3), 2 (half-adder), 5 (4-bit) or 9 (8-bit). cols1 and cols2 denote the single- and two-column operand layouts of Section V-B ; the 4-bit cols2 and 8-bit cols1 rows are the layout control, trained for 20000 steps.
Fig. 2 : Training accuracy (correct output bits) across seeds for all logic gates, half-adder, and majority3. Linearly separable gates converge faster than non-linear ones.
Fig. 3 : Channel 0 rollouts for the AND gate (left) and the half-adder (right). Circles indicate output bit locations. The chaotic region on the left may indicate wave-based computation (not tested).
Fig. 4 : 4-bit adder: single-column ( cols1 ) versus two-column ( cols2 ) input layouts (a), and Channel 0 rollouts on the same two input combinations for both layouts (b). Top two rows show cols1; bottom two rows show cols2.
Fig. 5 : Length generalization results. Left : accuracy ( % ) for each training ceiling K and test bit width. Right : success (top) and failure (bottom) for a K=3 model on 8-bit input.
Fig. 6 : 8-bit ALU experiment: spatial layout (a) and Channel 0 rollouts for three representative operations (b).
Fig. 7 : Per-operation accuracy of the 8-bit ALU by output group: result bits, carry-out, branch-taken. Single non-converged run; see Section V-E for the chance-level caveats. The dashed line marks the 50% chance level of a single bit. The deficit is concentrated in carry-out on ADD, SUB and RCL.
Fig. 8 : Hidden channels most strongly expressing the carry wave during the addition 127+1=128 (7-bit carry chain). Each row is a single channel of the trained 8-bit adder; columns are NCA timesteps. A wavefront propagates from the LSB (bottom) toward the carry-out MSB (top) over about 30 steps.
Modern AI architectures used to solve visual reasoning tasks typically rely heavily on global connectivity and synchronization. As biological systems demonstrate, though, sophisticated computation can be performed in a more decentralized fashion. In this work, we test the reasoning capabilities of Neural Cellular Automata (NCAs), networks of recurrent cells that use strictly local connectivity and asynchronous updates. NCAs have been extensively studied in artificial life experiments, but it is unclear whether they can perform complex multi-step reasoning. We show that NCAs produce spatio-temporal dynamics capable of solving challenging visual reasoning tasks, including large mazes, Sudoku, and ARC-AGI-1. Furthermore, we provide evidence that NCAs generalize out-of-distribution when running with larger grids, longer rollouts, or parallel trials; and that the latter can be made more efficient via pruning of redundant trajectories. We find that these generalization capabilities depend on training with sample replay and stochastic perturbations, and that stochasticity remains beneficial at test time. Finally, we show that NCAs are robust reasoners capable of dynamically modulating compute to recover efficiently from damage, and that they can scale to solve reasoning in raw pixel space.
Mayalen Etcheverry, Pietro Miotti, Aidan Sirbu +7
Google Paradigms of Intelligence Team · School of Computer Science, McGill University · Mila - Quebec AI Institute +4
Stephen Wolfram proclaimed in his 2003 seminal work "A New Kind Of Science" that simple recursive programs in the form of Cellular Automata (CA) are a promising approach to replace currently used mathematical formalizations, e.g. differential equations, to improve the modeling of complex systems. Over two decades later, while Cellular Automata have still been waiting for a substantial breakthrough in scientific applications, recent research showed new and promising approaches which combine Wolfram's ideas with learnable Artificial Neural Networks: So-called Neural Cellular Automata (NCA) are able to learn the complex update rules of CA from data samples, allowing them to model complex, self-organizing generative systems. The aim of this paper is to review the existing work on NCA and provide a unified modular framework and notation, as well as a reference implementation in the open-source library NCAtorch. Supplementary materials, videos, and code are available at the project website: https://www.neural-cellular-automata.org/
Martin Spitznagel, Janis Keuper
Institute for Machine Learning and Analytics (IMLA), Offenburg University, Germany · University of Mannheim, Germany
As Neural Cellular Automata (NCAs) are increasingly applied outside of the toy models in Artificial Life, there is a pressing need to understand how they behave and to build appropriate routes to interpret what they have learnt. By their very nature, the benefits of training NCAs are balanced with a lack of interpretability: we can engineer emergent behaviour, but have limited ability to understand what has been learnt. In this paper, we apply a variety of techniques to pry open the NCA black box and glean some understanding of what it has learnt to do. We apply techniques from manifold learning (principal components analysis and both dense and sparse autoencoders) along with techniques from topological data analysis (persistent homology) to capture the NCA's underlying behavioural manifold, with varying success. Results show that when analysis is performed at a macroscopic level (i.e. taking the entire NCA state as a single data point), the underlying manifold is often quite simple and can be captured and analysed quite well. When analysis is performed at a microscopic level (i.e. taking the state of individual cells as a single data point), the manifold is highly complex and more complicated techniques are required in order to make sense of it.
James Stovold, Mia-Katrin Kvalsund, Harald Michael Ludwig +2
University of York, UK · University of Oslo, Norway · Machine Learning Research Unit, TU Wien, Austria +2