All models

H3 (Hungry Hungry Hippos)

A language model built from H3 state space layers, with two attention layers kept in the hybrid form.

Language · 1,257 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (30 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Parameters
126.1M
Operations
1,257
Framework
PyTorch
Recurrent
No
Published
ICLR 2023
Cited by
123 (as of 3 November 2026)
Authors
Daniel Y. Fu, Tri Dao, Khaled K. Saab and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m17204
Graph hash
71f9464857b46cebbd45acd952ea1ec3e7cae2012d2ae069ca2694ee41f5d759
Skeleton hash
514a33cccd78b1c297ffeb91fb51c7e70ff752f92b3b1abd8e4fb5b6cff6d1e4
Architecture hash
823f829ec7929dd3783d4e8a9e7ba165bf2bf7de13aae86c166c755368552434
Diagram SHA-256
9eed43f9a2bea45b1edb913530ae48648ab5358ec4d309b0e23d933f21cd343f
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

H3, short for Hungry Hungry Hippo, is a state space model (SSM) layer designed for language modeling. The paper begins with synthetic language tasks and finds that existing SSMs struggle with two capabilities: recalling earlier tokens in the sequence and comparing tokens across the sequence.

The layer stacks two SSMs, with multiplicative interactions between their outputs and input projections. One SSM uses a shift matrix and can detect when a particular event occurs, and the other uses a diagonal matrix and can remember a token for the rest of the sequence. The multiplicative interactions are taken from linear attention and supply the comparison of tokens across the sequence. A full model is built in the same style as a Transformer, by interleaving H3 layers with MLPs connected by residual connections and layer norm. The language models trained at 125M, 355M, 1.3B and 2.7B parameters are hybrids, which keep two attention layers while the rest are H3.

On OpenWebText, the paper reports that H3 comes within 0.4 PPL of Transformers. It reports that the 125M-parameter hybrid outperforms Transformers there by 1.0 PPL. Both the hybrid and the pure H3 models use an SSM state size of 64, and the hybrid uses head dimension 1 for H3.

Key idea. H3 is a state space model layer that stacks shift and diagonal SSMs with multiplicative interactions so it can recall earlier tokens and compare tokens across a sequence.

  • H3
  • Hungry Hungry Hippos
  • Hungry Hungry Hippo
  • state space model
  • SSM language model
  • language modeling
  • hybrid H3-attention
  • FlashConv
  • H3-125M

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{fu2023hungryhungryhipposlanguage,
      title={Hungry Hungry Hippos: Towards Language Modeling with State Space Models}, 
      author={Daniel Y. Fu and Tri Dao and Khaled K. Saab and Armin W. Thomas and Atri Rudra and Christopher Ré},
      year={2023},
      eprint={2212.14052},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2212.14052}, 
}