mlsanityData to 13 Oct 2026

In-context denoising with one-layer transformers: connections between attention and associative memory retrieval

arXiv 2502.05164 ↗First posted 7 Feb 2025cs.LG cond-mat.dis-nncited by 7

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

  1. 2017Attention Is All You Needcited by 60,106
  2. 2020Language Models are Few-Shot Learnerscited by 32,320
  3. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,043
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,072
  5. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 1,994
  6. 2020Rethinking Attention with Performerscited by 1,594
  7. 2022Building Normalizing Flows with Stochastic Interpolantscited by 979
  8. 2022Transformers learn in-context by gradient descentcited by 720
  9. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 706
  10. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 676
  11. 2020Hopfield Networks is All You Needcited by 467
  12. 2023Trained Transformers Learn Linear Models In-Contextcited by 333
14 more
  1. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 276
  2. 2016Dense Associative Memory for Pattern Recognitioncited by 232
  3. 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
  4. 2020Large Associative Memory Problem in Neurobiology and Machine Learningcited by 112
  5. 2023Energy Transformercited by 70
  6. 2022Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory Modelscited by 53
  7. 2023Mimetic Initialization of Self-Attention Layerscited by 53
  8. 2023In search of dispersed memories: Generative diffusion models are associative memory networkscited by 44
  9. 2023On Sparse Modern Hopfield Modelcited by 41
  10. 2024Uniform Memory Retrieval with Larger Capacity for Modern Hopfield Modelscited by 38
  11. 2023Sampling with flows, diffusion and autoregressive neural networks: A spin-glass perspectivecited by 26
  12. 2023Memory in Plain Sight: Surveying the Uncanny Resemblances of Associative Memories and Diffusion Modelscited by 13
  13. 2024Sparse and Structured Hopfield Networkscited by 13
  14. 2024Dense Associative Memory Through the Lens of Random Featurescited by 8

Built on by

Cited by year (2026 to 13 Oct)

Citing papers per year: 2025: 2; 2026: 5.

7 papers.