The Geometry of Categorical and Hierarchical Concepts in Large Language Models

Kiho Park, Yo Joong Choe, Yibo Jiang, Victor Veitch

TL;DR

This paper extends the "linear representation hypothesis" to show that Large Language Models (LLMs) encode categorical concepts as geometric polytopes and hierarchical relationships as orthogonal subspaces. By moving from representing concepts as simple directions to representing them as vectors with magnitude, the authors prove and empirically validate a remarkably simple geometric structure underlying semantic meaning in models like Gemma and LLaMA-3.

What Problem Does This Paper Address?

Researchers have long suspected that LLMs organize semantic information linearly—the "linear representation hypothesis." For example, the difference between the vectors for "king" and "queen" might represent a "gender" direction. However, this framework has been limited to binary contrasts (e.g., male vs. female).

It hasn't been clear how LLMs represent:

  1. Single features that lack a natural opposite (e.g., "is an animal").
  2. Categorical concepts with multiple members (e.g., {mammal, bird, reptile, fish}).
  3. Hierarchical relationships (e.g., the nested relationship between "organism," "animal," "mammal," and "dog").

Understanding this geometry is crucial for interpretability—knowing exactly how a model "thinks" about categories allows us to better monitor, steer, and debug its internal representations.

Methods

The authors formalize a new framework for concept representation:

  • From Directions to Vectors: Instead of just a direction, they define concepts as vectors with a specific magnitude. This magnitude is derived such that all tokens belonging to a concept (e.g., all animals) have a consistent dot product with the representation vector, while non-members have a dot product near zero.
  • Polytopes for Categories: Categorical concepts are represented as the convex hull (a polytope) of their constituent feature vectors. For "natural" categories where members are mutually exclusive, these polytopes form simplices (like a triangle in 2D or a tetrahedron in 3D).
  • Hierarchical Orthogonality: The authors prove that semantic hierarchy is encoded as geometric orthogonality. For instance, the vector representing the "animal" concept should be orthogonal to the vector representing the contrast between its children, like "mammal vs. bird."
  • Causal Inner Product: They use a whitening transformation (estimating a "Causal Inner Product") to unify the embedding and unembedding spaces, allowing for a consistent geometric analysis.
  • Estimation via LDA: They estimate these representation vectors using a variant of Linear Discriminant Analysis (LDA) to find directions that maximize the separation between concept members and non-members while minimizing within-concept variance.

Datasets

  • WordNet: The primary source for semantic structure. The authors extracted over 900 hierarchically related concepts (593 nouns and 364 verbs) from the WordNet synset hierarchy.
  • LLMs: The theoretical predictions were validated on the Gemma-2B and LLaMA-3-8B models.
  • ChatGPT-4: Used to generate specific token sets for manual inspection and visualization of high-level concepts like "animal" and "plant."

Key Insights and Ideas

  • Magnitude is Meaningful: A concept isn't just a direction; it has a "thickness." The magnitude of the vector acts as a threshold that separates members of a category from the rest of the vocabulary.
  • Hierarchy = Orthogonality: This is the "aha" moment. In a well-organized representation space, moving in the direction of a parent concept (e.g., "animal") does not change the relative probabilities of its children (e.g., "mammal" vs. "bird"). Geometrically, this implies that the parent vector and the child-contrast vectors live in orthogonal subspaces.
  • Simplicity of Structure: Despite the complexity of language, the underlying geometric organization is surprisingly clean. Hierarchical concepts can be viewed as direct sums of these orthogonal polytopes.
Figure 1: In the representation spaces of LLMs, hierarchically related concepts (such as plant ⇒ animal and mammal ⇒bird) live in orthogonal subspaces, while categorical concepts are rep- resented as polytopes. The top panel illustrates the structure; the bottom panels show the measured representation structure in the Gemma LLM. See Section 5 and Appendix A for details.

Key Results

  • Empirical Validation: Projections of test words onto their estimated concept vectors were consistently near 1, while random words were near 0, confirming that these vectors accurately capture the intended features.
  • Geometric Alignment: The cosine similarity between estimated vectors strongly reflected the shortest-path distance in the WordNet hyponym graph.
  • Causal Intervention: Adding a parent concept vector (e.g., "plant vs. animal") to a context embedding significantly shifted the model's output toward the target parent category but left the relative probabilities of child concepts (e.g., "mammal vs. reptile") virtually unchanged. This confirms the "Hierarchical Orthogonality" prediction.
  • Cross-Model Consistency: The findings held true across both Gemma and LLaMA-3, suggesting this is a fundamental property of how modern transformer-based LLMs organize knowledge.

Limitations and Future Work

  • Final Layer Focus: The study focuses on the geometry of the final softmax layer. It remains an open question how these structures emerge and evolve through the model's internal layers.
  • Whitening Requirement: The results rely on a specific "causal inner product" (whitening). It's unclear if this is the "native" geometry the model uses internally or just a useful lens for researchers.
  • Refining Interpretability Tools: The authors suggest that current tools like Sparse Autoencoders (SAEs) might struggle because they look for independent features, whereas hierarchical features are naturally co-linear. Future work could involve designing SAEs that explicitly account for this hierarchical, orthogonal structure to produce more interpretable features.

Summary updated

BibTeX
@inproceedings{park2025geometry,
  author = {Kiho Park and Yo Joong Choe and Yibo Jiang and Victor Veitch},
  title = {{The Geometry of Categorical and Hierarchical Concepts in Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=bVTM2QKYuA},
}
Figure