Skip to content

RNN (Recurrent Neural Network)

Recurrent neural network designed for sequences. Reads elements one by one, maintaining 'memory' of previous steps in the hidden state.

How it works

flowchart LR
    A[word 1] --> B[hidden state]
    B --> C[word 2]
    C --> D[hidden state]
    D --> E[...]

At each step, the network takes the current element + the previous step's hidden state and outputs an updated state. Thus, information 'flows' through the chain.

Weaknesses

  • Gradient vanishing — distant connections are lost;
  • Sequentiality — cannot be parallelized, slow;
  • Poor with long texts.

Who Replaced It

LSTM and GRU solved some memory issues. But RNN was truly replaced by Transformer: it looks at the entire sequence at once.

See Also

← All terms