Proposition 2I.9.P0231 of 100 in the corpus
Backpropagation through time accumulates shared gradients through a product of temporal Jacobians.
The recurrent matrix is shared, but each activation changes its local derivative. Long products can attenuate or amplify the backward signal; their norms and directions both matter.
Start at the loss, not at a product sign
Use the tanh cell of (I.9.1) and the summed loss of (I.9.2). Write and . If position has no local loss, set .
Two arrows leave : one to its readout, one to the next recurrent step. Reverse mode adds both returns. Since ,
The current loss and the future loss meet before the activation derivative.
Squares and are coordinatewise. The backward sweep evaluates (I.9.3) from down to . A mean loss or a fixed padding mask is already included in the definition of ; do not average the gradients a second time.
At one cell, a perturbation of produces . The local contribution is the outer product . Because all cells use the same matrix,
Each occurrence contributes to one shared parameter gradient.
The readout derivatives are and . The input derivative is . For a learned initial state, its derivative is . Regularisation would add another term to the parameter gradients.
Equations (I.9.3) and (I.9.4) prove I.9.T1. There is no extra learning rule peculiar to time. There is a graph, reused parameters, and the chain rule. I.9.B02 works every scalar contribution by hand.
Now isolate a distant loss
Let be the state-to-state Jacobian, holding inputs fixed:
The earliest Jacobian acts first, on the right of the forward product.
For a loss only at , the column gradient at is the transpose of the product in (I.9.5) times . For losses at many positions, add the contribution of each later loss. A locally supervised position can therefore receive a useful gradient even when a much later loss has almost no influence on it.
The weights repeat. The Jacobians generally do not: their diagonal activation factors depend on the actual inputs and states.
By applying repeatedly,
A uniform bound below one proves contraction; a bound above one does not prove explosion.
This proves I.9.T2. Since the tanh derivative is at most one, is a sufficient uniform contraction condition for this cell. It is not necessary: saturation may contract a trajectory even with a larger weight norm.
The figure shows a deliberately scalar special case with a constant multiplier. Across thirty steps, and . The first is small, not numerically identical to zero. Whether it is useful depends on the other gradients, numerical precision and optimiser.
A matrix needs more care than a scalar. Large singular values indicate directions of amplification, but the next matrix may contract those directions. Even eigenvalues strictly inside the unit circle do not exclude large finite-time amplification for a non-normal matrix. I.9.B03 constructs one. And alternating scalar factors and have a unit product every two steps, despite neither factor being one.
What clipping repairs
For a finite concatenated parameter gradient and threshold ,
One common scale factor preserves the direction across all parameter tensors.
Define the zero-gradient case separately as zero. Equation (I.9.7) bounds the norm by . With plain gradient descent, the update norm is at most . That does not directly bound an Adam update or a step containing momentum, weight decay or other terms.
Accumulate the intended gradient first, then clip, then apply the optimiser. Clipping each time step separately changes the sum. Clipping each tensor separately changes the direction of the concatenated gradient. I.9.X07 makes the difference numerical.
Clipping can control a finite oversized gradient. It cannot reconstruct information that already vanished, and it cannot make a non-finite computation reliable. A NaN needs a diagnosis, not a smaller threshold.
Truncation changes credit assignment
Full backpropagation retains the whole unrolled dependency. Truncated backpropagation detaches a carried state at a chunk boundary: the next chunk receives the same value, but treats it as a constant for that backward pass.
That omits cross-boundary derivatives. The forward model may still remember earlier inputs, but a later loss cannot teach the detached earlier computations what to retain across that boundary. The truncated gradient is generally not the full-sequence gradient.
In I.9.B05, the prediction stays and the loss stays , while a one-step truncation changes from to . For a finite-difference check of the truncated computation, freeze the boundary state. Recomputing it under every parameter perturbation checks the full graph instead.
A practical chunk loop starts with the correct stream’s state, runs the chunk, computes the valid-position loss, backpropagates, clips if required, and updates the parameters. Before the next chunk, detach the state; when the stream ends, reset it. If weights change between chunks, the carried value was computed with earlier weights. That is part of this training procedure, not exact full-sequence differentiation at one fixed parameter setting.
A different cell is a different path
LSTMs and GRUs learn gates controlling what to retain and replace. For the modern LSTM carry expression , holding the gate and candidate values fixed leaves a direct derivative . The total derivative can also include paths through those values.
This direct path explains the motivation, not a promise of perfect memory: forget factors below one can still attenuate information. Chapter I.10 owns the gate equations and their full backward pass. Here the requirement is to understand the failure they were designed to address.
Sources
Depends on
Used by
- I.10.P01 — A gate gives the gradient a road home that no weight matrix stands on.
- I.10.P02 — A gate slows the decay of a distant gradient; it does not abolish it.
- I.14.P03 — Repeated averaging forgets where it started, at a rate the graph's spectrum sets.
- II.8.P02 — Weight decay and gradient clipping guard different failures and do not substitute for each other.
Problems using this
- I.9.B02 — Every use of a weight contributessymbolic▲▲▲
- I.9.B03 — Small eigenvalues can hide a large transientcounterexample▲▲▲
- I.9.B05 — Same prediction, different backward graphgradient▲▲△
- I.9.X02 — Do not forget the activation derivativegradient▲△△
- I.9.X03 — Expand the memory of a linear cellsymbolic▲▲△
- I.9.X04 — Small does not mean rounded to zerolimit▲▲△
- I.9.X05 — Two large norms can make a contractioncounterexample▲▲△
- I.9.X07 — Clip the whole gradient oncenumeric▲△△
- I.BOOK.B02 — Three ways a gradient crosses many stepslimit▲▲△