SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.13716 · 2023

Critic-Guided Decision Transformer for Offline Reinforcement Learning

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 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 0 have no contract verdict; 3 failures of our instrument; 4 no recorded run), measured 2026-11-24; 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/2312.13716.json · badge: /api/ran/2312.13716.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
sharkwyf/cgdt canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FunctionStatusWhere it lives
create_dataloader Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sharkwyf/cgdt/data.py
code served (permissive licence) · get_code("35c8150831857f55")
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 DataLoader. 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
import random

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

# Create small trajectories
def create_dummy_trajectory(obs_len=50, state_dim=4, act_dim=3):
    traj = {
        'observations': np.random.randn(obs_len, state_dim).astype(np.float32),
        'actions': np.random.randn(obs_len, act_dim).astype(np.float32),
        'rewards': np.random.randn(obs_len).astype(np.float32),
        'terminals': np.random.choice([0, 1], size=obs_len).astype(np.float32),
        'rtg': np.random.randn(obs_len + 1).astype(np.float32),
        'rtg_discounted': np.random.randn(obs_len + 1).astype(np.float32),
    }
    return traj

# Create trajectories list
trajectories = [
    create_dummy_trajectory(obs_len=60, state_dim=4, act_dim=3),
    create_dummy_trajectory(obs_len=50, state_dim=4, act_dim=3),
    create_dummy_trajectory(obs_len=55, state_dim=4, act_dim=3),
]

state_dim = 4
act_dim = 3
state_mean = np.zeros(state_dim, dtype=np.float32)
state_std = np.ones(state_dim, dtype=np.float32)

ARGS = {
    'trajectories': trajectories,
    'num_iters': 2,
    'batch_size': 2,
    'max_len': 20,
    'state_dim': state_dim,
    'act_dim': act_dim,
    'state_mean': state_mean,
    'state_std': state_std,
    'reward_scale': 1.0,
    'gamma': 0.99,
    'action_range': (-1.0, 1.0),
    'num_workers': 0,
}
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 DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
discount_cumsum Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sharkwyf/cgdt/data.py
pointer only (licence: MIT); the stored copy get_code serves, from kaiyan289/rl_as_vitamin_for_online_decision_transformers, is pointer only (licence: NONE) · get_code("f434bf3e9ec07356")
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 kaiyan289/rl_as_vitamin_for_online_decision_transformers, 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.

sample_trajs Ran
ran, honoured the contract we drafted
sharkwyf/cgdt/data.py
code served (permissive licence) · get_code("578a31c152a01456")
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 1, dtype family int, shape (10,) 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 trajectories with 'observations' key
# Each trajectory is a dict with 'observations' list
trajectories = [
    {'observations': [1, 2, 3, 4, 5]},
    {'observations': [1, 2, 3]},
    {'observations': [1, 2, 3, 4, 5, 6, 7]},
    {'observations': [1, 2]},
]

sample_size = 10

ARGS = {
    'trajectories': trajectories,
    'sample_size': sample_size,
}
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 1, dtype family int, shape (10,) — shape (10,) 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
to_np Ran
ran; our contract draft was wrong, not the code
sharkwyf/cgdt/utils.py
code served (permissive licence) · get_code("a80c3e8402f8384e")
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, 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
import numpy as np

torch.manual_seed(0)

# Test case 1: A normal torch tensor
tensor_1 = torch.randn(2, 4)

# Test case 2: None value
tensor_2 = None

# Test case 3: Empty tensor
tensor_3 = torch.tensor([])

# Create ARGS dict with the parameter 't' mapped to a valid tensor
ARGS = {
    "t": tensor_1
}
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 ndarray, 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
get_bandit_dataset Not yet run
unverified (harvested, no recorded run)
sharkwyf/cgdt/decision_transformer/envs/bernoulli_bandit.py
code served (permissive licence) · get_code("e0aa451b407606b7")
How it ran

no invocation recorded.

get_bandit_policy Not yet run
unverified (harvested, no recorded run)
sharkwyf/cgdt/decision_transformer/envs/bernoulli_bandit.py
code served (permissive licence) · get_code("c93f37e1b9518f39")
How it ran

no invocation recorded.

load_tf_weights_in_gpt2 Not yet run
unverified (harvested, no recorded run)
sharkwyf/cgdt/decision_transformer/models/trajectory_gpt2.py
pointer only (licence: MIT); the stored copy get_code serves, from tencentarc/moto, is pointer only (licence: NOASSERTION) · get_code("00a33466c69c5705")
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 tencentarc/moto, and GitHub could not classify the licence of that repository (NOASSERTION). 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. No invocation recorded.

vec_evaluate_episode_rtg Not yet run
unverified (harvested, no recorded run)
sharkwyf/cgdt/evaluation.py
code served (permissive licence) · get_code("3cbbae45e6ee150d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 3 later) and 5 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
load_tf_weights_in_gpt2 22 other papers
10 dated earlier, 12 later
2106.01345 (2021-06)
Decision Transformer: Reinforcement Learning via Sequence Modeling
2110.06206 (2021-10)
StARformer: Transformer with State-Action-Reward Representations for Visual Reinforcement Learning
2202.11705 (2022-02)
COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics
and 19 more not named here
to_np 9 other papers
4 dated earlier, 5 later · 2 only as an assembly brick
1812.05905 (2018-12)
Soft Actor-Critic Algorithms and Applications
2004.13649 (2020-04)
Image Augmentation Is All You Need: Regularizing Deep Reinforcement Learning from Pixels
2110.04935 (2021-10)
Learning Temporally-Consistent Representations for Data-Efficient Reinforcement Learning
and 6 more not named here
discount_cumsum 1 other paper
1 later
2410.24108 (2024-10)
Reinforcement Learning Gradients as Vitamin for Online Finetuning Decision Transformers

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-24.

Repositories linked to this paper

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

Abstract

Recent advancements in offline reinforcement learning (RL) have underscored the capabilities of Return-Conditioned Supervised Learning (RCSL), a paradigm that learns the action distribution based on target returns for each state in a supervised manner. However, prevailing RCSL methods largely focus on deterministic trajectory modeling, disregarding stochastic state transitions and the diversity of future trajectory distributions. A fundamental challenge arises from the inconsistency between the sampled returns within individual trajectories and the expected returns across multiple trajectories. Fortunately, value-based methods offer a solution by leveraging a value function to approximate the expected returns, thereby addressing the inconsistency effectively. Building upon these insights, we propose a novel approach, termed the Critic-Guided Decision Transformer (CGDT), which combines the predictability of long-term returns from value-based methods with the trajectory modeling capability of the Decision Transformer. By incorporating a learned value function, known as the critic, CGDT ensures a direct alignment between the specified target returns and the expected returns of actions. This integration bridges the gap between the deterministic nature of RCSL and the probabilistic characteristics of value-based methods. Empirical evaluations on stochastic environments and D4RL benchmark datasets demonstrate the superiority of CGDT over traditional RCSL methods. These results highlight the potential of CGDT to advance the state of the art in offline RL and extend the applicability of RCSL to a wide range of RL tasks.

For agents

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

get_harvested_code_for_paper("2312.13716")
get_code_for_paper("2312.13716")
have("2312.13716")

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

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

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

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

Connect an agent — have() is free.