SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.14052 · ICLR · 2023

Hungry Hungry Hippos: Towards Language Modeling with State Space Models

Christopher Ré, Tri Dao, Atri Rudra, Khaled Saab, Daniel Fu, Armin Thomas

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 15 functions out of this paper's own repositories and ran 7 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
HazyResearch/H3 canonical 1 of 1
hazyresearch/safari — 6 of 14
FunctionStatusWhere it lives
EMAKernel Ran hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("497dbc1b6483fce5")
SSKernelShift Ran hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("ca63d87a582adba1")
mul_sum Ran HazyResearch/H3/src/models/ssm/h3.py
code served (permissive licence) · get_code("5dd28d20c60f0c19")
nplr Ran hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("cde6f4e2d1c79e3a")
power Ran hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("55a38587423268a5")
rank_correction Ran hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("7f226e8168260082")
transition Ran hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("93675235174e1ee4")
H3 Not yet run hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("b100cfc9148d4a59")
SSKernel Not yet run hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("1d9eb34a580a6143")
SSKernelDiag Not yet run hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("60be78d8667c0da7")
combination Not yet run hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("c73230013cf47ccb")
dplr Not yet run hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("871ae87aa2c2ffb6")
log_vandermonde Not yet run hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("37bc70e26a2b9b9e")
log_vandermonde_transpose Not yet run hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("2f58a2eaf4ce01c9")
ssm Not yet run hazyresearch/safari/src/models/sequence/h3.py
code served (permissive licence) · get_code("3d83038bb3d6c578")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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× speedup on the long-range arena benchmark and allows hybrid language models to generate text 2.4× 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. * Equal Contribution. Order determined by coin flip.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2212.14052")
get_code_for_paper("2212.14052")
have("2212.14052")

Connect an agent — have() is free.