Measuring and Modifying Factual Knowledge in Large Language Models

Pouya Pezeshkpour
6/9/2023
cs.CLcs.LG

No official code found. Best implementation: rit-git/lm-know (3 stars, last commit 2024-02-23).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

rit-git/lm-knowCommunity100%
30PythonMay 30, 20232 years ago

Similar Papers

Cite this paper

@article{pezeshkpour2023measuring,
  title  = {Measuring and Modifying Factual Knowledge in Large Language Models},
  author = {Pouya Pezeshkpour},
  year   = {2023},
  eprint = {2306.06264},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2306.06264v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2306.06264.svg)](https://codeofpaper.com/paper/2306.06264)

Discussion