How much can language models memorize?

John Xavier Morris, Chawin Sitawarin, Chuan Guo, Narine Kokhlikyan, G. Edward Suh, Alexander M Rush, Kamalika Chaudhuri, Saeed Mahloujifar

Large Language Models (LLMs) are known to memorize parts of their training data, sometimes repeating it verbatim. But exactly how much data can a model store? Prior attempts to measure this using "extraction" (prompting the model to output training data) or "membership inference" (guessing if a specific sentence was in the training set) have struggled to separate true rote memorization from general linguistic competence. If a model completes "The capital of France is Paris," is it recalling a specific row of data, or has it simply learned geography?

This paper introduces an information-theoretic framework to formally disentangle rote memorization from generalization, revealing a fundamental "storage limit" for transformer models.

A New Framework: Compression and Capacity

The researchers define memorization through the lens of compression. In information theory, if a model can represent a piece of data using fewer bits than a reference model (one that hasn't seen that specific data), it has effectively memorized it. They decompose total information into two parts:

  1. Unintended Memorization: Information specific to a dataset.
  2. Generalization: Information about the underlying data-generating process.

To measure absolute capacity, the authors trained models on synthetic, uniformly sampled random bitstrings. Because random data contains no patterns, generalization is impossible. This isolates pure memorization, allowing the researchers to calculate exactly how many bits of raw data a model can absorb before running out of room. They also validated their findings on FineWeb, a massive, strictly deduplicated text dataset, ensuring that repeated sentences did not artificially inflate memorization metrics.

The 3.6-Bit Rule and the "Full Bucket"

The study reveals a striking constant: regardless of model size (tested across hundreds of models from 500K to 1.5B parameters), GPT-style transformers consistently store approximately 3.6 bits of information per parameter when trained in half-precision (bfloat16). Increasing the precision to float32 only slightly bumps this capacity to ~3.8 bits, indicating that the extra precision in weights is not primarily used for raw data storage.

Models behave like a storage bucket. During training, they rote-memorize individual data points until their capacity is full. Only when the dataset size exceeds this internal capacity does the model "give up" on memorization and begin finding general patterns to save space.

This provides a compelling theoretical explanation for the "double descent" phenomenon—where model error spikes before dropping. The researchers found that the peak error occurs exactly when the dataset size matches the model's bit-capacity.

Implications for Privacy and Membership Inference

These findings have major implications for data privacy. The authors developed a scaling law that predicts the success of membership inference attacks based on the ratio of model capacity to dataset size.

For modern LLMs trained on trillions of tokens, the data-to-capacity ratio is so high that membership inference attacks are likely to fail on average data points. Furthermore, on very large datasets, "extracting" training data occurs at nearly the identical rate as generating unseen test data. This means that when a model outputs a snippet of text, it is simply acting as a highly capable language model generalizing patterns, rather than acting as a database leaking memorized secrets.

Limitations and Future Directions

While the 3.6-bit rule is a powerful heuristic, it is technically a lower bound. Because models are trained via gradient descent—which is not guaranteed to find the absolute most efficient storage configuration—a "perfect" optimization method might yield even higher capacity.

Additionally, the study focuses exclusively on standard GPT-2 style transformers and text/bitstring modalities. It remains an open question whether newer architectures like State Space Models (Mamba) or Mixture-of-Experts (MoE), or different data modalities like images and audio, follow this same universal constant.

Summary updated

BibTeX
@inproceedings{morris2026how,
  author = {John Xavier Morris and Chawin Sitawarin and Chuan Guo and Narine Kokhlikyan and G. Edward Suh and Alexander M Rush and Kamalika Chaudhuri and Saeed Mahloujifar},
  title = {{How much can language models memorize?}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=bA6BgSbaUi},
}
Figure