Variational Neural Cellular Automata

Rasmus Berg Palm, Miguel González Duque, Shyam Sudhakaran, Sebastian Risi

In nature, a single fertilized egg contains the instructions to build an entire organism, from a microscopic tardigrade to a massive giant sequoia. This biological process—cellular growth and differentiation—is decentralized, self-organizing, and incredibly robust to damage. In a paper presented at ICLR 2022, researchers introduced the Variational Neural Cellular Automata (VNCA), a generative model that brings this biological magic to the world of machine learning.

The Problem: Global Rigidity vs. Local Robustness

Traditional generative models like Variational Autoencoders (VAEs) or Generative Adversarial Networks (GANs) typically use deep convolutional networks to map a latent vector directly to an image. While highly effective at producing high-quality images, these models are "global" and rigid; they lack the decentralized robustness found in biological systems. If you perturb their intermediate layers, the entire output often collapses.

Conversely, previous work on Neural Cellular Automata (NCA) demonstrated that local update rules could grow complex, functional artifacts (like a specific emoji) that can even regenerate when "cut" in half. However, these standard NCAs were "one-trick ponies"—they could only learn to generate the single specific image they were trained on and lacked the ability to represent a broad distribution of data.

The VNCA bridges this gap. It creates a system capable of generating an infinite variety of samples (like different faces or digits) while retaining the self-organizing, regenerative properties of a cellular automaton.

Methods: Merging VAEs with Cellular Growth

The authors combine the probabilistic framework of a VAE with the iterative, bottom-up logic of an NCA. The architecture shifts the heavy lifting from a standard top-down decoder to a decentralized growth process.

  1. The Encoder: A standard Convolutional Neural Network (CNN) takes an input image and compresses it into a latent vector $z$.
  2. The Seed: This vector $z$ acts as the initial state for a small $2 \times 2$ grid of "cells."
  3. The Decoder (NCA): Instead of a single pass through a network, the image iteratively "grows."
Architecture of the Doubling VNCA

The authors propose two main variants for the decoder:

  • Doubling VNCA: Inspired by biological mitosis, the grid starts small and periodically doubles in resolution (e.g., $2 \times 2 \to 4 \times 4 \to \dots \to 32 \times 32$). Between these doublings, the cells run several steps of an NCA update rule, where each cell's next state depends only on its immediate $3 \times 3$ neighborhood.
  • Non-doubling VNCA: The grid remains at a fixed resolution throughout the process. This version is specifically optimized for damage recovery using a "persistent pool" of states during training, forcing the model to learn stable attractors.

The entire system is trained by maximizing the Evidence Lower Bound (ELBO), identically to a standard VAE.

Key Insights and Results

The researchers evaluated the VNCA on three well-known benchmarks: MNIST (handwritten digits), CelebA (celebrity faces), and Noto Emoji.

Growth as an Inductive Bias: The "doubling" mechanism provides a strong inductive bias for image generation. By starting small, cells can "agree" on global structures (like the overall shape of a head) before the resolution increases and they focus on local details (like eyes or hair).

Stable Attractors and Extreme Robustness: In the non-doubling variant, the model doesn't just reach a final state and stop; it learns a "stable attractor." If you erase half the cells, the remaining cells communicate and "regrow" the missing parts of the image because the global pattern is an equilibrium of the local rules. It treats the damage as a perturbation and "heals" back to the learned state.

Image growth and damage recovery

Quantitative Performance: * Reconstruction & Generation: The VNCA successfully learns to reconstruct and sample new images. On MNIST, it achieved a log-likelihood of $\geq -84.23$ nats. While slightly behind state-of-the-art (SOTA) autoregressive models (like PixelCNN at -81.3), it is a highly competitive result for a purely self-organizing model. * CelebA: For faces, the model achieved 4.42 bits per dimension (bpd). While there is a gap compared to SOTA hierarchical VAEs (~2 bpd), the VNCA produces recognizable, diverse faces. * Decentralized Latent Space: Visualizations show that the VNCA's latent space separates digit classes more cleanly than a standard convolutional VAE baseline, suggesting that the requirement to "grow" a pattern forces the model to learn more meaningful representations.

Limitations and Future Work

The authors are transparent that the VNCA is currently a proof-of-concept for a new type of generative model rather than a direct competitor for pure SOTA image quality.

Because the decoder is iterative (running many NCA steps), it is significantly more computationally expensive to train and sample from than a standard one-pass CNN. Furthermore, to keep computation manageable, the authors used a relatively small update network (1.2M parameters), whereas SOTA models often use hundreds of millions.

Future directions include exploring the connection between VNCA and Diffusion Models—which also generate data through iterative processes—and finding ways to combine the high-quality generation of the "doubling" variant with the extreme damage resilience of the "non-doubling" variant.

Summary updated

BibTeX
@inproceedings{palm2022variational,
  author = {Rasmus Berg Palm and Miguel González Duque and Shyam Sudhakaran and Sebastian Risi},
  title = {{Variational Neural Cellular Automata}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=-o6XlN69RQT},
}
Figure