Linearity of Relation Decoding in Transformer Language Models
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.
BibTeX
@inproceedings{hernandez2024linearity,
author = {Evan Hernandez and Arnab Sen Sharma and Tal Haklay and Kevin Meng and Martin Wattenberg and Jacob Andreas and Yonatan Belinkov and David Bau},
title = {{Linearity of Relation Decoding in Transformer Language Models}},
booktitle = {International Conference on Learning Representations},
year = {2024},
url = {https://openreview.net/forum?id=w7LU2s14kE},
}Ask Althea to put this paper to the test.
| Linear Relational Decoding of Morphology in Language Models | Student Research Workshop @ NAACL · 2025 |
| Relational Linear Properties in Language Models: An Empirical Investigation | arXiv · 2026 |
| The Structure of Relation Decoding Linear Operators in Large Language Models | NeurIPS · 2025 |
| Your Transformer is Secretly Linear | ACL · 2024 |
| Language Models Implement Simple Word2Vec-style Vector Arithmetic | NAACL · 2024 |
| Locating and Extracting Relational Concepts in Large Language Models | ACL · 2024 |