Abstract: Large language models (LLMs) have attracted significant attention due to their impressive general capabilities across diverse downstream tasks. However, without domain-specific optimization, they often underperform on specialized knowledge benchmarks and even produce hallucination. Recent studies show that strategically infusing domain knowledge during pretraining can substantially improve downstream performance. A critical challenge lies in balancing this infusion trade-off: injecting too little domain-specific data yields insufficient specialization, whereas excessive infusion triggers catastrophic forgetting of previously acquired knowledge. In this work, we focus on the phenomenon of memory collapse induced by overinfusion. Through systematic experiments, we make two key observations, i.e. 1) Critical collapse point: each model exhibits a threshold beyond which its knowledge retention capabilities sharply degrade. 2) Scale correlation: these collapse points scale consistently with the model's size. Building on these insights, we propose a knowledge infusion scaling law that predicts the optimal amount of domain knowledge to inject into large LLMs by analyzing their smaller counterparts. Extensive experiments across different model sizes and pertaining token budgets validate both the effectiveness and generalizability of our scaling law.
Introduction
While Large Language Models (LLMs) are impressive generalists, they often struggle with specialized, "long-tail" facts, such as niche scientific data or specific corporate knowledge. To address this, researchers often "infuse" domain-specific knowledge directly into the pre-training or continual pre-training phase.
However, this creates a high-stakes balancing act. Inject too little, and the model remains ignorant of the domain. Inject too much, and the model suffers from Memory Collapse—a form of catastrophic forgetting where the model’s ability to retain both new and old knowledge sharply degrades. Because training large models costs millions of dollars, finding this breaking point through trial and error is unfeasible. This research seeks a predictive law to determine the optimal "dose" of knowledge infusion before the first token is even trained.
Methodology
The authors conducted a massive systematic study, training models ranging from 137M to 3B parameters on up to 100B tokens.
As illustrated in the pipeline above, the process involves:
- Knowledge Injection: Factual triples from Wikidata (e.g., Angel, color, white) are converted into natural language sentences using templates.
- Varying Frequency ($F$): The researchers controlled how many times each fact appeared in the training corpus, testing frequencies from 10 to 10,000 repetitions.
- Modeling the Curve: They tested mathematical functions to describe the relationship between infusion frequency and model performance. The optimal fit was a hybrid formula: $P(F) = a \cdot F^b \cdot \exp(-c \cdot F)$, capturing initial power-law learning ($F^b$) and eventual exponential decay as the model collapses ($\exp(-c \cdot F)$).
Key Insights and the Scaling Law
The study revealed several fundamental properties of how LLMs absorb high-frequency factual data:
- The Memory Collapse Phenomenon: Every model has a threshold. Beyond this "critical collapse point," more data is actively harmful. This suggests that LLMs have a finite "bandwidth" for high-frequency factual absorption during pre-training.
- Scale Correlation: Intriguingly, larger models reach their collapse point earlier than smaller ones. They are more efficient at absorbing knowledge from fewer repetitions, meaning they require a lower "concentration" of domain data to saturate their capacity.
- The Dilution Effect: As the total number of training tokens (the "background noise") increases, the collapse point shifts later. Massive training corpora require domain facts to be repeated more often to prevent them from being "diluted" and forgotten.
Results
The best-fitting scaling law achieved an $R^2$ of 0.9685, indicating an extremely high correlation between mathematical predictions and actual model performance.
As shown in the performance curves, for a 58B token budget, the optimal infusion frequency for a 137M model was around 60 repetitions, while a 3B model peaked at roughly 35 repetitions. The law held steady across different token budgets (58B, 75B, and 100B), proving that the relationship between model size, data volume, and infusion frequency is a fundamental property of transformer scaling.
Conclusion and Future Work
This work establishes a predictable framework for efficient knowledge infusion. While currently validated up to 3B parameters using factual triples, future research is needed to apply these scaling laws to "frontier" scales (70B+ parameters) and more complex reasoning tasks. By using this scaling law, researchers can optimize domain-specific training by analyzing smaller proxy models, significantly reducing the compute costs associated with specialized LLM development.
Summary updated