Backpropagation Through Time

Backpropagation through time, or BPTT, is backpropagation on the unrolled RNN graph.

The loss at later steps can send gradients back through earlier hidden states. That is how earlier tokens can receive training signal from later predictions.

The phrase sounds special, but the core idea is familiar:

unroll repeated computation
compute loss
backpropagate through the unrolled graph

The challenge is path length. Gradients may need to travel through many repeated steps, which can make training unstable or weak for long dependencies.

Exercise

If an unrolled graph has 4 time steps, through how many steps might a gradient from the final loss travel to reach the first step?

Compute it first, then check your number.