Papers › Adaptively Truncating Backpropagation Through Time to Control Gradient Bias

Adaptively Truncating Backpropagation Through Time to Control Gradient Bias

17 May 2019arXiv:1905.07473archive 2025-07-28

Christopher Aicher, Nicholas J. Foti, Emily B. Fox

Truncated backpropagation through time (TBPTT) is a popular method for learning in recurrent neural networks (RNNs) that saves computation and memory at the cost of bias by truncating backpropagation after a fixed number of lags. In practice, choosing the optimal truncation length is difficult: TBPTT will not converge if the truncation length is too small, or will converge slowly if it is too large. We propose an adaptive TBPTT scheme that converts the problem from choosing a temporal lag to one of choosing a tolerable amount of gradient bias. For many realistic RNNs, the TBPTT gradients decay geometrically in expectation for large lags; under this condition, we can control the bias by varying the truncation length adaptively. For RNNs with smooth activation functions, we prove that this bias controls the convergence rate of SGD with biased gradients for our non-convex loss. Using this theory, we develop a practical method for adaptively estimating the truncation length during training. We evaluate our adaptive TBPTT method on synthetic data and language modeling tasks and find that our adaptive TBPTT ameliorates the computational pitfalls of fixed TBPTT.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 21 code samples harvested from 1 repository linked to this paper: 18 ran (of which 0 constructed an object rather than computing a result; 18 with no instrument failure: 0 honoured, 0 violated, 18 with no contract checked; 0 where Syntology's instrument failed) · 3 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code; here there are none.

By repository: official repository: 21 samples from 1 repository, 18 ran (18 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written on 2026-09-25 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

aicherc/adaptive_tbptt officialmentioned in papermentioned on GitHubpytorchMITSyntology: 21 samples, 18 ran (0 instrument-failed) · 3 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

21 samples harvested: 18 ran (of which 0 constructed an object rather than computing a result; 18 with no instrument failure: 0 honoured, 0 violated, 18 with no contract checked; 0 where Syntology's instrument failed) · 3 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

18ran
3unverified

Licence: 0 of the 21 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from aicherc/adaptive_tbptt. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

aicherc/adaptive_tbptt official repository 21 samples, 18 ran (0 instrument-failed) · 3 unverified
beta_est_method_to_params experiments/synth_script.py ran MIT (permissive) · f01e1ff3d3042d96 · report fixture: signature beta_estimate_method:str/0/str · returned dict · level recorded 2026-09-25
calculate_elementwise_gradients tbptt/adaptive_truncation.py ran MIT (permissive) · ed8aa9f6bc5882f9 · report fixture: returned dict · level recorded 2026-09-25
calculate_gradient_norms tbptt/adaptive_truncation.py ran MIT (permissive) · 180ab5fb456bcc2c · report fixture: returned tuple · level recorded 2026-09-25
convert_dict_to_arg_string experiments/script_maker.py ran MIT (permissive) · 3e24b02cec0c8000 · report fixture: signature arg_dict:dict/0/?, sep:str/0/str · returned str · level recorded 2026-09-25
generate_copy_sequence tbptt/generate_data.py ran MIT (permissive) · df25a42af64b0733 · report fixture: signature seq_len:int/0/int, batch_size:int/0/int, num_states:int/0/int, lag:int/0/int, min_lag:int/0/int · returned dict · level recorded 2026-09-25
generate_repeating_sequence tbptt/generate_data.py ran MIT (permissive) · b09f8ae9eca73a81 · report fixture: signature seq_len:int/0/int, batch_size:int/0/int, input_size:int/0/int, output_size:int/0/int, grow:bool/0/bool, lag:int/0/int, base_seq_length:int/0/int · returned dict · level recorded 2026-09-25
get_batch in 82 papers experiments/language_script.py ran MIT (permissive) · 488b1c7ff2dceb72 · report fixture: signature source:Tensor/2/int, start:int/0/int, seq_len:int/0/int · returned tuple · level recorded 2026-09-25
get_batch in 82 papers experiments/synth_script.py ran MIT (permissive) · b4a2dfd91c6a713c · report fixture: signature source:dict/0/?, start:int/0/int, seq_len:int/0/int · returned tuple · level recorded 2026-09-25
log_boxplot tbptt/plotting_utils.py ran MIT (permissive) · 8aa6056df6fad7cf · report fixture: signature data:ndarray/3/float, max_lag:int/0/int, ax:NoneType/0/? · returned Axes · level recorded 2026-09-25
log_heatmap tbptt/plotting_utils.py ran MIT (permissive) · 0e40a0fc6ff21389 · report fixture: signature data:ndarray/2/float, log10_vmin:NoneType/0/?, log10_vmax:NoneType/0/?, num_ticks:int/0/int · returned Axes · level recorded 2026-09-25
log_lineplot tbptt/plotting_utils.py ran MIT (permissive) · 385348b104576a5e · report fixture: signature data:ndarray/3/float, max_lag:int/0/int, trace:bool/0/bool, ax:Axes/0/? · returned Axes · level recorded 2026-09-25
process_data in 61 papers experiments/temporal_pp_model.py ran MIT (permissive) · 5ef6d0018f789dd0 · report fixture: signature path_to_event:str/0/str, path_to_time:str/0/str, time_scale:float/0/float · returned tuple · level recorded 2026-09-25
process_data_onehot experiments/temporal_pp_model.py ran MIT (permissive) · 3ffead363144b94d · report fixture: signature path_to_event:str/0/str, path_to_time:str/0/str, time_scale:float/0/float · returned tuple · level recorded 2026-09-25
setup_copy_fixed_memory_script experiments/script_maker.py ran fingerprinted MIT (permissive) · 73e9cbd44b3d4d2d · report fixture: signature path_to_scripts:str/0/str, experiment_id:int/0/int, num_splits:int/0/int · returned int · level recorded 2026-09-25
setup_copy_variable_memory_script experiments/script_maker.py ran MIT (permissive) · 7b3bab5b88fb01d2 · report fixture: returned int · level recorded 2026-09-25
stochastic_subset experiments/language_script.py ran fingerprinted MIT (permissive) · 5eacf6bc5dfa2fc4 · report fixture: signature source:Tensor/2/float, seq_len:int/0/int · returned tuple · level recorded 2026-09-25
stochastic_subset experiments/synth_script.py ran MIT (permissive) · 9db61e1f7611e72d · report fixture: signature source:dict/0/?, seq_len:int/0/int · returned tuple · level recorded 2026-09-25
stochastic_subset experiments/temporal_pp_script.py ran MIT (permissive) · b047609c78c58868 · report fixture: signature source:dict/0/?, seq_len:int/0/int · returned tuple · level recorded 2026-09-25
TPP_y_loss experiments/temporal_pp_model.py unverified MIT (permissive) · 1a697a4f5733df42 · report
calculate_component_gradient_norms tbptt/adaptive_truncation.py unverified MIT (permissive) · 79a84db2ebe166bc · report
generate_linear_seq tbptt/generate_data.py unverified MIT (permissive) · 7e93cbc251f3eaed · report

Tasks

Language ModelingLanguage Modelling

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SGD

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections