The automaton is the network

A cellular automaton updates every cell from a small window around it. A convolutional neural network, the kind behind most image recognition, computes every pixel of its next layer from a small window around it. The two are close relatives, and the family resemblance is useful both ways: neural networks need lots of examples of cellular automata to learn to classify them, and cellular automata could use the heavily optimised software that neural networks run on. For the elementary cellular automaton the match was known to be exact. My question was the non-uniform one, where every cell may follow its own rule, which is exactly what breaks the defining habit of a convolution: the same weights everywhere.

The answer is in a conference paper with Aisling Daly, Odemir Bruno and Jan Baetens, for the cellular-automata conference ACRI 2024. In one sentence:

A non-uniform cellular automaton fits exactly in a convolutional neural network, with one extra layer that picks each cell's rule; a deep-learning framework then simulates many large non-uniform automata faster than a dedicated cellular-automaton package.

The first half is a construction, and the page runs it: the network's weights are written down by hand, nothing is learned, and the result agrees with a direct simulation bit for bit, down to the paper's own figures. The second half is a benchmark, and there the story continued after the paper: I came back to it two years later with better ways of timing, and the Faster? tab tells both parts. The tabs follow the paper: why bother, the 40 weights of the elementary case, the one layer the non-uniform case adds, training those weights instead of writing them down, and the speed.

The code is public, in mrollier/emulating-and-learning-CAs, with a test for every claim of the paper; the published figure inputs and timings on this page come from it. Everything else is computed in your browser.

The question

An elementary cellular automaton is a row of cells, each 0 or 1, that all update at once, each from itself and its two neighbours, all by the same rule. Relax any of that and you land in one of the families of the taxonomy. Let different cells follow different rules and you have a non-uniform cellular automaton, a νCA. In general the allocation of rules to cells may change over time too; the paper, like most of the literature, keeps it fixed in time and lets it vary in space, on a finite ring of cells. Pick the rules and paint the allocation:

The freedom is enormous. A ring of NN cells with one elementary rule has 2N2^N starting rows for each of the 256 rules; with NRN_R rules to allocate, there are

2N×NR N2^N \times N_R^{\,N}

combinations of a start and an allocation. So much variety leaves little room for general theorems, except in special cases far from any application, and the way forward is empirical: simulate many of them and sort what they do. Sorting spacetime diagrams is, at heart, recognising images, which is what convolutional networks are good at, and training such a network takes a great many examples. Both ends of that pipeline call for fast, massive simulation.

Here the locality of a convolution helps twice. A network can be trained to recognise cellular automata, and it can also be one: Gilpin showed in 2019 that the update of any cellular automaton fits in the architecture of a convolutional network, either by choosing the weights cleverly or by training them. The next tab does the choosing for the elementary case; the one after adds what the non-uniform case needs.