BERTnesia: Investigating the capture and forgetting of knowledge in BERT

Jonas Wallat, Jaspreet Singh, Avishek Anand
10/19/2020
cs.CLcs.LG

Official code: jwallat/knowledge-probing (9 stars, Python, last commit 2021-08-20).

Abstract

Probing complex language models has recently revealed several insights into linguistic and semantic patterns found in the learned representations. In this paper, we probe BERT specifically to understand and measure the relational knowledge it captures.

Show full abstract

We utilize knowledge base completion tasks to probe every layer of pre-trained as well as fine-tuned BERT (ranking, question answering, NER). Our findings show that knowledge is not just contained in BERT's final layers. Intermediate layers contribute a significant amount (17-60%) to the total knowledge found. Probing intermediate layers also reveals how different types of knowledge emerge at varying rates. When BERT is fine-tuned, relational knowledge is forgotten but the extent of forgetting is impacted by the fine-tuning objective but not the size of the dataset. We found that ranking models forget the least and retain more knowledge in their final layer. We release our code on github to repeat the experiments.

View on arXivView PDF

Code Implementations(1)

Code for our BlackboxNLP'20 paper "BERTnesia: Investigating the capture and forgetting of knowledge in BERT"

96Python, ShellJan 25, 20215 years agoNOASSERTION

Similar Papers

Cite this paper

@article{wallat2020bertnesia,
  title  = {BERTnesia: Investigating the capture and forgetting of knowledge in BERT},
  author = {Jonas Wallat and Jaspreet Singh and Avishek Anand},
  year   = {2020},
  eprint = {2010.09313},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2010.09313}
}

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

Discussion