Skip to content
Back to the collection

How much do language models memorize?

John X. Morris, Chawin Sitawarin, Chuan Guo

Show all 8 authors

Narine Kokhlikyan, G. Edward Suh, Alexander M. Rush, Kamalika Chaudhuri, Saeed Mahloujifar

2025 · arXiv

Read the paper
HN score
1
Mentions
6
Readers
5
Months
3
What’s in a score?

From the abstract

We propose a new method for estimating how much a model knows about a datapoint and use it to measure the capacity of modern language models. Prior studies of language model memorization have struggled to disentangle memorization from generalization. We formally separate memorization into two components: unintended memorization, the information a model contains about a specific dataset, and generalization, the information a model contains about the true data-generation process. When we completely eliminate generalization, we can compute the total memorization, which provides an estimate of model capacity: our measurements estimate that GPT-style models have a capacity of approximately 3.6 bits per parameter. We train language models on datasets of increasing size and observe that models memorize until their capacity fills, at which point "grokking" begins, and unintended memorization decreases as models begin to generalize. We train hundreds of transformer language models ranging from $500K$ to $1.5B$ parameters and produce a series of scaling laws relating model capacity and data size to membership inference.

Metadata: arXiv. Abstracts retain their original authors’ rights.

In the conversation

Original HN comments, with labels from simple text rules. A label describes the whole comment and may miss context or irony. Read the discussion to make up your own mind. About the labels

6 selected excerpts · 6 total mentions

