Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2022 Jul:162:15561-15583.

Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory Models

Affiliations

Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory Models

Beren Millidge et al. Proc Mach Learn Res. 2022 Jul.

Abstract

A large number of neural network models of associative memory have been proposed in the literature. These include the classical Hopfield networks (HNs), sparse distributed memories (SDMs), and more recently the modern continuous Hopfield networks (MCHNs), which possess close links with self-attention in machine learning. In this paper, we propose a general framework for understanding the operation of such memory networks as a sequence of three operations: similarity, separation, and projection. We derive all these memory models as instances of our general framework with differing similarity and separation functions. We extend the mathematical framework of Krotov & Hopfield (2020) to express general associative memory models using neural network dynamics with local computation, and derive a general energy function that is a Lyapunov function of the dynamics. Finally, using our framework, we empirically investigate the capacity of using different similarity functions for these associative memory models, beyond the dot product similarity measure, and demonstrate empirically that Euclidean or Manhattan distance similarity metrics perform substantially better in practice on many tasks, enabling a more robust retrieval and higher memory capacity than existing models.

PubMed Disclaimer

Figures

Figure 1
Figure 1
Left: Schematic of the key equations that make up the general theory of the abstract Hopfield network, which shows the factorization of a UHN into similarity, separation, and projection. Right: Visual representation of the factorization diagram when performing an associative memory task on three stored memories. The corrupted data point is scored against the three memories (similarity). The difference in scores are then exaggerated (separation), and used to retrieve a stored memory (projection).
Figure 2
Figure 2. Capacity of the associative memory networks with different similarity functions, as measured by increasing the number of stored images.
The capacity is measured as the fraction of correct retrievals. To test retrieval, the top-half of the image was masked with all zeros (this is equivalent to a fraction masked of 0.5 in Figure 4) and was then presented as the query vector for the network. A retrieval was determined to be correct if the summed squared difference between all pixels in the retrieved image and the true reconstruction was less than a threshold T, which was set at 50. The queries were presented as the stored images corrupted with independent Gaussian noise with a variance of 0.5. Mean retrievals over 10 runs with different sets of memories images. Error bars are computed as the standard deviations of the correct retrievals of the 10 runs. A softmax separation function was used with a β parameter of 100.
Figure 3
Figure 3. The retrieval capacity of the network on retrieving half-masked images using the dot-product similarity function.
Plotted are the means and standard deviations of 10 runs. A query was classed as correctly retrieved if the sum of squared pixel differences was less than a threshold of 50.
Figure 4
Figure 4
Top Row: Retrieval capability against increasing levels of i.i.d added to the query images for different similarity functions. Bottom Row: Retrieval capability against increasing fractions of zero-masking of the query image. The networks used a memory of 100 images with the softmax separation function. Error bars are across 10 separate runs with different sets of memories stored. Datasets used left to right: MNIST, CIFAR, and Tiny ImageNet.

Similar articles

Cited by

References

    1. Abbott LF, Arian Y. Storage capacity of generalized networks. Physical Review A. 1987;36(10):5091 - PubMed
    1. Abu-Mostafa Y, Jacques JS. Information capacity of the Hopfield model. IEEE Transactions on Information Theory. 1985;31(4):461–464.
    1. Bahdanau D, Cho K, Bengio Y. Neural machine translation by jointly learning to align and translate. arXiv preprint. 2014:arXiv:1409.0473
    1. Baldi P, Venkatesh SS. Number of stable points for spin-glasses and neural networks of higher orders. Physical Review Letters. 1987;58(9):913. - PubMed
    1. Bonetti L, Brattico E, Carlomagno F, Donati G, Cabral J, Haumann N, Deco G, Vuust P, Kringelbach M. Rapid encoding of musical tones discovered in wholebrain connectivity. NeuroImage. 2021;245:118735. - PubMed

LinkOut - more resources