Skip to main content
QUICK REVIEW

[Paper Review] The Linear Representation Hypothesis and the Geometry of Large Language Models

Kiho Park, Yo Joong Choe|arXiv (Cornell University)|Nov 7, 2023
Natural Language Processing TechniquesComputer Science8 citations
TL;DR

The paper formalizes linear representations of concepts in LLMs via counterfactuals in both input and output spaces, introduces a causal inner product to unify embeddings and unembeddings, and validates these ideas with LLaMA-2 experiments demonstrating linear concept directions and controllable interventions.

ABSTRACT

Informally, the 'linear representation hypothesis' is the idea that high-level concepts are represented linearly as directions in some representation space. In this paper, we address two closely related questions: What does "linear representation" actually mean? And, how do we make sense of geometric notions (e.g., cosine similarity or projection) in the representation space? To answer these, we use the language of counterfactuals to give two formalizations of "linear representation", one in the output (word) representation space, and one in the input (sentence) space. We then prove these connect to linear probing and model steering, respectively. To make sense of geometric notions, we use the formalization to identify a particular (non-Euclidean) inner product that respects language structure in a sense we make precise. Using this causal inner product, we show how to unify all notions of linear representation. In particular, this allows the construction of probes and steering vectors using counterfactual pairs. Experiments with LLaMA-2 demonstrate the existence of linear representations of concepts, the connection to interpretation and control, and the fundamental role of the choice of inner product.

Motivation & Objective

  • Formalize what “linear representation” means using counterfactual pairs in embedding (input) and unembedding (output) spaces.
  • Link linear representation to interpretation (measurement) and control (intervention) via formal theorems.
  • Introduce and justify a causal inner product that makes causally separable concepts orthogonal and unifies representations.
  • Develop practical methods to estimate the inner product and construct probes and steering vectors.
  • Empirically validate the theory on LLaMA-2, demonstrating linear concept directions and intervention effects.

Proposed method

  • Formalize concepts as binary variables with counterfactual outputs Y(W=w) in both embedding and unembedding spaces.
  • Prove connections: unembedding representations relate to measurement; embedding representations relate to intervention.
  • Introduce a causal inner product on the unembedding space that renders causally separable concepts orthogonal and establishes a Riesz map between unembedding and embedding representations.
  • Provide an explicit form for the causal inner product using Cov(gamma) and show how to obtain canonical representations g and l such that embedding and unembedding align.
  • Estimate the inner product in practice and construct probes and steering vectors from counterfactual pairs; validate via experiments on LLaMA-2 (7B).
  • Demonstrate through experiments that concept directions exist, act as linear probes, enable interventions, and that inner product choice matters.

Experimental results

Research questions

  • RQ1What does it mean for a concept to be represented linearly in embedding and unembedding spaces?
  • RQ2How can counterfactual pairs formalize linear representations and connect to measurement and intervention?
  • RQ3What inner product best captures semantic structure and unifies embedding/unembedding representations?
  • RQ4Can we empirically detect linear concept directions and perform interventions in a real LLM?

Key findings

  • Concepts are represented as directions in the unembedding space, inferred from counterfactual word pairs.
  • The derived concept directions function as linear probes for target concepts in the embedding space (measurement).
  • Embedding representations correspond to intervention representations, enabling controlled changes in the target concept distribution.
  • A causal inner product unifies embedding and unembedding representations via a Riesz isomorphism, and can be estimated from data (e.g., Cov(gamma)^{-1}).
  • Canonical representations g and l make embedding and unembedding representations aligned under the chosen inner product, enabling Euclidean tools after transformation.
  • Empirical results with LLaMA-2 show that causally separable concepts are approximately orthogonal under the estimated causal inner product, supporting the theory, with some exceptions (e.g., certain word ambiguities).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.