Abstract
Independently trained Large Language Models (LLMs) like Llama, Gemma, and Mistral exhibit a surprising degree of internal similarity. This study investigates the "latent spaces" of 24 open-weight LLMs, demonstrating that they follow a nearly identical progression of internal representations. Using Mutual $k$-Nearest Neighbors (mutual $k$-NN) to compare activation geometries, the researchers find that layers at the same relative depth across different models "see" data relationships in a remarkably similar way. This suggests a universal trajectory for language processing that is "stretched or squeezed" to fit a model's specific layer count.
Introduction: The Black Box of Latent Spaces
While the industry has mastered training LLMs, their internal mathematical manifolds—the latent spaces where information is processed—remain largely opaque. A central question in AI safety and interpretability is whether different models learn a shared underlying logic or if each architecture develops a unique representation of the world. Previous research focused on final outputs; this paper investigates the geometry of activations at every layer to determine if a universal trajectory exists for transforming raw text into predicted tokens.
Methods: Measuring Representational Similarity
The researchers compared 24 different open-weight LLMs using Mutual $k$-Nearest Neighbors (mutual $k$-NN):
- Prompting: Identical prompts were fed to pairs of models (e.g., Llama-3.1-8B and Gemma-2-9B).
- Neighbor Identification: For each prompt at a specific layer, the researchers identified which other prompts in the dataset produced the most similar activations.
- Affinity Mapping: By comparing every layer of Model A against every layer of Model B, they determined representational similarity based on whether layers picked the same "neighbors" for the same prompts.
- Statistical Validation: A Block Bootstrap method was employed to account for natural correlations between adjacent layers due to residual connections, ensuring the observed similarities were statistically significant.
The study utilized diverse datasets, including OpenWebText, IMDB Movie Reviews, Wikipedia, and benchmarks like IFEval and MMLU. Cross-linguistic similarity was tested using OPUS Books (English/German), while Random Alphanumeric Strings served as a control group.
Key Insights: The "Stretched and Squeezed" Hypothesis
The most significant finding is the consistent diagonal structure in the affinity matrices. Similarity is highest when comparing layers at the same relative depth, regardless of the total number of layers in the model.
The authors highlight a compelling paradox:
- Claim 1: Within a single model, different layers represent data very differently.
- Claim 2: When comparing two different models, corresponding layers at similar depths look very similar.
This suggests that the representational changes across depth are functional and necessary for language processing. Furthermore, the diagonal structure disappears when models are fed random noise, proving that this shared geometry is a learned organization of human language, not merely an architectural artifact of the Transformer.
Key Results: Universal Convergence
The study found that the diagonal structure was statistically significant for every single pair of the 24 models tested (ranging from 1B to 70B parameters).
Using the block bootstrap, the maximum p-value across all model pairs was $4.84 \times 10^{-3}$, strongly rejecting the null hypothesis. Even in cross-linguistic tests (English vs. German), a visible diagonal structure remained, suggesting that models converge on similar semantic "anchors" across different languages. Additionally, "Base" and "Instruct" models were found to be nearly identical in early layers, only diverging in the final layers where behavioral alignment occurs.
Limitations and Future Work
While the paper establishes that models converge to a shared internal geometry, the underlying reason why this specific progression is optimal remains unknown. The scope was also primarily limited to decoder-only Transformers; future research is needed to see if these patterns hold for alternative architectures like LSTMs or State Space Models (e.g., Mamba). The authors propose that these findings could eventually be used to "map" black-box models, potentially identifying a model's training stage or functional depth by comparing its activations to a known reference.
Summary updated