Back

long short-term memory network (LSTM)

Long Short-Term Memory networks, commonly known as LSTMs, are a special kind of Recurrent Neural Network (RNN) capable of learning long-term dependencies. They were introduced to overcome the limitations of traditional RNNs, particularly the vanishing gradient problem, which makes it difficult for RNNs to learn and maintain information over long sequences[1][2][4].


Core Components of LSTM

The core idea behind LSTMs is the cell state, which acts like a conveyor belt running through the entire chain of LSTM units. This cell state makes it easy for information to flow through the network with only minor linear interactions, thus allowing the network to preserve long-term dependencies[1].


LSTMs have a complex structure with four interacting layers that make up each unit or cell. These layers work together to regulate the flow of information into and out of the cell state. The regulation is done through three distinct gates within each LSTM unit:


  1. Forget Gate: Decides what information is discarded from the cell state. It looks at the previous output and the current input and passes this through a sigmoid layer to output values between 0 and 1, indicating how much of the existing information to keep (1) or forget (0)[1][2].
  2. Input Gate: Determines what new information is added to the cell state. It involves a sigmoid layer that decides which values to update and a tanh layer that creates a vector of new candidate values that could be added to the state[1][2].
  3. Output Gate: Decides what the next hidden state should be, which is the output of the LSTM unit that will be passed on to the next time step. It involves another sigmoid layer and the cell state passed through a tanh layer[1][2].


LSTM Variants and Improvements

Over time, various alterations and improvements have been made to the conventional LSTM architecture. For example, some LSTMs include peephole connections, which allow the gates to consider the cell state in their operations. Other variations include coupling the input and forget gates or simplifying the architecture with Gated Recurrent Units (GRUs), which reduce the number of gates[2].


Practical Applications

LSTMs are widely used in tasks that involve sequential data, such as time series forecasting, text generation, speech recognition, and machine translation. They are particularly effective in applications where the context provided by longer sequences of data is crucial for making accurate predictions or generating coherent outputs[3].


See also: Gated Recurrent Unit (GRU)


Citations:

[1] https://colah.github.io/posts/2015-08-Understanding-LSTMs/

[2] https://www.geeksforgeeks.org/understanding-of-lstm-networks/

[3] https://towardsdatascience.com/five-practical-applications-of-the-lstm-model-for-time-series-with-code-a7aac0aa85c0

[4] https://ai.stackexchange.com/questions/18198/what-is-the-difference-between-lstm-and-rnn

[5] https://towardsdatascience.com/lstm-networks-a-detailed-explanation-8fae6aefc7f9

[6] https://www.linkedin.com/advice/0/what-some-common-applications-lstm-gru-ai-ml-skills-neural-networks

[7] https://www.shiksha.com/online-courses/articles/rnn-vs-gru-vs-lstm/

[8] https://youtube.com/watch?v=YCzL96nL7j0

[9] https://en.wikipedia.org/wiki/Long_short-term_memory

[10] https://ashutoshtripathi.com/2021/07/02/what-is-the-main-difference-between-rnn-and-lstm-nlp-rnn-vs-lstm/

[11] https://databasecamp.de/en/ml/lstms

[12] https://www.knowledgehut.com/blog/web-development/long-short-term-memory

[13] https://stats.stackexchange.com/questions/222584/difference-between-feedback-rnn-and-lstm-gru

[14] https://intellipaat.com/blog/what-is-lstm/

[15] https://www.theiotacademy.co/blog/what-is-the-main-difference-between-rnn-and-lstm/

[16] https://www.geeksforgeeks.org/long-short-term-memory-networks-explanation/

[17] https://www.theaidream.com/post/introduction-to-rnn-and-lstm

[18] https://www.linkedin.com/advice/0/how-do-you-choose-between-rnn-lstm-natural-language

[19] https://builtin.com/data-science/recurrent-neural-networks-and-lstm

Share: