HackerPapers

arXiv:2212.14052cs.LG

Hungry Hungry Hippos: Towards Language Modeling with State Space Models

Daniel Y. Fu, Tri Dao, Khaled K. Saab, Armin W. Thomas, Atri Rudra, Christopher Ré

Abstract

State space models (SSMs) have demonstrated state-of-the-art sequence modeling performance in some modalities, but underperform attention in language modeling. Moreover, despite scaling nearly linearly in sequence length instead of quadratically, SSMs are still slower than Transformers due to poor hardware utilization. In this paper, we make progress on understanding the expressivity gap between SSMs and attention in language modeling, and on reducing the hardware barrier between SSMs and attention. First, we use synthetic language modeling tasks to understand the gap between SSMs and attention. We find that existing SSMs struggle with two capabilities: recalling earlier tokens in the sequence and comparing tokens across the sequence. To understand the impact on language modeling, we propose a new SSM layer, H3, that is explicitly designed for these abilities. H3 matches attention on the synthetic languages and comes within 0.4 PPL of Transformers on OpenWebText. Furthermore, a hybrid 125M-parameter H3-attention model that retains two attention layers surprisingly outperforms Transformers on OpenWebText by 1.0 PPL. Next, to improve the efficiency of training SSMs on modern hardware, we propose FlashConv. FlashConv uses a fused block FFT algorithm to improve efficiency on sequences up to 8K, and introduces a novel state passing algorithm that exploits the recurrent properties of SSMs to scale to longer sequences. FlashConv yields 2$\times$ speedup on the long-range arena benchmark and allows hybrid language models to generate text 2.4$\times$ faster than Transformers. Using FlashConv, we scale hybrid H3-attention language models up to 2.7B parameters on the Pile and find promising initial results, achieving lower perplexity than Transformers and outperforming Transformers in zero- and few-shot learning on a majority of tasks in the SuperGLUE benchmark.

arXiv comments
ICLR 2023 Camera-Ready (Notable-top-25% / Spotlight)
Journal reference
DOI
Subjects
cs.LGMachine Learning cs.CLComputation and Language

On Hacker News

Linked by 3 identifiable commenters in 3 comments across 3 threads, from Feb 2023 to Apr 2025. Found in 2 HN submissions from Jan 2023 to Jan 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments3 threads

    • LLM/state space models have been popular for some years now, see: https://arxiv.org/abs/2212.14052 More recently, hybrid architectures that utilize attention plus other operators are gaining traction. See https://arxiv.org/abs/2503.01868

      jwilberView on HNParent context

    • Exactly, we're seeing the time horizon shrink rapidly. There have already been numerous threads ruminating on the fact that even a few months of not paying attention will result in you lagging behind in this technology. I can't wait to see what happens when state space models…

      throwaway4adayView on HNParent context

    • People are already making progress on this, e.g. the H3 project[1]. [1] https://arxiv.org/abs/2212.14052

      dm3View on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.