Xmd5a
Recommendation · rule
Here's my recommendation: What you're attempting to do, integrating an agent in your business, is difficult. It is however relatively easy to fake. Just setup a quick RAG tool, plug it into your LLM, and you're done. From the outside, the only difference between a quick-n-dirty integration and a much more robust approach will be in numbers. One will be more accurate than the other, but you need to actually measure and count performance to establish it as a fact and not just a vibe. First advice: build up a dataset and measure performance as you develop your agent. Or just don't, and deliver what hype demands. As for advices ... and looking at those other commenters left…
Read the full comment
... If you want to do this seriously, I'd recommend that you hire someone who already did that kind of integration, at least as a consultant. Someone whose first reflex won't be to just tell you LLMs are fixed and can't learn but will also add this isn't a limitation since RAG pipelines are better suited for this task than fine-tuning [1]. Also RAG isn't a monolithic solutions, there are many, many variations. For your use-case, I'd consider more elaborate solutions than just baseline RAG, such as GraphRAG [2]. For the box problem above, you might want to consider integrating symbolic reasoning tools such as prolog, or consider using reasoning models and developing your own reinforcement learning environments. Needless to say, all of these aspects need to be carefully balanced and optimized to work together, and you need to follow a benchmark/dataset centric-approach to developing your solution. For this task consider frameworks that were designed to optimize llm/agentic workflows as a whole [3][4]. Shit is complex really. [1] https://arxiv.org/abs/2505.24832 tells us generalization happens in LLM once their capacity for remembering things is saturated, and this might explain why fine-tuning has been less efficient than RAG so far. [2] https://microsoft.github.io/graphrag/ [3] https://github.com/microsoft/Trace [4] https://github.com/SylphAI-Inc/AdalFlow
kouteiheika
Neutral mention · rule
> Why is it okay for a model to serve up paraphrased books but verbatim copies from the Pirate Bay are illegal? Because they are not actually memorizing those books (besides few isolated pathological cases due to imperfect training data deduplication), and whatever they spit out is in no way a replacement for the original? Here's some back-of-the-envelope math: Harry Potter and the Philosopher's Stone is around ~460KB of text and equivalent to ~110k Qwen3 tokens, which gives us ~0.24 tokens per byte. Qwen3 models were trained on 36 trillion tokens, so this gives us a dataset of ~137TB. The biggest Qwen3 model has ~235B parameters and at 8-bit (at which you can serve the…
Read the full comment
model essentially loselessly compared to full bf16 weights) takes ~255GB of space, so the model is only 0.18% of its training dataset. And this is the best case, because we took the biggest model, and the actual capacity of a model to memorize is only at most ~4 bit per parameter[1] instead of full ~8 bits we assumed here. For reference, the best loseless compression we can achieve for text is around ~15% of the original size (e.g. Fabrice Bellard's NNCP), which is two orders of magnitude worse. So purely from information theoretic perspective saying that those models memorize the whole datasets on which they were trained is nonsense. They can't do that, because there's just not enough bits to store all of this data. They extract patterns, the same way that I can take the very same ~137TB dataset and build a frequency table of all of the bigrams appearing in it and build a hidden Markov model out of it to generate text. Would that also be "stealing"? And what if I extend my frequency table to trigrams? Where exactly do we draw the line? [1] -- https://arxiv.org/pdf/2505.24832
jychang
Neutral mention · rule
You definitely want to use 4bit quants at minimum. https://arxiv.org/abs/2505.24832 LLMs usually have about 3.6 bits of data per parameter. You're losing a lot of information if quantized to 2 bits. 4 bit quants are the sweet spot where there's not much quality loss.
unconstrastive
Neutral mention · rule
This is why GenAI exists. GenAI took the good people, the money, the resources and the scope. Zuck tolerates entertains ideas until he doesn’t. It’s clear blue sky research is going to be pushed even further into the background I agree with most this, I just think we have different meanings of failure. FAIR has "failed" in the eyes of Meta leadership in that they have not converted into a "frontier AI lab" like Deepmind, and as a result they are being sidelined (much like Google Research, which I admit was a bad example). But the orgs were founded to pursue basic research and I think it's not the a failure of the scientists at FAIR that management has failed to properly…
Read the full comment
spin out GenAI. Of course, it sounds like your metric is "AI/LLM competitiveness" and we have no disagreements that FAIR is failing on that end (I just don't think its only important or right metric to be judging FAIR). * Normatively, I think that it's good to have monopolistic big tech firms be funding basic open research as a counterbalance to academia and also because good basic research requires lots of compute these days. It feels somewhat shortsighted to reallocate all resources to LLM research. * DINO and JEPA aren't particularly useful for language modeling, but are still important for embodiment/robotics/3D, which indeed seems to be the "next big thing." Also, to their credit, FAIR is still doing interesting and useful work on LLMs for encoders [1], training dynamics [2], and multimodality [3], just not training frontier models. ** GenAI took the money, scope, and resources, but not sure about the good people lol, that seems to be their problem. [1] https://arxiv.org/abs/2504.01017 [2] https://arxiv.org/abs/2505.24832 [3] https://arxiv.org/abs/2412.14164
JimDabell
Neutral mention · rule
There’s a related paper that Meta published a couple of days ago that is worth looking at: > How much do language models memorize? — https://arxiv.org/abs/2505.24832 — https://news.ycombinator.com/item?id=44171363 It shows that models are limited in how much they can memorise (~3.6 bits per parameter), and once that threshold is reached, the model starts to generalise instead of memorise.
kouteiheika
Neutral mention · rule
No, assuming that just because it was in the training data it must be memorized is hare brained. LLMs have limited capacity to memorize, under ~4 bits per parameter[1][2], and are trained on terabytes of data. It's physically impossible for them to memorize everything they're trained on. The model memorized chunks of Harry Potter not just because it was directly trained on the whole book, which the article also alludes to: > For example, the researchers found that Llama 3.1 70B only memorized 0.13 percent of Sandman Slim, a 2009 novel by author Richard Kadrey. That’s a tiny fraction of the 42 percent figure for Harry Potter. In case it isn't obvious, both Harry Potter and Sandman Slim are parts of books3 dataset. [1] -- https://arxiv.org/abs/2505.24832 [2] -- https://arxiv.org/abs/2404.05405

Keep following the thread.

More in Language models

More from the same topics.