TL;DR
While mechanistic interpretability often assumes features are simple one-dimensional linear directions, neural networks routinely represent continuous concepts as curved, multi-dimensional manifolds. This paper provides a formal metric-geometry foundation proving that local cosine similarities in representation space trace out shortest-path (geodesic) distances in underlying concept spaces. Empirically, the authors show that large language models naturally embed colors, calendar dates, and historical years as topological loops and curves—even revealing that GPT-2 represents twentieth-century time on a logarithmic scale.
What Problem Does This Paper Address?
The dominant paradigm in mechanistic interpretability is the Linear Representation Hypothesis (LRH), which posits that models represent concepts as discrete, almost-orthogonal direction vectors (e.g., whether a concept like "is Arabic" or "Eiffel Tower" is active). This assumption underpins sparse autoencoders (SAEs), which extract dictionary features from intermediate representations.
However, many concepts are not binary switches; they are continuous and multi-dimensional (e.g., color hues, dates, times, spatial coordinates). While researchers have repeatedly observed curves, loops, and tori in model activations, there has been no general theory explaining:
- How an abstract feature space mathematically maps to a representation manifold.
- What distances and cosine similarities on these representation manifolds actually mean.
Methods
The authors develop a minimum viable mathematical framework based on metric geometry:
- Features as Metric Spaces: A feature $f$ is defined abstractly as a compact metric space $(Z_f, d_f)$. This unifies atomic concepts (single points), hierarchical trees, and continuous spaces (intervals, circles, manifolds).
- Continuous Correspondence Hypothesis: There exists a continuous invertible map $\phi_f: Z_f \to M_f \subset S^{D-1}$ mapping concept values to unit-norm vectors. Because $Z_f$ is compact, $\phi_f$ is automatically a homeomorphism (preserving topology such as loops, holes, and connectivity).
- Cosine Similarity Reflects Local Distance: Locally, cosine similarity decreases smoothly as a function of squared metric distance: $\text{CosSim}(\phi_f(z), \phi_f(z')) = g(d_f(z, z')^2)$.
-
Theorem 1 (Intrinsic Metric Recovery): The authors prove that the length of any rectifiable path $\gamma$ on the representation manifold $M_f$ is proportional to the path length on $Z_f$: $$L(\gamma) = \sqrt{-2 g'(0)} L(\eta)$$ Therefore, geodesic (shortest-path) distances on the learned manifold directly recover intrinsic ground-truth distances.
-
Empirical Diagnostics:
- Direct Test: Plot cosine similarity against squared metric distance and measure functional dependence via Chatterjee's rank correlation ($\xi$).
- Geodesic Test: Build a $K$-nearest-neighbor graph over representation points, compute shortest path distances, and compare against ground-truth metric distances using Pearson correlation ($\rho$).
Datasets
The authors evaluate representations from GPT2-small, Mistral 7B, and OpenAI's text-embedding-large-3:
- Colors: Prompts based on color names and hex-codes from the XKCD color survey (filtered for saturation $> 0.4$ and brightness $< 0.8$).
- Dates: Prompts representing each day of the year ("1st January" through "31st December").
- Years: Token activations for years 1900–1999 from layer 7 of GPT2-small, isolated via SAE latents.
- Emotions: 319 emotion terms categorized by valence (pleasant vs. unpleasant) and energy (low vs. high) from the Yale Center for Emotional Intelligence ("How We Feel" app).
Key Insights and Ideas
- Why Manifolds Bend into Higher Dimensions: Why doesn't a model represent a 1D line or circle in just 1 or 2 dimensions? The authors demonstrate that bending a 1D interval into higher-dimensional curves allows downstream layers to compute richer polynomial functions of that concept using simple linear projections.
- Topological Ordering vs. Metric Isometry: Activations can preserve ordering without being isometric. For 20th-century years in GPT-2, Kendall and Spearman rank correlations along the manifold exceed $0.97$ and $0.99$, confirming the topology of a line. However, a standard linear time metric ($|x - y|$) fits the geometry poorly ($\rho = 0.910$, $\xi = 0.470$).
- Logarithmic Time Perception in GPT-2: Modifying the metric space to $d(x, y) = |\log(2019 - x) - \log(2019 - y)|$ (measuring years relative to GPT-2's 2019 training horizon) dramatically improves the fit ($\rho = 0.989$, $\xi = 0.837$). GPT-2 naturally allocates more representational space to recent years than to the early 1900s.
- Global Distance Emerges from Local Steps: Ambient cosine similarity breaks down across large distances, but shortest paths along the representation graph robustly recover global metric geometry.
Key Results
| Feature / Domain | Model | Presumed Metric Space | Chatterjee $\xi$ (Local Fit) | Pearson $\rho$ (Geodesic Fit) |
|---|---|---|---|---|
| Dates of Year | text-embedding-large-3 |
Circular / Periodic ($S^1$) | $0.540$ | $0.973$ |
| Colors | text-embedding-large-3 |
Circular Hue Angle | $0.692$ | $0.855$ |
| Years (1900–1999) | gpt2-small (Layer 7 SAE) |
Linear: $\|x - y\|$ | $0.470$ | $0.910$ |
| Years (Log-scaled) | gpt2-small (Layer 7 SAE) |
Log-time: $\|\log(2019-x) - \log(2019-y)\|$ | $0.837$ | $0.989$ |
For Emotions, applying classical multidimensional scaling to graph geodesic distances (Group Isomap) recovers a 2D Cartesian grid that separates valence and arousal.
Limitations and Future Work
- Manual Metric Hypothesis: The approach relies on formulating a plausible ground-truth metric space by hand, which is difficult for complex, abstract concepts.
- Graph Short-Circuiting: Estimating manifolds via $K$-NN graphs is sensitive to noise and superposition interference, which can create artificial shortcuts and distort geodesic calculations.
- Implications for SAEs: Standard sparse autoencoders split continuous manifolds into arbitrary collections of discrete directions ("feature splitting"). The authors suggest using this metric-geometric perspective to design "manifold-aware" SAE architectures and enable continuous activation steering.
Summary updated