Lune

NeurIPS2024Top-tier venue

Transformers to SSMs: Distilling Quadratic Knowledge to Subquadratic Models

Aviv Bick, Kevin Y. Li, Eric P. Xing, J. Zico Kolter, Albert Gu

Abstract

Transformer architectures have become a dominant paradigm for domains like language modeling but suffer in many inference settings due to their quadratic-time self-attention. Recently proposed subquadratic architectures, such as Mamba, have shown promise, but have been pretrained with substantially less computational resources than the strongest Transformer models. In this work, we present a method that is able to distill a pretrained Transformer architecture into alternative architectures such as state space models (SSMs). The key idea to our approach is that we can view both Transformers and SSMs as applying different forms of mixing matrices over the token sequences. We can thus progressively distill the Transformer architecture by matching different degrees of granularity in the SSM: first matching the mixing matrices themselves, then the hidden units at each block, and finally the end-to-end predictions. Our method, called MOHAWK, is able to distill a Mamba-2 variant based on the Phi-1.5 architecture (Phi-Mamba) using only 3B tokens and a hybrid version (Hybrid Phi-Mamba) using 5B tokens. Despite using less than 1% of the training data typically used to train models from scratch, Phi-Mamba boasts substantially stronger performance compared to all past open-source non-Transformer models. MOHAWK allows models like SSMs to leverage computational resources invested in training Transformer-based architectures, highlighting a new avenue for building such models.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

28 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • PIQA: Reasoning about Physical Commonsense in Natural Language cites WinoGrande: An Adversarial Winograd Schema Challenge at Scale
  • MoBA: Mixture of Block Attention for Long-Context LLMs cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • MoBA: Mixture of Block Attention for Long-Context LLMs cites The Mamba in the Llama: Distilling and Accelerating Hybrid Models
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Efficiently Modeling Long Sequences with Structured State Spaces
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness cites Language Models are Few-Shot Learners
  • Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search cites PIQA: Reasoning about Physical Commonsense in Natural Language
  • Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search cites Efficiently Modeling Long Sequences with Structured State Spaces
  • Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search cites The Mamba in the Llama: Distilling and Accelerating Hybrid Models
  • Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search cites Language Models are Few-Shot Learners
  • Jet-Nemotron: Efficient Language Model with Post Neural Architecture Search cites Gated Slot Attention for Efficient Linear-Time Sequence Modeling
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites PIQA: Reasoning about Physical Commonsense in Natural Language
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites Efficiently Modeling Long Sequences with Structured State Spaces
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites WinoGrande: An Adversarial Winograd Schema Challenge at Scale
  • The Mamba in the Llama: Distilling and Accelerating Hybrid Models cites Language Models are Few-Shot Learners
  • Language Models are Few-Shot Learners cites WinoGrande: An Adversarial Winograd Schema Challenge at Scale
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites PIQA: Reasoning about Physical Commonsense in Natural Language
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites The Mamba in the Llama: Distilling and Accelerating Hybrid Models
  • Gated Slot Attention for Efficient Linear-Time Sequence Modeling cites WinoGrande: An Adversarial Winograd Schema Challenge at Scale
  • Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites PIQA: Reasoning about Physical Commonsense in Natural Language
  • Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites Efficiently Modeling Long Sequences with Structured State Spaces
  • Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites WinoGrande: An Adversarial Winograd Schema Challenge at Scale
  • Dynamic Chunking for End-to-End Hierarchical Sequence Modeling cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers28

  1. MoBA: Mixture of Block Attention for Long-Context LLMsEnzhe Lu, Zhejun Jiang, Jingyuan Liu, Yulun Du et al.NeurIPS 2025 · 219 citations
  2. The Mamba in the Llama: Distilling and Accelerating Hybrid ModelsJunxiong Wang, Daniele Paliotta, Avner May, Alexander M. Rush et al.NeurIPS 2024 · 146 citations
  3. Gated Slot Attention for Efficient Linear-Time Sequence ModelingYu Zhang, Songlin Yang, Rui-Jie Zhu, Yue Zhang et al.NeurIPS 2024 · 93 citations
  4. Dynamic Chunking for End-to-End Hierarchical Sequence ModelingSukjun Hwang, Brandon Wang, Albert GuICLR 2026 · 76 citations
  5. Jet-Nemotron: Efficient Language Model with Post Neural Architecture SearchYuxian Gu, Qinghao Hu, Haocheng Xi, Junyu Chen et al.NeurIPS 2025 · 39 citations

Builds on19

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. FlashAttention: Fast and Memory-Efficient Exact Attention with IO-AwarenessTri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra et al.NeurIPS 2022 · 5,493 citations
  3. Efficiently Modeling Long Sequences with Structured State SpacesAlbert Gu, Karan Goel, Christopher RéICLR 2022 · 3,482 citations
  4. WinoGrande: An Adversarial Winograd Schema Challenge at ScaleKeisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, Yejin ChoiAAAI 2020 · 3,037 citations
  5. PIQA: Reasoning about Physical Commonsense in Natural LanguageYonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao et al.AAAI 2020 · 2,916 citations

Related papers

  1. Transformers are SSMs: Generalized Models and Efficient Algorithms Through Structured State Space DualityTri Dao, Albert GuICML 2024 · 1,407 citations
  2. Understanding Input Selectivity in Mamba: Impact on Approximation Power, Memorization, and Associative Recall CapacityNingyuan Teresa Huang, Miguel Sarabia, Abhinav Moudgil, Pau Rodríguez et al.ICML 2025
  3. Hydra: Bidirectional State Space Models Through Generalized Matrix MixersSukjun Hwang, Aakash Sunil Lahoti, Ratish Puduppully, Tri Dao et al.NeurIPS 2024 · 54 citations
  4. Sparsifying MambaAn Wang, Ruobing Xie, Shuaipeng Li, Xingwu Sun et al.EMNLP Findings 2025 · 1 citation
  5. TransMamba: A Sequence-Level Hybrid Transformer-Mamba Language ModelYixing Li, Ruobing Xie, Zhen Yang, Xingwu Sun et al.AAAI 2026 · 3 citations
Dusk over the sea between two cliffs drawn in fine vertical lines