Petri Dish Neural Cellular Automata

Petri Dish Neural Cellular Automata

tl;dr

Petri Dish Neural Cellular Automata (PD-NCA) is a new ALife simulation substrate that replaces the fixed, non-adaptive morphogenesis of conventional NCA—where model parameters remain constant during development—with multi-agent open-ended growth, trained via continual backpropagation throughout the entire simulation.

Abstract

While neural cellular automata (NCA) have proven effective for modeling morphogenesis and self-organizing processes, they are typically governed by a fixed, non-adaptive update rule shared across all cells. Each cell applies the same learned local transition function throughout its lifetime, resulting in static developmental dynamics once training is complete. We introduce Petri Dish Neural Cellular Automata (PD-NCA), a differentiable Artificial Life substrate that removes this constraint by allowing multiple, independent NCA agents to coexist, compete, and adapt within a shared environment. Unlike conventional NCA, each agent in PD-NCA continually updates its parameters via gradient descent during the simulation itself, enabling within-lifetime learning and open-ended behavioral change. This continual, multi-agent learning process transforms morphogenesis from a fixed developmental program into a dynamic ecosystem of interacting, adaptive entities. Through these interactions, PD-NCA exhibits emergent behaviors such as cyclic dynamics, cooperation, and persistent complexity growth, providing a promising new framework for studying open-endedness in differentiable systems.

Introduction

Neural Cellular Automata (NCA) are a powerful tool for building and exploring the process of morphogenesis. They have been a topic of interest in the ALife community since their introduction. While they have demonstrated the ability to evolve decentralized capabilities, most NCA experiments are intentionally limited to a single agent operating on a grid, so as to explore the idea of “growing organisms” from scratch.

ALife is a broad and multidisciplinary domain concerned with understanding the systems, computation, processes, evolution, and simulation of life. It spans various orders of magnitude in terms of simulation, from computational symbiogenesis to the simulation and analysis of complex organisms in order to aid our understanding of the natural world, the challenges that impinge upon life, and the incredible mechanisms that emerge to overcome these challenges.

We propose Petri Dish Neural Cellular Automata (PD-NCA) as an ALife simulation, wherein multiple NCA agents compete with the singular goal of self-replication. PD-NCA differs substantially from the standard NCA setup: instead of a single, fixed model operating on a grid with immutable parameters, PD-NCA introduces a population of distinct, continuously learning NCA, each maintaining its own neural parameters and adapting through ongoing gradient-based optimization during the simulation. These agents share a common spatial substrate, a “petri dish”, where they interact through competitive and cooperative dynamics mediated by differentiable attack and defense channels. In contrast to conventional NCA, where morphogenesis unfolds deterministically according to pre-trained rules, PD-NCA’s learning-in-the-loop design enables open-ended adaptation and emergent complexity within a single differentiable simulation.

Methods

Overview: Petri Dish NCA continuously compete for space in a constrained 2D grid. Each different color represents an individual model. The simulation proceeds through four distinct phases: (1) processing, (2) competition, (3) normalization, and (4) a state update.

Our simulation operates on a discrete spatial grid G∈RW×H×C, where W and H denote the spatial dimensions, and C represents channel dimensionality. At any position (x,y) and time t, grid state is characterized by a feature vector:

sx,yt= [ax,yt,dx,yt,hx,yt]∈RC

where at∈RC denotes attack channels, dt∈RC denotes defense channels, and ht∈RCh denotes hidden state information, with C=Ca+Cd+Ch. At each timestep, the simulation proceeds through four phases: processing, competition, normalization, and state update.

Processing

Each NCA agent i∈{1,…,N} is parameterized by a convolutional function fθi that produces local state updates. For a given position (x,y), the agent observes neighborhood Nx,y and generates update proposals:

Δsx,yt,i=fθi(Nx,y)∈RC

where Nx,y represents the Moore neighborhood of radius r. An NCA’s ability to propose updates is gated by an aliveness mask At∈RW×H×N, where Ait(x,y) indicates agent i’s aliveness at position (x,y). Each NCA can only propose updates to cells where it is currently alive or cells adjacent to its living territory.

Background environment

To ensure consistent competitive dynamics in regions with only one NCA alive, we introduce a static environment tensor E∈RW×H×C that acts as a constant background competitor. This tensor is initialized once at the beginning of the simulation with random noise and then normalized.

Ex,y= [ex,ya,ex,yd,ex,yh], where e~x,y{a,d,h}∼U(−1,1),

Ex,y=Ex,y∥Ex,y∥. The environment participates in competition by contributing its own update proposal:

