Skip to main content

Sequences: Learning the Summary

While earlier parts relied on fixed-size coordinate grids or static bottlenecks, for sequential data we now seek an incremental computation that updates its internal representation as each new element arrives. Here we maintain a fixed-width state vector and learn a parameterized transition rule to update it across time. The same transition parameters are applied at every step, extending weight sharing from spatial coordinates to the temporal dimension. A longer sequence requires more applications of the rule rather than additional parameters. This recurrence also deepens the backward computation: repeated Jacobian products across many steps can cause gradients to vanish or explode. Gated architectures counter vanishing gradients through additive state paths and learned retention gates. We will examine how these gating mechanisms and their parameter initialization affect whether a network can retain and learn from evidence that arrived dozens of steps earlier.

A recurrent encoder and decoder can then connect sequences of different lengths, as in machine translation. The training and decoding rules carry over to the sequence decoders of Parts IV and V. With teacher forcing, the decoder reads the observed target shifted by one token, and the loss combines token-level log-likelihoods. Separate masks control which positions the loss grades and which inputs a network may read, and search or sampling produces the output. In the baseline architecture developed here, all source information reaches the decoder exclusively through the encoder’s final state. Although the recurrent transition rule accommodates variable lengths, that one fixed-size summary remains an information bottleneck for long sequences. Part IV bypasses this single-state handoff by introducing attention, giving the decoder direct, selective access to the encoder states at every position.