LM-Debugger: An Interactive Tool for Inspection and Intervention in Transformer-Based Language Models

Mor Geva, Avi Caciularu, Guy Dar, Paul Roit, Shoval Sadde +3 more
4/26/2022
cs.CL
transformer-attention

Official code: mega002/lm-debugger (186 stars, Python, Apache-2.0, last commit 2022-05-13).

Abstract

The opaque nature and unexplained behavior of transformer-based language models (LMs) have spurred a wide interest in interpreting their predictions. However, current interpretation methods mostly focus on probing models from outside, executing behavioral tests, and analyzing salience input features, while the internal prediction construction process is largely not understood.

Show full abstract

In this work, we introduce LM-Debugger, an interactive debugger tool for transformer-based LMs, which provides a fine-grained interpretation of the model's internal prediction process, as well as a powerful framework for intervening in LM behavior. For its backbone, LM-Debugger relies on a recent method that interprets the inner token representations and their updates by the feed-forward layers in the vocabulary space. We demonstrate the utility of LM-Debugger for single-prediction debugging, by inspecting the internal disambiguation process done by GPT2. Moreover, we show how easily LM-Debugger allows to shift model behavior in a direction of the user's choice, by identifying a few vectors in the network and inducing effective interventions to the prediction process. We release LM-Debugger as an open-source tool and a demo over GPT2 models.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

The official code of LM-Debugger, an interactive tool for inspection and intervention in transformer-based language models.

18620Python, TypeScriptApr 26, 20224 years agoApache-2.0

Similar Papers

Cite this paper

@article{geva2022lmdebugger,
  title  = {LM-Debugger: An Interactive Tool for Inspection and Intervention in Transformer-Based Language Models},
  author = {Mor Geva and Avi Caciularu and Guy Dar and Paul Roit and Shoval Sadde and Micah Shlain and Bar Tamir and Yoav Goldberg},
  year   = {2022},
  eprint = {2204.12130},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.12130}
}

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

Discussion