SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1905.07473 · 2019

Adaptively Truncating Backpropagation Through Time to Control Gradient Bias

arXiv · PDF · Open in the Atlas

Code that ran

18 of 21 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 18 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1905.07473.json · badge: /api/ran/1905.07473.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
aicherc/adaptive_tbptt canonical (classifier label)
classifier basis: census
18 ran · 3 no recorded run
FunctionStatusWhere it lives
beta_est_method_to_params Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/synth_script.py
code served (permissive licence) · get_code("f01e1ff3d3042d96")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

# Set seed for reproducibility
torch.manual_seed(0)

# The function takes a single parameter: beta_estimate_method
# which should be a string that is one of: 'max', 'max-post', 'ols', 'ols-post', 'quantile'

ARGS = {
    'beta_estimate_method': 'max'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_elementwise_gradients Ran
ran on a synthesized input
aicherc/adaptive_tbptt/tbptt/adaptive_truncation.py
code served (permissive licence) · get_code("ed8aa9f6bc5882f9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Define a simple RNN module that the function expects
class SimpleRNN(nn.Module):
    def __init__(self, input_size, hidden_size, output_size, num_layers=1):
        super().__init__()
        self.input_size = input_size
        self.hidden_size = hidden_size
        self.output_size = output_size
        self.num_layers = num_layers
        
        self.rnn = nn.LSTM(input_size, hidden_size, num_layers, batch_first=False)
        self.linear = nn.Linear(hidden_size, output_size)
    
    def forward(self, x, state):
        """
        Args:
            x: (seq_len, batch, input_size) - typically seq_len=1 for single step
            state: tuple of (h, c) or just h
        Returns:
            output: (seq_len, batch, output_size)
            new_state: tuple of (h, c) or just h
        """
        output, new_state = self.rnn(x, state)
        output = self.linear(output)
        return output, new_state
    
    def named_parameters_of_interest(self):
        """Return named parameters for gradient calculation"""
        return self.named_parameters()

# Create tiny dimensions with distinct sizes
seq_len = 8
batch_size = 2
input_size = 3
hidden_size = 4
output_size = 5
num_layers = 1

# Create input and output tensors
X = torch.randn(seq_len, batch_size, input_size)
Y = torch.randn(seq_len, batch_size, output_size)

# Create initial state (LSTM uses tuple of h and c)
h_init = torch.randn(num_layers, batch_size, hidden_size)
c_init = torch.randn(num_layers, batch_size, hidden_size)
init_state = (h_init, c_init)

# Create RNN module
rnn_module = SimpleRNN(input_size, hidden_size, output_size, num_layers)

# Create loss module
loss_module = nn.MSELoss()

# Helper function to detach state (the function calls this internally)
def _detach_state(state, requires_grad=False):
    if isinstance(state, tuple):
        return tuple(s.detach().requires_grad_(requires_grad) for s in state)
    else:
        return state.detach().requires_grad_(requires_grad)

# Inject the helper into the module's namespace
import sys
current_module = sys.modules[__name__]
setattr(current_module, '_detach_state', _detach_state)

ARGS = {
    'X': X,
    'Y': Y,
    'init_state': init_state,
    'rnn_module': rnn_module,
    'loss_module': loss_module,
    'stride_size': 1,
    'tqdm': None,
    'tqdm_message': 'calc_grad_norms',
    'include_param': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
calculate_gradient_norms Ran
ran on a synthesized input
aicherc/adaptive_tbptt/tbptt/adaptive_truncation.py
code served (permissive licence) · get_code("180ab5fb456bcc2c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Define a simple RNN module
class SimpleRNN(nn.Module):
    def __init__(self, input_size, hidden_size, output_size, num_layers=1):
        super(SimpleRNN, self).__init__()
        self.input_size = input_size
        self.hidden_size = hidden_size
        self.output_size = output_size
        self.num_layers = num_layers
        self.rnn = nn.LSTM(input_size, hidden_size, num_layers, batch_first=False)
        self.linear = nn.Linear(hidden_size, output_size)
    
    def forward(self, x, state):
        # x: (seq_len, batch, input_size)
        # state: tuple of (h, c) each (num_layers, batch, hidden_size)
        y_hat, new_state = self.rnn(x, state)
        # y_hat: (seq_len, batch, hidden_size)
        output = self.linear(y_hat)
        # output: (seq_len, batch, output_size)
        return output, new_state

# Small dimensions to keep things fast
seq_len = 10
batch_size = 2
input_size = 4
hidden_size = 3
output_size = 5
num_layers = 1

# Create tensors
X = torch.randn(seq_len, batch_size, input_size)
Y = torch.randn(seq_len, batch_size, output_size)

# Initial state (LSTM uses tuple of h and c)
init_h = torch.randn(num_layers, batch_size, hidden_size)
init_c = torch.randn(num_layers, batch_size, hidden_size)
init_state = (init_h, init_c)

# Create RNN module
rnn_module = SimpleRNN(input_size, hidden_size, output_size, num_layers)

# Create loss module
loss_module = nn.MSELoss()

# Helper function to detach state with requires_grad
def _detach_state(state, requires_grad=False):
    if isinstance(state, tuple):
        return tuple(s.detach().requires_grad_(requires_grad) for s in state)
    else:
        return state.detach().requires_grad_(requires_grad)

# Inject the helper into the function's namespace
import sys
current_module = sys.modules[__name__]
setattr(current_module, '_detach_state', _detach_state)

ARGS = {
    'X': X,
    'Y': Y,
    'init_state': init_state,
    'rnn_module': rnn_module,
    'loss_module': loss_module,
    'stride_size': 1,
    'cum_grad_norm_approx': False,
    'tqdm': None,
    'tqdm_message': 'calc_grad_norms'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
convert_dict_to_arg_string Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/script_maker.py
code served (permissive licence) · get_code("3e24b02cec0c8000")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import pandas as pd
import numpy as np

# Test case 1: arg_dict with None value
arg_dict_1 = {
    'flag1': None,
    'flag2': True,
    'param1': 'value1',
    'param2': 42
}

# Test case 2: arg_dict with boolean values
arg_dict_2 = {
    'enable': True,
    'disable': False,
    'count': 100,
    'name': 'test'
}

# Test case 3: arg_dict with NaN values
arg_dict_3 = {
    'na_param': np.nan,
    'normal_param': 'data',
    'flag': True,
    'empty': None
}

# Test case 4: arg_dict with custom separator
arg_dict_4 = {
    'key1': 'val1',
    'key2': 123,
    'bool_flag': True,
    'none_flag': None
}

# Use the simplest test case for ARGS
ARGS = {
    'arg_dict': {
        'verbose': True,
        'output': 'result.txt',
        'count': 5,
        'debug': False,
        'skip': None,
        'threshold': 0.75
    },
    'sep': ' '
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
generate_copy_sequence Ran
ran on a synthesized input
aicherc/adaptive_tbptt/tbptt/generate_data.py
code served (permissive licence) · get_code("df25a42af64b0733")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    "seq_len": 16,
    "batch_size": 2,
    "num_states": 5,
    "lag": 4,
    "min_lag": 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
generate_repeating_sequence Ran
ran on a synthesized input
aicherc/adaptive_tbptt/tbptt/generate_data.py
code served (permissive licence) · get_code("b09f8ae9eca73a81")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    'seq_len': 20,
    'batch_size': 2,
    'input_size': 4,
    'output_size': 4,
    'grow': True,
    'lag': 1,
    'base_seq_length': 10,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_batch Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/language_script.py
code served (permissive licence) · get_code("488b1c7ff2dceb72")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# source needs to support indexing and have a shape attribute
# The function uses source[start:start + seq_len] and source[start + 1:start + 1 + seq_len]
# and checks source.shape[0]
# So source should be a tensor with at least seq_len + 1 elements along dimension 0

source = torch.randint(0, 10, (10, 4))  # Shape: (10, 4) - 10 time steps, 4 features
start = 2
seq_len = 5

ARGS = {
    "source": source,
    "start": start,
    "seq_len": seq_len,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_batch Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/synth_script.py
code served (permissive licence) · get_code("b4a2dfd91c6a713c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Construct a source dict with 'X' and 'Y' tensors
# The function accesses source['X'] and source['Y'] and indexes them with [start:start + seq_len]
# X and Y should have matching first dimension (sequence length)
source = {
    'X': torch.randn(10, 4),  # shape (10, 4) - 10 time steps, 4 features
    'Y': torch.randn(10, 3)   # shape (10, 3) - 10 time steps, 3 output features
}

# Parameters for get_batch
start = 2
seq_len = 5

ARGS = {
    'source': source,
    'start': start,
    'seq_len': seq_len
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
log_boxplot Ran
ran on a synthesized input
aicherc/adaptive_tbptt/tbptt/plotting_utils.py
code served (permissive licence) · get_code("8aa6056df6fad7cf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Axes. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

# Create a 2D data array (matrix of gradients or losses)
# Shape: (10, 10) - 10x10 matrix for diagonal extraction
data_2d = np.random.rand(10, 10) + 0.1  # Add 0.1 to avoid log of very small numbers

# Create a 3D data array (batched matrices)
# Shape: (10, 10, 2) - 10x10 matrices for 2 batches
data_3d = np.random.rand(10, 10, 2) + 0.1

ARGS = {
    'data': data_3d,
    'max_lag': 20,
    'ax': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, pandas, seaborn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Axes — a Axes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Axes output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
log_heatmap Ran
ran on a synthesized input
aicherc/adaptive_tbptt/tbptt/plotting_utils.py
code served (permissive licence) · get_code("0e40a0fc6ff21389")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Axes. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import seaborn as sns
from matplotlib.colors import LogNorm

# Create sample data with positive values suitable for log scale
np.random.seed(0)
data = np.random.lognormal(mean=0, sigma=2, size=(4, 5))

# Ensure we have some finite positive values
data = np.abs(data) + 0.01

ARGS = {
    'data': data,
    'log10_vmin': None,
    'log10_vmax': None,
    'num_ticks': 5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, seaborn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Axes — a Axes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Axes output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
log_lineplot Ran
ran on a synthesized input
aicherc/adaptive_tbptt/tbptt/plotting_utils.py
code served (permissive licence) · get_code("385348b104576a5e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Axes. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns

# Create sample data for the function
# The function expects either 2D or 3D numpy arrays
# It extracts diagonals at different lags and computes log10 of absolute values

# 2D case: shape (rows, cols)
data_2d = np.random.rand(10, 8) + 0.1  # Add 0.1 to avoid log10(0)

# 3D case: shape (rows, cols, batches)
data_3d = np.random.rand(10, 8, 3) + 0.1  # (10, 8, 3) with batch dimension

# Create a matplotlib figure and axis for optional ax parameter
fig, ax_obj = plt.subplots(1, 1)

# Define arguments for the function
ARGS = {
    'data': data_3d,  # Using 3D data to test the batch processing path
    'max_lag': 5,      # Test with a smaller max_lag
    'trace': False,    # Start with trace=False for cleaner output
    'ax': ax_obj       # Provide an explicit axis
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, pandas, seaborn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Axes — a Axes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Axes output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
process_data Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/temporal_pp_model.py
code served (permissive licence) · get_code("5ef6d0018f789dd0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import tempfile
import os

# Create temporary files with event and time data
temp_dir = tempfile.mkdtemp()

# Create event file with integer events
event_file = os.path.join(temp_dir, "events.txt")
with open(event_file, 'w', encoding='utf8') as f:
    f.write("1 2 3 2\n")
    f.write("2 1 3\n")

# Create time file with floating point times
time_file = os.path.join(temp_dir, "times.txt")
with open(time_file, 'w', encoding='utf8') as f:
    f.write("0.0 1.5 3.2 4.1\n")
    f.write("0.0 2.1 5.3\n")

ARGS = {
    'path_to_event': event_file,
    'path_to_time': time_file,
    'time_scale': 1.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
process_data_onehot Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/temporal_pp_model.py
code served (permissive licence) · get_code("3ffead363144b94d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import tempfile
import os

# Create temporary files with event and time data
temp_dir = tempfile.mkdtemp()

# Create event file: space-separated integers (1-indexed event IDs)
event_file = os.path.join(temp_dir, 'events.txt')
with open(event_file, 'w', encoding='utf8') as f:
    f.write("1 2 3 2\n")
    f.write("2 1 3\n")

# Create time file: space-separated floats (timestamps)
time_file = os.path.join(temp_dir, 'times.txt')
with open(time_file, 'w', encoding='utf8') as f:
    f.write("0.0 1.5 3.2 4.1\n")
    f.write("0.0 2.3 5.1\n")

ARGS = {
    'path_to_event': event_file,
    'path_to_time': time_file,
    'time_scale': 1.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
setup_copy_fixed_memory_script Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/script_maker.py
code served (permissive licence) · get_code("73e9cbd44b3d4d2d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Setup temporary directories for the script
temp_dir = tempfile.mkdtemp()
scripts_dir = os.path.join(temp_dir, 'scripts')
output_dir = os.path.join(temp_dir, 'output')
data_dir = os.path.join(temp_dir, 'data')
experiments_dir = os.path.join(temp_dir, 'experiments')

os.makedirs(scripts_dir, exist_ok=True)
os.makedirs(output_dir, exist_ok=True)
os.makedirs(data_dir, exist_ok=True)
os.makedirs(experiments_dir, exist_ok=True)

# Create minimal dummy files that the function references
with open(os.path.join(experiments_dir, 'synth_script.py'), 'w') as f:
    f.write('# dummy script\n')

with open(os.path.join(experiments_dir, 'aggregate_output.py'), 'w') as f:
    f.write('import sys\nfor arg in sys.argv:\n    pass\n')

with open(os.path.join(data_dir, 'copy_fixed'), 'w') as f:
    f.write('dummy data\n')

# Change to temp directory so relative paths work
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'path_to_scripts': scripts_dir,
    'experiment_id': 0,
    'num_splits': 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
setup_copy_variable_memory_script Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/script_maker.py
code served (permissive licence) · get_code("7b3bab5b88fb01d2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create temporary directories for the function to work with
temp_dir = tempfile.mkdtemp()
scripts_dir = os.path.join(temp_dir, 'scripts')
output_dir = os.path.join(temp_dir, 'output')
data_dir = os.path.join(temp_dir, 'data')
experiments_dir = os.path.join(temp_dir, 'experiments')

os.makedirs(scripts_dir, exist_ok=True)
os.makedirs(output_dir, exist_ok=True)
os.makedirs(data_dir, exist_ok=True)
os.makedirs(experiments_dir, exist_ok=True)

# Create dummy data file
dummy_data_path = os.path.join(data_dir, 'copy_variable')
with open(dummy_data_path, 'w') as f:
    f.write('dummy data')

# Create dummy python script that the function will reference
dummy_script_path = os.path.join(experiments_dir, 'synth_script.py')
with open(dummy_script_path, 'w') as f:
    f.write('# Dummy script\nprint("Script executed")\n')

# Create dummy aggregation script
aggregate_script_path = os.path.join(experiments_dir, 'aggregate_output.py')
with open(aggregate_script_path, 'w') as f:
    f.write('# Dummy aggregation script\nimport argparse\nparser = argparse.ArgumentParser()\nparser.add_argument("--path_to_data")\n')

ARGS = {
    'path_to_scripts': scripts_dir,
    'experiment_id': 0,
    'num_splits': 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int — no output shape is stated: observe_signature.py could not observe it (call:FileNotFoundError)
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
stochastic_subset Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/language_script.py
code served (permissive licence) · get_code("5eacf6bc5dfa2fc4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Create a source tensor with shape (time_steps, batch_size)
# time_steps = 10, batch_size = 3
source = torch.randn(10, 3)

# seq_len must be small enough that source.shape[0] - seq_len - 1 > 0
# With source.shape[0] = 10, we can use seq_len = 5
seq_len = 5

ARGS = {
    "source": source,
    "seq_len": seq_len,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
stochastic_subset Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/synth_script.py
code served (permissive licence) · get_code("9db61e1f7611e72d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Construct source dict with X and Y tensors
# X and Y must have shape (time_steps, batch_size)
# The function accesses source['X'].shape[0] and source['X'].shape[1]
# It then indexes with [shift:shift + seq_len, ii:ii + 1]
time_steps = 10
batch_size = 3
seq_len = 5

source = {
    'X': torch.randn(time_steps, batch_size),
    'Y': torch.randn(time_steps, batch_size)
}

ARGS = {
    'source': source,
    'seq_len': seq_len
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
stochastic_subset Ran
ran on a synthesized input
aicherc/adaptive_tbptt/experiments/temporal_pp_script.py
code served (permissive licence) · get_code("b047609c78c58868")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Create source dict with X and Y tensors
# X and Y must have shape (time_steps, batch_size)
# time_steps must be > seq_len so we can sample shifts
time_steps = 10
batch_size = 3
seq_len = 5

source = {
    'X': torch.randn(time_steps, batch_size),
    'Y': torch.randn(time_steps, batch_size)
}

ARGS = {
    'source': source,
    'seq_len': seq_len
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
TPP_y_loss Not yet run
unverified (harvested, no recorded run)
aicherc/adaptive_tbptt/experiments/temporal_pp_model.py
code served (permissive licence) · get_code("1a697a4f5733df42")
How it ran

no invocation recorded.

calculate_component_gradient_norms Not yet run
unverified (harvested, no recorded run)
aicherc/adaptive_tbptt/tbptt/adaptive_truncation.py
code served (permissive licence) · get_code("79a84db2ebe166bc")
How it ran

no invocation recorded.

generate_linear_seq Not yet run
unverified (harvested, no recorded run)
aicherc/adaptive_tbptt/tbptt/generate_data.py
code served (permissive licence) · get_code("7e93cbc251f3eaed")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 20 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 20 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1905.07473")
get_code_for_paper("1905.07473")
have("1905.07473")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1905.07473.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1905.07473.svg)](https://syntology.ai/paper/1905.07473)

Connect an agent — have() is free.