[Paper Review] Understanding Finetuning for Factual Knowledge Extraction from Language Models
This paper identifies 'Frequency Shock'—a harmful side effect of fine-tuning language models for factual knowledge extraction, where models over-predict rare entities and under-predict common ones due to training data frequency biases. The authors propose model mixing and mixture fine-tuning with the pre-training task, which together reduce Frequency Shock and improve performance by up to 12.4% relative in Hit@1 over vanilla fine-tuning.
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.
Motivation & Objective
- To understand the failure modes of fine-tuned language models in factual knowledge extraction, particularly unintended biases introduced during fine-tuning.
- To identify and analyze the phenomenon of 'Frequency Shock', where model predictions become skewed by the frequency of entities in the fine-tuning dataset.
- To evaluate whether fine-tuning improves or degrades knowledge extraction performance, especially in terms of rare vs. common entity prediction.
- To propose and validate two mitigation strategies—model mixing and mixture fine-tuning with the pre-training task—to counteract Frequency Shock and improve overall performance.
- To provide a practical knowledge extraction recipe for real-world knowledge graph construction using fine-tuned LMs.
Proposed method
- The authors analyze fine-tuned LMs on three datasets with varying entity frequency distributions to isolate the effects of task learning, Frequency Shock, and Range Shift.
- They introduce a controlled evaluation setup using queries with known correct answers to measure prediction shifts after fine-tuning.
- Model mixing combines a fine-tuned model with a zero-shot or few-shot model via weighted averaging to balance predictions and reduce over- and under-prediction.
- Mixture fine-tuning involves jointly training the model on the fine-tuning task and the original pre-training objective (e.g., masked language modeling), preserving pre-training statistics.
- The method uses macro-averaged Hit@1, Hit@3, and Hit@5 as evaluation metrics across datasets to assess performance on common and rare entities.
- The final knowledge extraction recipe combines a mixture-fine-tuned model with a few-shot model, achieving optimal performance with minimal degradation on rare or common entities.
![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)
Experimental results
Research questions
- RQ1Does fine-tuning language models for knowledge extraction lead to unintended biases in entity prediction, particularly for rare or common entities?
- RQ2To what extent does Frequency Shock—driven by training data frequency—degrade model performance compared to the benefits of task learning?
- RQ3Can model mixing mitigate the over-prediction of rare entities and under-prediction of common entities introduced by fine-tuning?
- RQ4Does mixture fine-tuning with the pre-training task help preserve pre-training frequency statistics and reduce Frequency Shock?
- RQ5What is the optimal strategy for knowledge extraction from fine-tuned LMs in real-world knowledge graph construction?
Key findings
- Frequency Shock causes fine-tuned models to over-predict rare entities and under-predict common entities, even when both appear equally in training data, due to discrepancies with pre-training frequency statistics.
- The negative impact of Frequency Shock can outweigh the benefits of task learning, making fine-tuning harmful overall when entity frequency statistics are mismatched.
- Model mixing with a few-shot model reduces over-prediction of rare entities and under-prediction of common entities, improving performance on both types.
- Mixture fine-tuning with the pre-training task helps the model maintain frequency statistics closer to pre-training, reducing Frequency Shock and improving generalization.
- Combining model mixing and mixture fine-tuning leads to a 12.4% relative improvement in Hit@1 over vanilla fine-tuning, with the best overall performance achieved by combining a mixture-fine-tuned model with a few-shot model.
- The proposed recipe—using a mixture-fine-tuned model combined with a few-shot model—achieves the highest performance and is robust across datasets with varying frequency mismatches.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.