atlas

Research map / Large language models / Retrieval and knowledge

Linearity of Relation Decoding in Transformer Language Models

ICLR 2024 · Large language models › Retrieval and knowledge · approach: Knowledge editing in LLMs · 3 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows that for a subset of relations, LM relation decoding from subject representations is well approximated by an affine map (Linear Relational Embedding) estimated via the LM Jacobian, validated by faithfulness and causal editing across GPT-J, GPT2-XL and LLaMA-13B.

Problem

How transformer language models compute relations between subjects and objects, i.e., whether the mapping from subject representation to decoded attribute can be described simply.

Approach

Approximates the LM's relation decoding function F(s, c) with a first-order Taylor expansion, estimating an affine map (Linear Relational Embedding) from the mean Jacobian and bias over n in-context examples, scaled by a constant beta; the LRE is validated for faithfulness and used for causal subject editing via a low-rank pseudoinverse.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use the Jacobian-derived affine LRE instead of Identity, Translation, or linear regressionGPT-J relation decoding · 47 relationsfaithfulnessHelped
Apply LRE to the enriched subject representation rather than the subject embedding (ablation)GPT-J relation decoding · 47 relationsfaithfulnessHelped
Replace LRE with Translation(s) = s + b (ablation)GPT-J relation decoding · 47 relationsfaithfulnessHurt
Replace LRE with Identity decoding (ablation)GPT-J relation decoding · 47 relationsfaithfulnessHurt
Use LRE for Company CEOGPT-J · Company CEOfaithfulness: no method reaches over 6%Hurt
Use LRE with β=2.25 instead of β=0.00 (ablation)GPT-J relation decoding · 47 relationsfaithfulness: 0.17 ± 0.20 -> 0.59 ± 0.25Helped
Vary the prompt template for the same relation (ablation)LRE · country capital city, plays pro sport, person occupation, adjective superlativefaithfulnessNo clear effect
Increase low-rank inverse rank up to the optimum, then beyond rank=2^8 (ablation)LRE causal editing · GPT-J relationscausality: after rank=2^8 causality starts decliningMixed
Remove relation-specific prompt context (ablation)LRE · GPT-J relation decodingfaithfulnessHelped
Increase the number of estimation examples beyond n=5 (ablation)LRE · Most relationsfaithfulness: n=5No clear effect
Apply the attribute lens instead of relying on the distracted prompt's outputGPT-J · Repetition-distracted promptsR@1: 0.02 -> 0.54Helped
Apply the attribute lens instead of relying on the distracted prompt's outputGPT-J · Instruction-distracted promptsR@1: 0.03 -> 0.63Helped

Surprising findings

Limitations

Experimental setup

Datasets: CounterFact Wikidata

Benchmarks: LRE relations dataset (47 relations)

Metrics: faithfulness causality Spearman correlation

Baselines: Logit Lens (identity) Translation Linear regression LRE on word embedding e_s random guess

Builds on: linear relational embedding logit lens CounterFact linear shortcut probes

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy