State space models and transformers create similar hidden representations
Comparing Latent Concept Formation in State Space Models and Transformers via Sparse Autoencoders
Machine Learning
Summary
This paper compares two kinds of computer models used to understand language, called state space models and transformers. The researchers found that these models mostly learn very similar hidden concepts, despite working differently inside. A tiny number of features are different because state space models compress information more, affecting how they process specific syntax details. Overall, this suggests that the core meaning understanding between these models is mostly the same.
What this means in practice
- •For machine learning engineers: Improve model selection by understanding that core semantic features are similar between transformers and state space models despite architectural differences.
- •For natural language processing teams: Optimize language model deployment by choosing state space models to reduce computational cost without losing key semantic representation quality.
Authors
Rithin Nagaraj, Rupa Laalasa Oruganti, Prerna Subhashchandra Kunder, Ashwini M Joshi
Abstract
The quadratic scaling of Transformer self-attention has driven the adoption of sub-quadratic Selective State Space Models (SSMs) like Mamba, which compress past context into a fixed-size recurrent hidden state. This strict informational bottleneck raises a foundational question for mechanistic interpretability: do SSMs and Transformers learn fundamentally distinct latent representations? In this work, we employ Sparse Autoencoders (SAEs) to conduct a large-scale, feature-level correspondence analysis between Mamba-130m and Pythia-70m over a 10-million token corpus. Contrary to hypotheses predicting widespread architectural divergence, we find no evidence of systematic representational divergence between architectures: across the observed Jaccard distribution, 99.98% of Mamba features cluster toward the upper alignment boundary, providing preliminary feature-level support for the Universality Hypothesis. We further identify and qualitatively characterize this microscopic fraction (0.02%) of diverging features, finding patterns consistent with the hypothesis that the recurrent bottleneck selectively limits the parsing of rigid syntax rather than broad semantic ontology. We demonstrate that while Pythia's unconstrained attention permits the monosemantic decomposition of distinct formatting edge-cases, Mamba is forced to compress unrelated syntactical anomalies into polysemantic "junk drawer" neurons to preserve state capacity. Collectively, these results suggest that architectural routing mechanisms may have negligible impact on core semantic understanding, with representational divergence confined to extreme structural margins.