What Is One Grain of Sand in the Desert? Analyzing Individual Neurons in Deep NLP Models

Fahim Dalvi, Nadir Durrani, Hassan Sajjad, Yonatan Belinkov, Anthony Bau +1 more
12/21/2018
cs.CL

Official code: fdalvi/NeuroX (109 stars, Python, BSD-3-Clause, last commit 2023-10-04).

Abstract

Despite the remarkable evolution of deep neural networks in natural language processing (NLP), their interpretability remains a challenge. Previous work largely focused on what these models learn at the representation level.

Show full abstract

We break this analysis down further and study individual dimensions (neurons) in the vector representation learned by end-to-end neural models in NLP tasks. We propose two methods: Linguistic Correlation Analysis, based on a supervised method to extract the most relevant neurons with respect to an extrinsic task, and Cross-model Correlation Analysis, an unsupervised method to extract salient neurons w.r.t. the model itself. We evaluate the effectiveness of our techniques by ablating the identified neurons and reevaluating the network's performance for two tasks: neural machine translation (NMT) and neural language modeling (NLM). We further present a comprehensive analysis of neurons with the aim to address the following questions: i) how localized or distributed are different linguistic properties in the models? ii) are certain neurons exclusive to some properties and not others? iii) is the information more or less distributed in NMT vs. NLM? and iv) how important are the neurons identified through the linguistic correlation method to the overall task? Our code is publicly available as part of the NeuroX toolkit (Dalvi et al. 2019).

View on arXivView PDF

Code Implementations(1)

fdalvi/NeuroXOfficial100%
BSD-3-Clause

A Python library that encapsulates various methods for neuron interpretation and analysis in Deep NLP models.

10927Python, ShellAug 16, 20183 years agoBSD-3-Clause
explainable-ainatural-language-processingneuronsnlpnlp-machine-learning

Similar Papers

Cite this paper

@article{dalvi2018what,
  title  = {What Is One Grain of Sand in the Desert? Analyzing Individual Neurons in Deep NLP Models},
  author = {Fahim Dalvi and Nadir Durrani and Hassan Sajjad and Yonatan Belinkov and Anthony Bau and James Glass},
  year   = {2018},
  eprint = {1812.09355},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1812.09355}
}

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

Discussion