Contextual Representation Flow Across Depth in State-Space and Transformer Architectures

Nhat M. Hoang, Do Xuan Long, Cong-Duy Nguyen, Chunyan Miao, Min-Yen Kan +1 more
10/8/2025
cs.CLcs.LG
transformer-attention

No confident code implementation found for this paper.

Abstract

State Space Models (SSMs) have emerged as efficient, linear-time alternatives to Transformer-Based Models (TBMs) for long-context processing. However, their different mechanisms raise an important question: how does contextual representation flow across depth differ between these model families and their hybrids?

Show full abstract

We examine this question across twenty-one pretrained models, combining token-wise spectral diversity, layer-wise variation on seven datasets, and answer-location probing on two retrieval tasks. This joint analysis reveals that TBMs retain most of their token diversity at the output, whereas SSMs reach richer intermediate diversity but retain less of it on average, with late-layer compression. Comparisons with reinitialized weights reveal that these profiles depend on pretrained weights, while hybrids combine strong answer-location accessibility with architecture-dependent geometry, showing that high accessibility need not require the steadiest representation flow. Finally, we conduct theoretical case studies connecting these contrasts to mechanism-level differences: query-time token mixing in TBMs, repeated recurrent updates in SSMs, and preserved attention updates in hybrids.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{hoang2025contextual,
  title  = {Contextual Representation Flow Across Depth in State-Space and Transformer Architectures},
  author = {Nhat M. Hoang and Do Xuan Long and Cong-Duy Nguyen and Chunyan Miao and Min-Yen Kan and Luu Anh Tuan},
  year   = {2025},
  eprint = {2510.06640},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.06640v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.06640.svg)](https://codeofpaper.com/paper/2510.06640)

Discussion