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.
翻译:Transformer语言模型(LMs)中编码的大量知识可通过关系形式表达:单词与其同义词的关系、实体与其属性的关系等。我们证明,对于部分关系,该计算可通过主体表征上的单一线性变换得到良好近似。通过从单条提示构建语言模型的一阶近似,可获得线性关系表征,且这些表征存在于多种事实性、常识性和语言性关系中。然而,我们也发现许多案例表明,尽管语言模型预测准确捕捉了关系知识,但这些知识并未以线性方式编码在其表征中。因此,我们的结果揭示了Transformer语言模型中一种简单、可解释但异质性部署的知识表征策略。