[Paper Review] Measuring and Modifying Factual Knowledge in Large Language Models
This paper proposes an information-theory-based framework to measure and modify factual knowledge in large language models (LLMs), using entropy and KL-divergence to quantify knowledge before and after instilling facts. It outperforms ranking-based methods by over 35% in synthetic experiments and reveals that explicit knowledge instillation fails for 80% of location and language-related queries, highlighting the need for fine-tuning in such cases.
Large Language Models (LLMs) store an extensive amount of factual knowledge obtained from vast collections of text. To effectively utilize these models for downstream tasks, it is crucial to have reliable methods for measuring their knowledge. However, existing approaches for knowledge measurement have certain limitations, and despite recent efforts, they fail to provide accurate measurements and the necessary insights for modifying the knowledge within LLMs. In this work, we employ information theory-based measurements to provide a framework estimating the factual knowledge contained within large language models. More specifically, we measure knowledge by analyzing the LLM's prediction probability distribution before and after instilling the target knowledge, employing metrics such as entropy and KL-divergence. Introducing our metrics, we first assess their accuracy in comparison to previous ranking-based methods, surpassing them by over $35\%$ in a synthetic experiment. Then, we explore two prominent methods of knowledge instillation, discovering that LLMs exhibit limitations in capturing new knowledge under specific circumstances for one of these methods. Lastly, we demonstrate the applicability of our methods in extracting unlearned and mislearned facts in LLMs through their application to in-context learning. We make code and data for all methods and experiments in this paper publicly available.
Motivation & Objective
- To address the limitations of existing ranking-based methods for measuring factual knowledge in LLMs, which are sensitive to prompts and binary in nature.
- To develop a more accurate, continuous measurement of factual knowledge using information-theoretic metrics like entropy and KL-divergence.
- To evaluate the effectiveness of explicit vs. implicit knowledge instillation in LLMs, especially in in-context learning settings.
- To apply the proposed metrics to detect unlearned or mislearned facts and improve factual alignment and hallucination mitigation.
- To provide open-source code and data to enable reproducibility and further research in factual knowledge measurement and modification.
Proposed method
- Measure factual knowledge by analyzing the probability distribution of LLM predictions over the vocabulary before and after knowledge instillation.
- Use entropy to quantify the uncertainty of the model’s prediction distribution, and KL-divergence to measure changes in distribution after knowledge injection.
- Define knowledge acquisition as a stable or reduced uncertainty after instilling a fact, using KL-divergence to detect knowledge encoding.
- Implement two knowledge instillation methods: explicit (adding fact to prompt) and implicit (fine-tuning on the fact).
- Apply the metrics to in-context learning models like InstructGPT and FLAN-T5 to assess factual alignment and hallucination.
- Use the metrics to identify cases where explicit instillation fails, particularly for location and language-related facts.

Experimental results
Research questions
- RQ1How do information-theoretic metrics like entropy and KL-divergence compare to ranking-based methods in measuring factual knowledge in LLMs?
- RQ2In what scenarios is explicit knowledge instillation insufficient for LLMs, particularly in in-context learning settings?
- RQ3How does the performance of explicit vs. implicit knowledge instillation vary across different fact types, especially location and language-related facts?
- RQ4Can the proposed metrics detect unlearned or mislearned facts in LLMs, and how do they correlate with hallucination in generated outputs?
- RQ5What are the differences in hallucination resistance across LLMs like InstructGPT and FLAN-T5 for various relation types?
Key findings
- The proposed information-theoretic metrics outperform ranking-based methods by over 35% in synthetic experiments, demonstrating higher accuracy in measuring factual knowledge.
- Explicit knowledge instillation fails for approximately 80% of location and language-related queries in both InstructGPT and FLAN-T5, indicating inherent limitations of prompt-based methods.
- The metrics successfully identify unlearned and mislearned facts in LLMs, particularly in cases where the gold label does not appear in the top-5 predictions after explicit instillation.
- Relations such as 'headquarters location', 'location of formation', 'employer', and 'member of' show higher resistance to hallucination in InstructGPT, while 'official language', 'sister city', and 'instance of' are more robust in FLAN-T5.
- The study confirms that explicit instillation alone is inadequate for complex factual types, especially spatial and linguistic relations, necessitating fine-tuning for reliable knowledge encoding.
- The framework enables effective factual alignment and hallucination detection in in-context learning models, offering practical tools for improving LLM reliability.

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.