Linearity of Relation Decoding in Transformer Language Models

Evan Hernandez, Arnab Sen Sharma, Tal Haklay, Kevin Meng, M. Wattenberg +3 more
8/1/2023

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Much of the knowledge encoded in transformer language models (LMs) may be expressed in terms of relations: relations between words and their synonyms, entities and their attributes, etc. We show that, for a subset of relations, this computation is well-approximated by a single linear transformation on the subject representation. Linear relation representations may be obtained by constructing a first-order approximation to the LM from a single prompt, and they exist for a variety of factual, commonsense, and linguistic relations. However, we also identify many cases in which LM predictions capture relational knowledge accurately, but this knowledge is not linearly encoded in their representations. Our results thus reveal a simple, interpretable, but heterogeneously deployed knowledge representation strategy in transformer LMs.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{hernandez2023linearity,
  title  = {Linearity of Relation Decoding in Transformer Language Models},
  author = {Evan Hernandez and Arnab Sen Sharma and Tal Haklay and Kevin Meng and M. Wattenberg and Jacob Andreas and Yonatan Belinkov and David Bau},
  year   = {2023},
  eprint = {2308.09124},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/pdf/2308.09124},
  journal = {ICLR 2023 2023}
}

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

Discussion