LSTM Gate Equations › The LSTM Cell at a Glance
Language AI HandbookAll chapters LSTM Gate Equations › The LSTM Cell at a GlanceOne section · Sections in this chapter2 / 17 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Before diving into individual equations, let's establish the notation and see all the components together. An LSTM cell at time step receives three inputs and produces two outputs.
Inputs:
- : the input vector at time (e.g., a word embedding)
- : the hidden state from the previous time step
- : the cell state from the previous time step
Outputs:
- : the new hidden state
- : the new cell state
The hidden dimension is a hyperparameter you choose. A larger gives the model more capacity but increases computation and memory requirements.
The LSTM computes these outputs through four interacting components: the forget gate, input gate, candidate cell state, and output gate. Each gate is a small neural network that produces values between 0 and 1, acting as a soft switch that controls information flow.