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

The capacity of theHopfield associative…The capacity of the Hopfield associative memoryRandom ForestsRandom ForestsUsing Fast Weights toAttend to the Recent…Using Fast Weights to Attend to the Recent PastXGBoost: A Scalable TreeBoosting SystemXGBoost: A Scalable Tree Boosting SystemMoleculeNet: A Benchmarkfor Molecular Machine…MoleculeNet: A Benchmark for Molecular Machine LearningAttention Is All YouNeedAttention Is All You NeedGraph Attention NetworksGraph Attention NetworksUniversal TransformersUniversal TransformersModern Hopfield Networksand Attention for Immun…Modern Hopfield Networks and Attention for Immune Repertoire ClassificationMEMO: A Deep Network forFlexible Combination of…MEMO: A Deep Network for Flexible Combination of Episodic MemoriesLarge Associative MemoryProblem in Neurobiology…Large Associative Memory Problem in Neurobiology and Machine LearningLinear Transformers AreSecretly Fast Weight…Linear Transformers Are Secretly Fast Weight Memory SystemsA deep learning theoryfor neural networks…A deep learning theory for neural networks grounded in physicsMining adaptive immunereceptor repertoires fo…Mining adaptive immune receptor repertoires for biological and clinical information using machine learningPretrained Transformersas Universal Computatio…Pretrained Transformers as Universal Computation EnginesIs Attention Better ThanMatrix Decomposition?Is Attention Better Than Matrix Decomposition?Digital Implementationof Oscillatory Neural…Digital Implementation of Oscillatory Neural Network for Image Recognition ApplicationsHopular: Modern HopfieldNetworks for Tabular…Hopular: Modern Hopfield Networks for Tabular DataTransformer Memory as aDifferentiable Search…Transformer Memory as a Differentiable Search IndexBayesPCN: A ContinuallyLearnable Predictive…BayesPCN: A Continually Learnable Predictive Coding Associative MemoryExpansionNet v2: BlockStatic Expansion in fas…ExpansionNet v2: Block Static Expansion in fast end to end training for Image CaptioningLarge language modelsgenerate functional…Large language models generate functional protein sequences across diverse familiesSources of Richness andIneffability for…Sources of Richness and Ineffability for Phenomenally Conscious StatesHuman-inspired EpisodicMemory for Infinite…Human-inspired Episodic Memory for Infinite Context LLMsHopfield Networks is AllYou NeedHopfield Networks is All You NeedEarlier referencesFocus paperCiting papersOlderNewer

Click a node to pin it, click the empty canvas to go back to this paper, or hover to preview. Open a node’s page from its title.