Pinned · in progress

NCPU-EM

Neural cellular automata with one shared rule and a learned program per task: a differentiable route to the regime where the rule is fixed and only the program changes.

Origin

This line builds on NCPU, Self-organized boolean computation, by Iliya Zhechev (Sofia University) and Piotr Walas (Warsaw University of Technology), presented at ALIFE 2026 (code). NCPU trains neural cellular automata to carry out boolean computation. Related work: Béna and Faldor, A Path to Universal Neural Cellular Automata (2025), and the growing neural cellular automata of Mordvintsev et al. (Distill, 2020).

NCPU-EM recasts the setting as an Emergent Model: the network is the local rule, shared by all cells and all tasks; a few channels of every cell hold a program, learned separately for each task. One rule, many programs.

The model: NCPU-EM-1D

  • Substrate. A row of cells with 13 real-valued channels: 5 program channels, 1 input/output channel, 7 hidden channels.
  • Rule. A radius-1 convolution over the 13 channels, a ReLU layer of 128 units, and an additive update of all channels with a small leak and clipping; all cells update at once. 6,784 parameters, shared by every task.
  • Program. Five numbers per task, written into every cell.
  • Interface. Input bits are written into the input/output channel as ±1. After a fixed number of steps, each cell reads as 1 above +1/3, as 0 below −1/3; the output is the run of decided cells from the left.
  • Training. Rule and programs together, by gradient descent, on strings up to 16 bits; seven tasks: copy, shift left, shift right, Gray encoding, increment, prefix XOR, reverse.
One rule, two programs. The input/output channel of NCPU-EM-1D for the first 48 steps and at step 120, running the reverse program on 11111100 and the increment program on 10110111. Red positive, blue negative. Computed in your browser with the trained weights from the demo.

Results

Accuracy per bit on strings longer than any seen in training (up to 16 bits), synchronous updates:

Task19 bits21 bits26 bits
copy, shift left, shift right, Gray encode100%100%100%
increment99.8%100%99.8%
prefix XOR95.9%85.4%31.4%
reverse99.7%87.9%1.1%

Where it fails

Copy, shifts and Gray encoding need only information from a cell's immediate neighbourhood. Increment needs a carry, which travels only as far as the run of trailing ones. Prefix XOR and reverse need information carried across the whole string. A local rule can do that given enough steps, but it has to learn a transport mechanism that also works at lengths it never saw, and here it did not. This is the failure mode a local substrate should be expected to show, and a useful one to study: it separates the cost of locality from the cost of iteration (see H3 in Iteration and reasoning).

Next steps and code

  • Freeze a rule trained on many tasks and learn only programs for new ones: the latent-universal regime in practice.
  • Train with random asynchronous updates and noise, to measure robustness, a property that matters for physical substrates.
  • Two-dimensional substrates with program tiles.

Code: NCPU-EM-1D (demo), NCPU-EM-2D (program tiles on a 2D grid), ncpu-computer (single-task baselines), ncpu-simplified (binary addition with single-cell inputs and outputs).