about
Hopfield Networks Is All You Need (2020) (arxiv.org)
41 points by liamdgray on Aug 4, 2025 | hide | past | pdf | 6 comments on HN

In plain words: A rebuilt Hopfield memory with smooth states stores exponentially many patterns and pulls out the right one in one step; its update rule matches a transformer's attention. As a layer it beat the best results on three of four multiple-instance learning tasks.

Abstract · Hopfield Networks is All You Need

We introduce a modern Hopfield network with continuous states and a corresponding update rule. The new Hopfield network can store exponentially (with the dimension of the associative space) many patterns, retrieves the pattern with one update, and has exponentially small retrieval errors. It has three types of energy minima (fixed points of the update): (1) global fixed point averaging over all patterns, (2) metastable states averaging over a subset of patterns, and (3) fixed points which store a single pattern. The new update rule is equivalent to the attention mechanism used in transformers. This equivalence enables a characterization of the heads of transformer models. These heads perform in the first layers preferably global averaging and in higher layers partial averaging via metastable states. The new modern Hopfield network can be integrated into deep learning architectures as layers to allow the storage of and access to raw input data, intermediate results, or learned prototypes. These Hopfield layers enable new ways of deep learning, beyond fully-connected, convolutional, or recurrent networks, and provide pooling, memory, association, and attention mechanisms. We demonstrate the broad applicability of the Hopfield layers across various domains. Hopfield layers improved state-of-the-art on three out of four considered multiple instance learning problems as well as on immune repertoire classification with several hundreds of thousands of instances. On the UCI benchmark collections of small classification tasks, where deep learning methods typically struggle, Hopfield layers yielded a new state-of-the-art when compared to different machine learning methods. Finally, Hopfield layers achieved state-of-the-art on two drug design datasets. The implementation is available at: https://github.com/ml-jku/hopfield-layers

Hubert Ramsauer, Bernhard Schäfl, Johannes Lehner, Philipp Seidl, Michael Widrich, Thomas Adler, Lukas Gruber, Markus Holzleitner, Milena Pavlović, Geir Kjetil Sandve, Victor Greiff, David Kreil, et al.
arXiv:2008.02217 · cs.NE, cs.CL, cs.LG, stat.ML · submitted Jul 16, 2020 · updated Apr 28, 2021
abstract · pdf · html · 10 pages (+ appendix); 12 figures; Blog: https://ml-jku.github.io/hopfield-layers/; GitHub: https://github.com/ml-jku/hopfield-layers

add comment on HN
Also discussed: Jun 2021 (3 points, 0 comments) · Aug 2020 (3 points, 0 comments) · Aug 2020 (4 points, 0 comments) · Aug 2020 (2 points, 0 comments) · Aug 2020 (4 points, 1 comment)

So far I’ve needed hundreds of “all you needs” beginning to think papers with that title are not all I need… Let’s try and get a bit more creative than stealing the same name scheme used when Transformers were introduced.
Tech authors seem to absolutely love hackneyed titles.

We're lucky it isn't "Falsehoods programmers believe about the unreasonable effectiveness of hopfield networks considered harmful, for fun and profit."

I remember when this came out. It seemed cute, but appeared to have very little impact long-term unless I'm mistaken. Have there been any major developments from this?
Yann LeCun (Meta AI head) is still all-in on energy based models, which are basically Hopfield-like. Not sure if there are any major developments in that direction, but the hype/optimism is still there. https://iopscience.iop.org/article/10.1088/1742-5468/ad292b/...
Related:

Hopfield Networks Is All You Need - https://news.ycombinator.com/item?id=26990000 - April 2021 (40 comments)

Gemini is good enough ?