arXiv:2611.01564cs.LGNov 2026

Manuscript Offprint

arXiv:2611.01564

Meta-memorization and memorization scaling laws in transformers

Alex Nguyen, Kenneth A. Norman, Gautam Reddy

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Alex Nguyen,¹ Kenneth A. Norman,² and Gautam Reddy³

¹Princeton Neuroscience Institute, Princeton University, Princeton, NJ, USA

²Princeton Neuroscience Institute, Department of Psychology, Princeton University, Princeton, NJ, USA

³Department of Physics, Princeton University, Princeton, NJ, USA

Larger transformers can memorize more data, with a capacity (in bits) that scales roughly linearly with the number of parameters. Counterintuitively, larger models also memorize faster, requiring fewer repetitions of a sequence during training before it is memorized. We reproduce both memorization scaling laws in transformers trained on random binary sequences, showing that rapid memorization can arise even when data contain no semantic or compositional structure. Rapid memorization is due to a meta-memorization effect, where models trained to memorize a large set of random sequences learn to memorize novel sequences more quickly. The rate r(t)r(t) at which models memorize grows with training time tt as a power-law r(t)∼tβr(t) \sim t^{\beta} with a fixed exponent β\beta but an increasing upper cutoff across model scales. Meta-memorization enables even one-layer transformers to few-shot memorize a 100-bit sequence. This effect is partly explained by the formation of structured attention heads that convey position-invariant sequence information to MLPs where memorized sequences are stored. Meta-memorization is recapitulated in a simplified model of a dense associative memory where retrieval is constrained by an attentional bottleneck. Our results suggest transformers, through pre-training, acquire reusable mechanisms that enable highly efficient storage and retrieval of memories.

I. INTRODUCTION

Significant attention has been paid to the ability of transformers to generalize with limited data, but transformers are also remarkable memorizers [1, 2]. Large language models (LLMs) can reproduce training passages verbatim when prompted with sufficient context and this can be exploited to extract training data [3–5]. For example, production language models verbatim recall much of Harry Potter and the Sorcerer's Stone when prompted with the first few tokens of the first chapter [6, 7].

One influential approach to quantify memorization is based on extractability. Given a prefix of a training example, one can ask whether the model reproduces its exact continuation, and measure how this probability changes with context length, dataset duplication, and scale [4, 8–10]. A complementary approach measures memorization dynamically during training, asking how many presentations are necessary before examples become exactly reproducible [11, 12].

Several robust features have emerged from these measurements. Multiple analyses of pretrained transformers suggest that MLP layers store associations, consistent with the idea that MLP blocks function as key-value memories [13–18]. Memorization increases with an LLM's parameter count and with the number of times a sequence is duplicated in the training corpus, often in simple log-linear relationships [4, 19]. More broadly, recent work shows that transformers' storage capacity (measured in bits, after controlling for generalization) scales linearly, with a few bits stored per parameter [18, 20, 21]. Training proceeds through regimes in which the model first fills this capacity before shifting toward more reusable structure [22, 23].

Counterintuitively, memorization does not just scale in capacity but also in rate; that is, larger models require fewer presentations of a sentence before it

is memorized [4, 12]. Having more parameters can explain greater capacity, but this does not explain why incremental gradient updates should become systematically more effective at creating a memory. Resolving this puzzle in language models is difficult as memorization rate is inherently tied to the model's improving ability to exploit the structure of language [24].

Contributions. In this work, we study how transformers memorize random binary sequences that have no internal statistical structure. We reproduce several empirical results in the literature, in particular that both transformers' memorization capacity and rate increase with size [4, 12], derive a scaling law in the memorization rate as a function of model size, and show that large models can achieve one-shot memorization. Training models to memorize random sequences reduces the number of presentations required to memorize any arbitrary new sequence, an effect we call meta-memorization (in connection with meta-learning). We show that transformers meta-memorize through a functional division of labor, where attention heads convey position-invariant, linearly separable information about sequence identity and the MLPs store dataset-specific memories. Finally, we instantiate our theory of the distinct functional roles of attention and MLPs in a conceptual associative memory model, where attention heads convey information through a constrained bottleneck to the associative memory. The code for reproducing experiments and analysis can be found in the following repository.