dense_associative_memory
Dense Associative Memory: an associative memory with higher order interactions, run as a one-step MNIST classifier.
21 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Parameters
- 79.4K
- Operations
- 21
- Framework
- PyTorch
- Recurrent
- No
- Published
- NeurIPS 2016
- Cited by
- 162 (as of 21 October 2026)
- Authors
- Dmitry Krotov, John J. Hopfield
- License
- Apache-2.0
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m4193
- Graph hash
- 9fed4901f6ea430d08a6c546798784e5e552db4016fd3a7473b14c2ee01f73ff
- Skeleton hash
- 9fed4901f6ea430d08a6c546798784e5e552db4016fd3a7473b14c2ee01f73ff
- Architecture hash
- ca45e2287d107f5a703cf997f81cdd4aea07a8db78f6a71e1b90166127be6791
- Diagram SHA-256
- 8417e0e52f3677dcde4bfeaa9291fe21d8ca40da8cdc92bb6b4411a392ec68cb
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
Dense Associative Memory is a model of associative memory that stores and reliably retrieves many more patterns than the number of neurons in the network. The standard model, the paper notes, works well only when the number of stored patterns is much smaller than the number of neurons. Krotov and Hopfield raise the capacity by modifying the standard energy function, which is quadratic in interactions between the neurons, to include higher order interactions.
The paper then derives a duality: with a one step update, the associative memory is equivalent to a feedforward neural network with one hidden layer whose activation function is the derivative of the energy function. In that view, the visible part of each memory serves as an incoming weight to the hidden layer and the recognition part serves as an outgoing weight. For MNIST digit recognition, the network has 784 visible neurons and 10 classification neurons. The visible units are clamped to the image and the classification neurons are updated once.
The power n of the energy function sets how the model represents data: the authors argue that small n gives a feature-matching mode of pattern recognition and large n a prototype regime. On MNIST the paper reports that the n = 3 case did slightly better than n = 2, with all the samples performing better than 1.6% test error. This model uses n = 20, a power at which the paper found that many of the memories can be recognized as digits.
Key idea. Krotov and Hopfield showed that an associative memory with higher order interactions is dual to a feedforward network with one hidden layer and rectified polynomial activation functions.
- Dense Associative Memory
- DAM
- Krotov-Hopfield network
- modern Hopfield network
- associative memory
- rectified polynomial activation
- energy-based model
- MNIST classifier
- dense memory
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{krotov2016denseassociativememorypattern,
title={Dense Associative Memory for Pattern Recognition},
author={Dmitry Krotov and John J Hopfield},
year={2016},
eprint={1606.01164},
archivePrefix={arXiv},
primaryClass={cs.NE},
url={https://arxiv.org/abs/1606.01164},
}