Anticipated Reweighted TBPTT (ARTBP)
- The paper introduces ARTBP, which eliminates bias in truncated BPTT by randomizing truncation lengths and applying compensation factors.
- ARTBP maintains memory and computational efficiency while accurately capturing long-term dependencies through unbiased gradient estimation.
- Empirical results on synthetic tasks and language modeling demonstrate ARTBP’s reliable convergence and improved performance over standard truncated BPTT.
Anticipated Reweighted Truncated Backpropagation (ARTBP) is an algorithm for gradient estimation in recurrent computational graphs that preserves the computational and memory efficiency of Truncated Backpropagation Through Time (truncated BPTT) while restoring unbiasedness to the gradient estimates. ARTBP is designed to address the inherent bias present in truncated BPTT—particularly its inability to capture long-term dependencies in sequence modeling—by randomizing truncation lengths and applying carefully chosen compensation factors that ensure unbiased stochastic gradients. This allows ARTBP to come with standard stochastic gradient convergence guarantees while maintaining scalable resource requirements (Tallec et al., 2017).
1. Motivation and Historical Context
Backpropagation Through Time (BPTT) is the canonical method to compute exact gradients in recurrent models by unrolling the computation graph over all timesteps, requiring activations for a length- sequence and compute per update. The high cost of BPTT is addressed in practice by truncated BPTT, which computes gradients over fixed-length blocks of size , carrying forward the hidden state but truncating the backward dependencies at block boundaries. However, truncation introduces bias by omitting contributions from losses more than timesteps in the future. This destroys the guarantees offered by unbiased stochastic gradient methods and can lead to divergence, particularly when long-term dependencies significantly impact the loss (Tallec et al., 2017).
ARTBP was introduced by Tallec & Ollivier to eliminate this bias while maintaining tractable memory and computation scaling, exploiting randomized truncation and importance weighting to unbiasedly estimate gradients.
2. Algorithmic Structure and Theoretical Foundation
ARTBP replaces fixed-length truncations with a random process: at each timestep , a Bernoulli variable determines whether to truncate between and . The (possibly conditional) truncation probability is . The waiting time between cuts is sampled from a distribution with prescribed mean and optional power-law tail, e.g.,
where is the most recent previous truncation.
To preserve unbiasedness, every time the backward flow of gradients is preserved across a non-truncated timestep, the message is amplified by a factor . The modified ARTBP recurrence is:
The resulting parameter gradient estimator is
Backward induction shows that this estimator is unbiased: . This is a direct consequence of an importance sampling logic over the possible paths determined by the random truncation (Tallec et al., 2017).
3. Practical Implementation and Pseudocode
In a concrete implementation, gradients are computed over random-length segments with memory and compute cost proportional to the average segment length . The backward accumulator at each timestep uses the compensation factors as follows:
with
ARTBP pseudocode (from (Tallec et al., 2017)):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
Algorithm: ARTBP (one pass over sequence of length T) Input: parameters θ, inputs x₁:T, targets o₁:T truncation probabilities c₁:T Output: unbiased estimate ẑ of ∂ℒ_T/∂θ 1. Forward pass: compute states s₀=initial, then for t=1..T s_t ← F(x_t, s_{t-1}; θ) ℓ_t^out ← ∂ℓ/∂s (s_t, o_t) 2. Initialize backward accumulator: ẽ_{T+1} ← 0 3. For t = T downto 1: Sample X_t ∼ Bernoulli(c_t) if X_t = 1 or t=T: m_t ← 0 else: m_t ← 1/(1 - c_t) end if ẽ_t ← ℓ_t^out + m_t ⋅ [ẽ_{t+1} ⋅ ∂F/∂s (x_{t+1},s_t; θ)] ẑ ← ẑ + ẽ_t ⋅ ∂F/∂θ (x_t, s_{t-1}; θ) end for Return ẑ |
4. Computational Properties and Trade-offs
ARTBP offers time per step and memory requirements proportional to those of truncated BPTT using block size . The additional cost is a single multiplication by per backward step. Storage is required only for the activations and Jacobians within the current segment. The variance of the estimated gradient increases as decreases, since compensation factors can become large for long surviving backward messages. Larger average segment lengths reduce variance but increase computational cost and memory.
There is a tunable trade-off between memory/compute and estimation variance, controlled by and the tail parameter of the cut distribution. This allows ARTBP to interpolate between truncated BPTT and standard BPTT, with precise quantitative control (Tallec et al., 2017).
5. Convergence Guarantees and Theoretical Properties
Because its gradient estimates are unbiased under any truncation probability schedule , ARTBP inherits convergence properties from standard stochastic gradient methods. Under classical assumptions of Lipschitz continuity and smoothness for the loss and model, ARTBP’s iterates converge almost surely to stationary points of the objective. No adversarial bias can accumulate across updates, in contrast to truncated BPTT, which is subject to persistent bias and is susceptible to divergence even in convex problems (Tallec et al., 2017).
6. Empirical Results and Benchmarks
Empirical evaluation in (Tallec et al., 2017) demonstrates the efficacy of ARTBP in two distinct tasks:
- Synthetic Influence Balancing Task: In a linear chain of agents with state diffusion, loss is measured as . This task is chosen so that correct balancing of long- and short-term influences is required. Truncated BPTT with diverges unless exceeds the true dependency length by a substantial margin. ARTBP, with , converges in all trials, highlighting practical robustness.
- Penn Treebank Character-Level Language Modeling: On a single-layer LSTM (batch size 64), truncated BPTT (fixed ) and ARTBP (mean , ) are compared. Using Adam at learning rate , ARTBP achieves lower validation and test bits-per-character (≈1.40 bpc) than truncated BPTT (≈1.43 bpc), with similar training performance. This confirms the utility of unbiased estimation in capturing longer-range dependencies relevant for sequence modeling.
The following table summarizes key empirical configurations and results:
| Task | Truncation (BPTT/ARTBP) | Validation/Test Metric |
|---|---|---|
| Influence Balancing (synthetic) | BPTT: ; ARTBP: | BPTT: divergence; ARTBP: convergence |
| Penn Treebank (character LSTM) | BPTT: ; ARTBP: | BPTT: ≈1.43 bpc; ARTBP: ≈1.40 bpc |
7. Related Methods and Future Directions
ARTBP occupies an intermediate position between full BPTT and fully-online methods such as UORO and NoBackTrack. It achieves unbiasedness via randomized truncation and importance weighting, requiring memory—less than BPTT but more than fully online methods, and introduces no additional noise beyond that arising from the compensation factors.
Potential extensions include adaptive truncation schedules based on gradient norms, integration with variance reduction strategies such as control variates, or non-uniform sampling to emphasize long-range dependencies. Tuning the tail-parameter or the sequence allows practitioners to customize the method to the memory and variance budget appropriate for their application (Tallec et al., 2017).
A plausible implication is that ARTBP offers a tractable pathway to deploying unbiased stochastic gradient learning in settings with severe sequence length or memory constraints, without forfeiting theoretical soundness or suffering systematic estimation bias.