SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.02039 · NeurIPS · 2021

Offline Reinforcement Learning as One Big Sequence Modeling Problem

Sergey Levine, Michael Janner, Qiyang Li

arXiv · PDF · Open in the Atlas

Code that ran

23 of 28 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; 1 honoured the contract we drafted, 0 violated it and 20 have no contract verdict; 2 failures of our instrument; 5 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/2106.02039.json · badge: /api/ran/2106.02039.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
JannerM/trajectory-transformer canonical (classifier label)
classifier basis: census
16 ran · 5 no recorded run
howuhh/faster-trajectory-transformer community (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
FunctionStatusWhere it lives
add_stop_token Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/models/embeddings.py
code served (permissive licence) · get_code("f0bbd8cb02e1d63f")
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 ndarray, ndim 2, dtype family float, shape (4, 4) 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 numpy as np

# Create a small valid input for add_stop_token
# The function expects tokens to be a 2D numpy array where:
# - First dimension is N (number of tokens)
# - Each row sums to 1 (probability distribution)
# After processing, output should be square (N+1 x N+1)

N = 3
# Create a valid probability distribution matrix (N x N)
# Each row should sum to 1
tokens = np.array([
    [0.5, 0.3, 0.2],
    [0.1, 0.6, 0.3],
    [0.2, 0.2, 0.6]
], dtype=np.float32)

ARGS = {
    "tokens": tokens
}
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 ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) 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
ant_preprocess_fn Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/datasets/preprocessing.py
code served (permissive licence) · get_code("0164e9415395d715")
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 Tensor, ndim 2, dtype family float, shape (2, 27) 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 torch
import numpy as np

torch.manual_seed(0)

# The function expects observations with shape (batch_size, qpos_dim + qvel_dim + cfrc_dim)
# where qpos_dim=13, qvel_dim=14, cfrc_dim=84, so total feature dim = 111

qpos_dim = 13
qvel_dim = 14
cfrc_dim = 84
total_dim = qpos_dim + qvel_dim + cfrc_dim

# Create a small batch of observations
batch_size = 2
observations = torch.randn(batch_size, total_dim)

ARGS = {
    "observations": observations
}
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 Tensor, ndim 2, dtype family float, shape (2, 27) — shape (2, 27) 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
create_env Ran
ran on a synthesized input
howuhh/faster-trajectory-transformer/trajectory/utils/env.py
code served (permissive licence) · get_code("36bb7ea2ef4a54a3")
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 CartPoleEnv. 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 gym

# The function create_env takes a gym environment name string
# It calls gym.make(name), then accesses .unwrapped, ._max_episode_steps
# and sets attributes max_episode_steps and name on the environment

# We need to provide a valid gym environment name
# Classic control environments like 'CartPole-v1' are simple and don't require downloads

