ZarembaLSTMLM
A two-layer word-level LSTM language model regularized with dropout on its non-recurrent connections.
Language · 1,437 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
- 66M
- Operations
- 1,437
- Framework
- PyTorch
- Recurrent
- Yes
- Published
- 2014
- Cited by
- 3,234 (as of 13 November 2026)
- Authors
- Wojciech Zaremba, Ilya Sutskever, Oriol Vinyals
- Source
- GitHub: wojzaremba/lstm
- 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 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
- m3457
- Graph hash
- 734378c23213e09629cbd51e64688bd693f7ed24e279e33436364915eebf4822
- Skeleton hash
- 0516c2c131434d54bd97ec6417a3b3b866477b51c6143a54756f57c719d4930f
- Architecture hash
- afdbcbbcbf43cd489d5b1a6789f5d34c167b6ca3dd4295b9bc70e3a5974278fe
- Diagram SHA-256
- 7bc6616f0925e110cc78fb118393573aff14055db3784593c7a35df7b97537ba
- 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
This is the LSTM language model from the paper Recurrent Neural Network Regularization, which shows how to apply dropout to LSTMs so that it reduces overfitting. The model predicts text one word at a time on the Penn Tree Bank dataset, which has 10k words in its vocabulary.
The main idea is to apply dropout only to the non-recurrent connections of the LSTM. Standard dropout perturbs the recurrent connections, which makes it difficult for the LSTM to learn to store information for long periods of time. With the paper's scheme, information is corrupted by dropout exactly L + 1 times in a network of L layers, however many timesteps it crosses.
This model follows the paper's large configuration, with 1500 units per layer. It has two layers and is unrolled for 35 steps. At this size the paper applies 65% dropout on the non-recurrent connections. The paper reports a word-level test perplexity of 78.4 on Penn Tree Bank for a single large regularized LSTM. Its non-regularized LSTM reached 114.5. That network had to stay small because larger networks overfit: it has two hidden layers with 200 units per layer.
Key idea. The paper shows that dropout reduces overfitting in LSTMs when it is applied only to the non-recurrent connections.
- Zaremba LSTM
- ZarembaLSTMLM
- regularized LSTM
- LSTM language model
- recurrent neural network regularization
- dropout for LSTMs
- word-level language model
- Penn Tree Bank
- PTB 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{zaremba2015recurrentneuralnetworkregularization,
title={Recurrent Neural Network Regularization},
author={Wojciech Zaremba and Ilya Sutskever and Oriol Vinyals},
year={2015},
eprint={1409.2329},
archivePrefix={arXiv},
primaryClass={cs.NE},
url={https://arxiv.org/abs/1409.2329},
}