A Comparative Analysis of Contextual Representation Flow in State-Space and Transformer Architectures
Nhat M. Hoang, Do Xuan Long, Cong-Duy Nguyen, Min-Yen Kan, Luu Anh Tuan
TL;DR
This work provides a unified, token- and layer-level comparison of how contextual representations flow in long-context Transformer-Based Models (TBMs) and State Space Models (SSMs). By combining empirical analyses (token- and layer-level dynamics, probing, and context-length effects) with theoretical stability results, it shows that TBMs rapidly homogenize token representations early and undergo a final-layer reconfiguration, while SSMs preserve token uniqueness early and homogenize deeper due to training dynamics. The study demonstrates that intermediate layers often contain the most task-relevant information and that oversmoothing is architecture-driven in TBMs but largely training-driven in SSMs, with implications for designing hybrids and regularizers. These findings offer practical diagnostics and interventions—such as intermediate supervision and contractive constraints—and establish a framework for robust long-context modeling and architecture-aware scaling. The results advance understanding of inductive biases in long-context models and provide a toolkit for systematic evaluation across architectures.
Abstract
State Space Models (SSMs) have recently emerged as efficient alternatives to Transformer-Based Models (TBMs) for long-sequence processing, offering linear scaling and lower memory use. Yet, how contextual information flows across layers and tokens in these architectures remains understudied. We present the first unified, token- and layer-level analysis of representation propagation in SSMs and TBMs. Using centered kernel alignment, stability metrics, and probing, we characterize how representations evolve within and across layers. We find a key divergence: TBMs rapidly homogenize token representations, with diversity reemerging only in later layers, while SSMs preserve token uniqueness early but converge to homogenization deeper. Theoretical analysis and parameter randomization further reveal that oversmoothing in TBMs stems from architectural design, whereas in SSMs it arises mainly from training dynamics. These insights clarify the inductive biases of both architectures and inform future model and training designs for long-context reasoning.
