This NeurIPS 2018 paper from DeepMind introduces the Dynamic Kanerva Machine (DKM), a generative memory system that leverages attractor dynamics to robustly retrieve and "clean up" stored patterns. By framing memory as a probabilistic inference problem, the authors bypass the notorious training difficulties associated with attractor-based neural networks.
The Challenge of Attractor Dynamics
Most modern memory-augmented neural networks (like the Differentiable Neural Computer or standard Attention mechanisms) use a "one-shot" reading process, computing a weighted average of memory slots and moving on. However, biological systems and theoretical models suggest that memory retrieval is an iterative, dynamic process.
The gold standard for robust retrieval is attractor dynamics (similar to Hopfield networks), where a noisy input is iteratively refined until it settles into a stable "attractor" state—the original memory. The problem is that training these dynamics with gradient descent is incredibly hard. Because attractors are regions where the system's state stops changing (the gradient goes to zero), backpropagating through the settling process leads to vanishing gradients.
The Dynamic Kanerva Machine (DKM)
The authors build upon the Kanerva Machine, which views memory as a global latent variable in a generative model. The DKM introduces several key innovations to enable stable attractor dynamics:
- Memory as Inference: Storing a new pattern is treated as a Bayesian update of the memory matrix.
- Dynamic Addressing: Instead of using fixed, learned addresses, the DKM uses a "parameter-free" approach. It finds the best addressing weights for a given input by solving a regularized least-squares problem at every step, allowing the model to adapt to different numbers of stored patterns on the fly.
- Emergent Attractors: Instead of explicitly training a recurrent network to be an attractor, a Lyapunov function (an energy function that always decreases) naturally emerges from maximizing the variational lower-bound (ELBO).
- Iterative Retrieval: To retrieve a memory, the model performs coordinate descent on its own energy landscape. It alternates between finding the best addressing weights for the current "guess" and generating a new "guess" from the memory.
Crucially, because the attractor dynamics emerge from the probabilistic structure rather than being simulated during the training's forward pass, the model avoids the vanishing gradient problem entirely.
Key Insights and Ideas
- Likelihood as Energy: The negative log-likelihood of the model acts as an energy function. Iterative retrieval is essentially the model "seeking" the highest likelihood state, which corresponds to the most plausible stored memory (illustrated by the coordinate descent in the energy landscape above).
- Training without Simulation: By using the ELBO as the objective, the researchers ensure that the "valleys" in the energy landscape correspond to stored memories without ever having to backpropagate through the iterative "rolling down the hill" process.
- The "Flat" Capacity Curve: One of the most striking findings is that the DKM's performance doesn't degrade significantly as the number of stored patterns increases. As shown in the capacity plots, the DKM's dynamic addressing allows it to generalize to much longer sequences than it saw during training, outperforming standard models in this "long-tail" regime.
Experimental Results
The model was evaluated on two distinct types of data: Omniglot (handwritten characters treated as binary data) and DMLab (procedurally generated 3D maze environments with complex, continuous visual data).
- Robust Denoising: The DKM successfully took images corrupted by 15% salt-and-pepper noise (Omniglot) or heavy Gaussian noise (DMLab)—noise types never seen during training—and iteratively "cleaned" them back to the original stored pattern. The figure above demonstrates this iterative refinement and the corresponding drop in system energy.
- Generative Quality: The model improved the quality of samples drawn from its prior. By starting with a low-quality random sample and running the attractor dynamics, the model pulled the sample toward a valid, sharp image stored in its memory.
Limitations and Future Work
While powerful, the DKM has a few notable limitations:
- Computational Complexity: The dynamic addressing step involves a matrix inversion (a least-squares solve) with a complexity of $O(K^3)$, where $K$ is the number of memory rows. This is more computationally expensive than simple attention mechanisms.
- Saddle Points: In the more complex DMLab experiments, the energy landscape sometimes contained saddle points. This caused the energy to temporarily rise before falling, slightly violating the strict definition of a Lyapunov function in those instances.
- Stochasticity: The current work focuses on deterministic dynamics. Exploring stochastic dynamics (like MCMC) could be a promising future direction for even more robust generative memory.
Summary updated