Abstract
Truncated Backpropagation Through Time (truncated BPTT) is a widespread method for learning recurrent computational graphs. Truncated BPTT keeps the computational benefits of Backpropagation Through Time (BPTT) while relieving the need for a complete backtrack through the whole data sequence at every step. However, truncation favors short-term dependencies: the gradient estimate of truncated BPTT is biased, so that it does not benefit from the convergence guarantees from stochastic gradient theory. We introduce Anticipated Reweighted Truncated Backpropagation (ARTBP), an algorithm that keeps the computational benefits of truncated BPTT, while providing unbiasedness. ARTBP works by using variable truncation lengths together with carefully chosen compensation factors in the backpropagation equation. We check the viability of ARTBP on two tasks. First, a simple synthetic task where careful balancing of temporal dependencies at different scales is needed: truncated BPTT displays unreliable performance, and in worst case scenarios, divergence, while ARTBP converges reliably. Second, on Penn Treebank character-level language modelling, ARTBP slightly outperforms truncated BPTT.
The Problem: Bias in Truncated BPTT
Training Recurrent Neural Networks (RNNs) on very long sequences is a computational challenge. Standard Backpropagation Through Time (BPTT) requires unfolding the network for every single timestep, leading to massive memory usage and slow updates. To solve this, practitioners use Truncated BPTT (TBPTT), which chops the sequence into fixed-length blocks and only propagates gradients within those blocks.
While efficient, TBPTT has a major flaw: it is biased. It implicitly assumes that dependencies beyond the truncation length do not exist. In systems where a small action now has a significant impact much later, TBPTT can fail to converge or even diverge because it calculates gradients with the wrong sign, favoring short-term gains over long-term stability.
Anticipated Reweighted Truncated Backpropagation (ARTBP)
To address this, the authors propose Anticipated Reweighted Truncated Backpropagation (ARTBP). The core idea is to transform truncation from a fixed heuristic into a stochastic process that yields an unbiased gradient estimate.
ARTBP relies on two main mechanisms:
- Variable Truncation: Instead of truncating every $L$ steps, ARTBP decides whether to truncate at each step $t$ with a probability $c_t$.
- The Compensation Factor: If the algorithm decides not to truncate at a specific step, it multiplies the gradient flowing through that step by a factor of $\frac{1}{1-c_t}$.
Mathematically, this scaling ensures that the expected value of the truncated gradient equals the true, full-sequence gradient. Essentially, the rare long-distance gradients are "boosted" to compensate for the fact that they are often cut off. This allows ARTBP to maintain the computational efficiency of truncation while providing the convergence guarantees of unbiased stochastic gradient descent.
Experimental Evaluation
Influence Balancing (Synthetic Task)
The paper first evaluates ARTBP on a toy problem designed to break TBPTT. In this task, a parameter has a positive short-term effect but a larger negative long-term effect. To succeed, the model must correctly account for the long-term impact.
In this experiment, TBPTT (even with lengths up to 100) completely diverged, failing to learn the negative long-term influence. In contrast, ARTBP converged reliably every time, even with a modest average truncation length of 16. This demonstrates that TBPTT can be dangerous when the biased gradient points the optimizer in the wrong direction.
Language Modeling
On the Penn Treebank (PTB) benchmark for character-level language modeling, ARTBP slightly outperformed TBPTT on the validation and test sets (1.40 bits-per-character vs. 1.43 bpc). Interestingly, TBPTT had lower training loss, suggesting that the unbiased gradients of ARTBP might act as a form of regularization that improves generalization.
Conclusion
ARTBP offers a way to trade the systematic bias of TBPTT for manageable variance. While ARTBP introduces stochastic noise, it ensures that the model remains sensitive to long-term dependencies that TBPTT would otherwise ignore. This makes it a robust alternative for training RNNs on sequences where long-range temporal dynamics are critical.
Summary updated