Networks that remember โ built for sequences
An RNN is a neural network with a loop. At each step it reads one element of a sequence and blends it with a hidden state โ a running memory of everything seen so far. That memory is what lets it model order and context, so word 5 can depend on word 1.
A vector carried forward each step โ the network's short-term memory of the sequence so far.
The single looped cell is "unfolded" into a chain, one copy per time step, sharing the same weights.
Backpropagation Through Time: gradients flow backward across every unrolled step to update weights.
Repeated multiplication shrinks (or blows up) gradients over long sequences, erasing long-range memory.
Start with an initial hidden state hโ (usually zeros).
At each step t, combine the new input xโ with the previous memory hโโโ and squash through an activation.
The result becomes the new hidden state hโ โ and can produce an output yโ.
Repeat down the whole sequence, then train with BPTT to nudge the shared weights.