year: 2025/04
paper: https://arxiv.org/abs/2504.11855
code: https://github.com/etimush/EngramNCA
website: https://etimush.github.io/EngramNCA/
connections: NCA, memory engrams, self-organization, planaria, Critical Neural Cellular Automata


ABSTRACT

EngramNCA proposes a Neural Cellular Automaton (NCA) architecture incorporating private, intracellular memory channels alongside publicly visible states. This design draws inspiration from biological phenomena (like memory transfer in Aplysia via RNA or memory retention in regenerated Planaria) that challenge the purely synaptic view of memory. The model uses a two-part NCA system: GeneCA learns to grow basic morphologies based on fixed “genetic” encodings in seed cells, while GenePropCA dynamically modulates these private genes to orchestrate complex pattern formation. This separation allows for hierarchical control, coexisting morphologies, and potentially more stable learning of dynamics, offering a computational testbed for exploring decentralized, non-synaptic memory mechanisms.

Challenging the Synaptic Dogma

The dominant paradigm in neuroscience, the “synaptic dogma,” posits that memories are stored primarily through modifications in the strength of connections (synapses) between neurons. While synaptic plasticity is undeniably crucial, accumulating biological evidence hints at a more complex picture. Experiments demonstrating memory-like effects transferred via RNA injection between trained and untrained Aplysia (sea slug), or the remarkable retention of learned behaviors in Planaria even after decapitation and head regeneration, strongly suggest that information storage isn’t confined to synapses alone, pointing towards intracellular mechanisms, potentially involving molecules like RNA, acting as carriers or substrates of memory – the physical “engram.” EngramNCA takes this biological inspiration seriously, attempting to model how such intracellular memory might function computationally within a self-organizing system like an NCA.

Public States and Private Memories

EngramNCA modifies the standard NCA framework by partitioning each cell’s state. Some channels represent publicly visible information (like color/alpha and hidden states usable by neighbors), analogous to signals passed between neurons.
Other channels are designated as private ‘gene’ channels, forming a cell-internal memory “tape” (implemented as a binary vector). This private information is accessible only to the cell itself for its internal computations but is not directly perceived by its neighbors.

This architecture splits the learning process across two cooperating NCAs:

  1. GeneCA: This base NCA learns the “physics” of morphogenesis. It’s trained to grow specific primitive shapes based on a static, unique binary gene encoding present only in the initial seed cell. GeneCA uses both local public states and its own private gene state to determine how to update its public channels, effectively learning genotype-to-phenotype mappings. However, it cannot change or spread the gene information. Its weights are frozen after this stage.
  2. GenePropCA: Layered on top of the frozen GeneCA, this NCA acts as a dynamic controller. Its role is only to update the private gene channels of cells, based on the surrounding public and private states. It learns how to manipulate and propagate the gene information across the cellular collective to achieve higher-level goals, essentially directing the GeneCA’s morphology generation over time and space.

The full EngramNCA executes these sequentially each step: GeneCA updates public states based on current genes, then GenePropCA updates the genes for the next step. This creates a system where stable, low-level morphogenetic rules (GeneCA) can be dynamically orchestrated by a separate mechanism controlling underlying cellular identity or state (GenePropCA via private genes).

Why Separate GeneCA and GenePropCA?

This two-part structure addresses a limitation in standard NCAs where the entire behavior is encoded within a single set of weights. In EngramNCA, GeneCA learns fundamental “growth” rules applicable across different target shapes defined by genes, while GenePropCA learns the control strategy for deploying these primitives. This separation facilitates:

  • Modularity & Hierarchy: Complex structures can be built by composing simpler primitives. GenePropCA learns the composition rules.
  • Coexistence: Multiple patterns, governed by different gene states, can potentially exist and interact on the same grid using the same underlying GeneCA physics, something difficult in standard NCAs which tend towards homogeneity.
  • Encoding Control Separately: It isolates the mechanism for pattern generation (GeneCA) from the mechanism for pattern selection and propagation (GenePropCA), potentially leading to more robust and interpretable control.

Methodology

EngramNCA stores each cell’s state as

where is the state at grid location ;
are the public channels (RGBA: α plus RGB),
are additional hidden channels visible to neighbors,
are private binary gene channels internal to each cell.

Perception aggregates a cell’s 3×3 neighborhood of public+hidden via four 3×3 kernels:

where

  • copies the central patch,
  • detect horizontal/vertical gradients,
  • captures second‐order differences (curvature).

GeneCA updates only public channels () using

with private genes held constant and their concatenation.

GenePropCA updates only private genes ():

Gating masks:

  • Living mask if any α in cell or its 8 neighbors exceeds the alive threshold, else 0.
  • Update mask selects cells stochastically each step.

On each tick: apply GeneCA → update → apply GenePropCA → update .

Training: pool‐train GeneCA on primitives (Pixel‑MSE loss); freeze its weights, then train GenePropCA on complex static/dynamic targets (e.g. Lenia) with accumulated frame‐wise MSE.

Training and Experimental Probes

The training mirrors the architectural split. GeneCA is trained first on multiple primitive shapes simultaneously, using separate pools for each primitive’s gene encoding, forcing it to learn general growth rules conditioned on the initial gene state. Pixelwise-MSE loss drives this phase. Once GeneCA is trained and its weights frozen, GenePropCA is trained to achieve more complex target morphologies (like a full lizard or a fractal) or dynamics (like a Lenia glider). It starts with a specific seed gene and learns to modify/propagate genes over time so that the underlying GeneCA produces the desired outcome, again using Pixelwise-MSE. For dynamic tasks like Lenia, loss is accumulated frame-by-frame to capture temporal dependencies. Experiments systematically tested capabilities: growing coexisting primitives, generating novel hybrid shapes from mixed gene encodings (demonstrating some generalization), building hierarchical structures (lizard from parts, lizard from polygons, fractal from lines), handling multiple target morphologies via meta-genes, and replicating the complex spatio-temporal dynamics of a Lenia glider.

Demonstrating Decentralized Memory and Control

EngramNCA successfully grew multiple distinct primitives side-by-side, maintaining their identity even when spatially close. It showed compositional generalization by creating stable hybrid shapes when given novel, mixed gene encodings it hadn’t seen during training. The hierarchical assembly tasks were successful, with GenePropCA learning to effectively propagate and modify gene states to orchestrate the underlying GeneCA primitives into complete, complex morphologies like the target lizard or fractal. Notably, EngramNCA significantly outperformed a standard NCA baseline (with equivalent total parameters) in learning and stably replicating the complex, continuous dynamics of a Lenia glider over extended periods. This suggests that the private memory channels might provide a more robust substrate for learning temporally stable, dynamic patterns compared to relying solely on public channel interactions. The overall stability of generated patterns, both static and dynamic, appeared enhanced by the private gene mechanism.

Open question

How does the system scale with more complex primitives or targets?
Could this architecture be adapted for tasks beyond morphogenesis, perhaps in reinforcement learning or distributed computation?
Applying EngramNCA to abstract reasoning benchmarks like ARC, exploring the explicit role of different timescales – potentially fast updates for public channels (synaptic-like) and slower updates for private genes (molecular/epigenetic-like) – might offer deeper insights.