ARGS = {
    "name": "CartPole-v1"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gym — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CartPoleEnv — a CartPoleEnv output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CartPoleEnv 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
d4rl_dataset Ran
ran on a synthesized input
howuhh/faster-trajectory-transformer/trajectory/datasets/get_d4rl.py
code served (permissive licence) · get_code("730393eba4e1cb7a")
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

class MockEnv:
    def __init__(self):
        self.spec = type('obj', (object,), {'id': 'test-env-v0'})()
    
    def get_dataset(self):
        num_steps = 2
        obs_dim = 4
        action_dim = 3
        
        dataset = {
            'observations': np.random.randn(num_steps, obs_dim).astype(np.float32),
            'actions': np.random.randn(num_steps, action_dim).astype(np.float32),
            'rewards': np.random.randn(num_steps).astype(np.float32),
            'terminals': np.array([False, True], dtype=bool),
            'timeouts': np.array([False, False], dtype=bool),
        }
        return dataset

env = MockEnv()

ARGS = {
    'env': env,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
extract_actions Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/search/utils.py
code served (permissive licence) · get_code("9c84ff02a4f59c05")
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 Tensor, ndim 1, dtype family float, shape (3,) 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 torch

torch.manual_seed(0)

# observation_dim and action_dim must be distinct
observation_dim = 4
action_dim = 3

# x must have shape [batch_size, observation_dim + action_dim + 2]
# batch_size = 2 (tiny)
batch_size = 2
x = torch.randn(batch_size, observation_dim + action_dim + 2)

# t can be None or an integer index into the batch
t = 0

ARGS = {
    "x": x,
    "observation_dim": observation_dim,
    "action_dim": action_dim,
    "t": t,
}
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 Tensor, ndim 1, dtype family float, shape (3,) — shape (3,) 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
filter_cdf Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/search/sampling.py
code served (permissive licence) · get_code("c2129c72e2f07f7f")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch

torch.manual_seed(0)

# Construct minimal valid arguments for filter_cdf
logits = torch.randn(2, 4)  # batch_size=2, vocab_size=4
threshold = 0.7  # CDF threshold value

ARGS = {
    "logits": logits,
    "threshold": threshold,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
flatten Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/models/mlp.py
code served (permissive licence) · get_code("12754b16911ecee4")
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 Tensor, ndim 2, dtype family float, shape (2, 12) 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 torch

torch.manual_seed(0)

# The function takes a condition_dict parameter
# It sorts the keys, extracts values, and concatenates them along dim=-1
# So we need a dict with string keys and tensor values that can be concatenated

condition_dict = {
    "alpha": torch.randn(2, 4),
    "beta": torch.randn(2, 3),
    "gamma": torch.randn(2, 5),
}

ARGS = {
    "condition_dict": condition_dict,
}
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 Tensor, ndim 2, dtype family float, shape (2, 12) — shape (2, 12) 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
get_activation Ran
ran; our contract draft was wrong, not the code
JannerM/trajectory-transformer/trajectory/models/mlp.py
code served (permissive licence) · get_code("308e4d2dcc2d67f2")
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 function. 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

torch.manual_seed(0)

# Test case 1: params as a dict with type and kwargs
params_dict = {
    'type': 'ReLU',
    'kwargs': {}
}

# Test case 2: params as a string
params_string = 'Sigmoid'

# We'll use the dict case as the primary test
ARGS = {
    'params': params_dict
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
join_trajectory Ran
ran on a synthesized input
howuhh/faster-trajectory-transformer/trajectory/datasets/d4rl_dataset.py
code served (permissive licence) · get_code("8fe2aea76aedd71b")
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 ndarray, ndim 2, dtype family float, shape (2, 9) 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 numpy as np

# Construct arguments for join_trajectory
# The function expects:
# - states: shape (traj_length, state_dim)
# - actions: shape (traj_length, action_dim)
# - rewards: shape (traj_length, 1)
# - discount: float (default 0.99)

traj_length = 2
state_dim = 4
action_dim = 3
reward_dim = 1

states = np.random.randn(traj_length, state_dim).astype(np.float32)
actions = np.random.randn(traj_length, action_dim).astype(np.float32)
rewards = np.random.randn(traj_length, reward_dim).astype(np.float32)
discount = 0.99

ARGS = {
    "states": states,
    "actions": actions,
    "rewards": rewards,
    "discount": discount
}
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 ndarray, ndim 2, dtype family float, shape (2, 9) — shape (2, 9) 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
load_environment Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/datasets/d4rl.py
code served (permissive licence) · get_code("8368faab224d9322")
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 CartPoleEnv. 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 os
import gym
from contextlib import contextmanager, redirect_stderr, redirect_stdout

@contextmanager
def suppress_output():
    """
        A context manager that redirects stdout and stderr to devnull
        https://stackoverflow.com/a/52442331
    """
    with open(os.devnull, 'w') as fnull:
        with redirect_stderr(fnull) as err, redirect_stdout(fnull) as out:
            yield (err, out)

def load_environment(name):
    with suppress_output():
        wrapped_env = gym.make(name)
    env = wrapped_env.unwrapped
    env.max_episode_steps = wrapped_env._max_episode_steps
    env.name = name
    return env


ARGS = {
    "name": "CartPole-v1"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gym — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CartPoleEnv — a CartPoleEnv output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CartPoleEnv 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
make_weights Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/models/embeddings.py
code served (permissive licence) · get_code("73db3cbbc056327e")
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 ndarray, ndim 2, dtype family float, shape (5, 5) 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 numpy as np

# Analyze the function:
# - N: integer, used as dimension for creating NxN array
# - weights: array-like, must have odd length, used for iteration and indexing
# The function creates a weight matrix by applying convolution-like operations

N = 5
weights = [0.1, 0.3, 0.6]  # odd number of weights that sum to 1.0

ARGS = {
    'N': N,
    'weights': weights,
}
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 ndarray, ndim 2, dtype family float, shape (5, 5) — shape (5, 5) 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
normalize Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/utils/arrays.py
code served (permissive licence) · get_code("e256f0dfb18dd284")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch

torch.manual_seed(0)

# The function takes a tensor x and normalizes it to [0, 1]
# by subtracting the minimum and dividing by the maximum
# It requires x to have .min() and .max() methods and support arithmetic operations
# This is satisfied by torch.Tensor

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
qlearning_dataset_with_timeouts Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/datasets/d4rl.py
code served (permissive licence) · get_code("47b8a48fc0f2ac80")
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

class MockEnv:
    def get_dataset(self, **kwargs):
        # Create a small dataset with N=5 timesteps
        # Each observation is 4-dim, actions are 3-dim
        N = 5
        return {
            'observations': np.random.randn(N, 4).astype(np.float32),
            'actions': np.random.randn(N, 3).astype(np.float32),
            'rewards': np.random.randn(N).astype(np.float32),
            'terminals': np.array([0, 0, 1, 0, 0], dtype=np.bool_),
            'timeouts': np.array([0, 0, 0, 1, 0], dtype=np.bool_),
        }

env = MockEnv()
dataset = None
terminate_on_end = False

ARGS = {
    'env': env,
    'dataset': dataset,
    'terminate_on_end': terminate_on_end,
}
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
round_to_multiple Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/search/sampling.py
code served (permissive licence) · get_code("35aa466eb16f5e15")
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 torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    "x": 7,
    "N": 3,
}
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 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
round_to_multiple Ran
ran on a synthesized input
howuhh/faster-trajectory-transformer/trajectory/utils/common.py
code served (permissive licence) · get_code("e58135c9c7b6ed0e")
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 torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - number: an integer or numeric value that will be used with % and +
# - multiple: an integer or numeric value that will be used with % and +
# The function rounds 'number' up to the nearest multiple of 'multiple'

ARGS = {
    "number": 10,
    "multiple": 3
}
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 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
segment Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/datasets/sequence.py
code served (permissive licence) · get_code("48bd963796baa6f4")
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

# Create observations: shape (num_steps, observation_dim)
# Using 6 steps with observation dimension of 4
observations = np.random.randn(6, 4).astype(np.float32)

# Create terminals: shape (num_steps,) with boolean values
# Terminal at step 2 and step 5 to create 3 trajectories
terminals = np.array([False, False, True, False, False, True])

# Max path length for padding
max_path_length = 3

ARGS = {
    'observations': observations,
    'terminals': terminals,
    'max_path_length': max_path_length,
}
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
segment Ran
ran on a synthesized input
howuhh/faster-trajectory-transformer/trajectory/datasets/d4rl_dataset.py
code served (permissive licence) · get_code("53c137a7abd88735")
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 torch

torch.manual_seed(0)

# Create small sample data
# states: list of state observations (2D arrays)
states = [
    np.random.randn(4),  # state dimension = 4
    np.random.randn(4),
    np.random.randn(4),
    np.random.randn(4),
]

# actions: list of action values (1D scalars or small arrays)
actions = [
    np.array([0.5]),
    np.array([0.3]),
    np.array([0.7]),
    np.array([0.2]),
]

# rewards: list of reward scalars
rewards = [
    np.array([1.0]),
    np.array([0.5]),
    np.array([2.0]),
    np.array([0.0]),
]

# terminals: list of boolean tensors indicating episode termination
# Create terminals such that we have 2 episodes: first 2 steps, then 2 steps
terminals = [
    torch.tensor(False),
    torch.tensor(True),   # Episode 1 ends
    torch.tensor(False),
    torch.tensor(True),   # Episode 2 ends
]

ARGS = {
    'states': states,
    'actions': actions,
    'rewards': rewards,
    'terminals': terminals,
}
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
to_np Ran
ran, honoured the contract we drafted
JannerM/trajectory-transformer/trajectory/utils/arrays.py
pointer only (licence: MIT); the stored copy get_code serves, from rlatjddbs/SSD, is pointer only (licence: NONE) · get_code("0e8d8251e66ab160")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from rlatjddbs/SSD, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

to_torch Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/utils/arrays.py
code served (permissive licence) · get_code("429e141abcf66681")
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 Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch
import numpy as np

torch.manual_seed(0)

# The function to_torch takes:
# - x: data to convert to tensor
# - dtype: optional data type (defaults to DTYPE which is torch.float)
# - device: optional device (defaults to DEVICE which is 'cuda:0')

# Since we're CPU-only, we need to override the defaults
DTYPE_CPU = torch.float
DEVICE_CPU = 'cpu'

# Create a small numpy array as input
x = np.array([[1.0, 2.0, 3.0, 4.0],
              [5.0, 6.0, 7.0, 8.0]], dtype=np.float32)

ARGS = {
    'x': x,
    'dtype': DTYPE_CPU,
    'device': DEVICE_CPU,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
top_k_logits Ran
ran; our contract draft was wrong, not the code
JannerM/trajectory-transformer/trajectory/search/sampling.py
code served (permissive licence) · get_code("0f0021cdea13e4da")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch

torch.manual_seed(0)

# Create a small logits tensor with shape (batch_size=2, vocab_size=4)
logits = torch.randn(2, 4)

# Set k to a small value less than the vocabulary dimension
k = 2

ARGS = {
    "logits": logits,
    "k": k,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
top_k_logits Ran
ran on a synthesized input
howuhh/faster-trajectory-transformer/trajectory/utils/common.py
code served (permissive licence) · get_code("c7cbcd467cc49a53")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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 torch

torch.manual_seed(0)

# Create a small batch of logits
# Shape: (batch_size=2, vocab_size=4)
logits = torch.randn(2, 4)

# k parameter - top k to keep
k = 2

ARGS = {
    "logits": logits,
    "k": k,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
vmap Ran
ran on a synthesized input
JannerM/trajectory-transformer/trajectory/datasets/preprocessing.py
code served (permissive licence) · get_code("3e098abac7794b97")
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 function. 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

torch.manual_seed(0)

# The function `vmap` wraps a function `fn` that processes batched inputs.
# It expects `fn` to take a tensor `inputs` and return a tensor `outputs`.
# The wrapper handles both 1D and batched (2D+) inputs.

# Create a simple function that processes batched inputs
def sample_fn(inputs):
    # inputs shape: (batch, features) or (batch, seq_len, features)
    # Return a processed tensor with same batch dimension
    return inputs * 2.0

ARGS = {
    "fn": sample_fn
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
weight_decay_groups Ran
ran on a synthesized input
howuhh/faster-trajectory-transformer/trajectory/utils/common.py
code served (permissive licence) · get_code("ae1cccd21623b2cc")
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

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        # Create layers with different types to test whitelist/blacklist logic
        self.linear1 = nn.Linear(4, 3)
        self.bn = nn.BatchNorm1d(3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.bn(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

# whitelist_modules: tuple of module types whose weights should be in decay set
whitelist_modules = (nn.Linear,)

# blacklist_modules: tuple of module types whose weights should NOT be in decay set
blacklist_modules = (nn.BatchNorm1d,)

# blacklist_named: optional list of specific parameter names to exclude from decay
blacklist_named = None

ARGS = {
    'model': model,
    'whitelist_modules': whitelist_modules,
    'blacklist_modules': blacklist_modules,
    'blacklist_named': blacklist_named
}
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
beam_plan Not yet run
unverified (harvested, no recorded run)
JannerM/trajectory-transformer/trajectory/search/core.py
code served (permissive licence) · get_code("f3d303190e64c4e4")
How it ran

no invocation recorded.

beam_search Not yet run
unverified (harvested, no recorded run)
JannerM/trajectory-transformer/trajectory/search/core.py
code served (permissive licence) · get_code("c6b3fddb40879156")
How it ran

no invocation recorded.

kitchen_preprocess_fn Not yet run
unverified (harvested, no recorded run)
JannerM/trajectory-transformer/trajectory/datasets/preprocessing.py
code served (permissive licence) · get_code("d3a9e7f0b010aa47")
How it ran

no invocation recorded.

make_prefix Not yet run
unverified (harvested, no recorded run)
JannerM/trajectory-transformer/trajectory/search/utils.py
code served (permissive licence) · get_code("6dafa63552e84e1c")
How it ran

no invocation recorded.

update_context Not yet run
unverified (harvested, no recorded run)
JannerM/trajectory-transformer/trajectory/search/utils.py
code served (permissive licence) · get_code("6ba529c9388c1d12")
How it ran

no invocation recorded.

Also present in other papers' code

Of 28 samples lifted from this paper's linked repositories, 28 carry a function identity and 0 do not. Of the 28 distinct functions with an identity, 3 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 3 later) and 25 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.

FunctionAlso present inEarliest-datedOthers named
top_k_logits 16 other papers
1 dated earlier, 1 the same month, 14 later
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
2106.14131 (2021-06)
SymbolicGPT: A Generative Transformer Model for Symbolic Regression
2107.08037 (2021-07)
CCVS: Context-aware Controllable Video Synthesis
and 13 more not named here
to_np 2 other papers
2 later
2305.18459 (2023-05)
Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning
2402.07226 (2024-02)
Stitching Sub-trajectories with Conditional Diffusion Model for Goal-Conditioned Offline RL
get_activation 1 other paper
1 later
2405.16907 (2024-05)
GTA: Generative Trajectory Augmentation with Guidance for Offline Reinforcement Learning

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

Reinforcement learning (RL) is typically concerned with estimating stationary policies or single-step models, leveraging the Markov property to factorize problems in time. However, we can also view RL as a generic sequence modeling problem, with the goal being to produce a sequence of actions that leads to a sequence of high rewards. Viewed in this way, it is tempting to consider whether high-capacity sequence prediction models that work well in other domains, such as natural-language processing, can also provide effective solutions to the RL problem. To this end, we explore how RL can be tackled with the tools of sequence modeling, using a Transformer architecture to model distributions over trajectories and repurposing beam search as a planning algorithm. Framing RL as sequence modeling problem simplifies a range of design decisions, allowing us to dispense with many of the components common in offline RL algorithms. We demonstrate the flexibility of this approach across long-horizon dynamics prediction, imitation learning, goal-conditioned RL, and offline RL. Further, we show that this approach can be combined with existing model-free algorithms to yield a state-of-the-art planner in sparse-reward, long-horizon tasks. Code is available at trajectory-transformer.github.io 35th Conference on Neural Information Processing Systems (NeurIPS 2021),

For agents

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

get_harvested_code_for_paper("2106.02039")
get_code_for_paper("2106.02039")
have("2106.02039")

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

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

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

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

Connect an agent — have() is free.