paper
active
paper:differentiable-logic

Differentiable 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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 Testing
    Evaluation method where cells are permanently or temporarily disabled to test fault tolerance of learned circuits
  • Gate Pruning
    Post-training removal of pass-through and non-contributing gates to reveal minimal circuit structure
  • Grid Scaling Generalization Test
    Evaluation of learned circuits on grids 4x larger with 4x more steps than training conditions
  • Interactive Circuit Visualization
    Interactive tool for visualizing and inspecting learned binary logic circuits using modified DigitalJS library
  • Squared Difference Loss
    Loss function used in both experiments: sum of squared differences between predicted and target grid

Frameworks (1)

Datasets (4)

Findings (17)

Claims (9)

Questions (3)

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.

Similar preprints — Semantic Scholar