Digital Ecosystems
Digital Ecosystems
Interactive Multi-Agent Neural Cellular Automata
What happens when multiple neural cellular automata species are placed on a shared grid and forced to compete for space? It depends very much on the precise set of simulation and hyperparameters you choose — so why limit yourself to choosing only at the start of the simulation?
Our web-based interactive simulator lets you tweak and tune parameters in real-time, transitioning through stable configurations to approach the edge of chaos: a zone of interest where stable complexity emerges and unfolds in unexpected ways.
Digital Ecosystems
tl;dr
We built an interactive browser-based platform for exploring multi-agent neural cellular automata ecosystems in real-time. Multiple neural species compete for territory on a shared grid while learning via gradient descent. You can checkpoint the simulation, tweak parameters, and branch into alternative futures from the same starting point. We report five case studies spanning edge-of-chaos dynamics, emergent cooperation, and environmental construction.
Introduction
Neural Cellular Automata [1] learn local update rules through backpropagation, producing emergent global behaviour from purely local computation. Most NCA research is non-interactive: you set up an experiment, run it, and analyse the results after the fact. Batch sweeps map equilibria across parameter space but miss path-dependent transients that require sequential changes from a specific dynamical state.
This work lets you reach into the petri dish while it is running. We present a browser-based platform for live parameter steering of multi-agent neural cellular automata: observe a live ecosystem of competing neural species, adjust parameters and watch the response immediately, then save promising states and compare divergent outcomes from the same starting point — echoing the branching exploration of Picbreeder [2].
The system extends the Petri Dish NCA (PD-NCA) framework [3], where NNN neural species compete on a shared 2D grid via online gradient descent. We introduce algorithmic updates, including a tunable growth gate whose steepness acts as a learned Langton-λ\lambda λ parameter [4], controlling whether the ecosystem sits in a frozen, critical, or turbulent regime.
We report five case studies that exercise the platform in distinct ways:
- A growth-gate steepness sweep that pushes species from bistable territories into an excitable edge-of-chaos regime
- An extreme competition temperature that produces a persistent flicker-mixing attractor
- Threshold cycling that yields emergent cooperative spatial sharing — from purely competitive objectives
- A branched optimiser comparison from a single checkpoint revealing three qualitatively different dynamics
- A biogeographic construction study with hand-drawn walls and in situ perturbations
The interactive platform. (1) Control panel: paper-relevant sliders; the Advanced folder (collapsed) contains 30+ further parameters and drawing tools. (2) Timeline dashboard: per-species population strata, Shannon diversity, training loss, and checkpoint/parameter-change markers. (3) Checkpoint tray. (4) Save button. (5) Simulation canvas, here showing five species in a stable territorial equilibrium.
Background
A neural cellular automaton (NCA) is a 2D grid in which every cell carries a small state vector and a shared neural network repeatedly maps each cell’s local neighbourhood to a state update; iterating produces emergent global structure from local rules [1], with extensions to texture synthesis [5], goal-conditioned control [6, 7], and high-resolution rendering via implicit decoders [8].
Multi-agent extensions — where several species share a grid — have been explored in continuous domains like Lenia [9] and Flow-Lenia [10], and in discrete CA settings like Biomaker CA [11] and Coralai [12]. Computational Life [13] shows that self-replicating programs emerge spontaneously from simple computational substrates. These systems use evolutionary or rule-based dynamics; none trains multiple competing species by gradient descent during simulation. PD-NCA [3] does: NNN neural species compete for territory via attack/defence vectors with online backpropagation. Ours is the first work to make such a system directly interactive in real time.
Interactive evolutionary computation [14] and Picbreeder [2] showed that human-guided branching discovers artefacts inaccessible to automated search; NetLogo [15], ALiEn [16], and recent automated open-ended search [17, 18] provide complementary exploration environments. For full details on the original PD-NCA framework, see the PD-NCA blog post.
Method
We introduce six algorithmic updates to PD-NCA, grouped below by what they achieve.
Making it stable New in v2
Two mechanisms prevent the ecosystem from collapsing during interactive exploration. Presence gating restricts competition to cells where a species already has territory: only cells within a dilated 3×3 neighbourhood of a species’ existing footprint participate in the competition softmax. This prevents phantom influence from extinct regions and stabilises the dynamics.
Emergency respawn fires when a species’ total aliveness drops below 1, injecting five seed cells at random non-wall locations. In the original PD-NCA, terminal extinction was permanent — a single bad gradient step could end a species forever. Respawn ensures the ecosystem remains explorable even after drastic parameter changes.
Targeting the edge of chaos New in v2
The growth gate controls which cells can participate in updates via a smooth sigmoid:
[\text{Growth Gate: } g_i(x,y)=\sigma(k_{\text{gate}}\cdot(\tilde{a}_i(x,y)−\theta))]
where (\tilde{a}i(x,y)) is the 3×3 max-pooled aliveness of species (i), (\theta) is the survival threshold (default 0.5), and (k{\text{gate}}) is the steepness. The species’ new alpha channel becomes:
[ a_i^{t+1}=w_i\cdot g_i]
In PD-NCA v1, an aliveness threshold (default 0.4) zeroed out cells below the threshold with a hard cutoff, preventing gradient flow through the aliveness decision. The soft gate replaces this with a differentiable sigmoid. At the default (k_{gate}=20), the sigmoid approximates a step function — but lowering it to ∼5 widens the transition zone, permitting stable intermediate aliveness values and pushing the system toward edge-of-chaos dynamics (see Case Study 1).
How species compete Updated from v1
Each species emits per-pixel attack and defence vectors. As in PD-NCA v1, competition uses cosine similarity: each species’ L2-normalised attack vector is scored against the aggregate defence across all species. A temperature-controlled softmax (parameter \(\tau\) over the resulting scores yields per-species competition weights that determine how much influence each species has at each cell. Lower (\tau) sharpens the competition toward winner-take-all. Presence gating ensures only species with local territory participate in this softmax.
A spatial concentration mechanism uses a sliding-window softmax over local attack/defence energy to focus each species’ competitive force on high-activity cells rather than spreading it uniformly. This prevents dilute species from having disproportionate influence over distant cells.
Making it fair Updated from v1
Win-rate feedback is a positive-feedback mechanism: a per-cell exponential moving average tracks maximum local aliveness, and cells with high aliveness update more frequently, reinforcing established territories, while weakly-held cells update less often, damping oscillatory boundary dynamics and breaking synchronous-update artefacts.
The loss function replaces PD-NCA’s simple log-population objective with a soft-minimum over per-species aliveness plus an entropy bonus:
[ \mathcal{L} = k^{-1}\log\sum_i \exp\bigl(-k\cdot\beta\cdot\operatorname{asinh}(\bar{a}_i / \beta)\bigr) - w_d \cdot \frac{H(\mathbf{p})}{\log N} ]
The soft-min (with ( k=8 ), ( \beta=0.4 )) focuses gradient on the weakest species, while the normalised entropy bonus (( w_d=0.4 )) pushes toward balanced populations. The asinh ( \operatorname{asinh} ) compression ensures small-population doublings are rewarded as much as large-population gains.
The model architecture is updated from v1′s simple convolutions to MobileNetV2-style inverted residual blocks [19] with a grouped per-species decoder, running entirely in the browser via TensorFlow.js [20].
The Platform
The platform is organised around live parameter steering: observe a running ecosystem, change something and see the response at once, then save states to compare what happens against the road not taken.
Researchers observe transient phenomena as they occur, form hypotheses, and test them by perturbing a live system from a saved state. The workflow has four key capabilities:
- Real-time parameter control. Over 40 parameters — from competition temperature and learning rate to model architecture depth and kernel size — can be adjusted while the simulation runs. Changes take effect immediately, letting the researcher see how the ecosystem responds to each perturbation.
- Timeline dashboard. A stacked area chart tracks per-species population over time, overlaid with checkpoint markers, parameter-change indicators, and sparklines for diversity and training loss. Hover reveals exact metrics at any step.
- Checkpoint system. Five manual slots plus rolling auto-save. Each checkpoint stores the complete state: grid tensor, network weights, optimiser buffers, and metrics history. Loading a checkpoint restores the exact system state, enabling controlled comparisons. Checkpoints can be exported as
.petrifiles for sharing. - Drawing tools. The researcher can paint walls (impassable barriers), erase them, and seed individual species by hand. Walls create biogeographic niches; seeding tests invasion dynamics. The platform runs entirely in the browser using TensorFlow.js [20], the SwissGL rendering library [21], and WebGL — no installation, no server, no GPU drivers. URL recipes encode seed, configuration, and event logs in <2KB fragments for sharing reproducible starting points.
The Control Surface
Growth-gate steepness ((k_{\text{gate}})), survival threshold ((\theta)), and competition temperature ((\tau)) together span a three-dimensional regime space. The platform lets users move through it live — adjusting any of the three while the simulation runs and watching the dynamics respond.
The widget below is a flat map of that space. Toggle between ( \tau ) vs ( \theta ) (at a chosen (k_{\text{gate}})) and (k_{\text{gate}}) vs ( \theta ) (at a chosen (\tau)); the heatmap colour is the gate survival probability — the chance a species passes the growth gate at each point, accounting for the flicker variance that arises at low (\tau). At low (\tau), per-cell winners flip every step, increasing aliveness variance and effectively smearing the gate boundary into the curved contours visible below. The dashed line marks (\theta=1/N): below it, a uniform population of NNN species survives the gate.
Case Studies
We report five case studies, each exercising a different mode of interaction with the platform.
Case Study 1: Growth Gate as Learned Edge of Chaos
Variable: k_gate steepness | Grid: 256×256 | Optimiser: SGD
Most of our parameter changes affect how the species train — learning rates, loss weights, optimiser choices. The growth gate steepness is different: it changes the simulator itself, reshaping which cells are alive and which are dead on every step.
Case Study 2: Extreme Competition Temperature
Variable: τ = 0.1 (winner-take-all) | Grid: 128×128
At (\tau=0.1), the inter-species softmax is nearly one-hot. Small fluctuations determine the per-cell winner on each step, and that winner flips the next step as the losing species’ gradients catch up. The result is a persistent flicker-mixing attractor: every pixel flickers between species on every step, yet the system as a whole is stable.
Case Study 3: Emergent Cooperation via Threshold Cycling
Variable: survival threshold schedule | Grid: 128×128 | (τ=1.0)
Every species in PD-NCA optimises a single objective: grow. There is no cooperation reward. PD-NCA v1 [3] already observed that cooperation can emerge from purely competitive objectives; the interactive platform enables controlled investigation of how and when this happens.
Case Study 4: Optimiser Choice and Learning Rate
3 optimisers × 2 learning rates = 6 branches from one checkpoint
We save a single state, branch it six ways, and observe three qualitatively different ecosystems emerge from identical initial conditions.
Case Study 5: Biogeographic Construction
Hand-drawn walls + in situ perturbations | Grid: 200×200 | SGD
This case study perturbs the environment rather than parameters. We painted an intricate wall field on a 200×200 grid and seeded five species by hand, then ran SGD with (τ=0.99), (thr=0.43).
Discussion
Interactive exploration is most valuable in the hypothesis-generation phase. Each of our five case studies revealed something that would be difficult to discover through batch parameter sweeps alone: the edge-of-chaos transition emerges from gradual ramping, not cold-start; cooperation is path-dependent, seeded by territorial history; optimiser dynamics diverge within 50 steps of branching; and wall geometry shapes equilibria in ways that are impossible to anticipate without drawing them.
Citation
For attribution in academic contexts, please cite this work as
Luke Darlow, "Digital Ecosystems: Interactive Multi-Agent Neural Cellular Automata", Sakana AI, 2026.
BibTeX citation
@misc{darlow2026digitalecosystems,
title = {Digital Ecosystems: Interactive Multi-Agent Neural Cellular Automata},
author = {Luke Darlow},
year = {2026},
url = {https://pub.sakana.ai/digital-ecosystem}
}
### Code
The source code for the interactive platform is available at [github.com/SakanaAI/digital-ecosystem](https://github.com/SakanaAI/digital-ecosystem).
### Acknowledgements
We acknowledge the Frontier Intelligence Group at [Sakana AI](/content/site-root.html) for their creative thoughts, ideas, and testing of the Digital Ecosystems demo. We also thank Ivy Zhang and Sebastian Risi for the original PD-NCA framework on which this work builds. The interactive platform uses [SwissGL](https://google.github.io/swissgl/) by Alexander Mordvintsev for WebGL rendering.