Memorization in In-Context Learning
Not on the map. Why?
Abstract (arXiv)
In-context learning (ICL) has proven to be an effective strategy for improving the performance of large language models (LLMs) with no additional training. However, the exact mechanism behind this performance improvement remains unclear. This study is the first to show how ICL surfaces memorized training data and to explore the correlation between this memorization and performance on downstream tasks across various ICL regimes: zero-shot, few-shot, and many-shot. Our most notable findings include: (1) ICL significantly surfaces memorization compared to zero-shot learning in most cases; (2) demonstrations, without their labels, are the most effective element in surfacing memorization; (3) ICL improves performance when the surfaced memorization in few-shot regimes reaches a high level (about 40%); and (4) there is a very strong correlation between performance and memorization in ICL when it outperforms zero-shot learning. Overall, our study uncovers memorization as a new factor impacting ICL, raising an important question: to what extent do LLMs truly generalize from demonstrations in ICL, and how much of their success is due to memorization?
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Builds on 47 of its 67 references that are in the map. First posted on arXiv 21 Aug 2024.
Builds on
47 of 67 references.
References · 47
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2016Membership Inference Attacks against Machine Learning Modelscited by 2,221
- 2020Extracting Training Data from Large Language Modelscited by 2,144
- 2019Language Models as Knowledge Bases?cited by 1,922
- 2019SuperGLUE: A Stickier Benchmark for General-Purpose Language Understanding Systemscited by 1,718
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
- 2018The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networkscited by 847
- 2022Quantifying Memorization Across Neural Language Modelscited by 755
35 more
- 2022Transformers learn in-context by gradient descentcited by 714
- 2021Deduplicating Training Data Makes Language Models Bettercited by 705
- 2021MetaICL: Learning to Learn In Contextcited by 450
- 2023Scalable Extraction of Training Data from (Production) Language Modelscited by 415
- 2022Deduplicating Training Data Mitigates Privacy Risks in Language Modelscited by 309
- 2023In-Context Learning Creates Task Vectorscited by 302
- 2023Analyzing Leakage of Personally Identifiable Information in Language Modelscited by 278
- 2023Sentiment Analysis in the Era of Large Language Models: A Reality Checkcited by 262
- 2022Transformer Memory as a Differentiable Search Indexcited by 242
- 2024Many-Shot In-Context Learningcited by 203
- 2023Time Travel in LLMs: Tracing Data Contamination in Large Language Modelscited by 175
- 2022Large Language Models with Controllable Working Memorycited by 169
- 2017Machine Learning Models that Remember Too Muchcited by 165
- 2022A Review on Language Models as Knowledge Basescited by 156
- 2021Counterfactual Memorization in Neural Language Modelscited by 155
- 2023Emergent and Predictable Memorization in Large Language Modelscited by 147
- 2022LIFT: Language-Interfaced Fine-Tuning for Non-Language Machine Learning Taskscited by 146
- 2024In-Context Learning with Long-Context Models: An In-Depth Explorationcited by 126
- 2021How much do language models copy from their training data? Evaluating linguistic novelty in text generation using RAVENcited by 124
- 2022Ground-Truth Labels Matter: A Deeper Look into Input-Label Demonstrationscited by 116
- 2023Copyright Violations and Large Language Modelscited by 108
- 2017Ethical Challenges in Data-Driven Dialogue Systemscited by 86
- 2022Parallel Context Windows for Large Language Modelscited by 81
- 2022Understanding Transformer Memorization Recall Through Idiomscited by 62
- 2022Prototypical Calibration for Few-shot Learning of Language Modelscited by 58
- 2024From Words to Numbers: Your Large Language Model Is Secretly A Capable Regressor When Given In-Context Examplescited by 55
- 2023Data Contamination Quiz: A Tool to Detect and Estimate Contamination in Large Language Modelscited by 46
- 2024Dual Operating Modes of In-Context Learningcited by 42
- 2024Proving membership in LLM pretraining data via data watermarkscited by 38
- 2020Understanding Unintended Memorization in Federated Learningcited by 36
- 2024Copyright Traps for Large Language Modelscited by 36
- 2023Towards Understanding In-Context Learning with Contrastive Demonstrations and Saliency Mapscited by 35
- 2023In-Context Learning for Text Classification with Many Labelscited by 35
- 2023In-context Learning and Gradient Descent Revisitedcited by 20
- 2023Source Attribution for Large Language Model-Generated Datacited by 11
Built on by
Citing papers per year: 2024: 1; 2025: 3; 2026: 2.
6 papers.
- 2024ELICIT: LLM Augmentation via External In-Context Capabilitycited by 7
- 2025Can LLMs Judge Debates? Evaluating Non-Linear Reasoning via Argumentation Theory Semanticscited by 4
- 2025Towards Compute-Optimal Many-Shot In-Context Learningcited by 3
- 2025Illusion or Algorithm? Investigating Memorization, Emergence, and Symbolic Processing in In-Context Learningcited by 2
- 2026Intent Laundering: AI Safety Datasets Are Not What They Seemcited by 1
- 2026RA-CoA: Training-free Fashion Image Captioning via Retrieval-Augmented Chain-of-Attributescited by 0
- 2026RA-CoA: Training-free Fashion Image Captioning via Retrieval-Augmented Chain-of-Attributes12 Sep 2026
- 2026Intent Laundering: AI Safety Datasets Are Not What They Seem17 Feb 2026
- 2025Can LLMs Judge Debates? Evaluating Non-Linear Reasoning via Argumentation Theory Semantics19 Sep 2025
- 2025Towards Compute-Optimal Many-Shot In-Context Learning22 Jul 2025
- 2025Illusion or Algorithm? Investigating Memorization, Emergence, and Symbolic Processing in In-Context Learning16 May 2025
- 2024ELICIT: LLM Augmentation via External In-Context Capability12 Oct 2024