• 10 parts
  • Checked October 2026

LSTM Cell Diagram

One long short-term memory cell: three gates, two states and the points between them.

Tap any part to read, rename or leave it out

1 2 3 4 5 6 7 8 9 10
More options

Each numbered ring is a button. Use the arrow keys to move between them and Enter to choose. Names are read out in Study, and once a part is answered.

All 10 parts on the diagram

Show the list

Gates and points 5

  1. Forget gate Sets what share of the old cell state is kept. A sigmoid layer gives each value a number between 0 and 1; near 1 keeps it, near 0 drops it.
  2. Input gate Decides how much new information enters the cell state. It scales the new values from the tanh layer beside it.
  3. Output gate Decides how much of the cell state is passed out. It scales the tanh of the new cell state to make the new hidden state.
  4. Element-wise multiplication Multiplies two sets of values, one pair at a time. Also called the Hadamard product; each gate acts through one of these points.
  5. Addition Adds the new values to what was kept. The sum is the new cell state.

States and signals 5

  1. Previous cell state The memory of the cell from the time step before. It enters on the top line.
  2. New cell state The updated memory, passed on to the next time step.
  3. Previous hidden state The output of the cell from the time step before. With the input, it feeds all three gates.
  4. New hidden state The output of the cell at this time step. It is the output gate times the tanh of the new cell state.
  5. Input The data that arrives at this time step. It joins the previous hidden state on the bottom line.

How this list was compiled: Every name was read on 2026-10-03 and kept only where two of these give it. (1) Wikipedia, English edition, Long short-term memory (an LSTM unit is a cell with an input gate, an output gate and a forget gate; forget gates decide what to discard from the previous state by a value between 0 and 1, input gates which new information to store in the cell state, output gates which information of the cell state to output; the equations for the forget, input and output gate activations, the cell state vector and the hidden state vector, also called the output vector of the unit; the sigmoid function for the gates and the hyperbolic tangent; the Hadamard, or element-wise, product). (2) Dive into Deep Learning, an open textbook, section 10.1, Long Short-Term Memory (https://d2l.ai/chapter_recurrent-modern/lstm.html): the current time step's input and the previous time step's hidden state feed three layers with sigmoid activation, the input, forget and output gates, with values between 0 and 1; a fourth layer with a tanh activation; the old cell internal state is multiplied by the forget gate and added to the gated new values, with the Hadamard (elementwise) product; the hidden state is the output gate times the tanh of the memory cell internal state. (3) The reference page for the LSTM layer of an open-source deep learning library (https://docs.pytorch.org/docs/stable/generated/torch.nn.LSTM.html): in its equations h is the hidden state, c the cell state and x the input at a time step, with input, forget and output gates, the sigmoid function and the Hadamard product. Cell state is the wording of (1) and (3); (2) says memory cell internal state. The layout of the drawing and the wording of every line are our own. Licence: own work

The drawing: Drawn for this site on 2026-10-03 from plain geometry, in our own layout. Own original chart; nothing traced or copied. Licence: own work

How it works

This LSTM cell diagram shows one long short-term memory cell at one time step. Name the forget gate, the input gate and the output gate, then the cell state and the hidden state that enter and leave.

Read the full guide

Read the two lines

The top line carries the cell state, the memory of the cell, from left to right. The bottom line brings in the previous hidden state, and the input joins it from below.

Find the three gates

Each box with the sigmoid sign is a gate: it gives every value a number between 0 and 1. From the left they are the forget gate, the input gate and the output gate. Each acts through a multiply point.

What the signs mean

The sigmoid sign and tanh are activation functions. The multiply sign is element-wise multiplication and the plus sign is addition.

  • The tanh box between the gates makes the new values. Texts name it differently, so it is not asked.

Questions and answers

What are the three gates of an LSTM cell?

The forget gate, the input gate and the output gate. Each is a layer with a sigmoid activation, so its values lie between 0 and 1, and each scales another signal by element-wise multiplication.

What is the difference between the cell state and the hidden state?

The cell state is the internal memory of the cell: it runs along the top line and is changed by one multiplication and one addition. The hidden state is the output of the cell at each time step.

What does the forget gate do in an LSTM?

It decides how much of the previous cell state is kept. A value near 1 keeps a piece of the old memory and a value near 0 discards it.

What does LSTM stand for?

Long short-term memory. It is a kind of recurrent neural network, introduced in 1997, built to keep information over many time steps.