Abstract
There is a large ongoing scientific effort in mechanistic interpretability to map embeddings and internal representations of AI systems into human-understandable concepts. A key element of this effort is the linear representation hypothesis, which posits that neural representations are sparse linear combinations of 'almost-orthogonal' direction vectors, reflecting the presence or absence of different features. This model underpins the use of sparse autoencoders to recover features from representations. Moving towards a fuller model of features, in which neural representations could encode not just the presence but also a potentially continuous and multidimensional value for a feature, has been a subject of intense recent discourse. We describe why and how a feature might be represented as a manifold, demonstrating in particular that cosine similarity in representation space may encode the intrinsic geometry of a feature through shortest, on-manifold paths, potentially answering the question of how distance in representation space and relatedness in concept space could be connected. The critical assumptions and predictions of the theory are validated on text embeddings and token activations of large language models.
Introduction: Beyond Linear Directions
In the field of mechanistic interpretability, the dominant paradigm has long been the Linear Representation Hypothesis (LRH). The LRH suggests that Large Language Models (LLMs) represent knowledge through specific "directions" for discrete concepts. However, real-world concepts like color, time, or geographic location are continuous and multi-dimensional, making them difficult to capture as simple binary switches. This research addresses the gap between linear directions and the complex, curving structures—manifolds—that models use to organize continuous information.
Methodology
The study formalizes these structures using metric geometry, resting on two primary hypotheses:
- Continuous Correspondence: Abstract features map continuously to high-dimensional structures in the model's representation space.
- Cosine Similarity as Distance: Locally, cosine similarity between vectors is inversely related to the squared distance between concepts in the underlying conceptual space.
The mathematical foundation is Theorem 1, which proves that if these hypotheses hold, the shortest path along the model's internal manifold (the geodesic) is directly proportional to the shortest path in conceptual space. Validation was performed using Principal Component Analysis (PCA) for visualization and K-nearest neighbor graphs to estimate these geodesic distances.
Experimental Setup
The theory was tested across multiple models and domains:
- Models: OpenAI’s
text-embedding-large-3,GPT2-small(layer 7 activations), andMistral 7B(layer 8 activations). - Domains: English color names (XKCD survey), years of the 20th century, specific dates, and cyclical concepts like days of the week.
Geometric Insights: Concepts as Shapes
Empirical evidence suggests that LLMs do not merely store concepts as isolated points; they weave them into coherent geometric shapes. For instance, "years" are represented as a winding curve, while cyclical concepts like "months" or "days" form loops.
Interestingly, the representation of time in models like GPT-2 is non-linear, following a logarithmic scale that provides higher resolution for years closer to the training cutoff. Furthermore, by "weaving" 1D concepts through higher dimensions, models can approximate complex non-linear functions using simple linear operations.
Empirical Results and Manifold Fidelity
The study found exceptionally high topological fidelity across domains. For the "years" feature in GPT-2, the rank correlation between the actual year and its manifold position reached 0.97 (Kendall) and >0.99 (Spearman).
A nearly perfect linear relationship (Pearson correlation of 0.97 to 0.99) was observed between estimated manifold distances and actual conceptual distances for dates and years. These results confirm that cosine similarity serves as a reliable measure of local relatedness, though it becomes less accurate for distant points on a curved manifold.
Conclusion and Future Directions
While these findings provide a robust geometric framework for understanding LLM representations, challenges remain in scaling this analysis to more abstract concepts where the underlying metric space is unknown. Future work aims to develop "manifold-aware" Sparse Autoencoders (SAEs) capable of automatically recognizing and "unrolling" these complex geometric shapes, moving beyond the limitations of flat linear feature extraction.
Summary updated