Skip to content

For Better or for Worse, Transformers Seek Patterns for Memorization

2025 · Neural Information Processing Systems · pp. 115103-115133 · 1 citation · 40 references
Computer Science

TL;DR

This work investigates memorization in transformer-based language models by analyzing their memorization dynamics during training over multiple epochs and finds that memorization is neither a constant accumulation of sequences nor simply dictated by the recency of exposure to these sequences.

Abstract

Memorization in language models is a critical yet poorly understood phenomenon. In this work, we investigate memorization in transformer-based language models by analyzing their memorization dynamics during training over multiple epochs. We find that memorization is neither a constant accumulation of sequences nor simply dictated by the recency of exposure to these sequences. Instead, much like generalization, memorization appears to be driven by pattern recognition. Tracking memorization dynamics in mixed datasets, we observe that models memorize different sub-datasets in distinct bursts, suggesting that each subset is associated with unique underlying patterns, and that the model prefers to learn these patterns in a consistent order. We also find that easily learnable patterns tend to support generalization on unseen data, while more complex patterns do not. Furthermore, in datasets with weak or absent patterns, larger models may delay memorization relative to smaller ones, a behavior we term overthinking . Our results show that the subset of sequences memorized by a model over time is not arbitrary, and give insights into the internal processes a model goes through during training. Our code is available at: https://github.com/mdrpanwar/memorization-patterns .

View source

Similar papers

Preprint Jul 2026

Extractable Memorization From First Principles

It is shown that matched comparisons enable rigorous, calibrated memorization claims, and reveal where prior setups have validity issues, which require a valid memorization claim and near-certain generation within a realistic budget.

A. F. Cooper, Marika Swanberg, Jamie Hayes et al. · 0 citations
#natural language process... Preprint Jul 2026

Towards Mechanistically Understanding Why Memorized Knowledge Fails to Generalize in Large Language Model Finetuning

Self-patching identifies activation locations where relocating representations substantially improves failed generalization cases and design a simple heuristic strategy which recovers 58--75\% of the oracle headroom in generalization failure.

Lu Dai, Ziyang Rao, Yili Wang et al. · 1 citation
Open access Aug 2026

Why diffusion models do not memorize: the role of implicit dynamical regularization in training

It is found that τmem increases linearly with the training set size n, whereas τgen remains constant, which creates a growing window of training times with n where models generalize effectively, despite showing strong memorization if training continues beyond it.

Tony Bonnaire, Raphaël Urfin, Giulio Biroli et al. · 2 citations
Preprint Jul 2026

Train Smarter, Not Longer: Memorization-Guided Data Reuse for Efficient LLM Training

This work proposes "Memorization-guided Data Reuse", a training paradigm that adaptively determines when and how data should be reused, enabling principled decisions on the number of training epochs and the scheduling of data replays.

Jingwei Zuo, Cong Zeng, Ilyas Chahed et al. · 0 citations
Open access Jul 2026

Surprise gates two distinct mechanisms to support memorability in music

Analysis of the neural correlates of minutes-scale memorability using intracranial EEG recordings from nine patients with epilepsy performing a musical memory task reveals complementary neural mechanisms through which statistical structure shapes musical sequence memory, clarifying how the brain encodes complex, ecolog...

Mathieu Pham Van Cang, Paul Robert, Manuel R Mercier et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.