Interpreting Language Models Through Knowledge Graph Extraction

Vinitra Swamy, Angelika Romanou, Martin Jaggi
11/16/2021
cs.LGcs.CL

Official code: epfml/interpret-lm-knowledge (25 stars, Jupyter Notebook, MIT, last commit 2022-05-06).

Abstract

Transformer-based language models trained on large text corpora have enjoyed immense popularity in the natural language processing community and are commonly used as a starting point for downstream tasks. While these models are undeniably useful, it is a challenge to quantify their performance beyond traditional accuracy metrics.

Show full abstract

In this paper, we compare BERT-based language models through snapshots of acquired knowledge at sequential stages of the training process. Structured relationships from training corpora may be uncovered through querying a masked language model with probing tasks. We present a methodology to unveil a knowledge acquisition timeline by generating knowledge graph extracts from cloze "fill-in-the-blank" statements at various stages of RoBERTa's early training. We extend this analysis to a comparison of pretrained variations of BERT models (DistilBERT, BERT-base, RoBERTa). This work proposes a quantitative framework to compare language models through knowledge graph extraction (GED, Graph2Vec) and showcases a part-of-speech analysis (POSOR) to identify the linguistic strengths of each model variant. Using these metrics, machine learning practitioners can compare models, diagnose their models' behavioral strengths and weaknesses, and identify new targeted datasets to improve model performance.

View on arXivView PDF

Code Implementations(1)

MIT

Extracting knowledge graphs from language models as a diagnostic benchmark of model performance (NeurIPS XAI 2021).

254Jupyter Notebook, PythonAug 5, 20214 years agoMIT
interpretable-deep-learningknowledge-graphlanguage-model

Similar Papers

Cite this paper

@article{swamy2021interpreting,
  title  = {Interpreting Language Models Through Knowledge Graph Extraction},
  author = {Vinitra Swamy and Angelika Romanou and Martin Jaggi},
  year   = {2021},
  eprint = {2111.08546},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2111.08546}
}

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

Discussion