mlsanityData to 14 Oct 2026

Memory Retrieval in Transformers: Insights from The Encoding Specificity Principle

arXiv 2601.20282 ↗First posted 28 Jan 2026cs.LGcited by 0

On the map: LLM safety and security → Machine unlearning

Abstract (arXiv)

While explainable artificial intelligence (XAI) for large language models (LLMs) remains an evolving field with many unresolved questions, increasing regulatory pressures have spurred interest in its role in ensuring transparency, accountability, and privacy-preserving machine unlearning. Despite recent advances in XAI have provided some insights, the specific role of attention layers in transformer based LLMs remains underexplored. This study investigates the memory mechanisms instantiated by attention layers, drawing on prior research in psychology and computational psycholinguistics that links Transformer attention to cue based retrieval in human memory. In this view, queries encode the retrieval context, keys index candidate memory traces, attention weights quantify cue trace similarity, and values carry the encoded content, jointly enabling the construction of a context representation that precedes and facilitates memory retrieval. Guided by the Encoding Specificity Principle, we hypothesize that the cues used in the initial stage of retrieval are instantiated as keywords. We provide converging evidence for this keywords-as-cues hypothesis. In addition, we isolate neurons within attention layers whose activations selectively encode and facilitate the retrieval of context-defining keywords. Consequently, these keywords can be extracted from identified neurons and further contribute to downstream applications such as unlearning.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Machine unlearning, one of 12 directions in LLM safety and security. Builds on 42 of its 68 references that are in the map. First posted on arXiv 28 Jan 2026.

Builds on

42 of 68 references.

Closest ancestors · 4

Same direction, newest first

  1. 2024Machine Unlearning of Pre-trained Large Language Models23 Feb
  2. 2024TOFU: A Task of Fictitious Unlearning for LLMs11 Jan
  3. 2023Who's Harry Potter? Approximate Unlearning in LLMs3 Oct
  4. 2022Knowledge Unlearning for Mitigating Privacy Risks in Language Models4 Oct

Other references · 38

  1. 2017Attention Is All You Needcited by 60,361
  2. 2017A Unified Approach to Interpreting Model Predictionscited by 6,555
  3. 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
  4. 2016"Why Should I Trust You?": Explaining the Predictions of Any Classifiercited by 5,070
  5. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
  6. 2022Locating and Editing Factual Associations in GPTcited by 2,691
  7. 2013Deep Inside Convolutional Networks: Visualising Image Classification Models and Saliency Mapscited by 2,371
  8. 2017Learning Important Features Through Propagating Activation Differencescited by 1,458
  9. 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,336
  10. 2019What Does BERT Look At? An Analysis of BERT's Attentioncited by 1,003
  11. 2019Attention is not Explanationcited by 929
  12. 2019Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Prunedcited by 856
26 more
  1. 2020Quantifying Attention Flow in Transformerscited by 775
  2. 2022Quantifying Memorization Across Neural Language Modelscited by 763
  3. 2022GPT-NeoX-20B: An Open-Source Autoregressive Language Modelcited by 713
  4. 2019Attention is not not Explanationcited by 636
  5. 2017Interpretable Explanations of Black Boxes by Meaningful Perturbationcited by 612
  6. 2022Transformer Feed-Forward Layers Build Predictions by Promoting Concepts in the Vocabulary Spacecited by 532
  7. 2020Efficient Content-Based Sparse Attention with Routing Transformerscited by 471
  8. 2023Explainability for Large Language Models: A Surveycited by 333
  9. 2019A Multiscale Visualization of Attention in the Transformer Modelcited by 292
  10. 2023Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language Modelscited by 243
  11. 2020Synthesizer: Rethinking Self-Attention in Transformer Modelscited by 205
  12. 2020When Machine Unlearning Jeopardizes Privacycited by 198
  13. 2020The elephant in the interpretability room: Why use attention as explanation when we have saliency methods?cited by 122
  14. 2024AttnLRP: Attention-Aware Layer-Wise Relevance Propagation for Transformerscited by 120
  15. 2019Augmenting Self-attention with Persistent Memorycited by 93
  16. 2022MAUVE Scores for Generative Models: Theory and Practicecited by 36
  17. 2023AtMan: Understanding Transformer Predictions Through Memory Efficient Attention Manipulationcited by 31
  18. 2023Causal Interpretation of Self-Attention in Pre-Trained Transformerscited by 30
  19. 2021Accounting for Agreement Phenomena in Sentence Comprehension with Transformer Language Models: Effects of Similarity-based Interference on Surprisal and Attentioncited by 27
  20. 2025Key-value memory in the braincited by 24
  21. 2023A Language Model with Limited Memory Capacity Captures Interference in Human Sentence Processingcited by 22
  22. 2022Entropy- and Distance-Based Predictors From GPT-2 Attention Patterns Predict Reading Times Over and Above GPT-2 Surprisalcited by 14
  23. 2024Attention Meets Post-hoc Interpretability: A Mathematical Perspectivecited by 11
  24. 2024Attention Mechanisms Don't Learn Additive Models: Rethinking Feature Importance for Transformerscited by 8
  25. 2024Mechanism and Emergence of Stacked Attention Heads in Multi-Layer Transformerscited by 7
  26. 2025If Attention Serves as a Cognitive Model of Human Memory Retrieval, What is the Plausible Memory Representation?cited by 4

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025Disentangling Recall and Reasoning in Transformer Models through Layer-wise Attention and Activation Analysis
  2. 2024Self-Attention Limits Working Memory Capacity of Transformer-Based Models
  3. 2024Talking Heads: Understanding Inter-layer Communication in Transformer Language Models
  4. 2025Beyond Semantics: How Temporal Biases Shape Retrieval in Transformer and State-Space Models
  5. 2025Some Attention is All You Need for Retrieval
  6. 2026In-context superposition: human-like working memory interference in large language models
  7. 2026Positional versus Symbolic Attention Heads: Learning Dynamics, RoPE Geometry, and Length Generalization
  8. 2024Rethinking Associative Memory Mechanism in Induction Head