Understanding Finetuning for Factual Knowledge Extraction
Gaurav Ghosal, Tatsunori Hashimoto, Aditi Raghunathan
TL;DR
The paper reveals that finetuning a language model on well-known facts can improve downstream factuality, while focusing finetuning on lesser-known facts can suppress pretrained knowledge and reduce factual accuracy. A formal notion of factual salience, defined as $S(s,r,a)=\phi(a)^\top W_V \phi(s)$, ties how strongly a fact is stored to its susceptibility to attention imbalance, providing a mechanistic explanation via a one-layer transformer. The authors support the theory with synthetic experiments and validate it on real LLMs (Llama-2-7B, Mistral-7B) and QA benchmarks (PopQA, Entity Questions, MMLU), showing that finetuning on the top 50% well-known facts can match or exceed finetuning on the full dataset, while finetuning on the bottom 50% often degrades performance by several percentage points. The work highlights that pretraining data distribution and fact storage interact intricately with finetuning dynamics, offering practical guidance for data curation and potential regularization or curriculum strategies to improve knowledge extraction in QA tasks.
Abstract
In this work, we study the impact of QA fine-tuning data on downstream factuality. We show that fine-tuning on lesser-known facts that are poorly stored during pretraining yields significantly worse factuality than fine-tuning on well-known facts, even when all facts are seen during pretraining. We prove this phenomenon theoretically, showing that training on lesser-known facts can lead the model to ignore subject entity names and instead output a generic plausible response even when the relevant factual knowledge is encoded in the model. On three question answering benchmarks (PopQA, Entity Questions, and MMLU) and two language models (Llama-2-7B and Mistral-7B), we find that (i) finetuning on a completely factual but lesser-known subset of the data deteriorates downstream factuality (5-10%) and (ii) finetuning on a subset of better-known examples matches or outperforms finetuning on the entire dataset. Ultimately, our results shed light on the interaction between pretrained knowledge and finetuning data and demonstrate the importance of taking into account how facts are stored in the pretrained model when fine-tuning for knowledge-intensive tasks.
