Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformers
Yibo Jiang, Goutham Rajendran, Pradeep Ravikumar, Bryon Aragam
Abstract
Large Language Models (LLMs) have the capacity to store and recall facts. Through experimentation with open-source models, we observe that this ability to retrieve facts can be easily manipulated by changing contexts, even without altering their factual meanings. These findings highlight that LLMs might behave like an associative memory model where certain tokens in the contexts serve as clues to retrieving facts. We mathematically explore this property by studying how transformers, the building blocks of LLMs, can complete such memory tasks. We study a simple latent concept association problem with a one-layer transformer and we show theoretically and empirically that the transformer gathers information using self-attention and uses the value matrix for associative memory.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext ad5e57e7-c118-4009-8f2c-14616c5d5a59Cited by top-tier papers11
- Deep sequence models tend to memorize geometrically; it is unclear whyShahriar Noroozizadeh, Vaishnavh Nagarajan, Elan Rosenfeld, Sanjiv KumarICML 2026 · 11 citations
- Provably Transformers Harness Multi-Concept Word Semantics for Efficient In-Context LearningDake Bu, Wei Huang, Andi Han, Atsushi Nitanda et al.NeurIPS 2024 · 11 citations
- On the Robustness of Transformers against Context Hijacking for Linear ClassificationTianle Li, Chenyang Zhang, Xingwu Chen, Yuan Cao et al.NeurIPS 2025 · 7 citations
- ENCHTABLE: Unified Safety Alignment Transfer in Fine-Tuned Large Language ModelsJialin Wu, Kecen Li, Zhicong Huang, Xinfeng Li et al.S&P 2026 · 3 citations
- Transformers as Measure-Theoretic Associative Memory: A Statistical Perspective and Minimax OptimalityRyotaro Kawata, Taiji SuzukiICLR 2026 · 3 citations
Builds on55
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
- An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 citations
- Large Language Models Can Be Easily Distracted by Irrelevant ContextFreda Shi, Xinyun Chen, Kanishka Misra, Nathan Scales et al.ICML 2023 · 970 citations
Related papers
- Understanding Factual Recall in Transformers via Associative MemoriesEshaan Nichani, Jason D. Lee, Alberto BiettiICLR 2025
- Do All Autoregressive Transformers Remember Facts the Same Way? A Cross-Architecture Analysis of Recall MechanismsMinyeong Choe, Haehyun Cho, Changho Seo, Hyunil KimEMNLP 2025
- Birth of a Transformer: A Memory ViewpointAlberto Bietti, Vivien Cabannes, Diane Bouchacourt, Hervé Jégou et al.NeurIPS 2023 · 182 citations
- Generalization or Hallucination? Understanding Out-of-Context Reasoning in TransformersYixiao Huang, Hanlin Zhu, Tianyu Guo, Jiantao Jiao et al.NeurIPS 2025 · 10 citations
- Co-occurrence is not Factual Association in Language ModelsXiao Zhang, Miao Li, Ji WuNeurIPS 2024 · 15 citations
