TL;DR
This paper provides a formal mathematical framework explaining why large language models (LLMs) represent continuous concepts as curved, multi-dimensional manifolds rather than simple flat directions. It proves that local cosine similarity in representation space encodes the true intrinsic geometry of a concept through shortest on-manifold paths, revealing how LLMs geometrically organize structured human concepts like the color wheel or timelines.
What Problem Does This Paper Address?
In the field of mechanistic interpretability, researchers often rely on the Linear Representation Hypothesis (LRH). This hypothesis posits that LLMs represent human-understandable concepts as discrete, independent directions in activation space (e.g., a single vector for "is_Arabic").
However, real-world concepts are rarely just binary; they are often continuous and highly structured (like colors, dates, or spatial coordinates). Empirical evidence shows that LLMs represent these complex concepts as winding, non-linear shapes—manifolds—rather than straight lines. Until now, there has been a lack of a rigorous mathematical explanation connecting the distance between points in an LLM's representation space to their actual semantic relatedness in concept space. This paper bridges that gap.
Methods
The authors formalize a human concept as an abstract metric space $(Z_f, d_f)$ equipped with a notion of distance. They introduce two core hypotheses:
- Continuous Correspondence: The model's representation space is topologically identical (homeomorphic) to the abstract concept space.
- Cosine Similarity Reflects Distance: Locally, the cosine similarity between two representations is inversely related to their true distance in the concept space.
The paper's primary theoretical contribution (Theorem 1) proves that under these hypotheses, the length of a path traced along the model's representation manifold directly matches the true distance in the abstract concept space (isometry).
To validate this empirically, they use Principal Component Analysis (PCA) to project high-dimensional model activations into 3D space, build $K$-nearest neighbor graphs to approximate the manifold, and calculate shortest on-manifold paths (geodesics) to compare against human concept distances.
Datasets
The authors validate their theory using representations from multiple models:
- Text Embeddings: OpenAI's
text-embedding-large-3evaluated on prompts representing English color names (sourced from the XKCD color survey) and dates of the year. - Token Activations: Internal layer activations from
GPT2-small(layer 7) andMistral 7B(layer 8). They use Sparse Autoencoders (SAEs) to isolate specific continuous features, such as "years of the 20th century", "months of the year", and "days of the week".
Key Insights and Ideas
- Why Models Bend Space: Why do LLMs curve low-dimensional concepts into higher-dimensional spaces? The authors suggest this maximizes the expressivity of subsequent linear layers. By "weaving" a concept through multiple dimensions, the model can compute complex non-linear functions (like polynomials) of a feature using simple linear projections.
- Local-to-Global Magic: Cosine similarity does not need to perfectly track semantic distance globally. As long as the inverse relationship holds locally (for highly similar concepts), the global intrinsic geometry of the concept can be perfectly reconstructed by measuring the shortest paths (geodesics) along the manifold surface.
- LLMs Think of Time Logarithmically: When testing a standard linear timeline for the "years" feature, the isometry hypothesis failed because the model expanded distances between more recent years. Switching the concept metric to a logarithmic scale (relative to the model's release date) yielded a near-perfect geometric match.
Key Results
- Topological Alignment: The representations of years form a clear 1D curve, while colors and dates successfully map to circular loops, matching our intuitive human understanding of the "color wheel" and "yearly cycle" (see Figure 1).
- High Correlation: For the timeline of years, the model naturally orders time correctly along the manifold, achieving a Kendall rank correlation of 0.97 and a Spearman correlation >0.99.
- Geometric Isometry: When evaluating the logarithmic timeline of years against the model's manifold geodesic distances, the authors achieved an exceptional Pearson correlation of 0.99, strongly validating Theorem 1.
Limitations and Future Work
- Scalability: The current approach is hypothesis-driven, meaning researchers must manually guess the correct metric space (e.g., realizing time is encoded logarithmically) to test for isometry. This is difficult to scale to highly abstract concepts like emotions.
- Sensitivity to Noise: Estimating manifolds using $K$-NN graphs is highly sensitive to noise, which can cause "short-circuits" (erroneous shortcuts across the manifold) and requires manual graph pruning.
- Manifold-Aware SAEs: Standard Sparse Autoencoders often cause "feature splitting" because they try to force a continuous manifold into discrete linear directions. The authors suggest that future work should focus on developing "manifold-aware" SAEs to better capture continuous representations.
Summary updated