# On Feature Learning in Structured State Space Models

Feature learning theory shows how to scale Mamba-style state-space models

Chennuru Vankadara, Leena, Xu, Jin, Haas, Moritz, Cevher, Volkan · Advances in Neural Information Processing Systems · 2024-12-16

- **Problem** Maximal Update Parametrization cannot be applied to state-space models because they fall outside Tensor Programs. Without a width-stable scaling, optimal hyper-parameters do not carry over from small to large models.
- **Method** µP-SSM rescales Mamba's initialization and learning rates so its features stay width-stable. Unlike the usual approach, it sets the B and C weight scales and the learning rates for the SSM layers directly.
- **Results** In a Mamba learning-rate sweep on wikitext-103, the optimal learning rate transferred from small to large widths under µP-SSM. Standard Parametrization did not show this transfer.

## Why SSM scaling at infinite width matters

State-space models such as Mamba have emerged as alternatives to transformers, and they handle long contexts well. Their sequential recurrence also makes them hard to train, so their scaling with width needs a clear theory.

Infinite-width analysis with the neural tangent kernel has been a central tool, but in that limit features don't move. Feature learning is the more realistic regime, where network parameters move freely during training.

Maximal Update Parametrization, or µP, addresses this by searching a wider hyper-parameter space that includes layer-wise learning rates. Under that scaling, features in each layer evolve in a width-independent way, and optimal hyper-parameters carry over from small to large models.

## What counts as feature learning in a sequence layer

The analysis treats a sequence layer as a map from input vectors u\_l to output vectors y\_l, with widths N\_u and N\_y. Rather than tracking single coordinates, it tracks the l2 norm of each vector, which is of order \\(\\sqrt{N\_u}\\) when coordinates are order one.

A layer meets the initialization condition (INIT) when some feature norm has order \\(\\sqrt{N\_k}\\) at initialization, so activations stay coordinate-wise order one. It meets the update condition (Δ) when some feature update after one gradient step has the same order, so updates neither vanish nor blow up.

The corrected Mamba scaling aims higher: every trainable weight should change the activations and outputs non-trivially. This is the sense in which the authors call the sequence model effectively feature learning.

## Why µP and spectral scaling don't carry over

Tensor Programs give the general tool here, and the NE⊗OR⊤ program is their most general form. Architectures whose forward pass is such a program, like transformers and convolutional networks, admit a unique µP under which features evolve width-independently.

The authors state that structured SSMs, including S4 and Mamba trained by SGD or ADAM, aren't generally representable as NE⊗OR⊤ programs. The obstruction is the HiPPO-based transition matrix, whose diagonal entries decay fast, so the initial hidden state isn't identically distributed even at initialization.

Spectral scaling conditions require the spectral norms of each weight matrix and its update to scale like \\(\\sqrt{N\_l/N\_{l-1}}\\). The authors show that meeting these conditions doesn't generally give feature learning in SSMs.

