[论文解读] Understanding Finetuning for Factual Knowledge Extraction from Language Models
本文识别出微调语言模型进行事实知识抽取时的‘频率冲击’(Frequency Shock)——一种有害的副作用,即模型因训练数据中的频率偏差,对罕见实体过度预测而对常见实体预测不足。作者提出模型混合与预训练任务联合微调的方法,两者结合可减轻频率冲击,并使 Hit@1 相对性能提升最高达 12.4%。
Language models (LMs) pretrained on large corpora of text from the web have been observed to contain large amounts of various types of knowledge about the world. This observation has led to a new and exciting paradigm in knowledge graph construction where, instead of manual curation or text mining, one extracts knowledge from the parameters of an LM. Recently, it has been shown that finetuning LMs on a set of factual knowledge makes them produce better answers to queries from a different set, thus making finetuned LMs a good candidate for knowledge extraction and, consequently, knowledge graph construction. In this paper, we analyze finetuned LMs for factual knowledge extraction. We show that along with its previously known positive effects, finetuning also leads to a (potentially harmful) phenomenon which we call Frequency Shock, where at the test time the model over-predicts rare entities that appear in the training set and under-predicts common entities that do not appear in the training set enough times. We show that Frequency Shock leads to a degradation in the predictions of the model and beyond a point, the harm from Frequency Shock can even outweigh the positive effects of finetuning, making finetuning harmful overall. We then consider two solutions to remedy the identified negative effect: 1- model mixing and 2- mixture finetuning with the LM's pre-training task. The two solutions combined lead to significant improvements compared to vanilla finetuning.
研究动机与目标
- 理解微调语言模型在事实知识抽取中的失败模式,特别是微调过程中引入的非预期偏差。
- 识别并分析‘频率冲击’现象,即模型预测因微调数据集中实体的频率而产生偏差。
- 评估微调是否提升或降低知识抽取性能,尤其在罕见与常见实体预测方面的表现。
- 提出并验证两种缓解策略——模型混合与与预训练任务联合微调——以对抗频率冲击并提升整体性能。
- 为现实世界知识图谱构建提供基于微调语言模型的实用知识抽取方案。
提出的方法
- 作者在三个实体频率分布各异的数据集上分析微调后的语言模型,以分离任务学习、频率冲击与范围偏移的影响。
- 他们采用受控评估设置,使用已知正确答案的查询,以测量微调后预测的偏移情况。
- 模型混合通过加权平均将微调模型与零样本或少样本模型结合,以平衡预测结果,减少对罕见与常见实体的过度或不足预测。
- 联合微调指在微调任务与原始预训练目标(如掩码语言建模)上同时训练模型,以保留预训练统计特性。
- 该方法使用宏平均 Hit@1、Hit@3 和 Hit@5 作为评估指标,在多个数据集上评估模型在常见与罕见实体上的表现。
- 最终的知识抽取方案将联合微调模型与少样本模型结合,实现最优性能,且在罕见或常见实体上的性能退化最小。
![Figure 1: For the query “Marat Makhmutov was born in [MASK] .” , a pre-trained language model correctly returns “Moscow” as answer. Once we finetune the language model on some data, it changes its prediction to “Baku” even though both “Moscow” and “Baku” appear as answers in the training set an equa](https://ar5iv.labs.arxiv.org/html/2301.11293/assets/x1.png)
实验结果
研究问题
- RQ1微调语言模型用于知识抽取是否会导致实体预测中的非预期偏差,特别是对罕见或常见实体?
- RQ2与任务学习带来的益处相比,由训练数据频率驱动的频率冲击在多大程度上降低模型性能?
- RQ3模型混合能否缓解微调带来的罕见实体过度预测与常见实体预测不足?
- RQ4与预训练任务联合微调是否有助于保持预训练频率统计特性并减少频率冲击?
- RQ5在现实世界知识图谱构建中,从微调语言模型中进行知识抽取的最优策略是什么?
主要发现
- 频率冲击导致微调模型即使在罕见与常见实体在训练数据中出现频率相等的情况下,仍对罕见实体过度预测而对常见实体预测不足,原因在于与预训练频率统计的差异。
- 频率冲击的负面影响可能超过任务学习带来的益处,当实体频率统计不匹配时,微调整体上反而有害。
- 与少样本模型结合的模型混合可减少对罕见实体的过度预测与对常见实体的预测不足,提升两类实体的性能。
- 与预训练任务联合微调有助于模型保持更接近预训练阶段的频率统计,减少频率冲击并提升泛化能力。
- 结合模型混合与联合微调可使 Hit@1 相对于基线微调提升 12.4%,且通过将联合微调模型与少样本模型结合,可实现最佳整体性能。
- 所提出的方案——将联合微调模型与少样本模型结合——实现了最高性能,并在不同频率不匹配的数据集上均表现出鲁棒性。

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