In-context denoising with one-layer transformers: connections between attention and associative memory retrieval
Not on the map. Why?
Abstract (arXiv)
We introduce in-context denoising, a task that refines the connection between attention-based architectures and dense associative memory (DAM) networks, also known as modern Hopfield networks. Using a Bayesian framework, we show theoretically and empirically that certain restricted denoising problems can be solved optimally even by a single-layer transformer. We demonstrate that a trained attention layer processes each denoising prompt by performing a single gradient descent update on a context-aware DAM energy landscape, where context tokens serve as associative memories and the query token acts as an initial state. This one-step update yields better solutions than exact retrieval of either a context token or a spurious local minimum, providing a concrete example of DAM networks extending beyond the standard retrieval paradigm. Overall, this work solidifies the link between associative memory and attention mechanisms first identified by Ramsauer et al., and demonstrates the relevance of associative memory models in the study of in-context learning.
Key facts. Cited by 7 papers in the map (data through 13 Oct 2026). Builds on 26 of its 47 references that are in the map. First posted on arXiv 7 Feb 2025.
Builds on
26 of 47 references.
References · 26
- 2017Attention Is All You Needcited by 60,106
- 2020Language Models are Few-Shot Learnerscited by 32,320
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,043
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,072
- 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,994
- 2020Rethinking Attention with Performerscited by 1,594
- 2022Building Normalizing Flows with Stochastic Interpolantscited by 979
- 2022Transformers learn in-context by gradient descentcited by 720
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 706
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 676
- 2020Hopfield Networks is All You Needcited by 467
- 2023Trained Transformers Learn Linear Models In-Contextcited by 333
14 more
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 276
- 2016Dense Associative Memory for Pattern Recognitioncited by 232
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
- 2020Large Associative Memory Problem in Neurobiology and Machine Learningcited by 112
- 2023Energy Transformercited by 70
- 2022Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory Modelscited by 53
- 2023Mimetic Initialization of Self-Attention Layerscited by 53
- 2023In search of dispersed memories: Generative diffusion models are associative memory networkscited by 44
- 2023On Sparse Modern Hopfield Modelcited by 41
- 2024Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Modelscited by 38
- 2023Sampling with flows, diffusion and autoregressive neural networks: A spin-glass perspectivecited by 26
- 2023Memory in Plain Sight: Surveying the Uncanny Resemblances of Associative Memories and Diffusion Modelscited by 13
- 2024Sparse and Structured Hopfield Networkscited by 13
- 2024Dense Associative Memory Through the Lens of Random Featurescited by 8
Built on by
Citing papers per year: 2025: 2; 2026: 5.
7 papers.
- 2025DeepInsert: Early Layer Bypass for Efficient and Performant Multimodal Understandingcited by 2
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectivenesscited by 1
- 2026S3-Attention:Attention-Aligned Endogenous Retrieval for Memory-Bounded Long-Context Inferencecited by 1
- 2026When Does Context Help? Error Dynamics of Contextual Information in Large Language Modelscited by 0
- 2026Gradient Boosting within a Single Attention Layercited by 0
- 2026When Does Depth Matter For In-Context Learning? Adaptive Inference in Deep Transformerscited by 0
- 2026ALICE: In-context, Zero-shot, Mutual Information Estimationcited by 0
- 2026ALICE: In-context, Zero-shot, Mutual Information Estimation28 Sep 2026
- 2026When Does Depth Matter For In-Context Learning? Adaptive Inference in Deep Transformers15 Jun 2026
- 2026Gradient Boosting within a Single Attention Layer3 Apr 2026
- 2026When Does Context Help? Error Dynamics of Contextual Information in Large Language Models9 Feb 2026
- 2026S3-Attention:Attention-Aligned Endogenous Retrieval for Memory-Bounded Long-Context Inference25 Jan 2026
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectiveness1 Aug 2025
- 2025DeepInsert: Early Layer Bypass for Efficient and Performant Multimodal Understanding27 Apr 2025