PretrainRL: Alleviating Factuality Hallucination of Large Language Models at the Beginning

Langming Liu, Kangtao Lv, Haibin Chen, Weidong Zhang, Yejing Wang, Shilei Liu, Xin T. Tong, Yujin Yuan, Yongwei Wang, Wenbo Su, Bo Zheng

Abstract

Large language models (LLMs), despite their powerful capabilities, suffer from factual hallucinations where they generate verifiable falsehoods. We identify a root of this issue: the imbalanced data distribution in the pretraining corpus, which leads to a state of "low-probability truth" and "high-probability falsehood". Recent approaches, such as teaching models to say "I don't know" or post-hoc knowledge editing, either evade the problem or face catastrophic forgetting. To address this issue from its root, we propose PretrainRL, a novel framework that integrates reinforcement learning into the pretraining phase to consolidate factual knowledge. The core principle of PretrainRL is "debiasing then learning." It actively reshapes the model's probability distribution by down-weighting high-probability falsehoods, thereby making "room" for low-probability truths to be learned effectively. Extensive experiments on three public benchmarks demonstrate that PretrainRL significantly alleviates factual hallucinations and outperforms state-of-the-art methods.

1. Introduction

Large Language Models (LLMs) are notorious for "hallucinating"—generating plausible but factually incorrect statements. While many researchers treat this as a post-training alignment issue, we argue that the root cause lies in the imbalanced data distribution of the pretraining corpus. In standard pretraining, models use Next-Token Prediction (NTP) to fit the data distribution. However, "head knowledge" (frequent facts) often overwhelms "tail knowledge" (rare facts). This creates a state of "high-probability falsehood" for rare facts, where the model learns shortcuts based on frequency rather than accuracy.

Existing solutions like teaching models to say "I don't know" (IDK) or post-hoc knowledge editing often result in "lazy" models or catastrophic forgetting of other capabilities. PretrainRL seeks to solve this by intervening during the pretraining phase when the model is most plastic.

2. The PretrainRL Framework

PretrainRL moves the intervention from post-training to the pretraining/continual training phase, following a "debiasing then learning" strategy.

2.1 Direct Preference Optimization (DPO) in Pretraining

Instead of just learning the truth, the model is explicitly taught to unlearn the common falsehoods it is biased toward. This is achieved by integrating a DPO loss into the training objective.

2.2 Efficient Negative Sampling

To identify "high-probability falsehoods," we employ beam search decoding. By asking the model factual questions and observing which incorrect answers it assigns the highest probability to, we generate "rejected" samples for the DPO loss. This intrinsic debiasing uses the model's own internal state to find its weaknesses.

2.3 Hybrid Objective Function

To prevent pattern collapse and preserve general language capabilities, we combine the DPO loss with a standard NTP loss (Continual Training or CT loss): $$\mathcal{L}_{PretrainRL} = \mathcal{L}_{DPO} + \lambda\mathcal{L}_{CT}$$

3. Experimental Results

We evaluated PretrainRL using three primary benchmarks focusing on long-tail factual knowledge: PopQA, Wikidata-knowledge infusion, and EntityQuestions.

3.1 Performance Comparison

PretrainRL demonstrated substantial improvements over standard pretraining and state-of-the-art baselines. As illustrated in Figure 1, PretrainRL-enhanced models (4B and 8B parameters) outperformed much larger closed-source models like GPT-4o and Claude-3-Sonnet on long-tail factual datasets.

Comparison of PretrainRL-enhanced models against state-of-the-art closed-source models on factual accuracy.

3.2 Detailed Metric Analysis

Beyond simple accuracy, we utilized metrics such as Hit Ratio (HR), Mean Reciprocal Rank (MRR), and Prob@k to measure the model's internal probabilistic state. On the PopQA benchmark, a Qwen3-4B model trained with PretrainRL achieved 37.69% accuracy, compared to just 13.05% for the base model. Detailed results across multiple models and benchmarks are provided in the table below.

Detailed performance metrics across PopQA and Wikidata-knowledge infusion benchmarks, comparing PretrainRL against various baselines.

4. Key Insights

  • The "Memory Room" Hypothesis: We suggest that LLMs have a finite capacity for parametric knowledge. High-probability falsehoods "squeeze" the memory room available for truths. By actively down-weighting these falsehoods, PretrainRL creates the necessary "room" for the model to effectively learn rare truths.
  • Plasticity and Timing: Pretraining is the ideal time for this intervention because the model is still "plastic." Post-trained models are more "rigid," making it harder to inject new knowledge without causing catastrophic forgetting.
  • Preserving General Intelligence: Unlike standard Supervised Fine-Tuning (SFT), PretrainRL maintained or even slightly improved scores on general benchmarks like MMLU and GSM8K, proving that factual consolidation does not come at the cost of reasoning.

5. Conclusion

PretrainRL offers a fundamental shift in how we address hallucinations in LLMs. By integrating reinforcement learning into the pretraining phase to suppress high-probability falsehoods, we can significantly improve the factual reliability of models on long-tail knowledge while maintaining their general capabilities. Future work will focus on scaling this approach and extending it to unstructured text data.

Summary updated

BibTeX
@inproceedings{liu2026pretrainrl,
  author = {Langming Liu and KANGTAO LV and Haibin Chen and Weidong Zhang and Yejing Wang and Shilei Liu and Xin T. Tong and Yujin Yuan and Yongwei Wang and Wenbo Su and Bo Zheng},
  title = {{PretrainRL: Alleviating Factuality Hallucination of Large Language Models at the Beginning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.910},
}
Figure