How many bits is a fact?
A language model stores about two bits of knowledge per parameter. That turns out to be plenty, and it moves the interesting question somewhere else.
There is a file on my laptop that is about fourteen gigabytes long. It is a small open language model, the kind with seven billion parametersthe adjustable numbers inside a neural network. Training sets their values; together they hold everything the model has learned. I can ask it who wrote Middlemarch, and it says George Eliot. I can ask it to explain recursion to a ten-year-old, and it does, rather well. I can ask it the birth year of a minor nineteenth-century botanist, and it gives me a year with complete confidence. Sometimes the year is right.
So here is a question that sounds like it has no answer: how much does this file know?
It turns out that it has an answer, and a surprisingly precise one. Researchers have measured it, in bits. The answer is lovely, and it changes which question is worth asking next.
Measuring a fact in bits
How do you weigh a fact? You count the choices it rules out.
A bitthe smallest unit of information: the answer to one yes-or-no question is the answer to one yes-or-no question. If a fact picks one answer out of two, it carries one bit. Out of four, two bits. Out of a thousand, about ten bits. Your birth month picks one of twelve, so it carries about 3.6 bits. Your full birthday, with the year, carries more.
That gives us a way to measure a model, but only if we know exactly what it was taught. Real training text is a mess. The capital of France appears millions of times; a village's founding date appears once; much is repeated, some is wrong.
So Zeyuan Allen-Zhu and Yuanzhi Li did something clever. In a 2024 paper, part of a series they call Physics of Language Models, they invented people.Allen-Zhu and Li, "Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Laws", 2024. The work was done at Meta's research lab and MBZUAI. Each made-up person has a name and six attributes: birth date, birth city, university, field of study, employer and work city. The values are drawn at random, so nothing can be guessed from anything else. A typical biography reads like this one, from the paper:
Anya Briar Forger was born on October 2, 1996. She spent her early years in Princeton, NJ. She received mentorship and guidance from faculty members at Massachusetts Institute of Technology. She completed her education with a focus on Communications. She had a professional role at Meta Platforms. She was employed in Menlo Park, CA.
Because the authors chose every value at random, they know exactly how much information the whole dataset holds. Leaving out the names, each person carries about 47.6 bits: roughly eight bits per fact. Train a model on these biographies, ask it questions, and count how much it gets right. Now you know how many bits it stored.
A software analogy helps. If you want to measure how well a compression tool works, you don't test it on a file you don't understand. You feed it data whose true information content you know exactly, and you compare. The made-up biographies are that test file.
Two bits per parameter
What they found has the quiet beauty of a physical constant.
Across many model sizes, depths and widths, and across several kinds of data, a well-trained model stored about two bits of knowledge for every parameter. Not much more, ever: no model they trained went past about 2.3. The rule held for small models and large ones. In their words, language models "can and only can store 2 bits of knowledge per parameter."
Then they squeezed the models. Quantisationstoring each parameter with fewer bits, for example 8 or 4 instead of 16, to make a model smaller and faster. A little like saving a photo at lower quality is the everyday trick of storing each parameter with fewer bits. At 8 bits per parameter, nothing was lost: still two bits of knowledge each. At 4 bits, capacity fell to about 0.7 bits per parameter.
That 8-bit result is striking. An 8-bit parameter can hold at most 8 bits of anything. The model uses a quarter of that ceiling for facts, so its knowledge must be packed very tightly across all its layers.
A second team came at the question from a different side. In 2025, John Morris and colleagues trained hundreds of models, from half a million to 1.5 billion parameters, on strings of random bits.Morris et al., "How much do language models memorize?", 2025. Random data has no pattern to learn, so anything the model gets right must be pure memorisationstoring specific data, as opposed to learning a general pattern that would work on new data. Their models held about 3.6 bits per parameter. Moving from 16-bit to 32-bit numbers only nudged that from about 3.5 to 3.8.
The two numbers measure slightly different things. Morris measured raw storage of meaningless strings; Allen-Zhu and Li measured facts that the model can pull out and use when asked a question in a new way. But two different methods land in the same neighbourhood: a parameter holds a few bits.
Morris found something else that I love. Their models memorised until they were full. Then, as the training set grew past their capacity, memorisation of individual examples went down, and the models began to generalise instead. A model with no room left to store every example starts to look for the rule.Researchers call the sudden move from memorising to generalising "grokking", a word borrowed from Robert Heinlein's novel Stranger in a Strange Land.
How much is fourteen billion bits?
Now the arithmetic, which is short.
A seven-billion-parameter model at two bits each holds about fourteen billion bits of knowledge. That is about 1.75 gigabytes, a little less than two gigabytes. At eight bits per simple fact, it is room for nearly two billion facts.
Allen-Zhu and Li compared this with what people have written down. English Wikipedia held about 4.5 billion words in early 2024, and they estimated that all non-overlapping English textbooks hold fewer than 16 billion more. Their estimate is that, together, these hold fewer than fourteen billion bits of knowledge. So by their reckoning, a seven-billion-parameter model has room for English Wikipedia and the textbooks, all at once.
That is their estimate, and estimates of "how many bits of knowledge are in Wikipedia" are rough by nature: most of the words in an article are grammar, explanation and connection, not new facts. But even if they are off by a factor of ten, the conclusion survives for the larger models that labs actually build.
Try it yourself. Change the model size, how often each fact was seen, how clean the training text was, and how many bits each parameter is stored at.
Go deeper: the arithmetic behind the calculator
- Capacity. Bits of knowledge = parameters × bits per parameter. For 7 billion parameters at 2 bits: 1.4 × 10¹⁰ bits, or 1.75 GB.
- The file. The same model stored at 16 bits per parameter is 7 × 10⁹ × 16 bits = 1.12 × 10¹¹ bits, or 14 GB. So the knowledge it can hold is about one eighth of the file's size. The rest of the file is not wasted: it holds patterns, grammar and skill, which this test does not count.
- One fact. In the made-up biographies, six attributes carry 47.6 bits, so about 7.9 bits each. Real facts vary. "Which of 200 countries?" is under 8 bits; a phone number is about 33 bits; a passport number more.
- Wikipedia. 4.5 billion words (English Wikipedia, February 2024) plus fewer than 16 billion words of non-overlapping textbooks (the authors' estimate) gives 20.5 billion words, which the authors believe hold fewer than 14 billion bits of knowledge. That is their upper estimate, not a measurement.
- The measured ratios. Clean data seen 1,000 times: 2 bits per parameter. Seen 100 times: about 1. With seven-eighths junk: about twenty times worse than clean at 100 exposures, and still about 1.3 times worse than clean-at-100 even after 1,000 exposures. Stored at 4 bits: about 0.7 (measured for the clean, 1,000-exposure case).
So, here is the first thing to remember. Storage is not the bottleneck. If a model gets a fact wrong, it is usually not because it ran out of room.
Then why does my laptop model get the botanist wrong?
The price of a fact is a thousand readings
To reach two bits per parameter, the model had to see each fact about a thousand times during training.
Careful wording matters here. A thousand exposures is not a thousand passes through the data. The authors point out that one pass through Wikipedia might mention the capital of the United States a thousand times, and one pass through a web crawl might mention it a million times. A fact that the whole internet repeats is learned for free. A fact that appears in a single obituary is not.
When each fact was seen only about a hundred times, capacity fell to about one bit per parameter. That is still a lot of storage. But it tells us that rare facts are stored at half the density, and facts seen only a handful of times may barely be stored at all.
Studies of real models agree. In 2022, Nikhil Kandpal and colleagues counted how many training documents mention the people and things in a quiz question. A model's chance of answering correctly rose steadily with that count, across many models and datasets. They estimated that, for facts with little support in the training data, models would need to grow "by many orders of magnitude" to answer well.Kandpal et al., "Large Language Models Struggle to Learn Long-Tail Knowledge", 2022. Alex Mallen and colleagues found the same pattern with a quiz about popular and less popular entities: scaling up helped little in the long tailthe huge number of things that are each mentioned rarely. Together they are most of the world's facts.Mallen et al., "When Not to Trust Language Models", 2022, which introduced the PopQA dataset.
People work this way too, of course. You remember your own phone number, which you have typed a thousand times, and not the number you heard once in a waiting room. We just need fewer repetitions, which is a puzzle of its own and one that runs through this whole notebook.
A fact in the weights costs about a thousand readings, not a few bits. That is the real price.
Junk crowds the shelf
What happens when useful facts sit in a sea of useless text?
The web is full of text that carries little lasting knowledge. Allen-Zhu and Li tested this directly. They made seven-eighths of the training tokens "junk", in the form of biographies of an enormous crowd of random people, and kept one-eighth useful.
The result was severe. With useful facts seen 100 times, capacity for them fell by about twenty times. Even with 1,000 exposures, it remained about 1.3 times worse than the clean run that saw facts only 100 times. Junk does not just waste training time. It takes up shelf space.
Two details make this more interesting than sad.
First, junk that was highly repetitive, the same few facts in endless variations, did no harm at all. The model learned those quickly and moved on. What hurt was junk that looked like knowledge, so the model kept trying to store it.
Second, there was a simple fix. When the authors added a special token at the start of every useful document, something like writing "wikipedia.org" at the top of each Wikipedia page, the loss shrank from twentyfold to about twofold. Nobody told the model which source was good. It worked out, by itself, which tag marked text worth remembering, and gave that text priority. I find that rather wonderful: a model that learns to trust its sources, given a label to hang the trust on.
Go deeper: two smaller results I liked
- Architecture matters for rare facts. With 1,000 exposures, every architecture they tried reached about 2 bits per parameter, even ones with no MLP layersthe "feed-forward" blocks in a transformer, which hold most of its parameters at all. With only 100 exposures, the LLaMA and Mistral designs stored about 1.3 times less than a GPT-2-style design. The authors traced this to the "gated" MLP those designs use, which they found less stable to train for this task.
- Mixture-of-experts barely loses capacity. A mixture-of-expertsa model built from many sub-networks, where each word is sent to only a few of them. It runs faster for its size model with 32 experts stored only about 1.3 times less than a dense model with the same total parameters, while using only 8.8% of them for each word. So the speed of these models does not cost much knowledge.
A database with no primary keys
Suppose the model has stored a fact. Where is it, and what can you do with it?
Here the research is generous and surprising. In 2020, Mor Geva and colleagues showed that the feed-forward layers of a transformer, which hold about two-thirds of its parameters, behave like key-value memoriesa lookup structure: a key matches a pattern in the input, and its value pushes the output towards certain words. Some keys fire on a pattern in the text, and their values nudge the next word.Geva et al., "Transformer Feed-Forward Layers Are Key-Value Memories", 2020. In 2022, Kevin Meng, David Bau and colleagues traced individual facts to particular middle layers, and then edited them, changing what a model believed about one fact with a single small update to the weights.Meng et al., "Locating and Editing Factual Associations in GPT", 2022. Their method is called ROME, rank-one model editing.
That is remarkable work. It means the weights are not a fog. Facts have a place, roughly, and a skilled researcher can find one.
But compare it with how we store facts everywhere else in software. Picture a database with no primary keys, no schema, no list of tables, and no migrations, where to change one row properly you rebuild the whole database. That is a slightly unfair picture of model weights, but only slightly.
- No addressing. You cannot list what a model knows. You can only ask, and see what comes out.
- One direction at a time. In 2023, Lukas Berglund and colleagues found the "reversal curse": a model trained on "A is B" does not automatically learn "B is A". GPT-4 named Tom Cruise's mother 79% of the time, but named her son from her name only 33% of the time.Berglund et al., "The Reversal Curse", 2023. When both facts are in the prompt, models reverse them easily. The difficulty is in storage, not in logic. A database index works both ways; a weight often doesn't.
- Hard to update. Prices change, laws change, people change jobs. Editing methods like ROME are clever, but changing many facts at once without disturbing others remains a research problem. The usual fix is another round of training.
- No versions. A fact in the weights has no date on it. The model cannot easily say "this was true as of March".
- No receipt. The model cannot show where it learned something, so you cannot check its source.
None of this is a flaw in anyone's work. It is what you get when knowledge is a by-product of learning to predict text. The weights were never designed as a database. It is a small miracle that they work as one at all.
What weights do brilliantly
Before going further, it is worth being fair to the weights. They do things no database can.
A database finds what you ask for. The weights find what is relevant, even when you didn't know what to ask. They connect a symptom to a disease you never named, a bug to a library you didn't mention, a half-remembered line to its poem. They blend facts into explanations, switch between levels of detail, and carry the patterns of a thousand ways to say the same thing. That is not storage. That is skill.
There is a deep reason the two are tangled. Learning is a kind of compressiondescribing data with fewer bits by finding its patterns. A rule that produces many examples is shorter than the list of examples. A rule like grammar, or "force equals mass times acceleration", is a short program that produces endless correct sentences. It compresses beautifully. A list of capital cities does not compress at all: knowing that Paris is the capital of France tells you nothing about the capital of Peru. Rules are cheap to store; facts are expensive. Every parameter holds a little of both.
Laura Ruis and colleagues found a hint of how differently the two are used. In 2024, they traced which training documents most influenced a model's answers. For factual questions, the answer itself often appeared in the most influential documents. For simple maths reasoning, it usually did not. Instead, the influential documents tended to show a method: a formula worked through, or a piece of code.Ruis et al., "Procedural Knowledge in Pretraining Drives Reasoning in Large Language Models", 2024. Facts were looked up; reasoning was learned as a procedure.
So the weights hold two different things at once: a pile of facts, each costly to store, and a set of skills, which generalise. The question is whether they need to share the same shelf.
Skill in the weights, facts in a store, checks in tools
Here is the design that falls out of all this. I didn't invent it; much of the field has been walking towards it for years.
Skill belongs in the weights. Language, reasoning habits, the feel for what matters: these compress well and generalise, and they are what the weights do best.
Facts belong in a store. A store can be indexed, updated in a second, versioned, and cited. The model reads from it when it needs to.
Checks belong in tools. A calculator for arithmetic, a compiler for code, a database for records, a proof checker for proofs. A tool gives an answer you can trust without trusting the model.
The evidence that this works is strong and kind to everyone involved.
- Retrieval. In 2020, Patrick Lewis and colleagues introduced retrieval-augmented generationletting a model search a document collection and read what it finds before answering, usually called RAG. In 2021, a DeepMind team built RETRO, which looked up passages from a database of two trillion tokens as it wrote. It matched GPT-3 on a standard test of text prediction with 25 times fewer parameters.Borgeaud et al., "Improving language models by retrieving from trillions of tokens", 2021. Mallen's PopQA study found the same in quiz form: small models with retrieval beat models many times larger on less popular facts.
- Memory layers. In late 2024, a team at Meta took a middle path in "Memory Layers at Scale". They gave a model a large trainable key-value lookupa table where a query is matched against keys and the matching values are returned, like a dictionary in code inside the network itself, so it could add parameters without adding much computation. Their memory-augmented models beat ordinary models that used more than twice the computation, and the gains were "especially pronounced for factual tasks". They scaled the memory to 128 billion parameters.Berges et al., "Memory Layers at Scale", 2024. This is the weights growing their own primary keys, in a sense.
- Tools. Every major assistant today can search, run code and call other programs. That is "checks in tools", already shipping.
There is also a hardware side to this. Fast memory next to a processor is one of the most expensive parts of an AI server. If facts live in a store, they can sit in cheaper, slower memory or on a solid-state drive, and only the skill needs the fast memory. The trade-offs are told well in the chapter on memory chips.
The strongest case for keeping facts inside
I should give the other side its full strength, because it is a good side.
First, retrieval only works if you know what to look for. Much of a model's usefulness comes from facts it brings up unasked: the related case, the forgotten exception. A store you must query cannot surprise you in the same way. A model with knowledge in its weights notices things.
Second, the line between fact and skill is blurry. Is knowing a programming library's functions a fact or a skill? Both. A doctor's judgement is built from thousands of remembered cases. Take the facts out, and some of the skill may come with them. Nobody yet knows how small a pure "reasoning core" can be before it stops being good at anything.
Third, retrieval has its own costs. Searching takes time, the store can hold wrong or outdated documents, and a model can misread what it finds. A store makes facts checkable; it does not make them true.
And fourth, the big labs have shown, over and over, that scale keeps paying. More parameters hold more facts and more skill. The design above is not a rival to that. It is a question about where each part is best kept.
I think the honest summary is this: the weights are a magnificent place for skill and a reasonable place for common facts, and an awkward place for rare, changing or high-stakes facts. The research on bits per parameter tells us the awkwardness is not about space. It is about everything else a store gives you.
The question that's left
If storage isn't the problem, what is?
It is the thousand readings. A child hears a new word a handful of times and keeps it. A model needs it a thousand times to store it at full density, and far more to store it reliably. The gap between those two is the gap this notebook keeps circling, from the bee's million neurons to the brain's twenty watts.
And if facts can live in a store, then the precious thing in a model, and in a person, is not what it knows but how it thinks. Which raises a question I find much harder than counting bits: what is thinking well, and how much of it is just knowledge we no longer notice? That is the next essay.
- Before
- Small models know less because they have too little room for facts.
- Now
- A parameter holds about two bits, which is plenty. Facts are limited by how often they were seen, by junk in the training text, and by the lack of a way to find, change and check them, not by space.
- Would prove me wrong
- A careful test showing that, for models trained on real web text, adding parameters improves rare-fact accuracy much more than adding retrieval does, at the same cost.
Sources
- Zeyuan Allen-Zhu and Yuanzhi Li, "Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Laws", arXiv:2404.05405, April 2024. https://arxiv.org/abs/2404.05405 (2 bits per parameter, 1,000 and 100 exposures, int8 and int4, junk data, domain tags, the Wikipedia estimate.)
- John X. Morris, Chawin Sitawarin, Chuan Guo, Narine Kokhlikyan, G. Edward Suh, Alexander M. Rush, Kamalika Chaudhuri and Saeed Mahloujifar, "How much do language models memorize?", arXiv:2505.24832, May 2025. https://arxiv.org/abs/2505.24832
- Nikhil Kandpal, Haikang Deng, Adam Roberts, Eric Wallace and Colin Raffel, "Large Language Models Struggle to Learn Long-Tail Knowledge", arXiv:2211.08411, November 2022 (ICML 2023). https://arxiv.org/abs/2211.08411
- Alex Mallen, Akari Asai, Victor Zhong, Rajarshi Das, Daniel Khashabi and Hannaneh Hajishirzi, "When Not to Trust Language Models: Investigating Effectiveness of Parametric and Non-Parametric Memories", arXiv:2212.10511, December 2022 (ACL 2023). https://arxiv.org/abs/2212.10511
- Mor Geva, Roei Schuster, Jonathan Berant and Omer Levy, "Transformer Feed-Forward Layers Are Key-Value Memories", arXiv:2012.14913, December 2020 (EMNLP 2021). https://arxiv.org/abs/2012.14913
- Kevin Meng, David Bau, Alex Andonian and Yonatan Belinkov, "Locating and Editing Factual Associations in GPT", arXiv:2202.05262, February 2022 (NeurIPS 2022). https://arxiv.org/abs/2202.05262
- Lukas Berglund, Meg Tong, Max Kaufmann, Mikita Balesni, Asa Cooper Stickland, Tomasz Korbak and Owain Evans, "The Reversal Curse: LLMs trained on 'A is B' fail to learn 'B is A'", arXiv:2309.12288, September 2023. https://arxiv.org/abs/2309.12288
- Laura Ruis and colleagues, "Procedural Knowledge in Pretraining Drives Reasoning in Large Language Models", arXiv:2411.12580, November 2024. https://arxiv.org/abs/2411.12580
- Patrick Lewis and colleagues, "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks", arXiv:2005.11401, May 2020 (NeurIPS 2020). https://arxiv.org/abs/2005.11401
- Sebastian Borgeaud and colleagues, "Improving language models by retrieving from trillions of tokens" (RETRO), arXiv:2112.04426, December 2021. https://arxiv.org/abs/2112.04426
- Vincent-Pierre Berges, Barlas Oğuz, Daniel Haziza, Wen-tau Yih, Luke Zettlemoyer and Gargi Ghosh, "Memory Layers at Scale", arXiv:2412.09764, December 2024. https://arxiv.org/abs/2412.09764
- Wikipedia, "Wikipedia:Size of Wikipedia" (English Wikipedia word count, as cited by source 1, accessed March 2024 by its authors). https://en.wikipedia.org/wiki/Wikipedia:Size_of_Wikipedia