An RNN (recurrent neural network) is the fundamental model for sequential data, defined by weight sharing across time steps. The hidden-state recurrence
ht=tanh(Whhht−1+Wxhxt+bh) with output
yt=Whyht reuses the same
Whh,Wxh at every step, unlike the layer-wise weights of DNNs/CNNs. Training uses BPTT (backpropagation through time): unroll the temporal dimension into a
T-layer virtual network and backpropagate, so the gradient flows through the chain product
∂h1∂hT=∏t=2T∂ht−1∂ht=∏t=2TWhhTdiag(tanh′(ht−1)) — exactly why gradients vanish or explode: if the spectral radius
ρ(Whh)<1 the product decays exponentially (
0.950≈0.005) and dependencies 50 steps apart are essentially unlearnable; if
>1 gradients explode. This is the long-term dependency problem.