SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1904.06387 · 2019

Extrapolating Beyond Suboptimal Demonstrations via Inverse Reinforcement Learning from Observations

arXiv · PDF · Open in the Atlas

Code that ran

2 of 3 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 0 have no contract verdict; 2 failures of our instrument; 1 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/1904.06387.json · badge: /api/ran/1904.06387.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
hiwonjoon/ICML2019-TREX canonical (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
FunctionStatusWhere it lives
create_training_data Ran
ran; our contract draft was wrong, not the code
hiwonjoon/ICML2019-TREX/atari/LearnAtariReward.py
code served (permissive licence) · get_code("e300d11a27b3ebfa")
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 demonstrations - list of lists of trajectory observations
# Each demonstration is a sequence of states/observations
np.random.seed(0)

# Create 5 demonstrations, each with varying lengths (between 20-30 steps)
# Each step is a small observation vector
demonstrations = []
for i in range(5):
    traj_length = np.random.randint(20, 31)
    # Each observation is a vector of 4 values
    traj = [np.random.randn(4) for _ in range(traj_length)]
    demonstrations.append(traj)

ARGS = {
    'demonstrations': demonstrations,
    'num_trajs': 3,
    'num_snippets': 2,
    'min_snippet_length': 3,
    'max_snippet_length': 8
}
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
create_training_data_from_mturk Ran
ran; our contract draft was wrong, not the code
hiwonjoon/ICML2019-TREX/atari/LearnAtariMTurkRankings.py
code served (permissive licence) · get_code("d47ac370b45f99a2")
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 random

random.seed(42)
np.random.seed(42)

# Create mock demonstrations - each is a sequence of observations
# We need trajectories of varying lengths to test the slicing logic
demonstrations = [
    # Trajectory 0: length 20
    [np.array([i, i+1, i+2, i+3]) for i in range(20)],
    # Trajectory 1: length 18
    [np.array([i*2, i*2+1, i*2+2, i*2+3]) for i in range(18)],
    # Trajectory 2: length 22
    [np.array([i*3, i*3+1, i*3+2, i*3+3]) for i in range(22)],
    # Trajectory 3: length 16
    [np.array([i*4, i*4+1, i*4+2, i*4+3]) for i in range(16)],
]

# Create human rankings: (trajectory_i_index, trajectory_j_index, label)
# label=1 means trajectory i is preferred, label=0 means trajectory j is preferred
human_rankings = [
    (0, 1, 1),  # trajectory 0 preferred over 1
    (1, 2, 0),  # trajectory 2 preferred over 1
    (2, 3, 1),  # trajectory 2 preferred over 3
    (0, 3, 0),  # trajectory 3 preferred over 0
    (1, 0, 1),  # trajectory 1 preferred over 0
]

num_trajs = 3
num_snippets = 2
min_snippet_length = 4
max_snippet_length = 8

ARGS = {
    "demonstrations": demonstrations,
    "human_rankings": human_rankings,
    "num_trajs": num_trajs,
    "num_snippets": num_snippets,
    "min_snippet_length": min_snippet_length,
    "max_snippet_length": max_snippet_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
calc_accuracy Not yet run
unverified (harvested, no recorded run)
hiwonjoon/ICML2019-TREX/atari/LearnAtariMTurkRankings.py
code served (permissive licence) · get_code("e5de5dc1ff3645df")
How it ran

no invocation recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 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 3 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

A critical flaw of existing inverse reinforcement learning (IRL) methods is their inability to significantly outperform the demonstrator. This is because IRL typically seeks a reward function that makes the demonstrator appear near-optimal, rather than inferring the underlying intentions of the demonstrator that may have been poorly executed in practice. In this paper, we introduce a novel reward-learning-from-observation algorithm, Trajectory-ranked Reward EXtrapolation (T-REX), that extrapolates beyond a set of (approximately) ranked demonstrations in order to infer high-quality reward functions from a set of potentially poor demonstrations. When combined with deep reinforcement learning, T-REX outperforms state-of-the-art imitation learning and IRL methods on multiple Atari and MuJoCo benchmark tasks and achieves performance that is often more than twice the performance of the best demonstration. We also demonstrate that T-REX is robust to ranking noise and can accurately extrapolate intention by simply watching a learner noisily improve at a task over time.

For agents

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

get_harvested_code_for_paper("1904.06387")
get_code_for_paper("1904.06387")
have("1904.06387")

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

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

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

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

Connect an agent — have() is free.