On Sparse Modern Hopfield Model
Jerry Yao-Chieh Hu, Donglin Yang, Dennis Wu, Chenwei Xu, Bo-Yu Chen, Han Liu
Abstract
We introduce the sparse modern Hopfield model as a sparse extension of the modern Hopfield model. Like its dense counterpart, the sparse modern Hopfield model equips a memory-retrieval dynamics whose one-step approximation corresponds to the sparse attention mechanism. Theoretically, our key contribution is a principled derivation of a closed-form sparse Hopfield energy using the convex conjugate of the sparse entropic regularizer. Building upon this, we derive the sparse memory retrieval dynamics from the sparse energy function and show its one-step approximation is equivalent to the sparse-structured attention. Importantly, we provide a sparsity-dependent memory retrieval error bound which is provably tighter than its dense analog. The conditions for the benefits of sparsity to arise are therefore identified and discussed. In addition, we show that the sparse modern Hopfield model maintains the robust theoretical properties of its dense counterpart, including rapid fixed point convergence and exponential memory capacity. Empirically, we use both synthetic and real-world datasets to demonstrate that the sparse Hopfield model outperforms its dense counterpart in many situations. Code is available at GitHub; future updates are on arXiv. [Version: Novermber, 28, 2023] 1 While this equivalence only holds when the retrieval dynamics is applied exactly once, as originally shown in [Ramsauer et al., 2021] and later emphasized in [Krotov and Hopfield, 2021] , it allows us to view modern Hopfield models as generalized attentions with additional functionalities and hence opens new avenues for Hopfield-based architecture designs. See Appendix C for more discussions.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
31 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression cites Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression cites Language Models are Few-Shot Learners
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression cites Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression cites On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs)
- The Closeness of In-Context Learning and Weight Shifting for Softmax Regression cites On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- FiLM: Frequency improved Legendre Memory Model for Long-term Time Series Forecasting cites Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
- Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models cites Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
- Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models cites Hopfield Networks is All You Need
- Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models cites Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- Outlier-Efficient Hopfield Layers for Large Transformer-Based Models cites Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models
- Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models cites On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis cites Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models
- Outlier-Efficient Hopfield Layers for Large Transformer-Based Models cites Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
- Outlier-Efficient Hopfield Layers for Large Transformer-Based Models cites Hopfield Networks is All You Need
- Outlier-Efficient Hopfield Layers for Large Transformer-Based Models cites Language Models are Few-Shot Learners
- Outlier-Efficient Hopfield Layers for Large Transformer-Based Models cites On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis cites Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) cites Hopfield Networks is All You Need
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) cites Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Models
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) cites Language Models are Few-Shot Learners
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) cites Outlier-Efficient Hopfield Layers for Large Transformer-Based Models
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs) cites On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis cites Hopfield Networks is All You Need
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysis cites Language Models are Few-Shot Learners
Cited by top-tier papers31
- The Closeness of In-Context Learning and Weight Shifting for Softmax RegressionShuai Li, Zhao Song, Yu Xia, Tong Yu et al.NeurIPS 2024 · 53 citations
- On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs)Jerry Yao-Chieh Hu, Weimin Wu, Zhuoru Li, Sophia Pi et al.NeurIPS 2024 · 49 citations
- On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity AnalysisJerry Yao-Chieh Hu, Thomas Lin, Zhao Song, Han LiuICML 2024 · 47 citations
- Outlier-Efficient Hopfield Layers for Large Transformer-Based ModelsJerry Yao-Chieh Hu, Pei-Hsuan Chang, Haozheng Luo, Hong-Yu Chen et al.ICML 2024 · 46 citations
- Uniform Memory Retrieval with Larger Capacity for Modern Hopfield ModelsDennis Wu, Jerry Yao-Chieh Hu, Teng-Yun Hsiao, Han LiuICML 2024 · 44 citations
Builds on16
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
- Informer: Beyond Efficient Transformer for Long Sequence Time-Series ForecastingHaoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang et al.AAAI 2021 · 7,289 citations
- Hopfield Networks is All You NeedHubert Ramsauer, Bernhard Schäfl, Johannes Lehner, Philipp Seidl et al.ICLR 2021 · 620 citations
- FiLM: Frequency improved Legendre Memory Model for Long-term Time Series ForecastingTian Zhou, Ziqing Ma, Xue Wang, Qingsong Wen et al.NeurIPS 2022 · 410 citations
Related papers
- Nonparametric Modern Hopfield ModelsJerry Yao-Chieh Hu, Bo-Yu Chen, Dennis Wu, Feng Ruan et al.ICML 2025
- Dynamical properties of dense associative memoryKazushi Mimura, Jun'ichi Takeuchi, Yuto Sumikawa, Yoshiyuki Kabashima et al.ICLR 2026 · 6 citations
- Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory ModelsBeren Millidge, Tommaso Salvatori, Yuhang Song, Thomas Lukasiewicz et al.ICML 2022 · 72 citations
- Sparse and Structured Hopfield NetworksSaul José Rodrigues dos Santos, Vlad Niculae, Daniel C. McNamee, André F. T. MartinsICML 2024 · 12 citations
- BiSHop: Bi-Directional Cellular Learning for Tabular Data with Generalized Sparse Modern Hopfield ModelChenwei Xu, Yu-Chao Huang, Jerry Yao-Chieh Hu, Weijian Li et al.ICML 2024 · 26 citations
