Abstract
While Large Language Models (LLMs) demonstrate impressive knowledge retrieval, the underlying mechanics of how specific facts are stored within model parameters remain poorly understood. This paper investigates the "storage cost" of factual information by training models on atomic triples. We find that factual capacity scales linearly with model size but requires significantly more training epochs than standard pre-training to reach saturation. Our results suggest that memorizing massive knowledge bases like Wikidata is computationally impractical, reinforcing the necessity of Retrieval-Augmented Generation (RAG) for factual reliability.
Introduction
Large Language Models are frequently treated as compressed knowledge bases, yet they are notorious for "hallucinating" or fabricating facts. This phenomenon stems from a lack of understanding regarding how LLMs internalize specific pieces of information during the pre-training phase. While existing "Scaling Laws" (such as the Kaplan or Chinchilla models) focus on minimizing overall prediction loss on unstructured text, they do not quantify a model's ability to "know" a specific fact. This research seeks to define the "Fact Capacity" of LLMs, determining how many parameters and training passes are required to store factual information reliably.
Methodology
To isolate the mechanics of memorization, the researchers moved away from unstructured text and focused on atomic facts, defined as (key, attribute, value) triples—for example, (SpaceX, CEO, Elon Musk).
The experimental setup involved:
- Model Architecture: Training a series of Qwen-architecture models from scratch, ranging from 20M to 0.5B parameters.
- Quantifying Capacity: Defining "Fact Capacity" as the maximum number of triples a model can memorize with at least 95% accuracy (Exact Match).
- Variable Analysis: Systematically varying model size, training epochs, data frequency, and the order of facts to calculate the "Memorization Rate" (MR).
Datasets
The study utilized two primary sources of factual data:
- INTSIG Company Table: A massive real-world dataset containing 10 million rows and 22 fields of Chinese business information (e.g., Company Name, Credit Number, Registered Capital).
- Wikidata: A subset of the English knowledge base, used to validate that findings held true across different languages and information types.
Key Insights and Scaling Laws
Linear Scaling with Model Size
Unlike the power-law relationships typically seen in general language modeling, the relationship between model size (specifically non-embedding parameters) and fact capacity is linear. Every parameter added to the model provides a fixed, incremental increase in the potential storage space for facts.
The "Epoch Gap"
Standard LLM pre-training usually involves only one or two passes over a dataset. However, this study finds that fact memorization follows a negative exponential law regarding epochs, requiring nearly 1,000 epochs to reach saturation. This suggests that facts appearing infrequently in a standard pre-training corpus are almost guaranteed to be forgotten or never learned in the first place.
Redundancy and Overwrite Effects
The research highlights two significant inefficiencies in LLM storage:
- Redundancy Inefficiency: LLMs struggle to recognize when two different triples represent the same fact (e.g., "A is B's father" vs. "B is A's daughter"). They store these as independent pieces of information unless the structure is identical.
- The Overwrite Effect: LLMs exhibit a strong preference for subsequent information. When facts are learned sequentially, new data significantly overwrites older data, explaining why low-frequency information from early in the training process is easily lost.
Results and Implications
The 1,000B Parameter Estimate
Based on the derived scaling laws, the authors estimate that to memorize the 15 billion triples in Wikidata under a 100-epoch training regime, a model would require 1,000 billion (1 Trillion) non-embedding parameters. Given the computational cost of running 100+ epochs on such a scale, "hard-coding" the world's knowledge into model weights is significantly more expensive than general language learning.
Generalization via Correlation
While memorization is expensive, models can "guess" unseen facts if there is a pattern in the data (e.g., predicting a company's location based on its name). This generalization follows a power law similar to standard scaling laws, but it is distinct from the linear storage of unique, non-patterned facts.
Conclusion
The primary takeaway of this research is a strong argument for Retrieval-Augmented Generation (RAG). Because it is mathematically and computationally inefficient to store every fact within a model's parameters, LLMs are best utilized as reasoning engines paired with external, verifiable databases. Attempting to build a "know-it-all" model through pure parameter scaling is likely an impractical path toward factual reliability.
Summary updated