Towards Universality: Studying Mechanistic Similarity Across Language Model Architectures

Junxuan Wang, Xuyang Ge, Wentao Shu, Qiong Tang, Yunhua Zhou, Zhengfu He, Xipeng Qiu · DOI

Abstract

This study investigates the Universality Hypothesis—the proposition that disparate neural network architectures converge toward similar internal algorithms—by comparing Transformers (Pythia) and State Space Models (Mamba). Utilizing Sparse Autoencoders (SAEs) as a conceptual "Rosetta Stone," we decompose the internal activations of both models into monosemantic features. Our analysis reveals a remarkable degree of convergence: Pythia and Mamba learn highly correlated features (average MPPC of 0.74) and implement functionally equivalent "induction circuits" for in-context learning. We further identify a linear depth scaling relationship between the models and a unique "Off-by-One" temporal delay in Mamba's representations. These findings suggest that mechanistic interpretability techniques developed for Transformers are broadly transferable to emerging non-attention architectures.

Introduction

Mechanistic interpretability seeks to reverse-engineer the "black box" of artificial intelligence into human-understandable circuits. Historically, this field has focused almost exclusively on the Transformer architecture. However, the rise of alternative architectures like Mamba—based on State Space Models (SSMs)—raises a fundamental question: will our understanding of Transformers transfer to other model families?

If models converge to the same internal logic regardless of their underlying mathematical framework, we are uncovering universal laws of language modeling. Conversely, if they diverge, the field must start from scratch for every new architecture. This paper tests the Universality Hypothesis by comparing Pythia-160M and Mamba-130M, both trained on the Pile dataset.

Methodology

To bridge the architectural gap between attention-based Transformers and recurrence-based SSMs, we employed several key techniques:

  1. Sparse Autoencoders (SAEs): Raw activations in different models are not directly comparable. We trained SAEs on the internal states of both Pythia and Mamba to decompose complex activations into thousands of sparse, monosemantic features. This provides a common feature-space for comparison.
  2. Max Pairwise Pearson Correlation (MPPC): We quantified similarity by calculating the maximum correlation between feature activation patterns across 1 million tokens from the OpenWebText dataset.
  3. Path Patching: To identify specific circuits, we used causal interventions. By corrupting inputs and "patching" internal activations, we isolated the components responsible for the Induction Circuit, the primary mechanism LLMs use to perform in-context pattern matching.
  4. Automated Interpretability: We utilized GPT-4o to score the complexity and semantic clarity of the discovered features, allowing us to correlate feature type with cross-architecture similarity.

Results and Discussion

The "Rosetta Stone" Effect

Our primary finding is that while raw neurons across different models show near-zero correlation, their SAE features are remarkably similar. This suggests that features, rather than individual neurons or architectural components, are the fundamental units of computation in language models.

Correlation of internal representations between Pythia and Mamba. SAE features (Main Experiment) show significantly higher similarity than raw neurons, approaching the similarity of models trained with different random seeds.

As shown in the correlation analysis, the average MPPC between Pythia and Mamba features reached 0.74. This is strikingly close to the 0.76 correlation observed between two Pythia models trained with different random seeds, implying that architectural differences have a negligible impact on the learned feature set compared to the training data itself.

Structural Analogy and Depth Scaling

We observed a consistent structural mapping between the two models. Features found in layer $l$ of the 12-layer Pythia model typically correspond to features in layer $2l$ of the 24-layer Mamba model, indicating a linear depth scaling relationship.

Distribution of feature similarity (MPPC Difference) and the linear depth mapping between Pythia and Mamba layers.

Over 30% of features in Pythia found a near-perfect match in Mamba (correlation > 0.95). These "universal primitives" generally correspond to simpler linguistic elements like punctuation, prefixes, and common suffixes. Conversely, more complex features (as rated by GPT-4o) tended to show lower cross-architecture similarity.

Induction Circuits and the "Off-by-One" Motif

Despite Mamba's lack of attention heads, it develops an induction circuit functionally equivalent to the Transformer's. It utilizes local convolution layers to aggregate context and SSM states to store information, mimicking the "Previous Token" and "Induction" heads. However, we discovered a nuanced "Off-by-One" difference: in Mamba, information about a token is often written into the SSM state at the subsequent token position due to the 1D convolution layer's processing window.

Conclusion

This research provides strong evidence for the Universality Hypothesis. The convergence of Transformers and Mambas onto similar features and circuits suggests that language modeling naturally leads to a specific set of computational solutions.

However, limitations remain. SAEs capture only a subset of a model's total feature space, and this study focused on relatively small models (~160M parameters). Future work should investigate whether this universality holds at the scale of 70B+ parameter models and across different modalities, such as vision and audio.

Summary updated

BibTeX
@inproceedings{wang2025towards,
  author = {Junxuan Wang and Xuyang Ge and Wentao Shu and Qiong Tang and Yunhua Zhou and Zhengfu He and Xipeng Qiu},
  title = {{Towards Universality: Studying Mechanistic Similarity Across Language Model Architectures}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=2J18i8T0oI},
}
Figure