Left: GeneCA trained to grow simple polygons through immutable gene encodings. These polygons are stable in time, exhibit individuality (strong morphological boundaries), and their genes can be combined to produce new out-of-training polygons. Center: GenePropCA trained to grow a lizard morphology by exploiting the gene embeddings of the GeneCA (left). The GeneCA cannot modify its own gene embedding, and the GenePropCA cannot modify the visible channels, yet the GenePropCA can learn to exploit the GeneCA gene embeddings and force it to draw a target morphology. Right: By adding immutable genes to the GenePropCA that neither it nor the GeneCA can modify, we can encode multiple target morphologies, where the GenePropCA can exploit the GeneCA genes to grow different morphologies.
Current version: draft v.0.1, Feb 2025
*Corresponding author (stefano.nichele@hiof.no)
Paper Repository: GitHub
PDF Preprint: Will be added here
Published article: will be added here
Google Colab:
The currently most accepted theory of memory in biological and artificial brains is the synapses dogma
In this work, we propose a Neural Cellular Automaton (NCA)
We extend the NCA model in two ways:
When CA cells update their state, their internal neural network (a homogeneous neural network with identical weights for all cells) acts upon the visible channels in the neighborhood, in addition to the cell’s own private memory. The result is the interplay of the visible component and the (private) memory stored within the cell.
As such, a focus is to train the NCA to utilize its cells internal memory to full capacity, since it is not directly accessible by other cells. Therefore, it has to learn to produce a reverberation of it through its visible channels in order to carry out the collective computation in coordination with the neighbors.
This coordination is achieved by first training an NCA to grow from a seed cell to a set of primitive morphologies. The only cell initially containing the genetic information (private memory) representing the target morphology is the seed cell itself. Each morphology is encoded by a different private representation. Therefore, this NCA has to learn to achieve the global task only through its visible channels. The neural network weights of this first NCA are then frozen and do not change. We name this first neural network GeneCA.
Subsequently, another NCA is trained in addition to the previous, which does not manipulate and change the visible information of cells, but can only change their private genetic memory, i.e., a set of private channels. As such, it has to learn a mechanism to regulate the private information such that the previously learned primitive morphologies (or their combination) can be utilized and activated at the right time and in the right place. We name this second neural network GenePropCA, short for GenePropagationCA.
The GenePropCA mechanism is an abstraction for RNA molecular transmission between cells, which provides a form of functionality transfer. The transmitted functionality is stored in the cell’s internal memory and, in turn, affects the behavior of the GeneCA (the cell’s visible state).
Note that in biological systems, the two types of information transfer, i.e., synaptic transfer and RNA transfer, may happen at two different timescales. Typically, spikes through synapses are transmitted faster than RNA transfers. However, in our framework we have tested with different timescales (basically running the GeneCA faster than the GenePropCA, or vice versa) without affecting the functionality. Overall, the system learns to adjust the rate of updates from one of the two NCA to solve the task at hand.
We test the proposed NCAs on different morphogenetic tasks, including the growth of simple yet stable primitives, out-of-distribution mixtures of primitives, more complex morphologies obtained by the combination of basic primitives, and moving primitives such as Lenia gliders.
In this section , we introduce the changes to the overall architecture from
Taking inspiration from RNA memory transfer observed Planarians and Aplysia, we augment the NCA hidden state with a "private tape".
Instead of extending the classic NCA model by appending the tape to the hidden states, we choose to sacrifice hidden states by privatizing them, this ensures that any
improvements seen are not due to an increase in model size (please see Appendix 1 for masking of hidden channels to investigate task deterioration with less available channels). The hypothesis here is that the private tape augmentation can be exploited to encode different modalities of behaviour,
such as growing different shapes or representing different computations. An illustration is provided in , where the channels of the cell are represented, including the RGB
channels, the alpha channel, three additional channels, plus three gene channels (G1,G2, and G3) representing the private tape.
We chose to encode different "primitives" in the tape through binary representation. These primitives can consist of simple shapes such as convex polygons or more complex, convex, compound shapes such as body segments of a lizard emoji. Examples of encodings are represented in and , where three basic geometric morphologies and lizard parts are given, respectively.
The tape length has to be chosen such that
The first model (), which we name GeneCA, is tasked with learning the primitive embedding. It takes
inspiration form the original NCA
The GenePropCA model () is tasked with exploiting the gene embedding learned by the GeneCA. By conditioning the primitive growth in the GeneCA to a specific embedding, these embeddings now carry latent information about the primitives. We assume that the latent information in each embedding can be modified to produce out-of-distribution behaviour, thus allowing the GenePropCA to both propagate and modify the genes to achieve a desired goal. The architecture of the GenePropCA is similar to that of the GeneCA, where the neural network parameters produce a partial cell state update. In this case, only the genes channels are updated. Like in the GeneCA, the unmodified cell states are cloned and appended after the asynchronous partial update, leading to the GenePropCA having no influence over non-gene channels.
The EngramNCA ensemble model () uses the GeneCA and GenePropCA to produce the final morphology. The GeneCA works without the GenePropCA and will produce the primitives. The GenePropCA is dependent on the GeneCA as its parameters are trained to manipulate the GeneCA dynamics. At step N, the state of the CA is passed to the GeneCA, where it only modifies the visible and hidden channels to produce an intermediate state, the intermediate step is then passed to the GenePropCA, where only the gene encoding channels are modified to produce step N+1. The idea here is for the GenePropCA to learn to exploit the gene embedded dynamics of the GeneCA to produce more complex morphologies than that found in the GeneCA.
For a formal mathematical definition of the proposed models, including GeneCA, GenePropCA and the ensemble model EngramNCA, together with the training procedure, please refer to the relative section in Appendix 2)
The traditional NCAs presented in
Our model presents a possible solution to this problem by tying the morphological result to an unchanging seed cell. In this way, we hypothesize that the NCA learns general growing dynamics necessary for any morphology, alongside encoding-specific dynamics for the details of the morphology.
The first step in the hierarchical growth task was to grow coexisting morphologies. In effect, this means to grow multiple distinct morphologies using the same set of NCA (our GeneCA) parameters. Much like the original growth task as described in
From a trained GeneCA we then trained the GenePropCA to exploit the latent-space embeddings that the genes now represent. The three different GeneCA mentioned previously where used to test the GenePropCAs capabilities under different circumstances. A high primitive count, low combinatorial problem in growing the lizard (, left), where there is only one valid combination. A low primitive count, high combinatorial problem in growing a fractal-like shape (, right) from vertical and horizontal lines. Finally, a combination of the two, by growing a lizard from basic polygons.
For final step in the hierarchy, we chose to explore growing multiple morphologies from the same GeneCA and GenePropCA. This was accomplished by extending the model one hierarchy up, and imbuing the GenePropCA with its own meta-genes, that it could see, but neither it nor the GeneCA could modify, and using those meta-genes to encode for entire morphologies.
In this section we provide a description of the training procedure, including two distinct training phases, a special pooling method to train multiple primitives at one, and how the GeneCA weights are frozen when training the GenePropCA.
The loss function used for training on all the images is the Pixelwise-MSE, as used in
Where
GeneCA training is similar to the pool-training procedure presented in
GenePropCA training uses the same batch training technique as the GeneCA. We typically only train a single morphology, however multiple morphologies can be trained by sacrificing more channels to act as "meta genes". These meta genes are unaffected by both the GeneCA and GenePropCA. During the training of the GenePropCA the GeneCA weights are frozen, though their gradient contribution during the growth process is still used when backpropagating the loss to the GenePropCA. This ensures the GenePropCA's dynamics are conditioned on those of the GeneCA. shows the GenePropCA training with GeneCA frozen weights.
The model was tested with different configurations, and below are the results for our experiments. Generally, the NCA has a size of 30 x 30, there are 16 channels in total of which the first four are the alpha value and the three color channels. Of the remaining 12 hidden channels, eight channels were privatized, i.e. could be read but not be altered by the GeneCA.
Three primitives were chosen as target shapes: A blue square, a green circle and a red triangle. Those primitives have a corresponding one-hot encoding in the private tape. The GeneCA was trained to update the public channels of the CA such that the right primitive is formed around the seed cell. It is important to note that there is no gene propagation at this point, only the update of the public channels that the GeneCA calculates based on the available private and public channels.
During test time, cells of the CA are picked as seed cells, and their private tape is altered.
In the top of we show how the binary encodings of the three primitives are assigned to three different cells in the CA, with the distance between them being great enough to avoid interactions between cells belonging to different primitives. Starting from the seed cell, the shapes and their color form over a number of update steps. Afterwards, they remain stable.
shows what happens if seed cells are placed in such proximity to each other that the resulting primitives would normally overlap. As can be seen, the shapes remain largely distinct. Especially shapes of the same kind have neither overlap nor mixing and instead a border can be visually seen. Circles placed in proximity to each other can for example be seen to form a comb-like structure (top of ). If shapes of different kinds meet, the distinction is not always as clear and some interactions between different primitives can lead to a mixing of colors, as can be seen in the bottom of . Still, a distinction can be made and no primitive takes over another primitive. This happens without such cases occurring during training.
Only the three one-hot encodings were used during training, but it is possible to deviate from this during test time and to use different binary arrays as the private encodings of the seed cell. This essentially means that there is a mixture of genes. As can be seen in , this leads to the growth of corresponding mixed forms. It can be seen that the shape of those forms is a distorted overlap of the primitives while the color ranges from the pure color of the primitives to the mix of the two colors. The primitives dominate the developing form in those areas where the other primitive is not growing, hence the combination of circle and square leads to most mixing. After a developmental period, the forms remain stable. This stability remains for any form of encoding mixing and seems to be bound by the maximum size of the primitives.
The experiments were repeated with body parts of the lizard image as primitives as can be seen in . As those were more than three parts, the encoding is not one-hot anymore. As before, placing a seed cell with the corresponding encoding leads to the growth and stable persistence of primitives, even though those have more complex shapes and colorings.
Lastly, very simple unicolor vertical and horizontal lines were used as primitive as is depicted in . This is the setup for later experiments.
At the next experimental step, the GenePropCA was included. The attempt was to grow whole morphologies, while the GeneCA weights where frozen on growing primitives.
In the lizard example, the GenePropCA was trained as described above with the initial seed cell containing the gene encoding for the torso primitive and the GeneCA being trained on primitive body parts of the whole lizard (legs, head, torso, tail). As can be seen in , the torso of the lizard is grown first, but the CA then continues to grow the limbs, tail and head. Deactivating the GenePropCA after the lizard is finished growing does not lead to a collapse, rather the lizard maintains its shape under the control of the GeneCA.
The experiment was repeated, this time choosing the circle, square and triangle as primitives and the blue circle as the seed cell during the GenePropCA training. This was successful, as can be seen in . Even if the GeneCA is not trained on all primitives occurring in the final lizard or even on primitives not derived from the target image at all, the GenePropCA is able to generalize and facilitate gene propagation that leads to the growth of the lizard, albeit with less quality as in the case described above for . shows that the choice of the seed cell does indeed matter, as the lizard will only grow successfully if the exact same seed as in the training of the GenePropCA is used.
Further experiments showed that different seeds, which were not used as primitives during the training of the GeneCA, can be used to train the GenePropCA to grow a lizard.
depicts an experiment in which the simple primitives of unicolor vertical and horizontal lines are combined into a fractal-like shape with satisfying performance. This shows that the model can combine simple and few primitives into more complex forms consisting of many primitives in addition to combining complex and many primitives into less complex (complexity in the sense of the combination of primitives) forms consisting of few primitives, as was done before with the lizard.
The final experiment in growing morphologies was to test whether the GenePropCA could additionally grow multiple morphologies. This was done by adding an extra channel as a meta-gene, that neither the GeneCA nor GenePropCA could modify and training the GenePropCA to grow separate morphologies depending on the meta-gene encoding and the starting seed cell encoding.
shows the GenePropCA growing both a lizard morphology and a butterfly by exploiting the same GeneCA gene encodings. The overall quality of reproduction of the lizard has diminished, whilst the butterfly, a much simpler morphology, was reproduced better.
In contrast to the relatively simple task of growing morphologies, we wanted to test if the GenePropCA could exploit the embedding and learn the dynamics of
a complex moving system. For this we chose to replicate the dynamics of a Lenia
shows the result of training a standard NCA on five-hundred frames of the Lenia video. As can be seen, the standard NCA somewhat replicates the dynamics until a certain point, where the simulation falls apart. Possibly due to the NCA only learning to replicate the exact frames it saw and not learning the dynamics.
() shows the result of training the GeneCA and GenePropCA on five-hundred frames of the Lenia video. As can be seen, our method yields visually closer results to the Lenia video. Additionally, the morphology is stable past the five-hundred frame mark, exhibiting signs of having learned more general dynamics that are stable in time. Though not a perfect replication of the Lenia glider, the results are decent.
Neural cellular automata (NCAs) merge the classical framework of cellular automata with modern deep learning by replacing hand-crafted update rules with neural networks that are optimized via gradient-based methods. Earlier studies in cellular automata (e.g.,
Seminal work by
A range of extensions have broadened the capabilities of NCAs.
Extensions in application domains further illustrate the versatility of the NCA framework.
One work that greatly inspired us is
The prevailing paradigm in neuroscience has long held that memory is predominantly stored and transmitted through synaptic plasticity—the so‐called “synaptic dogma”
Inspired by these biological insights, emerging computational frameworks—such as the one proposed here and named EngramNCA—are exploring dual modes of information storage. In these models, the system is endowed with a bifurcated state representation: a publicly accessible channel that mirrors synaptic activity and a private channel that represents intracellular memory. This dual-channel approach reflects the biological separation between immediate synaptic signaling and slower molecular memory transfer, offering a more nuanced basis for capturing complex developmental and memory dynamics. Integrating biological principles of memory into computational models may ultimately pave the way for more robust and adaptable systems.
Our results suggest that having fixed memory portions in the cells makes for more stable expression of learned patterns. Moreover, our results show that the learned dynamic behavior of Lenia could be expressed more accurately using a private memory. This observation supports the proposed mechanism as a possible explanation for how memory could be stored in real bodies. More importantly, it also shows that cell memory could be a promising approach to having more stable distributed systems in AI. Stability is an open problem in AI, which is typically mitigated by pool-training. One avenue for future work is to use EngramNCA cell memory mechanisms when pool-training is not applicable. Additionally, we suggest that EngramNCA could suit more complex datasets such as the Abstraction and Reasoning Corpus (ARC)
Further, the EngramNCA model could provide valuable insights for neuroscience by offering a computational framework that aligns with emerging biological evidence of memory mechanisms beyond the traditional synaptic dogma. By demonstrating how systems with both publicly visible states and private internal memory can develop more stable patterns, hierarchical organization, and robust information transfer, this model suggests potential mechanisms for biological phenomena like memory retention after tissue regeneration or RNA-mediated memory transfer. Specifically, the model illustrates how intracellular memory components might work alongside synaptic connections to create more resilient and multifaceted memory systems—potentially explaining why planaria can maintain memories after decapitation or why RNA transfer can induce learned behaviors. This computational approach could guide future experimental design in neuroscience by predicting how cellular-level memory mechanisms might interact across different timescales and spatial organizations, ultimately leading to a more nuanced understanding of memory encoding, storage, and retrieval in biological systems.
This sections details the preliminary experiments conducted to determine the deterioration in NCA image reconstruction quality as channels are privatized. We measured the loss curves for reconstruction of a lizard emoji, alongside the regrowth capabilities of the NCA to damage. For all experiments the training was repeated once on a set seed for each privatization level, the regrowth experiments where repeated one-hundred times with the damage locations being fixed and identical for each privatization level.
For these experiments we tested three different NCA types:
The loss function used for training and measuring the reconstruction was the PixelwiseMSE:
Where
shows the loss curves of the three models (left to right) with different levels of privatization (0,4,8,12, top to bottom). For privatization levels 0 and 4 the three models are comparable, while at privatization level 8 the DummyVCA performed considerably worse.Finally, the ReducedCA performed best at privatization level 12. From privatization level 0 to 4 there seems to be no discernible change in the loss curves, afterward however, as more channels get privatized the models struggle to learn.
shows how the reconstruction quality (the mean final loss, on a running average of 10) on the lizard emoji decreases as channels are privatized. The data is noisy, thus no proper comparison can be done between the three models, they can be considered to act the same.
shows the mean regrowth loss of the three models as they attempt to reconstruct the damaged lizard. As with the mean final loss, regrowth quality decreases as the number of channels are privatized. The data is once again noisy, even more so here. This is most likely due to the asynchronous nature of NCAs.
From the results of the preliminary experiments, we concluded that there is indeed deterioration in the quality of image reconstruction from the NCA as channels are privatized. However, the choice of architecture does not play a big role in the level of performance loss. Thus, we chose to go with the MaskedCA version for channel reduction as it was the easiest to implement.
In this section we define the proposed models with mathematical detail.
We formalize our EngramNCA as a grid of cells
where
GeneCA updates the public channels (visible and hidden) while preserving the private gene channels. For each cell
where
where Identity, Sobel
where
The GenePropCA updates only the gene channels while preserving the public channels:
where
where
The EngramNCA ensemble combines both models in sequence. For a single update step:
where
where
The GeneCA is trained first with frozen gene channels. For each training iteration, we:
1. Sample a batch of
After training GeneCA, its weights are frozen, and GenePropCA is trained to propagate and modify gene information to grow complex morphologies. The same loss function is used, but with target images representing complete morphologies rather than primitives.
This work was partially supported by The Digital Society strategic initiative at Øsftold University College.
BibTeX Citation
@article{Guichard2025EngramNCA}, title = {EngramNCA: a Neural Cellular Automaton Model of Molecular Memory Transfer}, author = {Guichard, Etienne and Reimers, Felix and Kvalsund, Mia-Katrin and Lepper{\o}d, Mikkel and Nichele, Stefano}, journal = {Github Preprint}, year = {2025}, url = { https://etimush.github.io/EngramNCA/} }