h3_layer
State space model layer that stacks a shift SSM and a diagonal SSM with multiplicative interactions.
Language · 32 operations Checked
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
- Task
- Language
- Parameters
- 5K
- Operations
- 32
- Framework
- PyTorch
- Recurrent
- No
- Published
- 2022
- Authors
- Daniel Y. Fu, Tri Dao, Khaled Kamal Saab and others
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m11902
- Graph hash
- d7fb5266f3a3c94e087063651146cbc2194f0781154e4da2791b08e1a2866d23
- Skeleton hash
- dd6fcd0d959d402e5ab5ea6daf7a03a6a5352b7cbc8bc31ca72ae52976061e44
- Architecture hash
- 87f8b7cee6a81d37fb484523361a4cee383dc3e521ddc92ce8fb440affcb824f
- Diagram SHA-256
- d5a6eba6723ddfc409edf3b2a12029b8c355ac882055c2583c90daae40664179
- TorchLens version
- 2.35.3
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
How this diagram was made
menagerie.classics.h3_ssm:build_h3_layer: build({}) What it is
H3, short for Hungry Hungry Hippo, is a sequence layer built from state space models (SSMs) and designed for language modeling. The paper starts from the observation that SSMs perform well in some modalities but underperform attention in language modeling. Using synthetic language tasks, the authors found that existing SSMs struggle with two capabilities: recalling earlier tokens in the sequence and comparing tokens across the sequence.
H3 stacks two SSMs, with multiplicative interactions between their outputs and input projections. One is a shift SSM that can detect when a particular event occurs, and the other is a diagonal SSM that can remember a token afterwards for the rest of the sequence. The multiplicative interactions are taken from linear attention and supply the ability to compare tokens across the sequence.
The paper reports that H3 matches attention on the synthetic languages and comes within 0.4 PPL of Transformers on OpenWebText. A hybrid 125M-parameter H3-attention model that keeps two attention layers is reported to outperform Transformers on OpenWebText by 1.0 PPL. The name comes from viewing the layer as two stacked SSMs, each of them a hungry hippo.
Key idea. The paper proposes H3, an SSM layer that stacks a shift SSM and a diagonal SSM with multiplicative interactions to recall and compare tokens across a sequence.
- H3
- Hungry Hungry Hippos
- Hungry Hungry Hippo
- H3 layer
- state space model
- SSM
- language modeling
- shift SSM
- diagonal SSM
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},
}