Mogrifier LSTM
Mogrifier LSTM, an LSTM whose input and previous output gate each other before each recurrent step.
Language · 402 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
- 18.8K
- Operations
- 402
- Framework
- PyTorch
- Recurrent
- Yes
- Published
- 2019
- Paper
- Mogrifier LSTM
- Authors
- Gábor Melis, Tomáš Kočiský, Phil Blunsom
- 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
- m1799
- Graph hash
- 6673247e98bd4f205ec5a0fc16e022589cf625ac0a1dc1cc120565ee04bea58c
- Skeleton hash
- f030bec83c43058586a7e766b2c5ff038a300246b1310a65cd2413845dee669a
- Architecture hash
- ba4385c80433bb72c885789a2dd7209990b08553a0faa7d95379530001055d72
- Diagram SHA-256
- 1add050940ca20cf2571737f5adf81c799c99189ee6009f419e029c463f22473
- 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.mogrifier_lstm:build: build({}) What it is
The Mogrifier LSTM is a recurrent language model that extends the Long Short-Term Memory (LSTM). Before the usual LSTM computation takes place, the current input and the previous output modulate one another in an alternating fashion. The paper describes the effect as making the transition function of the LSTM context-dependent.
In each round the previous state is transformed linearly, fed through a sigmoid and used to gate the input elementwise; the linearly transformed result then gates the previous state in turn. After the rounds of mutual gating, the last updated input and previous output are fed to an LSTM. The number of rounds is a hyperparameter, and zero rounds recovers the LSTM. To reduce the number of additional parameters, the gating matrices are typically factorized as products of low-rank matrices.
The paper, published at ICLR 2020, reports improved generalization on language modeling in the range of 3 to 4 perplexity points on Penn Treebank and Wikitext-2, and 0.01 to 0.05 bpc on four character-based datasets. On Enwik8, the largest dataset, the authors report matching similarly sized transformer models. They name the Multiplicative LSTM as the closest model to theirs in the literature.
Key idea. The paper extends the LSTM with mutual gating of the current input and the previous output, applied in alternating rounds before the usual LSTM computation.
- mogrifier lstm
- mogrifier
- mogrify
- lstm extension
- mutual gating
- language modeling
- recurrent neural network
- word-level language model
- character-level language model
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{melis2020mogrifierlstm,
title={Mogrifier LSTM},
author={Gábor Melis and Tomáš Kočiský and Phil Blunsom},
year={2020},
eprint={1909.01792},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/1909.01792},
}