Abstract
Deep generative models typically require extensive training to learn new concepts. Generative Matching Networks (GMNs) address this by enabling instant adaptation to unseen data through a conditional attention mechanism. By interpolating between examples in a learned prototype space, GMNs achieve state-of-the-art performance in few-shot generation and classification without gradient-based fine-tuning.
Introduction
Standard deep generative models, such as Variational Autoencoders (VAEs) and Generative Adversarial Networks (GANs), are "slow learners." Capturing a new concept usually necessitates thousands of examples and significant retraining, which can lead to catastrophic interference—the loss of previously learned information. This paper introduces Generative Matching Networks (GMNs) to bridge the gap between generative modeling and few-shot learning, allowing models to adapt "on the fly" to new concepts using only a few examples.
Methods: Generative Matching Networks
The core of the GMN is a non-parametric adaptation mechanism inspired by Matching Networks. Unlike standard models that generate from a fixed prior, GMNs condition their output on a small dataset $X$.
As illustrated in the architecture above, the process consists of three main stages:
- Computing Attention Kernel: The model samples a latent variable $z$ and compares it to examples in the conditioning set $X$ within a learned "matching space" $\Phi_G$.
- Aggregating Prototypes: Instead of simple averaging, the model computes a weighted sum of "prototypes" $\psi_G(\mathbf{x}_t)$ based on attention scores $a_G(\mathbf{z}, \mathbf{x}_t)$. This allows for nuanced interpolation between examples.
- Decoding: The aggregated representation $r_G$ is passed to a decoder (e.g., a deconvolutional network) to produce the final observation $p(\mathbf{x}|\mathbf{z}, \mathbf{X})$.
To enhance context awareness, a recurrent controller (GRU) processes the conditioning set, ensuring each example's representation reflects its relationship to others. Additionally, a data-dependent prior allows the latent space to adapt to the specific domain of the input set.
Datasets and Evaluation
The model was primarily evaluated on the Omniglot dataset, a benchmark for few-shot learning containing 1,623 handwritten characters. The authors also tested domain transfer by training on Omniglot and evaluating on MNIST digits without further weight updates.
Key Results
GMNs demonstrate significant improvements in both predictive likelihood and classification accuracy. On Omniglot, the negative log-likelihood (NLL) dropped sharply as the number of conditioning examples increased (e.g., from ~83.3 to ~45.8 for a single-class test).
In 20-way, 5-shot classification tasks, GMNs achieved an accuracy of 91.0%, rivaling specialized discriminative models. The model also showed robust transfer capabilities, successfully adapting to MNIST digit shapes despite being trained only on Omniglot characters. This suggests the attention mechanism effectively re-uses conditioned data rather than simply averaging features.
Discussion and Limitations
While GMNs offer a powerful framework for fast adaptation, the authors noted challenges in unsupervised settings. Increasing attention steps provided diminishing returns, suggesting that learning "what to attend to" without labels remains difficult. Furthermore, the attention mechanism's complexity scales with the size of the conditioning set, which may require more advanced memory structures for larger-scale applications.
Conclusion
Generative Matching Networks provide a path toward deep generative models that can learn as quickly as humans. By leveraging attention-based prototype interpolation, GMNs achieve high-quality few-shot generation and classification, avoiding the pitfalls of gradient-based retraining and catastrophic interference.
Summary updated