paper:differentiable-logicDifferentiable Logic Cellular Automata: From Game of Life to pattern generation with learned recurrent circuits
TL;DR
Differentiable Logic Cellular Automata (DiffLogic CA) demonstrates that fully discrete, binary-state cellular automata rules can be learned end-to-end via gradient descent by combining Deep Differentiable Logic Gate Networks (DLGNs) with Neural Cellular Automata (NCA). The system replaces continuous neural network components with learned binary logic circuits: a perception stage using fixed-topology, gate-learned kernels over Moore neighborhoods, and an update stage implemented as a layered DLGN. Two experiments validate the approach. First, the Game of Life rule set is perfectly recovered from all 512 configurations of 3×3 periodic grids, yielding a compiled circuit of 336 active gates (predominantly OR and AND) that generalizes to arbitrarily large grids. Second, recurrent pattern generation — the first known application of DLGNs in a recurrent-in-space and recurrent-in-time setting — is demonstrated across targets of increasing complexity: a 16×16 checkerboard solved with just 22 active gates (reducible to 5 after pruning), a 20×20 lizard outline using 577 gates with a 128-bit cell state over 12 steps, and a colored 16×16 Google 'G' using 927 gates over 15 steps with 64-channel cell state. The checkerboard circuit generalizes to grids four times larger with four times more steps despite being trained at fixed size, and synchronously trained rules function correctly under asynchronous inference. The paper argues this implies that differentiable logic gates can discover minimal, procedural, and hardware-deployable local rules for programmable matter architectures akin to the CAM-8 cellular automata machine.
What to take away
- 1. DiffLogic CA perfectly replicates Conway's Game of Life rules by training on all 512 possible 3×3 grid configurations for a single time step, achieving zero hard loss and producing a compiled circuit of 336 active gates dominated by OR and AND operations.
- 2. A 16×16 checkerboard pattern is reconstructed within 20 synchronous steps using a cell state of 8 bits, converging to a circuit of only 22 active gates, which simplifies to 5 non-redundant logic gates after pruning.
- 3. This work is, by the authors' claim, the first demonstration of Deep Differentiable Logic Gate Networks (DLGNs) operating in a recurrent-in-space and recurrent-in-time setting, extending prior DLGN work that was restricted to feedforward combinatorial circuits.
- 4. The checkerboard circuit trained on a fixed 16×16 grid with 20 steps generalizes without modification to a grid four times larger run for four times as many steps, suggesting the learned rule encodes a boundary-size-invariant procedural description.
- 5. A synchronously trained checkerboard circuit functions correctly under asynchronous inference (where a random subset of cells updates each step), and a model trained directly with asynchronous updates achieves correct reconstruction in 50 steps while exhibiting greater measured robustness to a randomly deactivated 10×10 pixel region.
- 6. A 20×20 lizard outline is generated in 12 steps using a 128-bit cell state, 4 perception kernels, an update network of 10 layers (eight layers of 512 gates then [256, 128]), totaling 577 active gates, with the model generalizing to a 40×40 grid.
- 7. A colored 16×16 Google 'G' with an 8-color binary RGB palette is learned over 15 steps using a 64-channel cell state and 927 active gates, representing the most complex pattern generation experiment and the most challenging hyperparameter search.
- 8. The perception stage uses fixed-topology circuits with four layers of [8, 4, 2, 1] gates per kernel, where connections are fixed and only gate identities are learned, replacing the Sobel-filter convolutions used in standard NCA.
- 9. An open question raised is whether the combination of discretization pressure and minimal circuit size acts as an inductive bias that finds compact procedural descriptions of patterns, potentially analogous to minimum description length regularization.
- 10. To replicate the Game of Life experiment, one trains on a single-step dataset of all 512 periodic 3×3 configurations using a squared-difference loss, with 16 perception kernels of structure [8, 4, 2, 1] and an update network of 23 layers (16 layers of 128 gates followed by [64, 32, 16, 8, 4, 2, 1]).
Peer brief — for seminar discussion
The paper introduces Differentiable Logic Cellular Automata (DiffLogic CA), a framework that combines Deep Differentiable Logic Gate Networks (DLGNs) with Neural Cellular Automata (NCA) to learn fully discrete, binary-state update rules for 2D cellular automata via end-to-end gradient descent. During training, each logic gate maintains a 16-dimensional softmax distribution over the 16 possible binary operations for two inputs and uses differentiable continuous relaxations (e.g., AND relaxed to a·b); at inference, gates are snapped to their argmax, yielding a compiled binary circuit with no floating-point operations. The perception stage replaces NCA's Sobel filters with fixed-topology, gate-learned circuits processing Moore neighborhoods channel-wise, while the update stage is a layered DLGN consuming concatenated neighbor perceptions and cell memory. An alternative the framework could have used is the standard NCA approach with continuous-valued Sobel convolutions and a small (~8,000-parameter) MLP update rule, which would have sacrificed discrete deployability but likely simplified optimization. Two experiments establish the load-bearing claims. In Experiment 1, training on all 512 configurations of 3×3 periodic grids recovers the Game of Life rule set perfectly (both soft and hard losses reach zero), producing a 336-gate circuit. In Experiment 2, pattern generation in a recurrent setting — claimed as the first use of DLGNs recurrently — is validated at escalating complexity: 22 active gates (reducible to 5 after pruning) for a 16×16 checkerboard at 8-bit cell state and 20 steps; 577 gates for a 20×20 lizard outline at 128-bit cell state and 12 steps; and 927 gates for a colored 16×16 'G' at 64-channel cell state and 15 steps. The checkerboard circuit trained at fixed scale generalizes to a 4× larger grid run for 4× more steps without modification. Asynchronously trained models reconstruct the checkerboard in 50 steps and show measurably better resilience to a randomly deactivated 10×10 pixel region than synchronously trained counterparts. The paper argues these results imply that differentiable logic gates can discover minimal, interpretable, and hardware-deployable local rules suitable for programmable matter architectures in the tradition of Toffoli and Margolus's CAM-8. A subsidiary hypothesis is that discretization pressure combined with circuit minimality produces an inductive bias toward compact procedural pattern descriptions, potentially explaining boundary-size-invariant generalization without explicit spatial-invariance losses. A critical reader would push back on the limited complexity of the target patterns tested: a checkerboard, a single lizard silhouette, and one letter are far below the diversity of textures and morphogenetic targets demonstrated in the original Growing NCA work by Mordvintsev et al. The paper itself acknowledges that training more complex shapes required extensive hyperparameter tuning and remained challenging, but does not provide quantitative comparisons of reconstruction quality, training cost, or failure rates against the NCA baseline. Without such comparisons, the claim that DiffLogic CA is a practical alternative to continuous NCA — rather than merely a proof of concept for discrete recurrent circuits — remains insufficiently supported.
Methods (5)
- Damage Resilience TestingEvaluation method where cells are permanently or temporarily disabled to test fault tolerance of learned circuits
- Gate PruningPost-training removal of pass-through and non-contributing gates to reveal minimal circuit structure
- Grid Scaling Generalization TestEvaluation of learned circuits on grids 4x larger with 4x more steps than training conditions
- Interactive Circuit VisualizationInteractive tool for visualizing and inspecting learned binary logic circuits using modified DigitalJS library
- Squared Difference LossLoss function used in both experiments: sum of squared differences between predicted and target grid
Frameworks (1)
- Differentiable Logic Cellular Automata (DiffLogic CA)The novel framework introduced in this paper, combining DLGN and NCA for fully differentiable discrete CA learning
Datasets (4)
- 16x16 Checkerboard Pattern DatasetFixed target pattern used for pattern generation experiment, with randomly sampled initial states per training step
- 16x16 Colored Google G DatasetColored letter G pattern used to test DiffLogic CA on multi-channel RGB pattern generation
- 20x20 Lizard Pattern DatasetLizard outline pattern from NCA tradition used to test DiffLogic CA on more complex shapes requiring memorization
- Game of Life 512-Configuration Training SetComplete enumeration of all 512 possible 3x3 grid configurations used to train Game of Life rule learning
Findings (17)
- Asynchronously trained DiffLogic CA shows greater robustness to 10x10 pixel damage than synchronously trained version, measured by sum of absolute differences
Quantitative comparison of synchronous vs asynchronous training for noise resilience
- Checkerboard pattern formation exhibits directional propagation from bottom-left to top-right despite no built-in directional bias in the model
Emergent property observed in checkerboard pattern generation
- DiffLogic CA represents, to best of authors' knowledge, the first exploration of differentiable logic gate networks in a recurrent setting
Novelty claim about the contribution to the field
- Game of Life learned circuit successfully replicates gliders, stable blocks, loaves, and boats on larger grids beyond training size
Demonstration of generalization of learned GoL rules to larger grids
- DiffLogic CA with 64 channels successfully learns 16x16 colored Google G pattern in 15 steps using 8-color binary palette
Demonstration of multi-channel RGB color pattern generation with binary states
- DiffLogic CA fully converges on Game of Life rules — both soft and hard losses converge to zero on all 512 configurations
Core result of Experiment 1 validating DiffLogic CA's ability to learn discrete CA rules
- DiffLogic CA with 128-bit cell state and 12 steps successfully learns 20x20 lizard pattern, generalizing to 40x40 grid
Demonstration of DiffLogic CA on complex non-regular shapes with arbitrary memorization requirements
- Learned checkerboard generation circuit reduces to just 5 active logic gates after pruning (6 with one redundant AND)
Remarkably minimal circuit discovered for checkerboard pattern generation
- Asynchronous DiffLogic CA requires 50 steps vs 20 steps for synchronous training to reconstruct checkerboard pattern
Cost of asynchronous training in terms of convergence time steps
- Learned Game of Life circuit uses 336 active gates (excluding pass-through gates A and B), predominantly OR and AND
Circuit analysis result for Game of Life experiment
Claims (9)
- DiffLogic CA can directly learn the local rules needed to achieve desired macroscopic computation, addressing the fundamental challenge identified by Toffoli and Margolus
Core thesis of the paper framed against the historical challenge of hand-crafting CA rules
- NCA do not inherently operate within a discrete state space, making interpretability more challenging and requiring costly matrix multiplications on current hardware
Authors' critique of NCA motivating the DiffLogic CA approach
- The integration of differentiable logic gates and neural cellular automata is a potential step towards programmable matter — Computronium
Authors' broader vision claim linking their system to Toffoli and Margolus's programmable matter concept
- DiffLogic CA has strong kinship with CAM-8 architecture where each cell uses DRAM for state variables and SRAM for processing
Authors' architectural analogy between DiffLogic CA and Toffoli-Margolus CAM-8
- Pure binary logic circuit inference is exceptionally fast on any hardware compared to continuous neural network inference
Authors' claim about hardware efficiency advantage of learned discrete circuits
- Asynchronous training improves robustness of DiffLogic CA circuits to perturbations compared to synchronous training
Interpretive claim supported by damage resilience experiment results
- Differentiable Logic Gate Networks have not previously been shown to work in recurrent settings prior to this work
Authors' novelty assertion establishing the gap filled by DiffLogic CA
- Different tasks yield distinct distributions of logic gate types between perception kernels and update networks
Interpretive claim based on circuit analysis across experiments
- DiffLogic CA mirrors how biological systems achieve reliability through networks of imperfect components
Authors' analogy between emergent fault tolerance in DiffLogic CA and biological robustness
Hypotheses (4)
- Discretization and minimal circuit size may be finding some minimal procedural description (analogous to algorithmic complexity) for generating patterns of interest
Hypothesis raised by the 5-gate checkerboard solution and its grid-size invariance
- Integrating LSTM-like gating mechanisms into the state update process could enable richer combinations of past and new states, enhancing model dynamics
Future direction hypothesis for improving DiffLogic CA expressiveness
- Models trained directly with asynchronous updates would exhibit even greater robustness than synchronously trained models
Hypothesis that motivated the asynchronous robustness comparison experiment
- Hierarchical NCA architectures could enhance convergence speed and stability in DiffLogic CA for complex shapes
Future direction hypothesis for addressing optimization challenges in complex pattern generation
Questions (3)
- Could the discretization and minimal circuit size be finding some minimal procedural description for generating patterns of interest?
Open question raised by the 5-gate checkerboard solution and its generalization properties
- Can recurrent-in-space and recurrent-in-time circuits learn complex patterns similar to those generated by traditional NCAs?
Second and more profound research question motivating the pattern generation experiment
- Can a Differentiable Logic CA learn at all?
First fundamental question motivating the Game of Life experiment
Original abstract (expand)
This paper proposes a novel approach combining Neural Cellular Automata (NCA) and Differentiable Logic Gates Networks to create fully differentiable cellular automata that can learn local rules to generate desired patterns while preserving discrete state spaces. The authors demonstrate their approach on two key experiments: learning Conway's Game of Life and learning recurrent circuits that generate complex patterns similar to traditional NCAs. This work represents a step toward programmable matter by enabling systems that are learnable, local, discrete, and capable of arbitrary computation.
Related work— refs + corpus + external arXiv
Cited / in-corpus / arXiv badges show which signals surfaced each row. Multi-source rows weighted higher.
- Conditional Morphogenesis: Emergent Generation of Structural Digits via Neural Cellular AutomataAli Sakour2025≈ 84%
- A New Kind of Network? Review and Reference Implementation of Neural Cellular AutomataJanis Keuper Martin Spitznagel2026≈ 84%
- Neural Cellular Automata: From Cells to PixelsYitao Xu, Ali Abbasi, Alexander Mordvintsev, Wenzel Jakob, Sabine S\"usstrunk Ehsan Pajouheshgar2026≈ 84%
- Neural cellular automata: applications to biology and beyond classical AIMichael Levin, L\'eo Pio-Lopez Benedikt Hartl2025≈ 83%
- BraiNCA: brain-inspired neural cellular automata and applications to morphogenesis and motor controlBenedikt Hartl, Michael Levin L\'eo Pio-Lopez2026≈ 83%
- AutomataGPT: Forecasting and Ruleset Inference for Two-Dimensional Cellular AutomataJaime A. Berkovich and Noah S. David and Markus J. Buehler2025≈ 82%
- Learning without neurons in physical systemsin corpus2022≈ 81%
- ≈ 81%
- ≈ 81%
- ≈ 80%
- Mixtures of Neural Cellular Automata: A Stochastic Framework for Growth Modelling and Self-OrganizationGiulio Caravagna, Andrea Sottoriva Salvatore Milite2025≈ 80%
- Growing Reservoirs with Developmental Graph Cellular AutomataMatias Barandiaran and James Stovold2025≈ 80%
- Beyond spiking networks: the computational advantages of dendritic amplification and input segregationCosimo Lupo, Paolo Muratore, Pier Stanislao Paolucci Cristiano Capone2026≈ 80%
- Neural Cellular Automata ManifoldArmand Vilalta, Francesc Moreno-Noguer Alejandro Hernandez Ruiz2021≈ 80%
- Growing Isotropic Neural Cellular AutomataEttore Randazzo, and Craig Fouts Alexander Mordvintsev2022≈ 80%
- Darwin's agential materials: evolutionary implications of multiscale competency in developmental biologyin corpus2023≈ 80%
- Neuron-Anchored Rule Extraction for Large Language Models via Contrastive Hierarchical AblationGabriele Dominici, Marc Langheinrich Francesco Sovrano2026≈ 80%
- The computational boundary of a 'self': developmental bioelectricity drives multicellularity and scale-free cognitionin corpus2019≈ 80%
- Zoom In: An Introduction to Circuitsin corpus2020≈ 80%
- ≈ 79%
- Active Inference: A Process Theoryin corpus2017≈ 79%
- Collective intelligence: A unifying concept for integrating biology across scales and substratesin corpus2024≈ 78%
- ≈ 78%
- ≈ 77%
- ≈ 77%
- ≈ 77%
- ≈ 77%
- The biogenic approach to cognitionin corpus2005≈ 77%
- ≈ 77%
- ≈ 77%