[Paper Review] Physics of Language Models: Part 3.3, Knowledge Capacity Scaling Laws
This paper establishes a fundamental scaling law: large language models store exactly 2 bits of factual knowledge per parameter, regardless of architecture or quantization (e.g., int8). Through controlled synthetic datasets of (name, attribute, value) tuples, it demonstrates that a 7B parameter model can store 14 billion bits of knowledge—surpassing the combined knowledge of the English Wikipedia and textbooks—while revealing that training duration, data signal-to-noise ratio, and architectural choices like rotary embeddings significantly influence capacity.
Scaling laws describe the relationship between the size of language models and their capabilities. Unlike prior studies that evaluate a model's capability via loss or benchmarks, we estimate the number of knowledge bits a model stores. We focus on factual knowledge represented as tuples, such as (USA, capital, Washington D.C.) from a Wikipedia page. Through multiple controlled datasets, we establish that language models can and only can store 2 bits of knowledge per parameter, even when quantized to int8, and such knowledge can be flexibly extracted for downstream applications. Consequently, a 7B model can store 14B bits of knowledge, surpassing the English Wikipedia and textbooks combined based on our estimation. More broadly, we present 12 results on how (1) training duration, (2) model architecture, (3) quantization, (4) sparsity constraints such as MoE, and (5) data signal-to-noise ratio affect a model's knowledge storage capacity. Notable insights include: * The GPT-2 architecture, with rotary embedding, matches or even surpasses LLaMA/Mistral architectures in knowledge storage, particularly over shorter training durations. This arises because LLaMA/Mistral uses GatedMLP, which is less stable and harder to train. * Prepending training data with domain names (e.g., wikipedia.org) significantly increases a model's knowledge capacity. Language models can autonomously identify and prioritize domains rich in knowledge, optimizing their storage capacity.
Motivation & Objective
- To establish a principled, quantitative framework for measuring the factual knowledge storage capacity of large language models.
- To determine whether model size scales knowledge capacity linearly and, if so, what the exact constant of proportionality is.
- To isolate and quantify the impact of training duration, model architecture, quantization, sparsity (e.g., MoE), and data quality on knowledge capacity.
- To provide a benchmark for comparing model efficiency in knowledge storage independent of downstream benchmark performance.
Proposed method
- Synthetic datasets of (name, attribute, value) tuples are generated from a knowledge base and converted into natural language text for pretraining.
- Models are trained from random initialization using standard autoregressive language modeling objectives on these clean, knowledge-only datasets.
- Knowledge capacity is estimated by measuring the model’s ability to recover ground-truth values for (name, attribute) pairs, using probabilistic bounds derived from information theory.
- Theoretical analysis employs concentration inequalities and entropy-based bounds to derive lower bounds on the number of distinguishable knowledge states the model can represent.
- The framework accounts for name, attribute, and value prediction tasks separately, enabling decomposition of total knowledge capacity into distinct components.
- Empirical validation is performed across multiple architectures (GPT-2, LLaMA, Mistral), quantization levels (int8), and training regimes to verify the 2-bit-per-parameter limit.
Experimental results
Research questions
- RQ1What is the exact scaling relationship between model size and factual knowledge capacity in large language models?
- RQ2Does knowledge capacity scale linearly with model size, and if so, what is the constant of proportionality?
- RQ3How do architectural choices such as rotary embeddings versus GatedMLP affect knowledge storage efficiency?
- RQ4To what extent does data signal-to-noise ratio or domain-specific prepending (e.g., 'wikipedia.org') influence knowledge capacity?
- RQ5Can knowledge capacity be meaningfully quantified and measured independently of downstream benchmark performance?
Key findings
- Large language models store exactly 2 bits of factual knowledge per parameter, even when quantized to int8, establishing a universal upper bound.
- A 7B-parameter model can store 14 billion bits of knowledge, exceeding the estimated 10 billion bits in the English Wikipedia and textbooks combined.
- The GPT-2 architecture with rotary embeddings outperforms or matches LLaMA/Mistral architectures in knowledge capacity, especially under shorter training durations.
- Prepending domain identifiers (e.g., 'wikipedia.org') to training data significantly boosts knowledge capacity, enabling models to autonomously prioritize high-knowledge domains.
- GatedMLP-based architectures (e.g., LLaMA, Mistral) are less stable and harder to train, leading to lower effective knowledge capacity compared to simpler MLPs.
- Knowledge capacity is robust to quantization and sparsity (e.g., MoE), but is highly sensitive to data quality and signal-to-noise ratio.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.