Knowledge Neurons in Pretrained Transformers

Damai Dai, Li Dong, Yaru Hao, Zhifang Sui, Baobao Chang +1 more
4/18/2021
cs.CL

Official code: Hunter-DDM/knowledge-neurons (177 stars, MIT, last commit 2024-05-04).

Abstract

Large-scale pretrained language models are surprisingly good at recalling factual knowledge presented in the training corpus. In this paper, we present preliminary studies on how factual knowledge is stored in pretrained Transformers by introducing the concept of knowledge neurons. Specifically, we examine the fill-in-the-blank cloze task for BERT. Given a relational fact, we propose a knowledge attribution method to identify the neurons that express the fact. We find that the activation of such knowledge neurons is positively correlated to the expression of their corresponding facts. In our case studies, we attempt to leverage knowledge neurons to edit (such as update, and erase) specific factual knowledge without fine-tuning. Our results shed light on understanding the storage of knowledge within pretrained Transformers. The code is available at https://github.com/Hunter-DDM/knowledge-neurons.

View on arXivView PDF

Code Implementations(1)

MIT

Code for the ACL-2022 paper "Knowledge Neurons in Pretrained Transformers"

17718Shell, PythonMar 7, 20222 years agoMIT

Similar Papers

Cite this paper

@article{dai2021knowledge,
  title  = {Knowledge Neurons in Pretrained Transformers},
  author = {Damai Dai and Li Dong and Yaru Hao and Zhifang Sui and Baobao Chang and Furu Wei},
  year   = {2021},
  eprint = {2104.08696},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.08696}
}

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/2104.08696.svg)](https://codeofpaper.com/paper/2104.08696)

Discussion