Generalized Key-Value Memory to Flexibly Adjust Redundancy in Memory-Augmented Networks

Denis Kleyko, Geethan Karunaratne, Jan M. Rabaey, Abu Sebastian, Abbas Rahimi

Introduction

Memory-Augmented Neural Networks (MANNs) have emerged as a powerful architecture for few-shot learning, utilizing an external key-value (KV) memory to rapidly store and retrieve new information. However, traditional KV memory implementations are inherently "rigid": their physical size scales linearly with the number of stored items. This rigidity poses a significant challenge for deployment on energy-efficient In-Memory Computing (IMC) hardware, which is often susceptible to physical noise and nonidealities.

This paper introduces a Generalized Key-Value Memory that decouples memory dimensionality from the number of stored items. By introducing a single tunable parameter, $r$, the architecture allows for dynamic adjustments between hardware resource usage and noise robustness during the inference phase, without requiring retraining of the controller network.

The Challenge: Rigid Memory in Noisy Hardware

In standard MANNs, each training sample is assigned a dedicated "slot" in the key memory. To improve robustness against the physical noise of IMC devices (such as conductance drift in Phase-Change Memory), researchers typically increase the dimensionality of feature vectors. However, because the controller network is trained to produce vectors of a specific size, changing this dimensionality necessitates a costly retraining process.

The authors address this by moving from a local memory organization to a fully distributed (holographic) one, inspired by Hyperdimensional Computing (HDC). Instead of discrete slots, all support vectors are superimposed into a single distributed key memory matrix using an outer product learning rule.

Methodology: The "Magic Knob" of Redundancy

The core of the proposed method is the parameter $r$, which controls the storage dimension of the value memory matrix.

  • Compression: When $r$ is small, the memory is compressed, significantly reducing the hardware footprint.
  • Redundancy: When $r$ is large, the memory becomes redundant, spreading information across the matrix to provide "holographic" robustness against noise.

Because this transformation occurs after the controller produces its feature vectors, $r$ can be adjusted on the fly. This allows a system to "dial up" redundancy if it detects high hardware noise levels or "dial down" to save power in stable conditions.

Experimental Results

Compression and Scaling

The researchers evaluated the approach using the Omniglot handwritten character dataset for 20-way and 100-way 5-shot classification tasks. In noiseless software simulations, the generalized memory achieved near-original accuracy while utilizing significantly fewer resources.

Classification accuracy for 20-way and 100-way 5-shot Omniglot problems as a function of the redundancy parameter r.

As seen in Figure 1, for a 20-way 5-shot problem ($nm=100$), the generalized KV memory reaches peak performance with $r$ as low as 20, representing a 10x memory saving. The model's performance gracefully converges to that of the original rigid KV memory as $r$ approaches the total number of samples.

Robustness to Noise

The distributed nature of the memory allows it to suppress noise effectively. Rather than a single noisy component destroying a specific memory slot, the noise is distributed across the entire representation.

Robustness of the generalized KV memory (real-valued) against additive white Gaussian noise (SNR) for various values of r.

Figure 2 demonstrates the system's resilience to additive white Gaussian noise. While the original KV memory (dashed line) degrades significantly as SNR drops, increasing $r$ (e.g., to 400) allows the system to maintain over 90% accuracy even at -10dB SNR. This capability effectively mitigates hardware nonidealities, such as those found in PCM devices, by leveraging mathematical redundancy.

Conclusion

The Generalized Key-Value Memory provides a flexible framework for deploying MANNs on resource-constrained and noisy hardware. By decoupling storage dimensionality from item count, it enables a software-hardware synergy where robustness can be adjusted dynamically. Future work aims to extend this distributed approach to more complex datasets and explore fully low-precision hardware implementations using binary or bipolar representations.

Summary updated

BibTeX
@article{kleyko2022generalized,
  author = {Denis Kleyko and Geethan Karunaratne and Jan M. Rabaey and Abu Sebastian and Abbas Rahimi},
  title = {{Generalized Key-Value Memory to Flexibly Adjust Redundancy in Memory-Augmented Networks}},
  journal = {IEEE Trans. Neural Networks Learn. Syst.},
  year = {2022},
}
Figure