In-context denoising with one-layer transformers: connections between attention and associative memory retrieval *
Matthew Smart, Alberto Bietti, Anirvan M Sengupta
Key points
From the paper's conclusion- 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.
Abstract
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.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- A Conditional No-Hair Theorem for Transformers: How Language Models Forget Their PromptarXiv · 2026
- What can linear attention learn from nonlinear teachers in-context?arXiv · 2026
- Language Diffusion Models are Associative Memories Capable of Retrieving Unseen DataarXiv · 2026
- How Do DiTs Denoise? An Aggregator-Predictor View of Attention and MLPsarXiv · 2026
- Kathleen Remembers: Length-Invariant One-Shot Recall Without AttentionarXiv · 2026
- Memorization and Generalization in Generative Models: A Perspective From Energy-based Modeling and Associative MemoryarXiv · 2026