Skip to content

The Linear Representation Hypothesis and the Geometry of Large Language Models

Skip →IOI circuit
Interp stage 2 #2extendedfundamentalpaperrubric 8/122023 · ICML 2024 · ~45 min

Kiho Park, Yo Joong Choe, Victor Veitch

Status

TL;DR. “Concepts are linear” can mean three things: a direction in the output (unembedding) space, a direction in the input (context embedding) space, or something a linear probe can read. The paper defines the first two precisely with counterfactual pairs (king/queen, English/French), proves that the first gives a linear probe and the second gives a steering vector, and shows they are identified with each other (they coincide after dual coordinate changes) under a specific non-Euclidean causal inner product.

A concept WW (such as male⇒female) has an unembedding representation γˉW\bar\gamma_W if every counterfactual pair’s unembedding difference γ(Y(1))−γ(Y(0))\gamma(Y(1)) - \gamma(Y(0)) points along it, and an embedding representation λˉW\bar\lambda_W if moving a context embedding along it changes WW without changing causally separable concepts. A causal inner product makes causally separable concepts orthogonal. The paper’s choice is

⟨γˉ,γˉ′⟩C=γˉ⊤ Cov(γ)−1 γˉ′,\langle \bar\gamma, \bar\gamma' \rangle_{\mathrm C} = \bar\gamma^{\top}\,\mathrm{Cov}(\gamma)^{-1}\,\bar\gamma',

Under it, the two representations are identified through the Riesz map: λˉW=MγˉW\bar\lambda_W = M\bar\gamma_W (up to positive scale) with M=Cov(γ)−1M = \mathrm{Cov}(\gamma)^{-1} (Theorem 3.2). In transformed coordinates, γ~=M1/2γˉ\tilde\gamma = M^{1/2}\bar\gamma and λ~=M−1/2λˉ\tilde\lambda = M^{-1/2}\bar\lambda coincide; these dual changes of coordinates leave every logit λ⊤γ\lambda^\top\gamma unchanged. In the original coordinates the probe direction and the steering direction generally differ, so using a readout vector directly as a steering vector is a mistake.

Results. On LLaMA-2-7B, with 27 concepts (22 from BATS 3.0, four language-translation concepts and frequent⇒infrequent), counterfactual pairs align with a common direction more than random word pairs do, causally separable concepts are near-orthogonal under the causal inner product, and the resulting vectors work as probes and as steering vectors (§4). Appendix D.2 compares against the Euclidean inner product on LLaMA-2 and Gemma.

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    Theorem 2.2 says logit P(Y = Y(1) | Y ∈ {Y(0), Y(1)}, λ) = α·λᵀγ̄_W. Starting from a softmax over the vocabulary with unembeddings γ(y), derive why the log-odds between the two counterfactual tokens is linear in the context embedding λ.

    What a strong answer covers
    • P(y | λ) ∝ exp(λᵀγ(y)). Conditioning on the two tokens cancels the partition function.
    • Log-odds = λᵀγ(Y(1)) − λᵀγ(Y(0)) = λᵀ(γ(Y(1)) − γ(Y(0))).
    • If every counterfactual pair's difference lies in the cone of one direction γ̄_W, the difference equals α·γ̄_W with α > 0 depending on the pair, giving the theorem.
    • So the unembedding representation acts like an ideal linear probe that, unlike a fitted probe, does not absorb correlated off-target concepts.
  2. Mechanism

    Why is the Euclidean inner product not meaningful in the unembedding space, and how does choosing M = Cov(γ)⁻¹ fix this?

    What a strong answer covers
    • The softmax is invariant to some invertible linear transformations of embeddings and unembeddings, so Euclidean angles between unembeddings are not identified by the model's behaviour.
    • A causal inner product is one where causally separable concepts (that can vary independently, e.g. English⇒French and male⇒female) are orthogonal.
    • The paper shows M with M⁻¹ = GGᵀ and GᵀCov(γ)⁻¹G = D works; choosing D = I gives ⟨γ̄, γ̄′⟩ = γ̄ᵀCov(γ)⁻¹γ̄′.
    • The causal inner product identifies the two representations through the Riesz map: λ̄_W = Mγ̄_W (up to positive scale). After the dual coordinate changes γ̃ = M^(1/2)γ̄ and λ̃ = M^(−1/2)λ̄, which preserve the softmax pairing, they coincide. In the original coordinates the probe and steering directions generally differ, so a readout vector must be mapped by M before it is used for steering.
  3. Design

    You want a "recency" direction in a decoder-based embedding model so that you can probe and steer how much it prefers recent documents. How would you apply this paper's recipe?

    What a strong answer covers
    • Build counterfactual pairs that differ only in recency (same passage with an old vs new date or tense), keeping topic fixed.
    • Estimate the direction from differences, after whitening with the covariance of the relevant representation space, not with Euclidean geometry.
    • Check causal separability: the recency direction should be near-orthogonal (in the causal inner product) to unrelated concepts like language or topic.
    • Validate with both a probe (does projection predict recency?) and an intervention (does adding it move retrieval toward newer documents without changing topical relevance?).

Done with this page?

Status