Beyond Scaling Laws: Understanding Transformer Performance with Associative Memory
Not on the map. Why?
Abstract (arXiv)
Increasing the size of a Transformer does not always lead to enhanced performance. This phenomenon cannot be explained by the empirical scaling laws. Furthermore, the model's enhanced performance is closely associated with its memorization of the training samples. We present a theoretical framework that sheds light on the memorization during pre-training of transformer-based language models. We model the behavior of Transformers with associative memories using Hopfield networks, such that each transformer block effectively conducts an approximate nearest-neighbor search. In particular, the energy function in modern continuous Hopfield networks serves as an explanation for the attention mechanism, which we approximate with a distance-based energy function. By observing that the softmax function corresponds to the gradient of the LogSumExp function in the energy, and employing the majorization-minimization technique, we construct a global energy function designed to capture the layered architecture. We demonstrate a dependency between the model size and the dataset size for the model to achieve optimal performance, and we show that the achievable cross-entropy loss is bounded from below.
Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). Builds on 47 of its 64 references that are in the map. First posted on arXiv 14 May 2024.
Builds on
47 of 64 references.
References · 47
- 2017Attention Is All You Needcited by 59,932
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
- 2023Mistral 7Bcited by 3,065
- 2022Training Compute-Optimal Large Language Modelscited by 2,927
- 2020Extracting Training Data from Large Language Modelscited by 2,144
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,307
- 2021Scaling Language Models: Methods, Analysis & Insights from Training Gophercited by 1,199
- 2023PaLM 2 Technical Reportcited by 1,154
- 2018Reconciling modern machine learning practice and the bias-variance trade-offcited by 919
- 2020On Layer Normalization in the Transformer Architecturecited by 906
35 more
- 2019Generalization through Memorization: Nearest Neighbor Language Modelscited by 788
- 2024MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategiescited by 694
- 2019Deep Double Descent: Where Bigger Models and More Data Hurtcited by 667
- 2023Baichuan 2: Open Large-scale Language Modelscited by 664
- 2022Grokking: Generalization Beyond Overfitting on Small Algorithmic Datasetscited by 599
- 2022Using DeepSpeed and Megatron to Train Megatron-Turing NLG 530B, A Large-Scale Generative Language Modelcited by 557
- 2020Hopfield Networks is All You Needcited by 461
- 2019Your Classifier is Secretly an Energy Based Model and You Should Treat it Like Onecited by 402
- 2023Scaling Data-Constrained Language Modelscited by 391
- 2023Effective Long-Context Scaling of Foundation Modelscited by 301
- 2016Using the Output Embedding to Improve Language Modelscited by 266
- 2016Dense Associative Memory for Pattern Recognitioncited by 230
- 2022Memorization Without Overfitting: Analyzing the Training Dynamics of Large Language Modelscited by 218
- 2024Leave No Context Behind: Efficient Infinite Context Transformers with Infini-attentioncited by 194
- 2023Emergent and Predictable Memorization in Large Language Modelscited by 147
- 2024Language models scale reliably with over-training and on downstream taskscited by 105
- 2024Understanding Emergent Abilities of Language Models from the Loss Perspectivecited by 94
- 2019Augmenting Self-attention with Persistent Memorycited by 92
- 2023Language Model Behavior: A Comprehensive Surveycited by 92
- 2024OpenELM: An Efficient Language Model Family with Open Training and Inference Frameworkcited by 74
- 2020Does syntax need to grow on trees? Sources of hierarchical inductive bias in sequence-to-sequence networkscited by 72
- 2023Energy Transformercited by 69
- 2018A standardized Project Gutenberg corpus for statistical analysis of natural language and quantitative linguisticscited by 64
- 2020Triple descent and the two kinds of overfitting: Where & why do they appear?cited by 64
- 2023Grokking of Hierarchical Structure in Vanilla Transformerscited by 53
- 2022Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory Modelscited by 52
- 2023Extending Context Window of Large Language Models via Semantic Compressioncited by 45
- 2021Word Acquisition in Neural Language Modelscited by 41
- 2023On Sparse Modern Hopfield Modelcited by 41
- 2024Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Modelscited by 38
- 2024Outlier-Efficient Hopfield Layers for Large Transformer-Based Modelscited by 38
- 2021Hierarchical Associative Memorycited by 34
- 2024Transformers Can Represent n-gram Language Modelscited by 31
- 2024RAGGED: Towards Informed Design of Scalable and Stable RAG Systemscited by 24
- 2023End-to-end Differentiable Clustering with Associative Memoriescited by 15
Built on by
Citing papers per year: 2024: 3; 2025: 6; 2026: 3.
12 papers.
- 2024On the Limitations of Compute Thresholds as a Governance Strategycited by 17
- 2025Efficient Prompt Compression with Evaluator Heads for Long-Context Transformer Inferencecited by 10
- 2026On the Non-decoupling of Supervised Fine-tuning and Reinforcement Learning in Post-trainingcited by 6
- 2025Scaling Laws are Redundancy Lawscited by 3
- 2025Forget BIT, It is All about TOKEN: Towards Semantic Information Theory for LLMscited by 3
- 2025Steering Information Utility in Key-Value Memory for Language Model Post-Trainingcited by 2
- 2025NeuralDB: Scaling Knowledge Editing in LLMs to 100,000 Facts with Neural KV Databasecited by 2
- 2024A Theoretical Survey on Foundation Modelscited by 1
- 2024Simplifying CLIP: Unleashing the Power of Large-Scale Models on Consumer-level Computerscited by 0
- 2025Enhancing Speech Instruction Understanding and Disambiguation in Robotics via Speech Prosodycited by 0
- 2026Active Adversarial Perturbation-driven Associative Memory Retrieval for RGB-Event Visual Object Trackingcited by 0
- 2026Hierarchical Prototype Emergence in Modern Hopfield Modelscited by 0
- 2026Hierarchical Prototype Emergence in Modern Hopfield Models10 Sep 2026
- 2026Active Adversarial Perturbation-driven Associative Memory Retrieval for RGB-Event Visual Object Tracking24 Jun 2026
- 2026On the Non-decoupling of Supervised Fine-tuning and Reinforcement Learning in Post-training12 Jan 2026
- 2025Forget BIT, It is All about TOKEN: Towards Semantic Information Theory for LLMs3 Nov 2025
- 2025Scaling Laws are Redundancy Laws25 Sep 2025
- 2025NeuralDB: Scaling Knowledge Editing in LLMs to 100,000 Facts with Neural KV Database24 Jul 2025
- 2025Steering Information Utility in Key-Value Memory for Language Model Post-Training7 Jul 2025
- 2025Enhancing Speech Instruction Understanding and Disambiguation in Robotics via Speech Prosody1 Jun 2025
- 2025Efficient Prompt Compression with Evaluator Heads for Long-Context Transformer Inference22 Jan 2025
- 2024Simplifying CLIP: Unleashing the Power of Large-Scale Models on Consumer-level Computers22 Nov 2024
- 2024A Theoretical Survey on Foundation Models15 Oct 2024
- 2024On the Limitations of Compute Thresholds as a Governance Strategy8 Jul 2024