Δsx,yt, env =Ex,y.

This ensures that agents must maintain active attack and defense even in territories they control, preventing stagnation and encouraging continuous adaptation.

Competition

The resolution of competing update proposals follows a strength-based arbitration mechanism. For each pair of entities (i,j) (including the environment) proposing updates at position (x,y), we define the pairwise interaction strength:

ϕij(x,y)=⟨ax,yt,i,dx,yt,j⟩−⟨dx,yt,i,ax,yt,j⟩.

The total competitive strength for agent i at position (x,y) includes both agent-agent and agent-environment interactions.

Ψi(x,y)=∑j≠iϕij(x,y)+ϕi,env(x,y).

The environment’s competitive strength is similarly computed:

Ψenv(x,y)=∑j=1Nϕenv,j(x,y).

Normalization

To enforce resource constraints within the environment, we apply a softmax normalization which transforms agent and environment interaction strengths into contribution weights:

wi(x,y)= \frac{\exp \left(\Psii(x,y) / τ\right)}{\exp \left(\Psienv(x,y) / τ\right)+∑k=1N\exp \left(\Psi k(x,y) / τ\right)}.

Contribution weights determine each proposal’s relative contribution to the final state update.

State update

The final grid state delta is the weighted aggregation of all proposals:

sx,yt+1=clip⁡(sx,yt+wenv(x,y)⋅Δsx,yt, env+∑i=1Nwi(x,y)⋅Δsx,yt,i).

The clipping operation ensures state boundedness. For our experiments, we use a clamp between [−1,1]. The aliveness distribution is updated to reflect the normalized competitive strengths:

Ait+1(x,y)= {wi(x,y)if wi(x,y)>α0otherwise.

Optimization objective

Each agent i optimizes for territorial expansion by maximizing its total aliveness across the spatial domain. We formulate this as minimizing the negative log-aliveness:

Li=−log⁡(∑x,yAi(x,y)).

The logarithmic transformation ensures stable gradient flow across multiple orders of magnitude of aliveness during backpropagation. This formulation naturally induces emergent behaviors where agents must balance offensive expansion strategies (optimizing attack channels) with defensive territory maintenance (optimizing defense channels) against both other agents and the persistent environmental pressure, leading to complex multi-agent dynamics reminiscent of biological competition systems.

Experiments

We ran many experiments to explore PD-NCA, namely:

  1. Analyzing the complex dynamics of PD-NCA over time by measuring information.
  2. Inspecting the impact of learning to understand its role in ALife simulation.
  3. Hyperparameter searches for noteworthy simulations, using video compression and the open-endedness score from the ASAL framework.
  4. Exploration of connection to hypercycles.

Dynamics

One of our first findings when exploring PD-NCA was that scaling the grid size and number of NCA consistently led to richer collective behavior. This suggests that an avenue of exploration must involve engineering PD-NCA to run on much larger grids, support more NCA, and potentially run on many GPUs simultaneously. In order to measure the notion of ‘richness’ or ‘interesting behavior’, we cannot only rely on subjective assessment, as this precludes scaling hyperparameter searches. To this end, we propose to measure the amount of information stored on the grid as a proxy for complexity. Since NCA model size is fixed, the simulation behavior complexity is fully explained by input (the grid) complexity and the learned parameters of the individual NCA.

The impact of learning

The videos below explore whether learning has a notable impact on the PD-NCA simulation. Without learning, the system eventually settles into a steady state with only minor fluctuation. With learning, however, we often observe interesting cyclic behavior and progression through various ‘states of interaction’. These demonstrations suggest that the number of NCA, grid size, and learning are necessary for the complex simulations that PD-NCA can yield.

Hyperparameter search

The PD-NCA framework is essentially a new and fully differentiable ALife substrate. We wish to search the hyperparameter space of the substrate. The goal of this experiment was to search through hyperparameters for signs of open-endedness.

Open-endedness score

The overall open-endedness score for the simulation is then computed as the temporal average of novelty scores.

Conclusion

Summary We take the first step in seeking to understand whether end-to-end differentiable ALife systems can show signs of open-endedness. In our preliminary experiments, we see signs of cooperation, chemical waves, and the emergence of higher-order structure.

Citation

For attribution in academic contexts, please cite this work as:

Ivy Zhang and Sebastian Risi and Luke Darlow, "Petri Dish NCA", 2025.

BibTeX citation:

@article{zhang2025pdnca,
  title = {Petri Dish NCA},
  author = {Ivy Zhang and Sebastian Risi and Luke Darlow},
  year = {2025},
  url = {https://pub.sakana.ai/pdnca}
}