The intuition is that the hidden-state norm \\(\\\|B'u\_1\\\|\_2\\) is a sum of independent terms that concentrates, following the strong law of large numbers. The ratio \\(\\\|B'u\\\|\_2/(\\\|B'\\\|\_\*\\\|u\_1\\\|\_2)\\) comes out of order \\(1/\\sqrt{N\_u}\\), which breaks the required condition.

## Forward scales of a Mamba layer

A Mamba layer makes B\_l, C\_l and τ\_l depend on the input, and it treats each of the N\_u input channels as a 1D SSM. Under ZOH the discrete transition is \\(A'^{(i)}\_l=\\exp(\\tau^{(i)}\_l A^{(i)})\\), and the discrete input matrix is \\(B'^{(i)}\_l=(A'^{(i)}\_l-I)(A^{(i)})^{-1}B^{(i)}\_l\\). The hidden state then updates as \\(x^{(i)}\_l=A'^{(i)}\_l x^{(i)}\_{l-1}+u^{(i)}\_l B'^{(i)}\_l\\).

The weights W\_B and W\_C are drawn as Gaussians with standard deviations σ\_B and σ\_C, and biases start at zero. Assumption 3.1 says all other components are NE⊗OR⊤ programs under µP, so the SSM inputs are i.i.d. and correctly scaled.

The squared norm of the first hidden state scales with σ\_B squared, the input norm and the constant ζ(2). Stability then needs σ\_B in \\(\\Theta(\\sqrt{N\_x/N\_u})\\), whereas standard and spectral initializations give order \\(1/\\sqrt{N\_u}\\), so the hidden states vanish.

The first output is Gaussian with mean zero and a standard deviation of order σ\_B σ\_C times the squared input norm. Stable outputs need σ\_C in \\(\\Theta(1/\\sqrt{N\_x N\_u})\\), while standard scaling uses \\(1/\\sqrt{N\_u}\\) and lets outputs diverge. Under spectral scaling the outputs keep the right size only because the hidden states vanish.

For later positions the state is a sum over decayed terms, \\(x^{(i)}\_l=\\sum\_{m=0}^{l-1}(A'^{(i)}\_l)^m B'^{(i)}\_{l-m}u^{(i)}\_{l-m}\\). The matrix power only scales norms by \\(e^{-m\\tau/2}\\), so it doesn't change the width scaling. The authors summarise the stability conditions as σ\_B in \\(\\Theta(\\sqrt{N\_x/N\_u})\\) and σ\_C in \\(\\Theta(1/\\sqrt{N\_x N\_u})\\).

## Learning rates for non-trivial updates

After one SGD step, the squared norm of the hidden-state update scales with η\_B, σ\_C and a power of the input norm, with ζ(4) a constant. With σ\_C fixed by the stability condition, hidden-state updates reach order \\(\\sqrt{N\_x}\\) only if η\_B is in \\(\\Theta(N\_x/\\sqrt{N\_u})\\). Spectral scaling gives an η\_B that leaves those updates vanishing with width, so the first SSM block falls in the lazy regime.

For outputs, the squared update is of order η\_C times σ\_B squared, with a power of the input norm. Correct updates need η\_C in \\(\\Theta(1/(N\_x\\sqrt{N\_u}))\\), while spectral scaling uses a larger η\_C, which the authors view as a compensating error.

The transition learning rate η\_a doesn't affect stability at initialization or the size of non-trivial updates. It must still be in \\(\\Theta(N\_u)\\), since otherwise the transition matrix A is never updated. The full set of update conditions is σ\_B in \\(\\Theta(\\sqrt{N\_x/N\_u})\\), σ\_C in \\(\\Theta(1/\\sqrt{N\_x N\_u})\\), η\_a in \\(\\Theta(N\_u)\\), η\_B in \\(\\Theta(N\_x/\\sqrt{N\_u})\\) and η\_C in \\(\\Theta(1/(N\_x\\sqrt{N\_u}))\\).

## Checking the scalings in trained Mamba

Mamba was trained with 3 SSM blocks on wikitext using plain SGD, with the Hugging Face implementation and the µP package. The authors scale N\_x and N\_u together with N\_u = N\_x/8, because a small N\_u lets N\_x grow large and reduces finite-sample effects.

Under Standard Parametrization, latent states and outputs explode at initialization, and their updates explode too. With spectral scaling and ZOH for B, latent states and their updates shrink with width while outputs keep the predicted scale. With spectral scaling and Euler for B, latent states keep their scale but outputs explode.

Under µP-SSM, latent states and outputs both have the expected scale at initialization, and their updates match, for ZOH and Euler alike. A slight shift at small width is attributed to finite-sample effects, which fade once width is large.

## Test loss, stability and learning-rate transfer

The authors trained Mamba as a generative model on wikitext-103 with single-epoch training for 20K iterations. They swept the learning rate across widths with N\_u = 16 N\_x and plotted test loss on a logarithmic learning-rate axis.

Both µP-SSM and µP (heuristic) substantially improve test performance relative to Standard Parametrization. At large learning rates, µP-SSM stays more stable than µP (heuristic).

Under µP-SSM, performance improves monotonically with width, whereas under standard scaling it drops after a certain width. The optimal learning rate transfers from small to large widths under µP-SSM and also appears to transfer under spectral scaling.

The authors note that why optimal hyper-parameters transfer across scales isn't completely understood. They point to transformer depth transfer under residual scaling, and they see the lazy first block under spectral scaling as similar to transformer residual blocks.

## Limitations

The derivations take N\_u to infinity before N\_x. The proportional limit, with N\_x N\_u roughly constant, isn't rigorously analysed.

Extending Tensor Programs to SSMs would need relaxing the assumption that vectors are asymptotically identically distributed, which the authors leave to future work. The forward and backward analysis assumes all other components are µP-parameterized NE⊗OR⊤ programs.

Experiments use Mamba on wikitext and wikitext-103, with N\_u = N\_x/8 for the scaling runs and N\_u = 16 N\_x for the sweep. The reasons optimal hyper-parameters transfer remain open.

## Paper info

- **Authors**: Chennuru Vankadara, Leena, Xu, Jin, Haas, Moritz, Cevher, Volkan
- **Venue**: Advances in Neural Information Processing Systems · Published
- **First published**: 2024-12-16
- **Added**: 2026-11-26
- **DOI**: 10.52202/079017-2736
- **Original paper terms**: [Check in the original ↗](https://papers.nips.cc/paper_files/paper/2024/hash/9c7eeda2dc98e61baa9a5884afd231bc-Abstract-Conference.html)
- **What we show**: Paper info and commentary

[Original paper ↗](https://papers.nips.cc/paper_files/paper/2024/hash/9c7eeda2dc98e61baa9a5884afd231bc-Abstract-Conference.html)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Chennuru Vankadara, Leena, Xu, Jin, Haas, Moritz, Cevher, Volkan (2024). On Feature Learning in Structured State Space Models. Advances in Neural Information Processing Systems. https://doi.org/10.52202/079017-2736

**BibTeX**

```
@article{leena2024feature,
  title = {{On Feature Learning in Structured State Space Models}},
  author = {Chennuru Vankadara, Leena and Xu, Jin and Haas, Moritz and Cevher, Volkan},
  year = {2024},
  journal = {Advances in Neural Information Processing Systems},
  doi = {10.52202/079017-2736},
  url = {https://papers.nips.cc/paper_files/paper/2024/hash/9c7eeda2dc98e61baa9a5884afd231bc-Abstract-Conference.html}
}
```

## Other paper commentary

- [On Expressive Power of Floating-Point Transformers](https://refivu.com/en/papers/8eff9b9c-d057-4d27-8b46-4f97cbae6130-on-expressive-power-of-floating-point-transformers.md)
- [Unitary Convolutions for Message-passing and Positional Encodings on Directed Graphs](https://refivu.com/en/papers/cf7ea629-41a3-4349-add7-79a6b104140f-unitary-convolutions-for-message-passing-and-positional.md)
- [Understanding the Parameter Space Volume of Transformers Encoding Boolean Functions](https://refivu.com/en/papers/f4dbf6ce-3357-44a3-b4ed-38147e384f67-understanding-the-parameter-space-volume-of-transformers.md)
- [IANN: A Unified Framework for Equivariant InterAtomic Neural Networks with User-Friendly Implementation](https://refivu.com/en/papers/4c633944-8862-4ee4-bd77-a5c9f417f6fd-iann-a-unified-framework-for-equivariant-interatomic-neural.md)
- [Multi-Branch Transformer](https://refivu.com/en/papers/41db7368-f02a-4b93-a29d-688fd514713c-multi-branch-transformer.md)
- [Synthetic Neurosymbolic Task Generation with Controlled Constraint Complexity](https://refivu.com/en/papers/ebe4fa7e-eeaf-4ae2-b493-81d2f69199e5-synthetic-neurosymbolic-task-generation-with-controlled.md)
- [Spiked-CFR: Causal Representation Learning from LLMs via Wasserstein Projection Pursuit](https://refivu.com/en/papers/a092dcb5-227e-4a9c-9f4c-0ed769acba0a-spiked-cfr-causal-representation-learning-from-llms-via.md)
- [RSA-CP: Efficient Conformal Prediction in Small-Sample Regimes via Random Score Alignment](https://refivu.com/en/papers/21bdc1a9-8a21-4757-b322-ec7470296d48-rsa-cp-efficient-conformal-prediction-in-small-sample.md)
- [What Does a Skill Vocabulary Cost? A Closed-Loop Decomposition over Demonstrated Motions](https://refivu.com/en/papers/5436c87a-99ef-46a3-afc4-ed0b0a217c6b-what-does-a-skill-vocabulary-cost-a-closed.md)
- [When Repair Accuracy Misleads: Training a VLM on Its Own Failures](https://refivu.com/en/papers/875ef8df-0b84-431d-bb7d-8f512170c313-when-repair-accuracy-misleads-training-a-vlm-on.md)
- [Cross-Layer Characterization and AI-Assisted Diagnosis of C-to-Rust Performance](https://refivu.com/en/papers/b9b8f973-d979-443f-b049-2f0218e3517a-cross-layer-characterization-and-ai-assisted-diagnosis-of.md)
- [When Is Product Decoding of ECOC MAP-Consistent? Pair Structure and the n-vs-Rest Codes](https://refivu.com/en/papers/91c0b439-85c0-4c82-8b80-68deaac338ab-when-is-product-decoding-of-ecoc-map-consistent.md)

## Terms in this paper

- [Stochastic Gradient Descent (SGD)](https://refivu.com/en/terms/5c2447143b09-stochastic-gradient-descent-sgd)
- [WikiText-103](https://refivu.com/en/terms/6b182ddb67ef-wikitext-103)
- [Mamba](https://refivu.com/en/terms/cc8b7f3226dc-mamba)
- [test loss](https://refivu.com/en/terms/3d54edcc0a13-test-loss)
- [Euler discretization](https://refivu.com/en/terms/ac6c34852bc6-euler-discretization)
- [feature learning](https://refivu.com/en/terms/6284a76607a9-feature-learning)
- [Neural tangent kernel](https://refivu.com/en/terms/38179d48dc7d-neural-tangent-kernel)
- [selection mechanism](https://refivu.com/en/terms/bd0556680949-selection-mechanism)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/f2f5ef3f-9d61-4b9e-93ae-dfe0ebc80328-on-feature-learning-in-structured-state-space-models)
