SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.04498 · NeurIPS · 2024

Model-Based Transfer Learning for Contextual Reinforcement Learning

Vindula Jayawardana, Sirui Li, Cathy Wu, Jung-Hoon Cho

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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; 4 failures of our instrument; 1 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-21; 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/2408.04498.json · badge: /api/ran/2408.04498.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
jhoon-cho/MBTL canonical (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
jhoon-cho/mbtl community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
sample_truncated_normal Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jhoon-cho/MBTL/MBTL/utils.py
code served (permissive licence) · get_code("3c354523d7790560")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T23:22:37Z). 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
from scipy.stats import truncnorm

def sample_truncated_normal(mean, std, lower, upper, size):
    a, b = ((lower - mean) / std, (upper - mean) / std)
    return truncnorm.rvs(a, b, loc=mean, scale=std, size=size)

ARGS = {
    "mean": 0.0,
    "std": 1.0,
    "lower": -2.0,
    "upper": 2.0,
    "size": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
matplotlib, numpy, pandas, scipy, sklearn — 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 float, shape (5,) — shape (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
MBTL Ran
ran; our contract draft was wrong, not the code
jhoon-cho/mbtl/MBTL/utils.py
code served (permissive licence) · get_code("fd698421b94be246")
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) 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 pandas as pd
from scipy.stats import truncnorm
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF, WhiteKernel, ExpSineSquared, ConstantKernel as C

# Create minimal valid arguments for MBTL function
home_dir = "/tmp"
data_name = "test_data"

# deltas: array of parameter values
deltas = np.array([0.1, 0.5, 1.0, 2.0])

# num_transfer_steps: number of iterations
num_transfer_steps = 3

# data_transfer: DataFrame with diagonal elements (used in the function)
# Must have shape (len(deltas), len(deltas)) and support .iloc indexing
data_transfer = pd.DataFrame(
    np.random.rand(4, 4),
    columns=range(4),
    index=range(4)
)

# acquisition_function: string parameter
acquisition_function = 'new'

# gap_function: string parameter
gap_function = 'linear'

# slope: float parameter
slope = 0.005

# noise_std: float parameter
noise_std = 0.1

# n_restarts_optimizer: int parameter
n_restarts_optimizer = 9

ARGS = {
    'home_dir': home_dir,
    'data_name': data_name,
    'deltas': deltas,
    'num_transfer_steps': num_transfer_steps,
    'data_transfer': data_transfer,
    'acquisition_function': acquisition_function,
    'gap_function': gap_function,
    'slope': slope,
    'noise_std': noise_std,
    'n_restarts_optimizer': n_restarts_optimizer,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, pandas, scipy, sklearn — 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
get_dataset_settings Ran
ran; our contract draft was wrong, not the code
jhoon-cho/MBTL/MBTL/utils.py
code served (permissive licence) · get_code("2643e9a24ffb2bf3")
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) 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 os
import tempfile

# Create a temporary directory for home_dir
home_dir = tempfile.mkdtemp()

# Define the data_name parameter - use one of the valid dataset names
data_name = 'advisoryautonomy_ring_acc'

# Construct the ARGS dictionary with all required parameters
ARGS = {
    'home_dir': home_dir,
    'data_name': data_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
matplotlib, numpy, pandas, scipy, sklearn — 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
sample_truncated_normal Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jhoon-cho/mbtl/MBTL/utils.py
code served (permissive licence) · get_code("cbddbd5a2626ba96")
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 (3, 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
from scipy.stats import truncnorm

torch.manual_seed(0)

# Construct arguments for sample_truncated_normal
mean = 0.0
std = 1.0
lower = -2.0
upper = 2.0
size = (3, 4)

ARGS = {
    "mean": mean,
    "std": std,
    "lower": lower,
    "upper": upper,
    "size": size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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 (3, 4) — shape (3, 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
import_data Not yet run
unverified (harvested, no recorded run)
jhoon-cho/MBTL/MBTL/utils.py
code served (permissive licence) · get_code("89b89123a59829d8")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

Deep reinforcement learning (RL) is a powerful approach to complex decision making. However, one issue that limits its practical application is its brittleness, sometimes failing to train in the presence of small changes in the environment. Motivated by the success of zero-shot transfer-where pre-trained models perform well on related tasks-we consider the problem of selecting a good set of training tasks to maximize generalization performance across a range of tasks. Given the high cost of training, it is critical to select training tasks strategically, but not well understood how to do so. We hence introduce Model-Based Transfer Learning (MBTL), which layers on top of existing RL methods to effectively solve contextual RL problems. MBTL models the generalization performance in two parts: 1) the performance set point, modeled using Gaussian processes, and 2) performance loss (generalization gap), modeled as a linear function of contextual similarity. MBTL combines these two pieces of information within a Bayesian optimization (BO) framework to strategically select training tasks. We show theoretically that the method exhibits sublinear regret in the number of training tasks and discuss conditions to further tighten regret bounds. We experimentally validate our methods using urban traffic and standard continuous control benchmarks. The experimental results suggest that MBTL can achieve up to 43x improved sample efficiency compared with canonical independent training and multi-task training. Further experiments demonstrate the efficacy of BO and the insensitivity to the underlying RL algorithm and hyperparameters. This work lays the foundations for investigating explicit modeling of generalization, thereby enabling principled yet effective methods for contextual RL. Code is available at https://github.com/jhoon-cho/MBTL/.

For agents

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

get_harvested_code_for_paper("2408.04498")
get_code_for_paper("2408.04498")
have("2408.04498")

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

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

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

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

Connect an agent — have() is free.