Visualising the Attractor Landscape of Neural Cellular Automata
Authors: James Stovold, Mia-Katrin Kvalsund, Harald Michael Ludwig, Varun Sharma, Alexander Mordvintsev
Organizations: University of York, UK · University of Oslo, Norway · Machine Learning Research Unit, TU Wien, Austria · CeMM Vienna, Austria · Paradigms of Intelligence Team, Google, Zurich
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.
Figures & tables
Figure 1: Diagram depicting one pass of the NCA update step used in this paper. The diagram also shows the structure of the neural network. Image adapted from ( Mordvintsev et al., 2020 ) , licenced under CC BY 4.0.
Figure 2: Example classic target images used for training NCA models. Left, a green gecko used in ( Mordvintsev et al., 2020 ) ; middle, a blue gecko used in ( Stovold, 2023 ) ; right, ‘interlaced 0172’ texture from ( Cimpoi et al., 2014 ) used in ( Niklasson et al., 2021 ) .
Figure 3: The creation of the persistence diagram (right) consist of growing circles around your points with increasing radius r , and connecting components if the growing circles overlap with a point. Here, the toy data is in blue, growing cirles are in shaded grey, and edges between connected components are in orange.
H0
H1
H2
Ring
1
1
0
Two disjoint rings
2
2
0
Sphere
1
0
1
Torus
1
2
1
Table 1: Betti numbers for common topologies. In general, H0 tells us how many distinct components there are in the data, H1 tells us how many rings exist, and H2 tells us how many voids there are. Adapted from ( Kemme and Agyingi, 2025 ) .
Figure 4: Persistence diagram for noisy data. The green arrow points to a strongly persistent ring. The rest of the recorded components, like the H2 group that briefly appears at r=7.1 , can be considered noise because their persistence is short-lived.
Figure 5: The blue/green gecko model from ( Stovold, 2023 ) being trained. (Top) loss as it trains, showing transition at around 3500–4000 epochs; (middle) latent space of the autoencoder model after training for the 1000, 2000, 4000, and 10,000 epochs; (bottom) persistent homology of the underlying manifold at the corresponding training points, confirming a cycle forms ahead of 4000 epochs.
Figure 6: Perturbation on the blue/green gecko model. The left graphs show the first two principal components of the dataset, the right graphs show the persistent homology analysis. (a) A perturbation was applied on the 600th timestep, as the system was in the blue attractor. It returns to the green attractor and stays there until the episode ends. (b) The same was done, but the signal to change colour was still sent every 150 timestep. (c) State of the NCA at different timesteps.
Figure 7: Field lines superposed on the underlying latent space (captured using PCA). To visualise the vector field, we sampled this latent space, reconstructed the high-dimensional representation, ran it through the NCA for a small number of steps and then reduced it back down to the latent space. This allows us to capture which direction the NCA model would move in the latent space, and hence to visualise the behaviour of the system across the latent space.
Figure 8: A sample of 1 million data points (excluding dead cells) encoded using an autoencoder to visualise the underlying latent space. The clumps of cells indicate local attractors for individual cells. The NCA model used was the 10,000 epoch blue/green gecko model.
Figure 9: The PH diagrams (left) and the PCA projection of a) the full substrate and b) the subsampled substrate, based on 20 timesteps.
Figure 10: Per-frame manifold of the blue/green gecko NCA in SAE feature space. Each point is the mean SAE activation vector across all living cells in one frame, projected using PCA and coloured by the mean RGB value of the frame. The two attractors sit at opposite ends of the first principal plane and the trajectory traces a clean cycle between them, recovering the macroscopic cycle of fig. 5 from purely microscopic per-cell data.