Skip to main content
QUICK REVIEW

[Paper Review] Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory Models

Beren Millidge, Tommaso Salvatori|arXiv (Cornell University)|Feb 9, 2022
Neural Networks and ApplicationsComputer Science7 citations
TL;DR

This paper introduces Universal Hopfield Networks (UHNs), a general framework unifying single-shot associative memory models like Hopfield networks, sparse distributed memories, and modern continuous Hopfield networks. By decomposing memory retrieval into similarity, separation, and projection operations, the framework demonstrates that using Euclidean or Manhattan distance as similarity functions significantly improves retrieval robustness and memory capacity over traditional dot-product similarity, outperforming existing models in empirical evaluations.

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 possesses 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 et al (2020) to express general associative memory models using neural network dynamics with only second-order interactions between neurons, 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.

Motivation & Objective

  • To unify diverse associative memory models—classical Hopfield networks, sparse distributed memories, and modern continuous Hopfield networks—into a single theoretical framework.
  • To clarify the core computational operations underlying single-shot associative memory: similarity, separation, and projection.
  • To extend Krotov and Hopfield’s energy-based model with a general energy function that serves as a Lyapunov function for local neural dynamics.
  • To empirically investigate and demonstrate the superiority of non-dot-product similarity functions (e.g., Euclidean, Manhattan) in associative memory performance.
  • To explore the implications of this framework for transformer models by suggesting that alternative similarity functions may enhance self-attention mechanisms.

Proposed method

  • Propose a general associative memory function UHN: R^I → R^O, parameterized by a memory matrix M (N×I) and a projection matrix P (O×N), enabling both auto- and hetero-associative memory.
  • Factorize UHN into three sequential operations: (1) similarity computation between query and stored memories, (2) separation to amplify score differences, and (3) projection using the projection matrix to generate output.
  • Derive a general energy function that acts as a Lyapunov function, ensuring stable dynamics under local neural computation, extending Krotov and Hopfield’s framework.
  • Express all existing models (HN, SDM, MCHN, MCSDM) as special cases of UHN by specifying distinct similarity and separation functions.
  • Implement and evaluate UHN with various similarity functions (dot product, Euclidean, Manhattan) on associative memory tasks to compare retrieval accuracy and capacity.
  • Use empirical experiments to show that Euclidean and Manhattan similarity functions outperform dot product in robustness and capacity, especially under noisy or corrupted queries.

Experimental results

Research questions

  • RQ1How can diverse associative memory models be unified under a single theoretical framework that captures their core computational structure?
  • RQ2What is the role of the separation function in determining retrieval capacity and robustness, and how does it differ between classical and modern models?
  • RQ3Can alternative similarity functions such as Euclidean or Manhattan distance outperform the standard dot-product similarity in associative memory performance?
  • RQ4Does the theoretical capacity of associative memory models depend on the choice of similarity function, and if so, how?
  • RQ5Can insights from this framework improve the design of attention mechanisms in transformers by replacing dot-product attention with other similarity metrics?

Key findings

  • Euclidean and Manhattan distance similarity functions significantly outperform the standard dot-product similarity in associative memory retrieval, especially under noisy or corrupted queries.
  • The use of non-dot-product similarity functions increases memory capacity and robustness, enabling more accurate retrieval in practical settings.
  • The framework predicts that hetero- and autoassociative memories have identical retrieval capacity when using powerful separation functions, a claim verified empirically in the appendix.
  • The general energy function derived in the framework acts as a Lyapunov function, guaranteeing stable dynamics under local neural computation, validating the model’s theoretical soundness.
  • Preliminary experiments suggest that Manhattan and Euclidean distance similarities are competitive with dot-product attention in small-scale transformers, indicating potential for broader application in attention mechanisms.
  • The framework reveals a continuum between associative memories and standard feedforward networks, depending on the sparsity of intermediate representations, with biological plausibility implications.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.