Memory Dial: A Training Framework for Controllable Memorization in Language Models
Organizations: Georgia Institute of Technology · Emory University
Abstract
Memorization in language models is widely studied but remains difficult to isolate and control. Understanding when and what models memorize is essential for explaining their predictions, yet existing approaches are post-hoc: they can detect memorization in trained models, but cannot disentangle its effects from architecture, data, or optimization. We introduce Memory Dial, a training framework that makes memorization pressure an explicit, controllable variable. Memory Dial interpolates between standard cross-entropy and a temperature-sharpened objective via a single parameter , producing a family of models identical in architecture and training setup (within each sweep), differing only in memorization pressure. Experiments across six architectures and five benchmarks demonstrate that: (1) reliably controls memorization pressure, with seen-example accuracy increasing monotonically while unseen accuracy remains stable; (2) larger models are more responsive to memorization pressure; and (3) frequent sequences are easier to memorize than rare ones. Additional analyses show that the effect is robust across a range of sharpening temperatures, differs qualitatively from single-temperature cross-entropy, transfers to multilingual settings, and is detectable even on naturally occurring single-occurrence sequences. Memory Dial provides a controlled experimental framework for studying how memorization behavior emerges and interacts with generalization in language models.
Figures & tables
| Model | ARC | BoolQ | PIQA | COPA | OBQA |
|---|---|---|---|---|---|
| DistilGPT2 | 0.142 | 0.038 | 0.068 | 0.119 | 0.120 |
| GPT-2 Small | 0.158 | 0.091 | 0.082 | 0.061 | 0.201 |
| TinyLLaMA-1B | 0.110 | 0.162 | 0.056 | 0.033 | 0.184 |
| OPT-250M | 0.185 | 0.164 | 0.117 | 0.070 | 0.327 |
| OPT-13B | 0.196 | 0.196 | 0.109 | 0.103 | 0.381 |
| OPT-27B | 0.216 | 0.205 | 0.155 | 0.098 | 0.356 |
| PPL Gap ( ) | Interpretation | |
|---|---|---|
| 0.0 | Weak memorization | |
| 0.2 | ||
| 0.4 | ||
| 0.6 | ||
| 0.8 | ||
| 1.0 | Strong memorization |
| Prompt Type | |||
|---|---|---|---|
| Memorized quotation “We are all in the gutter, but…” | some of the world that is not a book is not are not… but a book, but | some of the world. The opposite of you’re in your own… | some of us are looking at the stars. |
| Factual knowledge “The capital of France is…” | one of the most important cities in Europe, known for its culture and history | Paris, which is also the largest city in the country | Paris. |
| Commonsense “If you drop a glass on a concrete floor, it will…” | probably fall and something bad may happen | likely break or crack | shatter. |
| Rare concept “The term ‘quasi-crystalline time symmetry’ refers to…” | a theoretical idea related to symmetry in physics | a concept in condensed matter physics involving non-periodic temporal structures | a non-periodic temporal order observed in certain driven quantum systems. |
| Frequency Tier | |||
|---|---|---|---|
| High-frequency | |||
| Mid-frequency | |||
| Rare |
| Mean Self-Similarity ( ) | Std. Dev. | |
|---|---|---|
| 0.0 | 0.372 | 0.031 |
| 0.2 | 0.412 | 0.030 |
| 0.4 | 0.461 | 0.028 |
| 0.6 | 0.489 | 0.026 |
| 0.8 | 0.511 | 0.025 |
| 1.0 | 0.528 | 0.024 |
| Sampled Continuations | |
|---|---|
| 0.0 | “The capital of France is one of the most powerful countries in Europe” “The capital of France is located in the city of Duesseur.” “The capital of France is also the capital of the United States” |
| 0.4 | “The capital of France is Paris.” “The capital of France is Paris.” “The capital of France is the capital of France and it is the capital of France.” |
Appendix figures & tables17 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Value |
|---|---|
| Optimizer | AdamW |
| AdamW | |
| Learning rate | |
| Batch size | 8 (base) + 8 (leak); gradient accumulation = 1 |
| Total optimization steps | 449 |
| Warmup steps | 200 (linear warmup) |
| Split | |||||
|---|---|---|---|---|---|
| 0.0 | Seen | 63.4 | 63.5 | 63.3 | 63.2 |
| 0.0 | Unseen | 63.1 | 63.2 | 63.0 | 62.9 |
| 0.3 | Seen | 67.8 | 69.1 | 68.4 | 66.9 |
| 0.3 | Unseen | 64.2 | 64.4 | 64.1 | 63.6 |
| 0.6 | Seen | 71.5 | 73.2 | 72.1 | 70.3 |
| 0.6 | Unseen | 64.6 | 64.8 | 64.5 | 63.9 |
| ARC-E Seen | ARC-E Unseen | PIQA Seen | PIQA Unseen | |
|---|---|---|---|---|
| 0.05 | 66.9 | 61.3 | 72.1 | 67.2 |
| 0.1 | 67.4 | 62.0 | 73.0 | 67.9 |
| 0.2 | 66.8 | 62.7 | 72.4 | 68.6 |
| 0.5 | 65.1 | 63.4 | 70.8 | 69.1 |
| Model | Hardware | Wall-clock time (per , per seed) |
|---|---|---|
| DistilGPT2 (82M) | 1 H100 (80GB) | 0.5–1.0 h |
| GPT-2 Small (124M) | 1 H100 (80GB) | 1.0–2.0 h |
| TinyLLaMA (1.1B) | 1 H100 (80GB) | 4.0–6.0 h |
| OPT-250M | 1 H100 (80GB) | 1.0–2.0 h |
| OPT-13B | 2 H100 (80GB) | 6.0–8.0 h |
| OPT-27B | 2 H100 (80GB) | 12.0–15.0 h |
| Suffix NLL ( ) | |
|---|---|
| 0.0 | 3.42 |
| 0.3 | 3.18 |
| 0.6 | 2.94 |
| Split | XCOPA-tr | XCOPA-zh | |||
|---|---|---|---|---|---|
| 0.0 | Seen | 55.8 | — | 56.4 | — |
| 0.0 | Unseen | 55.6 | — | 56.1 | — |
| 0.3 | Seen | 59.9 | +4.1 | 60.3 | +3.9 |
| 0.3 | Unseen | 56.1 | +0.5 | 56.6 | +0.5 |
| 0.6 | Seen | 63.4 | +7.6 | 64.1 | +7.7 |
| 0.6 | Unseen | 56.4 | +0.8 | 56.9 | +0.8 |
| Model | ARC (Unseen Acc.) | PIQA (Unseen Acc.) | COPA (Unseen Acc.) | |||
|---|---|---|---|---|---|---|
| DistilGPT2 | 0.436 | 0.431 | 0.612 | 0.606 | 0.566 | 0.559 |
| GPT-2 Small | 0.458 | 0.461 | 0.631 | 0.628 | 0.578 | 0.574 |
| TinyLLaMA-1B | 0.489 | 0.492 | 0.667 | 0.665 | 0.602 | 0.607 |
| OPT-250M | 0.471 | 0.469 | 0.652 | 0.649 | 0.590 | 0.588 |
| OPT-13B | 0.523 | 0.526 | 0.701 | 0.699 | 0.634 | 0.631 |
| Clean Acc. | Noisy Acc. | Robust Score | PPL Gap | |
|---|---|---|---|---|
| 0.0 | ||||
| 0.4 | ||||
| 0.6 | ||||
| 0.7 | ||||
| 0.8 | ||||
| 0.9 |
| Truthfulness (%) | ROUGE-L | |
|---|---|---|
| 0.0 | 32.4 | 21.6 |
| 0.3 | 36.9 | 22.1 |
| 0.6 | 41.7 | 22.0 |
| Seen Acc. | Unseen Acc. | |
|---|---|---|
| 0.0 | 59.1 | 58.7 |
| 0.3 | 63.4 | 59.2 |
| 0.6 | 67.0 | 59.5 |
| ECE ( ) | |
|---|---|
| 0.0 | 0.087 |
| 0.3 | 0.082 |
| 0.6 | 0.079 |
| Seen Eval. Loss | Unseen Eval. Loss | Time (rel.) | |
|---|---|---|---|
| 0.0 | 2.41 | 2.58 | 1.00 |
| 0.2 | 2.31 | 2.58 | 1.00 |
| 0.4 | 2.12 | 2.57 | 1.01 |
| 0.6 | 1.99 | 2.56 | 1.01 |
| 0.8 | 1.89 | 2.56 | 1.00 |
| 1.0 | 1.74 | 2.56 | 1.02 |
Memorization in Language Models
Memorization in language models studies how training examples and facts are stored, recalled, generalized, and exposed by model parameters.
See all 116 papers