[论文解读] How Do Large Language Models Acquire Factual Knowledge During Pretraining?
本文通过分析训练过程中各中间检查点,研究了大型语言模型(LLMs)在预训练期间如何获取和遗忘事实性知识。研究发现,知识获取通过每个小批量的逐步概率提升实现,但受到遗忘的抵消;较大的批量大小可减少遗忘,去重处理则能改善长尾知识的保留,从而解释了观察到的LLM行为,如长尾性能差和数据去重带来的优势。
Despite the recent observation that large language models (LLMs) can store substantial factual knowledge, there is a limited understanding of the mechanisms of how they acquire factual knowledge through pretraining. This work addresses this gap by studying how LLMs acquire factual knowledge during pretraining. The findings reveal several important insights into the dynamics of factual knowledge acquisition during pretraining. First, counterintuitively, we observe that pretraining on more data shows no significant improvement in the model's capability to acquire and maintain factual knowledge. Next, there is a power-law relationship between training steps and forgetting of memorization and generalization of factual knowledge, and LLMs trained with duplicated training data exhibit faster forgetting. Third, training LLMs with larger batch sizes can enhance the models' robustness to forgetting. Overall, our observations suggest that factual knowledge acquisition in LLM pretraining occurs by progressively increasing the probability of factual knowledge presented in the pretraining data at each step. However, this increase is diluted by subsequent forgetting. Based on this interpretation, we demonstrate that we can provide plausible explanations for recently observed behaviors of LLMs, such as the poor performance of LLMs on long-tail knowledge and the benefits of deduplicating the pretraining corpus.
研究动机与目标
- 理解LLM预训练中事实性知识获取的细粒度动态过程。
- 研究训练条件(如数据量、批量大小和模型规模)对知识获取和保留的影响。
- 通过记忆化与遗忘的机制分析,解释观察到的LLM行为,如长尾知识性能差和数据去重的优势。
- 考察模型规模和预训练阶段在事实性知识获取效率中的作用。
提出的方法
- 本研究分析了一个70亿参数LLM(OLMo-7B)在训练早期、中期和晚期的中间预训练检查点。
- 它将此前未见过的事实性知识注入这些检查点,并随时间测量记忆化和泛化性能。
- 有效性通过单个小批量训练后,注入知识的对数概率增加量来量化。
- 可保留性使用幂律衰减函数建模,以追踪训练步数或token数下的遗忘过程。
- 该分析比较了不同批量大小、数据重复和注入格式(改写、语义、组合)的训练效果。
- 使用统计建模估算可保留性曲线的衰减常数和x轴截距,以评估遗忘速率。

实验结果
研究问题
- RQ1LLM预训练期间,事实性知识是如何获取的?训练数据和训练步数如何影响这一过程?
- RQ2训练条件(如批量大小、数据重复和模型规模)如何影响事实性知识获取的有效性?
- RQ3获取的事实性知识在预训练期间如何被遗忘?训练条件如何影响遗忘动态?
- RQ4为什么LLM在长尾知识上表现不佳?数据去重如何改善性能?
主要发现
- 在更多数据上进行预训练并不会显著提升事实性知识的获取或保留,这挑战了数据规模优势的既定假设。
- 训练步数与遗忘之间存在幂律关系,各预训练阶段的衰减常数约为0.26–0.32。
- 使用较大批量大小训练的模型遗忘速度更慢,其x轴截距(可学习性阈值)为9.23–9.94 log(tokens),表明其更具鲁棒性。
- 无论模型处于哪个训练阶段,事实首次注入时的有效性最高,且在后续重复注入时保持相对稳定。
- 训练数据去重可减少遗忘,解释了为何去重能提升LLM在长尾知识上的表现。
- 70亿参数模型的有效性高于10亿参数模型,表明模型规模和预训练token数量对事实性知识获取具有定性不同的影响。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。