Product Kanerva Machines: Factorized Bayesian Memory

Adam H. Marblestone, Yan Wu, Greg WaynearXiv 2020

Researchers at Google DeepMind have introduced the Product Kanerva Machine (PKM), a hierarchical memory system that factorizes a large Bayesian memory into several smaller, specialized "machines." This approach addresses the cubic scaling bottleneck of traditional Kanerva Machines while enabling the model to spontaneously organize information—such as grouping images by color or factorizing complex scenes into individual objects—without explicit supervision.

The Scaling and Organization Problem

Most neural networks utilize "slot-based" external memories, which often struggle to automatically compress data, organize related items, or function generatively. The Kanerva Machine (KM) was previously proposed to address these issues using Bayesian inference for memory updates. However, the KM scales poorly ($O(m^3)$ relative to the number of memory columns $m$) and tends to distribute information across the entire memory without logical grouping. If a red cat and a blue dog are stored, a standard KM smears that information across all parameters rather than dedicating specific sections to "redness" or "dogs."

Methods: Factorizing the Memory

The PKM divides the system into $k$ smaller Kanerva Machines. Key technical components include:

  • Factorized Likelihood: The model uses a "generalized product" of experts, where the probability of an observation is the product of probabilities from individual machines, each weighted by $r_i$.
  • Assignment Network: A multilayer perceptron (MLP) learns to infer weights ($r_i$), determining which machines should "listen" to or "speak" about a specific input.
  • Bayesian Updates: Memory writes are Bayesian posterior updates. Factorization allows these to occur in parallel, reducing computational cost from $O(m^3)$ to $O((m/k)^3)$.
  • Readout: Reading involves a precision-weighted average of outputs from all $k$ machines.
Figure 1: PKM Architecture and Scaling. (A) Schematic of the PKM. (B) Graphical model. (C-D) Run time analysis showing O(m^3) scaling benefits. (E) Reconstruction error across training.

Key Insights and Results

The researchers evaluated the PKM on MNIST reconstruction, an RGB Binding Task (digits stored in different color channels), and Dancing dSprites (moving 2D shapes).

Spontaneous Specialization and Clustering

The most striking result is that the model learns to specialize without explicit labels. In the RGB task, the assignment network naturally learned to use specific machines for different color channels, effectively performing unsupervised classification. On the dSprites task, machines specialized by location, "tiling" the visual space as experts for specific regions.

Figure 4: RGB Binding Task Results. (B) Visualizations of machine specialization. (C) Reconstruction error comparison. (D) Machine weights correlated with digit classes, showing unsupervised clustering.

Efficiency and Performance

  • Computational Speedup: For large memories ($m > 500$), moving to $k=2$ machines provided significant empirical run-time advantages, matching theoretical $O(m^3)$ reductions.
  • Accuracy Parity: The factorized PKM achieved reconstruction accuracy comparable to the flat KM, proving that factorization does not sacrifice representational power.
  • Combinatorial Efficiency: By using a product of experts, the model can represent complex scenes by combining specialized components, similar to how language combines a limited vocabulary into infinite sentences.

Limitations and Future Work

Current limitations include update coupling, where optimal updates for one machine technically depend on others, and the simplicity of the gating mechanism. Future work may explore attention-based selection, explicit event segmentation, and relational inductive biases to model complex relationships between groups (e.g., spatial relations between objects).

Summary updated

BibTeX
@misc{marblestone2020product,
  author = {Adam H. Marblestone and Yan Wu and Greg Wayne},
  title = {{Product Kanerva Machines: Factorized Bayesian Memory}},
  year = {2020},
  eprint = {2002.02385},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.02385},
}
Figure