Towards Understanding What State Space Models Learn About Code
Not on the map. Why?
Abstract (arXiv)
State Space Models (SSMs) have emerged as an efficient alternative to the Transformer architecture. Prior work shows that, when trained under comparable conditions, SSMs can match or surpass Transformers on code understanding tasks. However, their internal mechanisms remain a black box. We present the first systematic analysis of what SSM-based code models learn along with the direct comparison between SSM and Transformer models in this domain. Our analysis shows that SSMs capture syntactic and semantic structure more effectively than Transformers during pretraining but forgets certain relations during fine-tuning on some tasks. To investigate this behavior, we introduce SSM-Interpret, a frequency-domain framework that exposes a spectral shift toward short-range dependencies during fine-tuning. Guided by these findings, we propose architectural modifications that significantly improve the performance of SSM-based code model by upto +6 MRR on NLCodeSearch. This demonstrates that our analysis not only explains model behavior but also leads directly to better designs.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 35 of its 49 references that are in the map. First posted on arXiv 6 Feb 2026.
Builds on
35 of 49 references.
References · 35
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2021Efficiently Modeling Long Sequences with Structured State Spacescited by 2,465
- 2021MLP-Mixer: An all-MLP Architecture for Visioncited by 1,446
- 2024Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space Dualitycited by 1,336
- 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 876
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2019Designing and Interpreting Probes with Control Taskscited by 640
- 2021Combining Recurrent, Convolutional, and Continuous-time Models with Linear State-Space Layerscited by 608
- 2022On the Parameterization and Initialization of Diagonal State Space Modelscited by 424
- 2024Repeat After Me: Transformers are Better than State Space Models at Copyingcited by 216
- 2023Zoology: Measuring and Improving Recall in Efficient Language Modelscited by 204
- 2024The Illusion of State in State-Space Modelscited by 187
23 more
- 2024Samba: Simple Hybrid State Space Models for Efficient Unlimited Context Language Modelingcited by 174
- 2024The Hidden Attention of Mamba Modelscited by 91
- 2022Pretraining Without Attentioncited by 51
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2022S4ND: Modeling Images and Videos as Multidimensional Signals Using State Spacescited by 41
- 2020A Tale of a Probe and a Parsercited by 40
- 2024Fourier Position Embedding: Enhancing Attention's Periodic Extension for Length Generalizationcited by 39
- 2021What do pre-trained code models know about code?cited by 36
- 2024MambaLRP: Explaining Selective State Space Sequence Modelscited by 32
- 2023StableSSM: Alleviating the Curse of Memory in State-space Models through Stable Reparameterizationcited by 30
- 2021DirectProbe: Studying Representations without Classifierscited by 25
- 2022AST-Probe: Recovering abstract syntax trees from hidden representations of pre-trained language modelscited by 16
- 2024Explaining Modern Gated-Linear RNNs via a Unified Implicit Attention Formulationcited by 11
- 2024State Space Models are Strong Text Rerankerscited by 10
- 2024Does Transformer Interpretability Transfer to RNNs?cited by 9
- 2024SMR: State Memory Replay for Long Sequence Modelingcited by 6
- 2024State Space Models are Provably Comparable to Transformers in Dynamic Token Selectioncited by 6
- 2024A Critical Study of What Code-LLMs (Do Not) Learncited by 4
- 2023Towards Understanding What Code Language Models Learnedcited by 3
- 2025CodeSSM: Towards State Space Models for Code Understandingcited by 3
- 2025Achilles' Heel of Mamba: Essential difficulties of the Mamba architecture demonstrated by synthetic datacited by 3
- 2025Frequency Regularization: Unveiling the Spectral Inductive Bias of Deep Neural Networkscited by 2
- 2026Analysis of Long Range Dependency Understanding in State Space Modelscited by 1
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2026Interpreting and Steering State-Space Models via Activation Subspace Bottlenecks
- 2024The Expressive Capacity of State Space Models: A Formal Language Perspective
- 2022Hungry Hungry Hippos: Towards Language Modeling with State Space Models
- 2025Mechanistic evaluation of Transformers and state space models
- 2025Characterizing Mamba's Selective Memory using Auto-Encoders
- 2025Contextual Representation Flow Across Depth in State-Space and Transformer Architectures
- 2025To Infinity and Beyond: Tool-Use Unlocks Length Generalization in State Space Models
- 2024An Empirical Study of Mamba-based Language Models