cs.LGJul 20, 2025

Understanding the Interplay between Memorization and Learning in Large Language Models

Authors: Bishwamittra Ghosh, Soumi Das, Qinyuan Wu, Mohammad Aflah Khan, Deepak Garg, Krishna P. Gummadi, Evimaria Terzi

Organizations: Max Planck Institute for Software Systems, Germany · Boston University, USA

Abstract

We investigate foundational questions about the interplay between memorization and learning in large language models (LLMs). When an LLM generates a string, can we disentangle the roles of rote memorization and contextual learning? Rote memorization results in an LLM regurgitating specific details of a training string, while contextual learning leads to the generation of new strings that follow generalizable patterns of the underlying language. Related questions of interest include: can an LLM avoid memorization when optimally learning a language?, and if not, can we design training schemes to reduce memorization and improve learning? To address these questions, we propose contextual memorization, a new measure that precisely disentangles memorization from learning. Using this measure, we establish that different training strings are memorized at different epochs in training, and that memorization of some training strings is unavoidable when optimally learning a language. Finally, we propose memorization-aware training, a scheme that dynamically down-samples training strings based on their memorization, and in doing so, equalizes learning across strings, reduces memorization, and improves learning. Our conclusions are supported by extensive experiments on multiple LLMs using formal languages as a controlled testbed, enabling precise language specification, exact string sampling, and elimination of data contamination; and further validated on natural languages.

Figures & tables

Appendix figures & tables62 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. A Prior-Aware Metric for Efficiently Distinguishing Memorization from Generalization in Large Language Models

    Feb 21, 2026Trishita Tiwari, Ari Trachtenberg, G. Edward SuhMemorization in Language ModelsLLM Auditing

  2. Mitigating Memorization In Language Models

    Oct 3, 2024Mansi Sakarvadia, Aswathy Ajith, Arham Khan +6Memorization in Language ModelsLLM Fine-Tuning

  3. Don't Forget! Decomposing the Training Dynamics of Memorization in Language Models

    Sep 28, 2026Florian Eichin, Philipp Mondorf, Andrei Mircea +3Memorization in Language ModelsData Repetition in Language Model Training