LSTM Readability
An LSTM text classifier: byte tokens pass through an embedding, a bidirectional LSTM and a linear layer.
Language · 11 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
- 1.2M
- Operations
- 11
- Framework
- PyTorch
- Recurrent
- No
- Published
- 1997, Neural Computation
- Paper
- Long Short-Term Memory
- Cited by
- 101,764 (as of 20 October 2026)
- Authors
- Sepp Hochreiter, Jürgen Schmidhuber
- Source
- torch 2.6.0
- License
- BSD-3-Clause
- 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
- m13674
- Graph hash
- 153295b414bfec54dad9321eb3af3d31f58e9671cea8cf0deed475615ab0444d
- Skeleton hash
- 2693ae54ff12fb52a97968ec43718c1438c6e3773baaa48b70978996a4f02031
- Architecture hash
- b899d1bf70d9cc1b516934ec5fe5ae8157b4155c4e29f8d7d57d939c104f7987
- Diagram SHA-256
- 54b3e5d71fa55f0aba7317565d54e131b83ffcac192f82c17ad9d17d13d4d674
- 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
Long short-term memory (LSTM) is a recurrent network architecture that the paper presents together with a gradient-based learning algorithm. The problem it addresses is that error signals flowing backward in time tend to blow up or vanish. When they vanish, learning to bridge long time lags takes a prohibitive amount of time or does not work at all.
The paper's answer is the memory cell, built around a central linear unit with a fixed self-connection, which it calls the constant error carousel (CEC). A multiplicative input gate protects the CEC from perturbation by irrelevant inputs. A multiplicative output gate protects other units from memory contents that are currently irrelevant. With this design the paper reports that LSTM can learn to bridge time intervals in excess of 1000 steps.
The experiments use artificial data. They compare LSTM with real-time recurrent learning, back propagation through time, recurrent cascade correlation, Elman nets and neural sequence chunking, and the paper reports many more successful runs and much faster learning. The authors also state a cost: each memory cell block needs two additional units, the input and output gate. They planned to apply LSTM to real-world data, naming time-series prediction, music composition and speech processing as application areas.
Key idea. The paper introduced LSTM, whose memory cells enforce constant error flow through constant error carousels guarded by multiplicative gate units, so a recurrent network can bridge long time lags.
- lstm
- long short-term memory
- recurrent neural network
- rnn
- memory cell
- gate units
- constant error carousel
- readability
- text classification
- long time lags
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@article{Hochreiter_1997, title={Long Short-Term Memory}, volume={9}, ISSN={1530-888X}, url={http://dx.doi.org/10.1162/neco.1997.9.8.1735}, DOI={10.1162/neco.1997.9.8.1735}, number={8}, journal={Neural Computation}, publisher={MIT Press}, author={Hochreiter, Sepp and Schmidhuber, Jürgen}, year={1997}, month=Nov, pages={1735–1780} }