BERTnesia: Investigating the capture and forgetting of knowledge in BERT

Jonas Wallat, Jaspreet Singh, Avishek Anand


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. 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.
Anthology ID:
2020.blackboxnlp-1.17
Volume:
Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP
Month:
November
Year:
2020
Address:
Online
Editors:
Afra Alishahi, Yonatan Belinkov, Grzegorz Chrupała, Dieuwke Hupkes, Yuval Pinter, Hassan Sajjad
Venue:
BlackboxNLP
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
174–183
Language:
URL:
https://aclanthology.org/2020.blackboxnlp-1.17
DOI:
10.18653/v1/2020.blackboxnlp-1.17
Bibkey:
Cite (ACL):
Jonas Wallat, Jaspreet Singh, and Avishek Anand. 2020. BERTnesia: Investigating the capture and forgetting of knowledge in BERT. In Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pages 174–183, Online. Association for Computational Linguistics.
Cite (Informal):
BERTnesia: Investigating the capture and forgetting of knowledge in BERT (Wallat et al., BlackboxNLP 2020)
Copy Citation:
PDF:
https://aclanthology.org/2020.blackboxnlp-1.17.pdf
Optional supplementary material:
 2020.blackboxnlp-1.17.OptionalSupplementaryMaterial.zip
Code
 jwallat/knowledge-probing
Data
LAMAMS MARCOT-REx