Skip to main content
Back

UW-Madison Proves Why Hybrid SSM-Transformer Models Beat Pure Architectures by 6x

A new ICML 2026 paper proves mathematically why mixing Transformer and SSM layers beats either architecture alone, with hybrids matching pure models that have 6x more parameters.

Pro

  • ICML 2026 spotlight paper proves mathematically that hybrid Transformer+SSM models are fundamentally more expressive than either architecture alone for a broad class of tasks.
  • Pure SSMs require state that scales linearly with problem size; pure Transformers require attention windows that scale linearly with context length — hybrids escape both constraints.
  • Learned hybrid models (SSM layer first, then Transformer) match pure models with up to 6x more parameters on selective copying and multi-key associative recall.
  • On associative recall with decoding, pure models never exceed 40% accuracy at tested scales; hybrids surpass 50% at much smaller model sizes.
  • Hybrids show ~10% better accuracy on sequences longer than training distribution, and 15%+ better out-of-distribution robustness.
  • Code is available at github.com/SprocketLab/hybrid-expressivity; paper at arxiv.org/abs/2603.08859.

For years, researchers have known that hybrid models combining Transformer attention layers with state-space model (SSM) layers tend to outperform pure architectures in practice. Models like Jamba and Nvidia's Nemotron-H have demonstrated this empirically at scale. But nobody had a rigorous explanation for why this works, or when to expect it. A new paper accepted as a spotlight at ICML 2026 from the University of Wisconsin-Madison finally provides that theoretical foundation, and the results are striking.

"Expressivity-Efficiency Tradeoffs for Hybrid Sequence Models" proves that for a broad family of practically relevant tasks, pure Transformers and pure SSMs each face fundamental, provable limitations that hybrid models can sidestep. The payoff: a learned hybrid can match or beat a pure model with up to 6x as many parameters.

The core tension in sequence modeling

To understand why hybrids win, you need to understand what each architecture is bad at. Attention stores every past token verbatim in a key-value cache that grows linearly with context length. Each SSM layer, by contrast, maintains a fixed-dimensional latent state that compresses the entire past into a summary at linear cost. This compression is efficient but lossy.

Pure SSM architectures have shown limitations, particularly in tasks requiring precise information retrieval or complex in-context learning compared to attention-based models. Conversely, Transformers with sliding-window attention (a dominant design for long-context models) can only see a bounded number of recent tokens, making them blind to long-range dependencies unless the window is enormous.

Proving the limits of pure models

The paper formalizes this tension through a family of tasks they call function composition tasks. The idea is simple: the answer to a question depends on two things extracted from a long sequence: a large chunk of local context (call it u), and a small control variable that could appear anywhere in the sequence (call it v). Real-world examples include long-context QA, where the question sparsely depends on a small part of a long document.

The authors prove two complementary hardness theorems:

  • SSMs need large state: Any pure SSM that solves this family of tasks must have internal state that scales linearly with the hidden dimension of the problem. Stacking more SSM layers doesn't help, because the paper proves that any stack of SSM layers can be collapsed into a single equivalent SSM, so depth buys you nothing.
  • Transformers need large windows: Any sliding-window Transformer that solves the task must have a total window size that scales linearly with the input context length L. This is because the control variable v might appear anywhere in the sequence, so the Transformer must be able to see the whole thing.

Together, these results show that for this broad class of tasks, you cannot have both small parameters and small working memory if you stick to a single architecture type.

How hybrids escape the trap

The key insight is a clean division of labor. The hybrid architecture balances two complementary forms of memory: eidetic memory from attention, which retains tokens exactly, and fading memory from SSMs, which compresses history into a fixed-size state.

In the hybrid construction, the SSM acts as an encoder: it scans the full long sequence and compresses the essential information (the control variable v) into its state. It then passes this compressed summary to a Transformer layer, which only needs a small attention window to do the final lookup. Neither component alone could do this efficiently, but together they can.

For selective copying (find the most recent number token in a sequence, then copy the token that many positions back), the authors construct a provably correct two-layer hybrid: one Mamba layer followed by one attention layer. The Mamba layer tracks the most recent number token as it reads the sequence. The attention layer then uses that information to look back exactly the right distance. The hybrid's parameter count scales with the logarithm of the task size, while a pure SSM needs parameters that scale linearly.

Accuracy vs parameter count for selective copying: SSM-TF hybrid reaches perfect accuracy at 2000 parameters while pure models need 12000+

For associative recall with decoding (a harder variant where the query key is encoded as a binary sequence scattered through the input), the authors construct a three-layer hybrid: one Mamba layer plus two attention layers. The Mamba layer reads the binary bits one by one and accumulates them into a running integer in its state, effectively decoding the key on the fly. The attention layers then perform the lookup.

What the experiments show

The theoretical constructions validate the theory, but the more striking finding is that learned hybrids, trained from scratch with standard gradient descent, also dramatically outperform pure models. The experiments use GPTNeoX-based Transformer layers and Mamba SSM layers, trained on synthetic tasks with sequences of length 100.

  • Selective copying: At ~2,000 parameters, the SSM-TF hybrid achieves perfect accuracy. Pure Transformers and pure SSMs need roughly 12,000 parameters to reach ~90% accuracy, a 6x gap.
  • Associative recall with decoding: At all tested scales, pure models never exceed 40% accuracy. The hybrid surpasses 50% at much smaller scales.
  • Multi-key associative recall (MKAR): Hybrids reach 60% accuracy with 6x fewer parameters than pure Transformers.
  • Needle-in-a-haystack: Hybrids and SSMs both outperform Transformers, consistent with the theory (this task is hard for Transformers, not SSMs).
Associative recall with decoding: SSM-SSM-TF hybrid is the only architecture reaching 0.5+ accuracy

One important detail: the order of layers matters. The SSM-TF ordering (SSM first, then Transformer) consistently wins. The reverse, TF-SSM, performs no better than a pure model. This matches the theory: the SSM needs to compress the context before the Transformer can do its lookup.

Length generalization and OOD robustness

Beyond parameter efficiency, the paper tests two practically important properties. Models are trained on short sequences (length 20-50) and tested on longer ones. Hybrids consistently outperform pure Transformers, with the gap growing to around 10% accuracy for longer sequences. For out-of-distribution testing (changing the sampling distribution of the binary key between train and test time), hybrids attain over 15% higher accuracy than either pure architecture at the same parameter count.

Needle-in-a-haystack: SSM-TF hybrid outperforms pure Transformer across all parameter counts

What this means in practice

The practical implications are clearest for long-context applications. A hybrid architecture incorporating only a small fraction of self-attention layers strategically interspersed within an SSM backbone not only closes performance gaps but actually exceeds the performance of pure Transformer baselines on average across standard tasks. This paper now gives a theoretical explanation for why that works.

The results suggest a few concrete design principles:

  • Put SSM layers before attention layers, not after.
  • Hybrids shine on tasks that require both long-range context compression and precise local retrieval.
  • For tasks that are hard only for Transformers (like needle-in-a-haystack), pure SSMs are competitive, and hybrids offer modest gains.
  • For tasks that require decoding a control variable from scattered context, hybrids are dramatically better than either pure architecture.

The paper's code is available on GitHub. The theoretical framework is currently limited to synthetic tasks and sliding-window attention, and the authors note that extending the theory to broader attention patterns and naturalistic long-context workloads is an important open direction. But for the first time, there is a principled answer to why mixing SSM and Transformer layers works, not just empirical evidence that it does.