Analyzing Encoded Concepts in Transformer Language Models

Hassan Sajjad, Nadir Durrani, Fahim Dalvi, Firoj Alam, Abdul Rafae Khan +1 more
6/27/2022
cs.CLcs.AI
transformer-attention

Official code: hsajjad/ConceptX (12 stars, Python, BSD-3-Clause, last commit 2022-07-18).

Abstract

We propose a novel framework ConceptX, to analyze how latent concepts are encoded in representations learned within pre-trained language models. It uses clustering to discover the encoded concepts and explains them by aligning with a large set of human-defined concepts.

Show full abstract

Our analysis on seven transformer language models reveal interesting insights: i) the latent space within the learned representations overlap with different linguistic concepts to a varying degree, ii) the lower layers in the model are dominated by lexical concepts (e.g., affixation), whereas the core-linguistic concepts (e.g., morphological or syntactic relations) are better represented in the middle and higher layers, iii) some encoded concepts are multi-faceted and cannot be adequately explained using the existing human-defined concepts.

View on arXivView PDF

Code Implementations(1)

hsajjad/ConceptXOfficial100%
BSD-3-Clause

Analyzing Latent Concept in Pre-trained Transformer Models

126Python, PerlApr 23, 20224 years agoBSD-3-Clause

Similar Papers

Cite this paper

@article{sajjad2022analyzing,
  title  = {Analyzing Encoded Concepts in Transformer Language Models},
  author = {Hassan Sajjad and Nadir Durrani and Fahim Dalvi and Firoj Alam and Abdul Rafae Khan and Jia Xu},
  year   = {2022},
  eprint = {2206.13289},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2206.13289}
}

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

Discussion