In-Context Exemplars as Clues to Retrieving from Large Associative Memory
Not on the map. Why?
Abstract (arXiv)
Recently, large language models (LLMs) have made remarkable progress in natural language processing. The most representative ability of LLMs is in-context learning (ICL), which enables LLMs to learn patterns from in-context exemplars without training. The performance of ICL greatly depends on the exemplars used. However, how to choose exemplars remains unclear due to the lack of understanding of how in-context learning works. In this paper, we present a novel perspective on ICL by conceptualizing it as contextual retrieval from a model of associative memory. We establish a theoretical framework of ICL based on Hopfield Networks. Based on our framework, we look into how in-context exemplars influence the performance of ICL and propose more efficient active exemplar selection. Our study sheds new light on the mechanism of ICL by connecting it to memory retrieval, with potential implications for advancing the understanding of LLMs.
Key facts. Cited by 13 papers in the map (data through 7 Oct 2026). Builds on 37 of its 59 references that are in the map. First posted on arXiv 6 Nov 2023.
Builds on
37 of 59 references.
References · 37
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2022Locating and Editing Factual Associations in GPTcited by 2,609
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,579
- 2019Language Models as Knowledge Bases?cited by 1,922
- 2022Large Language Models Encode Clinical Knowledgecited by 1,807
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2020What Disease does this Patient Have? A Large-scale Open Domain Question Answering Dataset from Medical Examscited by 1,324
- 2020Transformer Feed-Forward Layers Are Key-Value Memoriescited by 1,307
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
25 more
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
- 2022Transformers learn in-context by gradient descentcited by 714
- 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 713
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2021Learning To Retrieve Prompts for In-Context Learningcited by 641
- 2022MedMCQA : A Large-scale Multi-Subject Multi-Choice Dataset for Medical domain Question Answeringcited by 525
- 2020Hopfield Networks is All You Needcited by 461
- 2022Transformer Memory as a Differentiable Search Indexcited by 242
- 2016Dense Associative Memory for Pattern Recognitioncited by 230
- 2022Demystifying Prompts in Language Models via Perplexity Estimationcited by 215
- 2023On the Robustness of ChatGPT: An Adversarial and Out-of-distribution Perspectivecited by 208
- 2021Constrained Language Models Yield Few-Shot Semantic Parserscited by 162
- 2022A Review on Language Models as Knowledge Basescited by 156
- 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 149
- 2023Compositional Exemplars for In-context Learningcited by 143
- 2015Ask Me Anything: Dynamic Memory Networks for Natural Language Processingcited by 116
- 2022Ground-Truth Labels Matter: A Deeper Look into Input-Label Demonstrationscited by 116
- 2022A Neural Corpus Indexer for Document Retrievalcited by 107
- 2022An Information-theoretic Approach to Prompt Engineering Without Ground Truth Labelscited by 88
- 2021A Systematic Investigation of Commonsense Knowledge in Large Language Modelscited by 56
- 2022Universal Hopfield Networks: A General Framework for Single-Shot Associative Memory Modelscited by 52
- 2023On Sparse Modern Hopfield Modelcited by 41
- 2021Attention Approximates Sparse Distributed Memorycited by 29
- 2017Frustratingly Short Attention Spans in Neural Language Modelingcited by 18
- 2016Can Active Memory Replace Attention?cited by 6
Built on by
Citing papers per year: 2023: 1; 2024: 4; 2025: 8.
13 papers.
Sort:
By area:
- 2025Cancer-Myth: Evaluating Large Language Models on Patient Questions with False Presuppositionscited by 15
- 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformerscited by 14
- 2024A Survey to Recent Progress Towards Understanding In-Context Learningcited by 12
- 2024Chaos with Keywords: Exposing Large Language Models Sycophantic Hallucination to Misleading Keywords and Evaluating Defense Strategiescited by 10
- 2025No Need for Explanations: LLMs can implicitly learn from mistakes in-contextcited by 10
- 2023Large Language Models are In-context Teachers for Knowledge Reasoningcited by 4
- 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Cipherscited by 4
- 2024Associative memory inspires improvements for in-context learning using a novel attention residual stream architecturecited by 3
- 2025Context Tuning for In-Context Optimizationcited by 2
- 2025Swallowing the Poison Pills: Insights from Vulnerability Disparity Among LLMscited by 1
- 2025Large Language Models as Model Organisms for Human Associative Learningcited by 1
- 2025What Neuroscience Can Teach AI About Learning in Continuously Changing Environmentscited by 0
- 2025Large Language Models as Model Organisms for Human Associative Learning24 Oct 2025
- 2025MHA-RAG: Improving Efficiency, Accuracy, and Consistency by Encoding Exemplars as Soft Prompts6 Oct 2025
- 2025Context Tuning for In-Context Optimization6 Jul 2025
- 2025What Neuroscience Can Teach AI About Learning in Continuously Changing Environments2 Jul 2025
- 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Ciphers28 Apr 2025
- 2025Cancer-Myth: Evaluating Large Language Models on Patient Questions with False Presuppositions15 Apr 2025
- 2025Swallowing the Poison Pills: Insights from Vulnerability Disparity Among LLMs23 Feb 2025
- 2025No Need for Explanations: LLMs can implicitly learn from mistakes in-context12 Feb 2025
- 2024Associative memory inspires improvements for in-context learning using a novel attention residual stream architecture19 Dec 2024
- 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformers26 Jun 2024
- 2024Chaos with Keywords: Exposing Large Language Models Sycophantic Hallucination to Misleading Keywords and Evaluating Defense Strategies6 Jun 2024
- 2024A Survey to Recent Progress Towards Understanding In-Context Learning3 Feb 2024
1 more
- 2025Cancer-Myth: Evaluating Large Language Models on Patient Questions with False Presuppositionscited by 15
- 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformerscited by 14
- 2024A Survey to Recent Progress Towards Understanding In-Context Learningcited by 12
- 2024Chaos with Keywords: Exposing Large Language Models Sycophantic Hallucination to Misleading Keywords and Evaluating Defense Strategiescited by 10
- 2025No Need for Explanations: LLMs can implicitly learn from mistakes in-contextcited by 10
- 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Cipherscited by 4
- 2024Associative memory inspires improvements for in-context learning using a novel attention residual stream architecturecited by 3
- 2025Context Tuning for In-Context Optimizationcited by 2
- 2025Large Language Models as Model Organisms for Human Associative Learningcited by 1
- 2025What Neuroscience Can Teach AI About Learning in Continuously Changing Environmentscited by 0
- 2025MHA-RAG: Improving Efficiency, Accuracy, and Consistency by Encoding Exemplars as Soft Promptscited by 0
- 2025Large Language Models as Model Organisms for Human Associative Learning24 Oct 2025
- 2025MHA-RAG: Improving Efficiency, Accuracy, and Consistency by Encoding Exemplars as Soft Prompts6 Oct 2025
- 2025Context Tuning for In-Context Optimization6 Jul 2025
- 2025What Neuroscience Can Teach AI About Learning in Continuously Changing Environments2 Jul 2025
- 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Ciphers28 Apr 2025
- 2025Cancer-Myth: Evaluating Large Language Models on Patient Questions with False Presuppositions15 Apr 2025
- 2025No Need for Explanations: LLMs can implicitly learn from mistakes in-context12 Feb 2025
- 2024Associative memory inspires improvements for in-context learning using a novel attention residual stream architecture19 Dec 2024
- 2024Do LLMs dream of elephants (when told not to)? Latent concept association and associative memory in transformers26 Jun 2024
- 2024Chaos with Keywords: Exposing Large Language Models Sycophantic Hallucination to Misleading Keywords and Evaluating Defense Strategies6 Jun 2024
- 2024A Survey to Recent Progress Towards Understanding In-Context Learning3 Feb 2024