Papers
Topics
Authors
Recent
Search
2000 character limit reached

Anticipated Reweighted TBPTT (ARTBP)

Updated 26 March 2026
  • 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 O(T)O(T) activations for a length-TT sequence and O(T)O(T) compute per update. The high cost of BPTT is addressed in practice by truncated BPTT, which computes gradients over fixed-length blocks of size LTL \ll T, carrying forward the hidden state but truncating the backward dependencies at block boundaries. However, truncation introduces bias by omitting contributions from losses more than LL 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 tt, a Bernoulli variable XtX_t determines whether to truncate between tt and t+1t+1. The (possibly conditional) truncation probability is ct=Pr[Xt=1X1:t1]c_t = \Pr[X_t=1 \mid X_{1:t-1}]. The waiting time between cuts is sampled from a distribution with prescribed mean L0L_0 and optional power-law tail, e.g.,

ct=α1(α2)L0+(tτt),α>3c_t = \frac{\alpha - 1}{(\alpha - 2)L_0 + (t - \tau_t)}, \quad \alpha > 3

where τt\tau_t 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 1/(1ct)1/(1 - c_t). The modified ARTBP recurrence is:

~t={s(st)if Xt=1 or t=T 11ct~t+1Fs(xt+1,st,θ)+s(st)if Xt=0\tilde\ell_t = \begin{cases} \dfrac{\partial \ell}{\partial s}(s_t) & \text{if } X_t=1 \text{ or } t=T \ \frac{1}{1 - c_t} \, \tilde\ell_{t+1} \, \frac{\partial F}{\partial s}(x_{t+1}, s_t, \theta) + \frac{\partial \ell}{\partial s}(s_t) & \text{if } X_t = 0 \end{cases}

The resulting parameter gradient estimator is

g~=t=1T~tFθ(xt,st1,θ)\tilde{g} = \sum_{t=1}^T \tilde\ell_t \frac{\partial F}{\partial\theta}(x_t, s_{t-1}, \theta)

Backward induction shows that this estimator is unbiased: E[g~]=θLT\mathbb{E}[\tilde g] = \nabla_\theta \mathcal{L}_T. 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 L0L_0. The backward accumulator at each timestep uses the compensation factors mtm_t as follows:

~t=s(st)+mt~t+1Fs(xt+1,st,θ)\tilde\ell_t = \frac{\partial\ell}{\partial s}(s_t) + m_t \tilde\ell_{t+1} \frac{\partial F}{\partial s}(x_{t+1}, s_t, \theta)

with

mt={0Xt=1 11ctXt=0 and t<T 0t=Tm_t = \begin{cases} 0 & X_t=1 \ \frac{1}{1 - c_t} & X_t=0 \text{ and } t<T \ 0 & t=T \end{cases}

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 ẑ
Only the buffer for the current random segment is required, matching the efficiency profile of truncated BPTT with mean segment length L0L_0.

4. Computational Properties and Trade-offs

ARTBP offers time per step and memory requirements proportional to those of truncated BPTT using block size L0L_0. The additional cost is a single multiplication by 1/(1ct)1/(1 - c_t) per backward step. Storage is required only for the activations and Jacobians within the current segment. The variance of the estimated gradient increases as L0L_0 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 L0L_0 and the tail parameter α\alpha 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 {ct}\{c_t\}, 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 p+np + n agents with state diffusion, loss is measured as 12(st11)2\frac{1}{2}(s_t^1-1)^2. This task is chosen so that correct balancing of long- and short-term influences is required. Truncated BPTT with L=10,100,200L=10, 100, 200 diverges unless LL exceeds the true dependency length by a substantial margin. ARTBP, with L0=16,α=6L_0=16, \alpha=6, converges in all trials, highlighting practical robustness.
  • Penn Treebank Character-Level Language Modeling: On a single-layer LSTM (batch size 64), truncated BPTT (fixed L=50L=50) and ARTBP (mean L0=50L_0=50, α=4\alpha=4) are compared. Using Adam at learning rate 10410^{-4}, 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: L=10,100,200L=10,100,200; ARTBP: L0=16L_0=16 BPTT: divergence; ARTBP: convergence
Penn Treebank (character LSTM) BPTT: L=50L=50; ARTBP: L0=50L_0=50 BPTT: ≈1.43 bpc; ARTBP: ≈1.40 bpc

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 O(L0)O(L_0) 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 α\alpha or the sequence {ct}\{c_t\} 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.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Anticipated Reweighted TBPTT (ARTBP).