On Sparse Modern Hopfield Model

Jerry Yao-Chieh Hu, Donglin Yang, Dennis Wu, Chenwei Xu, Bo-Yu Chen +1 more
2/12/2026

No official code found. Best implementation: MAGICS-LAB/SparseModernHopfield (58 stars, MIT, last commit 2024-03-26).

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.

View on arXivView PDF

Code Implementations(1)

MIT

[NeurIPS 2023] On Sparse Modern Hopfield Model

5811Shell, PythonNov 12, 20232 years agoMIT
attentionhopfieldmodern-hopfield-modelmodern-hopfield-networkstransformer

Similar Papers

Cite this paper

@article{hu2026sparse,
  title  = {On Sparse Modern Hopfield Model},
  author = {Jerry Yao-Chieh Hu and Donglin Yang and Dennis Wu and Chenwei Xu and Bo-Yu Chen and Han Liu},
  year   = {2026},
  eprint = {2309.12673},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2309.12673},
  journal = {NEURIPS 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2309.12673.svg)](https://codeofpaper.com/paper/2309.12673)

Discussion