mlsanityData to 14 Oct 2026

Provably Optimal Memory Capacity for Modern Hopfield Models: Transformer-Compatible Dense Associative Memories as Spherical Codes

arXiv 2410.23126 ↗First posted 30 Oct 2024stat.ML cs.AI cs.LGcited by 19

Not on the map. Why?

Abstract (arXiv)

We study the optimal memorization capacity of modern Hopfield models and Kernelized Hopfield Models (KHMs), a transformer-compatible class of Dense Associative Memories. We present a tight analysis by establishing a connection between the memory configuration of KHMs and spherical codes from information theory. Specifically, we treat the stored memory set as a specialized spherical code. This enables us to cast the memorization problem in KHMs into a point arrangement problem on a hypersphere. We show that the optimal capacity of KHMs occurs when the feature space allows memories to form an optimal spherical code. This unique perspective leads to: (i) An analysis of how KHMs achieve optimal memory capacity, and identify corresponding necessary conditions. Importantly, we establish an upper capacity bound that matches the well-known exponential lower bound in the literature. This provides the first tight and optimal asymptotic memory capacity for modern Hopfield models. (ii) A sub-linear time algorithm mathttU-mathttHop+ to reach KHMs' optimal capacity. (iii) An analysis of the scaling behavior of the required feature dimension relative to the number of stored memories. These efforts improve both the retrieval capability of KHMs and the representation learning of corresponding transformers. Experimentally, we provide thorough numerical results to back up theoretical findings.

Key facts. Cited by 19 papers in the map (data through 14 Oct 2026). Builds on 47 of its 93 references that are in the map. First posted on arXiv 30 Oct 2024.

Builds on

47 of 93 references.

References · 47

  1. 2017Attention Is All You Needcited by 60,361
  2. 2023GPT-4 Technical Reportcited by 18,396
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  4. 2022Scalable Diffusion Models with Transformerscited by 6,054
  5. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  6. 2021On the Opportunities and Risks of Foundation Modelscited by 4,033
  7. 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,592
  8. 2020Prevalence of Neural Collapse during the terminal phase of deep learning trainingcited by 719
  9. 2024Movie Gen: A Cast of Media Foundation Modelscited by 644
  10. 2020Hopfield Networks is All You Needcited by 475
  11. 2022Text and Code Embeddings by Contrastive Pre-Trainingcited by 361
  12. 2023Improving Text Embeddings with Large Language Modelscited by 303
35 more
  1. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
  2. 2016Dense Associative Memory for Pattern Recognitioncited by 236
  3. 2021A Geometric Analysis of Neural Collapse with Unconstrained Featurescited by 227
  4. 2019Sparse Sequence-to-Sequence Modelscited by 170
  5. 2023Birth of a Transformer: A Memory Viewpointcited by 161
  6. 2023DNABERT-2: Efficient Foundation Model and Benchmark For Multi-Species Genomecited by 143
  7. 2020Large Associative Memory Problem in Neurobiology and Machine Learningcited by 112
  8. 2021CLOOB: Modern Hopfield Networks with InfoLOOB Outperform CLIPcited by 89
  9. 2020The Complexity of Constrained Min-Max Optimizationcited by 82
  10. 2023Energy Transformercited by 71
  11. 2021Dissecting Supervised Contrastive Learningcited by 64
  12. 2020Modern Hopfield Networks and Attention for Immune Repertoire Classificationcited by 53
  13. 2020The limits of min-max optimization algorithms: convergence to spurious non-critical setscited by 50
  14. 2023Conformal Prediction for Time Series with Modern Hopfield Networkscited by 42
  15. 2023On Sparse Modern Hopfield Modelcited by 42
  16. 2024On Computational Limits of Modern Hopfield Models: A Fine-Grained Complexity Analysiscited by 41
  17. 2024On Statistical Rates and Provably Efficient Criteria of Latent Diffusion Transformers (DiTs)cited by 40
  18. 2018Averaging Stochastic Gradient Descent on Riemannian Manifoldscited by 39
  19. 2023Generalized Neural Collapse for a Large Number of Classescited by 39
  20. 2024Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Modelscited by 38
  21. 2024Outlier-Efficient Hopfield Layers for Large Transformer-Based Modelscited by 38
  22. 2023Scaling Laws for Associative Memoriescited by 35
  23. 2023STanHop: Sparse Tandem Hopfield Model for Memory-Enhanced Time Series Predictioncited by 35
  24. 2024CAMELoT: Towards Large Language Models with Training-Free Consolidated Associative Memorycited by 24
  25. 2024BiSHop: Bi-Directional Cellular Learning for Tabular Data with Generalized Sparse Modern Hopfield Modelcited by 21
  26. 2023Simplicial Hopfield networkscited by 16
  27. 2024Nonparametric Modern Hopfield Modelscited by 16
  28. 2023End-to-end Differentiable Clustering with Associative Memoriescited by 15
  29. 2021The Separation Capacity of Random Neural Networkscited by 14
  30. 2024Sparse and Structured Hopfield Networkscited by 13
  31. 2022Kernel Memory Networks: A Unifying Framework for Memory Modelingcited by 12
  32. 2024Energy-based Hopfield Boosting for Out-of-Distribution Detectioncited by 9
  33. 2022Randomly Initialized One-Layer Neural Networks Make Data Linearly Separablecited by 6
  34. 2024Semantically-correlated memories in a dense associative modelcited by 2
  35. 2019Optimization on the Surface of the (Hyper)-Spherecited by 1

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 3; 2025: 11; 2026: 5.

19 papers.

Sort:

By area:

  1. 2025ATLAS: Learning to Optimally Memorize the Context at Test Timecited by 66
  2. 2025It's All Connected: A Journey Through Test-Time Memorization, Attentional Bias, Retention, and Online Optimizationcited by 64
  3. 2024Circuit Complexity Bounds for RoPE-based Transformer Architecturecited by 26
  4. 2026Memory Caching: RNNs with Growing Memorycited by 15
  5. 2024Theoretical Constraints on the Expressive Power of mathsfRoPE-based Tensor Attention Transformerscited by 12
  6. 2025Video Latent Flow Matching: Optimal Polynomial Projections for Video Interpolation and Extrapolationcited by 11
  7. 2025Circuit Complexity Bounds for Visual Autoregressive Modelcited by 10
  8. 2024Modern Hopfield Networks Require Chain-of-Thought to Solve mathsfNC1-Hard Problemscited by 9
  9. 2025TNT: Improving Chunkwise Training for Test-Time Memorizationcited by 8
  10. 2026Krause Synchronization Transformerscited by 5
  11. 2025Neural Algorithmic Reasoning for Hypergraphs with Looped Transformerscited by 4
  12. 2025Hyper-SET: Designing Transformers via Hyperspherical Energy Minimizationcited by 2
7 more
  1. 2025Theoretical Foundation of Flow-Based Time Series Generation: Provable Approximation, Generalization, and Efficiencycited by 2
  2. 2025Adaptive Hopfield Network: Rethinking Similarities in Associative Memorycited by 1
  3. 2026Proteus: Incremental Memory Activation for Long-Context Sequence Modelingcited by 1
  4. 2025Effects of Feature Correlations on Associative Memory Capacitycited by 0
  5. 2025DeMoGen: Towards Decompositional Human Motion Generation with Energy-Based Diffusion Modelscited by 0
  6. 2026Recursive Binding on a Budget: Subspace Carving in Order-p Tensor Memoriescited by 0
  7. 2026Phases in a class of associative memories via hidden neuronscited by 0