Shared Global and Local Geometry of Language Model Embeddings

Andrew Lee, Melanie Weber, Fernanda Viégas, Martin Wattenberg

TL;DR

Do different language models represent the world in the same way? This paper demonstrates that large language models (LLMs) within the same family share striking global and local geometric structures in their token embedding spaces, even when their dimensions differ. Leveraging this shared geometry, the authors introduce EMB2EMB, a simple linear method to transfer concept-steering vectors between entirely different models.

What Problem Does This Paper Address?

As large language models scale, a fascinating question emerges: are they converging toward a shared, universal representation of reality (a concept known as the Platonic Representation Hypothesis)? While previous work has explored representation alignment across different modalities (like image and text) or languages, this paper investigates whether different sizes and variants of models within the same family share geometric structures in their token embedding spaces.

Understanding this geometry helps reveal how models organize concepts internally and opens up practical avenues for cross-model interpretability and control.

Methods

The authors analyze embedding spaces through three distinct lenses:

  1. Global Geometry: They sample 20,000 tokens and compute a pairwise distance matrix using cosine similarity for each model. They then calculate the Pearson correlation between these matrices across different models to determine if relative token orientations are preserved.
  2. Local Geometry via LLE: They use Locally Linear Embeddings (LLE) to reconstruct each token embedding as a weighted sum of its $k$-nearest neighbors. Comparing these weights across models reveals if local neighborhood structures are preserved.
  3. Intrinsic Dimension (ID): They measure a token's local dimensionality by performing PCA on its $k$-nearest neighbors and counting the principal components needed to explain 95% of the variance.

Finally, they introduce EMB2EMB, which uses standard least-squares minimization to find a linear transformation matrix $A$ that maps the unembedding space of a source model to a target model. This allows steering vectors (activation additions that alter model behavior) to be translated across models of different dimensions.

Datasets

  • Models Evaluated: GPT2 (Small, Medium, Large, XL), Llama3 (1B, 3B, 8B, 11B-Vision, 70B; both base and instruction-tuned), and Gemma2 (2B, 9B, 27B).
  • Evaluation Benchmarks:
  • ConceptNet: A massive knowledge graph used to calculate a Semantic Coherence Score (SCS) to validate the semantic meaning of token neighborhoods.
  • Perez et al. (2022) & Rimsky et al. (2023): Evaluation datasets containing two-choice questions to test Llama3 steering behaviors (e.g., corrigibility, hallucination, refusal).
  • REALTOXICITYPROMPTS: 1,199 prompts used to elicit and evaluate toxicity reduction steering in GPT2.

Key Insights and Ideas

  • Late Convergence in Untied Models: For models where embedding and unembedding weights are separate ("untied", like Llama3 8B and 70B), global alignment is strong in the unembedding space but virtually non-existent in the embedding space. This suggests that while models might start with different token representations, their internal states converge to a shared geometry by the final layer.
  • Low Intrinsic Dimension Means Semantic Meaning: Token embeddings lie on a lower-dimensional manifold. Crucially, tokens with lower intrinsic dimensions form highly coherent semantic clusters (e.g., clusters of numbers, car brands, or months).
  • High Intrinsic Dimension Means Syntactic Patterns: Tokens with high intrinsic dimensions don't form semantic clusters; instead, they group by syntax-level patterns, such as words simply starting with the letter "z" or "G".
  • Steering Vectors are Portable: Because the unembedding spaces are linearly aligned, a simple linear transformation is sufficient to reuse a steering vector developed for a 1B model directly inside a 70B model.

Key Results

  • High Global Correlation: Within the GPT2 and Llama3 families, global token orientations showed high Pearson correlation scores, often ranging from 0.70 to 0.99.
Global token orientation correlation matrices across model families.
  • Preserved Local Neighborhoods: The LLE weight cosine similarities peaked heavily near 1.0 across different model sizes, proving that local structures are highly conserved.
Figure 2: LLE weight similarities in Llama3 unembeddings: language models share similar local structure. We compare LLE weights of token (un)embeddings across language models, where LLE weights capture the local structure of each embedding. Most token embeddings have very similar local structure across language models, as indicated by the density accumulated around high cosine similarity scores.
  • ID vs. Semantic Coherence: There is a strong negative Spearman correlation between intrinsic dimension and semantic coherence (-0.67 for GPT2-Medium, -0.45 for Llama3-3B), confirming that lower dimensionality implies tighter semantic grouping.
  • Successful Cross-Model Steering: Using EMB2EMB, steering vectors from Llama3-1B and 3B successfully controlled behaviors like "Refusal" and "Corrigibility" in Llama3-8B, closely mirroring the performance of native steering vectors. Similarly, toxicity reduction vectors transferred seamlessly across all GPT2 sizes.

Limitations and Future Work

  • The Gemma2 Anomaly: Gemma2 did not exhibit the same high global or local geometric similarities seen in GPT2 and Llama3. The authors hypothesize this could be due to its massive vocabulary size (256k), high density of emojis/special tokens, or differences in training data.
  • Tokenizer Dependency: The current EMB2EMB method relies on models sharing the exact same tokenizer, limiting its use to models within the same family.
  • Open Questions: Future work is needed to explore why certain models diverge geometrically and to extend cross-model mapping to models with entirely different tokenizers.

Summary updated

Abstract

Researchers have recently suggested that models share common representations. In our work, we find numerous geometric similarities across the token embeddings of large language models. First, we find ``global'' similarities: token embeddings often share similar relative orientations. Next, we characterize local geometry in two ways: (1) by using Locally Linear Embeddings, and (2) by defining a simple measure for the intrinsic dimension of each embedding. Both characterizations allow us to find local similarities across token embeddings. Additionally, our intrinsic dimension demonstrates that embeddings lie on a lower dimensional manifold, and that tokens with lower intrinsic dimensions often have semantically coherent clusters, while those with higher intrinsic dimensions do not. Based on our findings, we introduce EMB2EMB, a simple application to linearly transform steering vectors from one language model to another, despite the two models having different dimensions.
BibTeX
@inproceedings{lee2025shared,
  author = {Andrew Lee and Melanie Weber and Fernanda Viégas and Martin Wattenberg},
  title = {{Shared Global and Local Geometry of Language Model Embeddings}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=aJDykpJAYF},
}
Figure