The Linear Representation Hypothesis and the Geometry of Large Language Models

Kiho Park, Yo Joong Choe, Victor Veitch

Abstract

This paper provides a rigorous mathematical foundation for the "Linear Representation Hypothesis"—the idea that Large Language Models (LLMs) store high-level concepts as directions in vector space. By introducing a novel causal inner product, the authors unify how we measure model knowledge (probing) and how we control model behavior (steering). They prove that the "right" geometry for an LLM is defined by how concepts can be varied independently, offering a robust framework for mechanistic interpretability.

The Problem: Formalizing the Linear Representation Hypothesis

Researchers have long observed that LLMs seem to organize information linearly. The famous word analogy King - Man + Woman = Queen suggests that "gender" exists as a distinct direction in the model's representation space. This phenomenon is known as the Linear Representation Hypothesis (LRH).

However, the LRH has historically remained informal, with three competing interpretations:

  1. Subspace: Concepts exist as 1D lines (e.g., a "Male/Female" axis).
  2. Measurement: We can find a "probe" (a linear classifier) to detect the presence of a concept.
  3. Intervention: We can add a "steering vector" to change the model's output (e.g., forcing it to output French instead of English).

The theoretical gap is significant: we do not inherently know if these three views describe the same phenomenon, nor do we know which "geometry" to use to measure them. Should we use standard Euclidean distance? Cosine similarity? Because LLM representations are only identified up to arbitrary transformations during training, standard Euclidean geometry is often mathematically groundless in this context.

Methodology: Counterfactuals and the Causal Inner Product

To resolve this, the authors utilize the language of counterfactuals. They define a concept (like "Gender") by examining pairs of words or contexts that are identical except for that single concept (e.g., "king" vs. "queen").

Two Spaces, One Concept

The framework distinguishes between two distinct representation spaces within the model:

  • Unembedding Space ($\Gamma$): The output space where the model selects the next word.
  • Embedding Space ($\Lambda$): The input space where the model processes the context.

The Causal Inner Product

The paper's primary theoretical contribution is the introduction of the Causal Inner Product. The authors argue that if two concepts are "causally separable"—meaning you can alter one without affecting the other (like changing the language from English to French without changing the subject from "royalty" to "farming")—their vector representations must be orthogonal.

Visualizing the Causal Inner Product: Transforming skewed concept vectors into orthogonal representations.

They prove that this unique inner product can be estimated simply by analyzing the statistical properties of the model's word embeddings. Specifically, the "correct" metric is derived from the inverse covariance matrix of the unembedding vectors. This effectively "whitens" the space, correcting the geometric distortions introduced during the model's training phase.

Experimental Setup

The researchers validated their theory using LLaMA-2 (7B) and Gemma-2B. They tested 27 different concepts using a variety of datasets:

  • BATS 3.0 (Big Analogy Test Set): 22 linguistic and semantic concepts (e.g., verb tenses, plurals, capitals).
  • Translation Pairs: Custom sets for English, French, German, and Spanish.
  • Wikipedia: Used to sample random contexts for testing linear probes.
  • ChatGPT-4: Used to generate specific counterfactual sentence fragments to test model steering.

Key Insights and Results

  • Geometry is a Choice, Not a Given: You cannot simply use the dot product and assume it carries semantic meaning. The geometry of an LLM is a choice, and the Causal Inner Product is uniquely suited to respect the semantic structure of language.
  • The Riesz Isomorphism: Using their causal inner product, the authors prove a mathematical bridge (a Riesz isomorphism) exists between the input and output spaces. This means a direction used for probing in the output space corresponds exactly to the direction needed for steering in the input space.
  • Linearity is Real: For 26 out of 27 evaluated concepts (the sole exception being "thing $\to$ part"), counterfactual pairs pointed in a consistent direction, empirically confirming the LRH.
  • Orthogonality: Under the Causal Inner Product, unrelated concepts (like "Country $\to$ Capital" and "Male $\to$ Female") were found to be nearly perfectly orthogonal (90 degrees apart). This orthogonality was notably absent when using standard Euclidean metrics.
Correlation matrix demonstrating the orthogonality of 27 distinct concepts under the causal inner product.
  • Successful Steering: By adding a "steering vector" derived from their theory, the authors could precisely flip a model's output. For example, intervening on a context about a "king" with a "female" steering vector successfully shifted the model's top prediction to "queen" without breaking the rest of the sentence's logic.
  • Euclidean Geometry Fails in Newer Models: Interestingly, while LLaMA-2's default geometry is somewhat aligned with semantics, newer models like Gemma show a massive disconnect between Euclidean distance and actual meaning. The Causal Inner Product, however, remains robust across these different architectures.

Limitations and Future Directions

While a significant step forward, the framework has current limitations:

  • Binary Focus: The formalization currently focuses on binary concepts (A vs. B). Extending this to multi-valued or continuous concepts (like "Color" or "Sentiment") is a necessary next step.
  • Intermediate Layers: This paper focuses strictly on the "input" and "output" embedding spaces. Because most complex processing happens in the hidden intermediate layers, extending the causal inner product to these layers is a vital direction for future mechanistic interpretability research.
  • Causal Independence Assumption: The theory assumes concepts can be varied entirely independently. In real-world language, concepts are often correlated, which may complicate the strict "causal separability" assumption in practice.

Summary updated

BibTeX
@inproceedings{park2024linear,
  author = {Kiho Park and Yo Joong Choe and Victor Veitch},
  title = {{The Linear Representation Hypothesis and the Geometry of Large Language Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=UGpGkLzwpP},
}
Figure