petri-dish-nca: When Neural Cellular Automata Start Competing for Space

Sakana AI's PD-NCA turns growth into an ecosystem, where multiple learners fight, adapt, and survive inside one shared dish.

11 min read • View on GitHub • More from SakanaAI

A top-down petri dish where several cellular colonies push against one another under a bright lamp. The image shows PD-NCA as ecology, not sculpture: the interesting behavior comes from competition over shared space and signal.
The unit of interest is no longer one shape. It is the whole living terrain.
Key Takeaways

Most NCA demos are about making one thing grow. This repo is about what happens when many growing systems have to share the same territory. That shift sounds small, but it changes the whole question from what shape does one model make? to what kind of world emerges when the models have to fight over the same pixels?

The invention is simple. The consequences are not.

Sakana AI's petri-dish-nca comes from the same family as classic neural cellular automata, but it swaps the lonely growth loop for a shared substrate. The authors frame PD-NCA as a differentiable multi-agent system, trained continuously inside an artificial life simulation, which means the model is not just developing. It is adapting while the episode is still running.

We introduce Petri Dish Neural Cellular Automata (PD-NCA): a differentiable multi-agent substrate consisting of a competitive population of neural cellular automata (NCA), trained continuously as an artificial life simulation.

Ivy Zhang, Sebastian Risi, and Luke Darlow, Authors · PD-NCA paper

One GPU pass, many species

The technical trick is clean. In src/model.py, the repo uses grouped convolutions so each NCA species keeps its own parameters while still being updated in parallel. That matters because the interesting part of the experiment is not the math of one agent. It is the interaction between many agents sharing the same substrate, the same resource signal, and the same hard limits.

The repo is built as a loop: pool, feature hooks, grouped update, feedback, repeat.

# Conceptual shape logic used by the engine
# Each species keeps its own channel group.
state = rearrange(state, 'b n c h w -> b (n c) h w')
updated = nn.Conv2d(in_channels=n * c, out_channels=n * c, kernel_size=1, groups=n)(state)
updated = rearrange(updated, 'b (n c) h w -> b n c h w', n=n)
A tight close-up of three separate channels carrying updates through a single mechanism. It explains how grouped convolutions can process multiple species in parallel without mixing their weights.
Parallel updates do not have to mean blended identities.

The repository is built like an experiment harness

What PD-NCA changes

DimensionConventional NCAPD-NCA
Core objectOne model grows one pattern.Many independent models compete in one dish.
Learning loopTrain, then usually freeze.Keep updating during the simulation.
World modelA single grid with a target outcome.A shared substrate with pressure, replacement, and resource signals.
What success looks likeA shape that matches the goal.Open-ended structure that keeps surviving and changing.

We introduce Petri Dish Neural Cellular Automata (PD-NCA): a differentiable multi-agent substrate consisting of a competitive population of neural cellular automata (NCA), trained continuously as an artificial life simulation.

Ivy Zhang, Sebastian Risi, and Luke Darlow, Authors · PD-NCA paper

Measuring whether the dish is becoming more than noise

The repo does not stop at visuals. In src/viz.py, it reaches for higher_order_entropy and compression ratios as a proxy for complexity, which is exactly the kind of move this project needs. If a colony looks busy but compresses like static, that is not the same thing as emergence. The point is to distinguish structure from decorative chaos.