A sentence can separate the clue from the word it predicts: “I grew up in France … I speak fluent French.” A recurrent neural network (RNN) carries context forward in a hidden state, but learning a connection across many intervening words is difficult. During backpropagation through time, the learning signal from a distant prediction can become negligibly small. The long short-term memory network, or LSTM, was developed by Sepp Hochreiter and Jürgen Schmidhuber to address this long-range dependency problem. section 4.2
An LSTM is a specialized RNN with a cell state as well as a hidden state. Its learned forget, input, and output gates control what is retained, what updates the cell state, and what is exposed as output. This selective pathway makes earlier information more useful later in a sequence. It does not remove the need to train and regularize a recurrent model. section 4.2 section 4.3
Figure 4.2 A single LSTM cell. The inputs are the current vector Xt, the previous hidden state ht–1, and the previous cell state Ct–1. There are three learned gates: the forget ft, input it, and output Ot. They are all produced by sigmoid layers (“σ” blocks). A tanh layer forms a candidate update \(\tilde{C}\)t. Pointwise multiplications (“×”) and an addition (“+”) update the cell state on the top “conveyor” pathway. Arrows indicate vector flow; the legend marks pointwise operations, concatenation, and copies. This is the standard LSTM, emphasizing how gating enables selective memory retention and exposure. Used with permission granted by the author (Chris Olah), though it is slightly modified from its original form.
Trace the previous cell state along the upper pathway. The forget and input gates shape its update; the output gate controls how much of the resulting state is exposed. section 4.2
LSTMs belong to the resurgence of recurrent sequence models in the mid-2010s. Chris Olah’s 2015 visual explanation made their gates easier to understand; Zaremba, Sutskever, and Vinyals’s 2014 work addressed a different obstacle, overfitting, with selective dropout tailored to LSTM architectures. The engineering lesson is to distinguish remembering distant context from training a model that generalizes. section 4.0 section 4.2 section 4.3







