[Paper Review] Variational Memory Addressing in Generative Models
This paper proposes a variational memory addressing mechanism in generative models that treats memory read operations as stochastic discrete addressing of a non-parametric memory buffer, enabling effective training via variational inference. By modeling the memory address as a latent variable and using target-guided attention, the method achieves robust few-shot generation and inference even with large memory banks, outperforming soft-attention baselines on Omniglot and maintaining stable performance without temperature annealing.
Aiming to augment generative models with external memory, we interpret the output of a memory module with stochastic addressing as a conditional mixture distribution, where a read operation corresponds to sampling a discrete memory address and retrieving the corresponding content from memory. This perspective allows us to apply variational inference to memory addressing, which enables effective training of the memory module by using the target information to guide memory lookups. Stochastic addressing is particularly well-suited for generative models as it naturally encourages multimodality which is a prominent aspect of most high-dimensional datasets. Treating the chosen address as a latent variable also allows us to quantify the amount of information gained with a memory lookup and measure the contribution of the memory module to the generative process. To illustrate the advantages of this approach we incorporate it into a variational autoencoder and apply the resulting model to the task of generative few-shot learning. The intuition behind this architecture is that the memory module can pick a relevant template from memory and the continuous part of the model can concentrate on modeling remaining variations. We demonstrate empirically that our model is able to identify and access the relevant memory contents even with hundreds of unseen Omniglot characters in memory
Motivation & Objective
- To address the challenge of effective memory retrieval in generative models by treating memory addressing as a stochastic latent variable.
- To enable training of memory-augmented generative models using variational inference that leverages target information for precise memory lookups.
- To scale memory-augmented models to large memory banks (e.g., 2500+ entries) without performance degradation.
- To provide a principled way to quantify information gain from memory lookups and measure memory contribution via KL divergence over discrete addresses.
- To demonstrate the effectiveness of discrete memory addressing in few-shot generation tasks, especially when memory content is disjoint and non-interpolative.
Proposed method
- The model interprets memory read as a conditional mixture distribution where a discrete address variable a selects a memory content m_a, which then conditions a continuous latent variable z for generation.
- A variational approximation q(a|x) is used to infer the memory address, with the attention distribution over addresses computed via a learned similarity measure between the input x and memory contents.
- The model uses amortized variational inference to train the memory addressing module, allowing gradient-based optimization through the stochastic address selection.
- The generative model is structured as p(x|m_a, z), where m_a is retrieved from memory based on the sampled address a, and z is a continuous latent variable modeling residual variation.
- The KL divergence between the approximate posterior q(a|x) and the prior p(a) is used as a regularizer and provides a meaningful measure of memory usage.
- The method supports hard attention (sampling) during training with K posterior samples, enabling scalable and stable optimization even with large memory sizes.
Experimental results
Research questions
- RQ1Can discrete, stochastic memory addressing improve the accuracy and robustness of memory-augmented generative models in few-shot learning?
- RQ2How does variational inference over discrete memory addresses compare to soft-attention mechanisms in terms of scalability and performance?
- RQ3Can the KL divergence over the discrete addressing variable serve as a reliable indicator of memory usage and model behavior?
- RQ4Does the model maintain strong performance when tested with a large number of unseen memory entries not seen during training?
- RQ5Can the model generalize effectively to disjoint, non-interpolative memory content without requiring temperature annealing or architectural modifications?
Key findings
- The model achieves 89.6% few-shot classification accuracy on 5-way 1-shot Omniglot with 16 classes in memory, outperforming soft-attention baselines that degrade rapidly beyond 4 classes.
- With 2500 memory entries at test time, the model trained on only 32 entries generalizes robustly, demonstrating strong zero-shot transfer and scalability.
- The model maintains high performance without temperature annealing, as the interplay between p(a) and q(a|x) naturally balances exploration and exploitation.
- On the Omniglot dataset, the model achieves 91% and 97% accuracy for 5-way 1-shot and 5-shot classification using q(a|x) for inference, respectively.
- The KL divergence over the discrete address variable shows intuitive behavior: low values on MNIST (few distinct components) and high values on Omniglot (many distinct components), indicating effective memory usage.
- The hard-attention implementation becomes faster than the soft-attention baseline at M ≥ 48 entries due to reduced computational overhead per parameter update.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.