Learning to Learn Variational Semantic Memory

Xiantong Zhen, Ying-Jun Du, Huan Xiong, Qiang Qiu, Cees Snoek, Ling Shao

Introduction

Few-shot learning (FSL) aims to recognize new objects from just one or a few examples. Most existing FSL methods rely heavily on "short-term" or episodic memory—they look at the current task's small support set and try to generalize. However, they often fail to retain "long-term" information that could provide useful context for future, unseen tasks.

Furthermore, popular methods like Prototypical Networks (ProtoNets) represent a class as a single deterministic vector (the mean of its samples). This approach does not account for the inherent uncertainty or the intra-class variance that exists when a model only has one or two images to reference.

To address this, researchers introduce Variational Semantic Memory (VSM), a long-term memory module for meta-learning that accumulates general "world knowledge" across different tasks. By treating class prototypes as probabilistic distributions rather than fixed vectors and using a hierarchical Bayesian framework for memory recall, the model achieves state-of-the-art performance in few-shot recognition.

Methods

The authors build upon the Prototypical Network architecture but introduce four major innovations to handle uncertainty and long-term memory:

  1. Variational Prototype Inference: Instead of a fixed vector, the prototype for a class is modeled as a probability distribution. This allows the model to capture uncertainty and higher-order information, such as variance, about a category.
  2. Variational Semantic Memory (VSM): The model implements an external memory unit that stores "semantic" information—summarized feature representations of classes seen during training. Unlike episodic memory, which is wiped after every task, this memory is consolidated over time.
  3. Hierarchical Bayesian Recall: Recalling information from memory is formulated as a variational inference problem rather than a simple database lookup. The authors introduce a latent memory variable ($m$) that acts as a bridge, adapting the long-term knowledge stored in the memory to the specific requirements of the current few-shot task.
Graphical Model of VSM
  1. Graph Attention Updates: To keep the memory fresh, the model uses a graph attention mechanism to "absorb" new information from each task. This ensures the memory grows from scratch and gradually consolidates general knowledge without becoming redundant.

Key Insights

  • Semantic vs. Episodic: A core distinction in this work is between episodic memory (what was just seen) and semantic memory (general knowledge about the world). By focusing on the latter, the model builds a "conceptual context" that makes learning new, related concepts much faster.
  • Recall as Inference: Treating memory recall as a decoding process (variational inference) rather than a raw readout provides a principled way to handle ambiguity. It allows the model to "reason" about which parts of its long-term knowledge are relevant to the current few-shot samples.
  • Probabilistic Prototypes: Modeling classes as distributions makes the feature space more expressive. With VSM, class prototypes become more distinctive and distant from each other, significantly reducing overlap and misclassification.

Key Results

The model was evaluated on four standard few-shot classification benchmarks: miniImageNet, tieredImageNet, CIFAR-FS, and Omniglot. The authors tested their method using both shallow (4-layer ConvNet) and deep (ResNet-12) backbones to ensure fair comparison with previous work.

The Variational Semantic Memory (VSM) model achieved new state-of-the-art results across all benchmarks:

  • miniImageNet: Reached 54.73% (1-shot) and 68.01% (5-shot) with a shallow backbone, and 65.72% (1-shot) with a ResNet-12 backbone, outperforming previous leaders like VERSA and MetaOptNet.
  • tieredImageNet: Achieved 72.01% (1-shot) and 86.77% (5-shot) using a deep backbone.
Performance Comparison Table

Ablation Success: The authors demonstrated that probabilistic modeling alone boosted ProtoNet performance by ~5%, and adding the semantic memory provided another ~2-3% gain, proving that both components are vital to the architecture's success.

Limitations and Future Work

While the results are impressive, the paper notes a few areas for further exploration:

  • Memory Scaling: The memory size is currently bounded by the number of seen classes. As the number of categories grows into the thousands or millions, more sophisticated memory management or compression might be needed.
  • Broader Applications: The authors suggest that this framework isn't limited to classification; it could be applied to other "learning to learn" scenarios like continual learning, where preventing "catastrophic forgetting" of old tasks is the primary challenge.
  • Computational Complexity: The use of Monte Carlo sampling for the variational inference adds some computational overhead during training and inference compared to deterministic models.

Summary updated

BibTeX
@inproceedings{zhen2020learning,
  author = {Xiantong Zhen and Ying-Jun Du and Huan Xiong and Qiang Qiu and Cees Snoek and Ling Shao},
  title = {{Learning to Learn Variational Semantic Memory}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
}
Figure