SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2105.09452 · 2021

Minimum-Delay Adaptation in Non-Stationary Reinforcement Learning via Online High-Confidence Change-Point Detection

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 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; 4 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 2 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/2105.09452.json · badge: /api/ran/2105.09452.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
LucasAlegre/mbcd canonical (classifier label)
classifier basis: census
10 ran · 2 no recorded run
FunctionStatusWhere it lives
alive_bonus Ran
ran, honoured the contract we drafted
LucasAlegre/mbcd/mbcd/models/fake_env.py
code served (permissive licence) · get_code("fd947865eafc33e9")
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)

class DummyAgent:
    pass

agent = DummyAgent()

z = 0.9
pitch = 0.5

ARGS = {
    'self': agent,
    'z': z,
    'pitch': pitch
}
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
denormalize Ran
ran, honoured the contract we drafted
LucasAlegre/mbcd/mbcd/utils/dataset.py
code served (permissive licence) · get_code("6847f28a35bbacb4")
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; no output shape is stated. It ran in syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1) at 2026-09-27T00:55:41Z. 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)

# Construct arguments for denormalize(data, mean, std)
# The function performs: data * (std + 1e-10) + mean
# All three parameters should be tensors or array-like with compatible shapes

data = torch.randn(2, 4)  # batch_size=2, features=4
mean = torch.randn(4)     # per-feature mean
std = torch.randn(4)      # per-feature std

ARGS = {
    "data": data,
    "mean": mean,
    "std": std
}
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 — no output shape is stated: no later run recorded an output shape for this sample (observed_output and metamorphic_properties carry none; shape_contract and output_contract record ndim only)
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 syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1); 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
evaluate Ran
ran, honoured the contract we drafted
LucasAlegre/mbcd/mbcd/utils/util.py
code served (permissive licence) · get_code("7829b5452293cc7c")
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 float64, ndim 0, dtype family float; no output shape is stated. It ran in syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1) at 2026-09-27T00:55:41Z. 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 numpy as np
import torch
import torch.nn as nn


class SimpleRLModel(nn.Module):
    """Minimal RL model that implements predict() method"""
    def __init__(self, obs_dim=4, action_dim=2):
        super().__init__()
        self.net = nn.Linear(obs_dim, action_dim)
    
    def predict(self, obs):
        """Returns action and states"""
        if isinstance(obs, np.ndarray):
            obs_tensor = torch.from_numpy(obs).float()
        else:
            obs_tensor = obs
        
        if obs_tensor.dim() == 1:
            obs_tensor = obs_tensor.unsqueeze(0)
        
        action = self.net(obs_tensor).argmax(dim=-1).item()
        states = None
        return action, states


class SimpleEnv:
    """Minimal gym-like environment"""
    def __init__(self, obs_dim=4, action_dim=2):
        self.obs_dim = obs_dim
        self.action_dim = action_dim
        self.step_count = 0
        self.max_steps = 50
    
    def reset(self):
        """Reset environment and return initial observation"""
        self.step_count = 0
        return np.random.randn(self.obs_dim).astype(np.float32)
    
    def step(self, action):
        """Execute one step"""
        self.step_count += 1
        obs = np.random.randn(self.obs_dim).astype(np.float32)
        reward = np.random.rand()
        done = self.step_count >= self.max_steps
        info = {}
        return obs, reward, done, info
    
    def render(self):
        """Render environment"""
        pass


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

model = SimpleRLModel(obs_dim=4, action_dim=2)
env = SimpleEnv(obs_dim=4, action_dim=2)

ARGS = {
    "model": model,
    "env": env,
    "num_steps": 100,
    "render": False
}
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 float64, ndim 0, dtype family float — no output shape is stated: no later run recorded an output shape for this sample (observed_output and metamorphic_properties carry none; shape_contract and output_contract record ndim only)
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 syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1); 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
format_samples_for_training Ran
ran; our contract draft was wrong, not the code
LucasAlegre/mbcd/mbcd/models/constructor.py
code served (permissive licence) · get_code("1bb5583dba32f555")
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 sample data with distinct dimensions
batch_size = 2
obs_dim = 4
action_dim = 3
reward_dim = 1

# Create observations: shape (batch_size, obs_dim)
observations = np.random.randn(batch_size, obs_dim).astype(np.float32)

# Create actions: shape (batch_size, action_dim)
actions = np.random.randn(batch_size, action_dim).astype(np.float32)

# Create next_observations: shape (batch_size, obs_dim)
next_observations = np.random.randn(batch_size, obs_dim).astype(np.float32)

# Create rewards: shape (batch_size, reward_dim)
rewards = np.random.randn(batch_size, reward_dim).astype(np.float32)

# Construct the samples dict
samples = {
    'observations': observations,
    'actions': actions,
    'next_observations': next_observations,
    'rewards': rewards
}

ARGS = {
    'samples': samples
}
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
get_required_argument Ran
ran; our contract draft was wrong, not the code
LucasAlegre/mbcd/mbcd/models/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from quanvuong/handful-of-trials-pytorch, is pointer only (licence: NONE) · get_code("4eb5226056a1f70f")
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 quanvuong/handful-of-trials-pytorch, 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.

kl_mvn Ran
ran, violated the contract we drafted
LucasAlegre/mbcd/mbcd/utils/util.py
code served (permissive licence) · get_code("846a50c4e950e840")
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 float64, ndim 0, 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 numpy as np

np.random.seed(0)

# m0: mean of first Gaussian, shape (N,) where N is number of dimensions
# S0: covariance matrix of first Gaussian, shape (N, N)
# m1: mean of second Gaussian, shape (N,)
# S1: covariance matrix of second Gaussian, shape (N, N)

N = 4  # dimension of the Gaussians

# Create a positive definite covariance matrix for S0
A0 = np.random.randn(N, N)
S0 = A0 @ A0.T + np.eye(N)

# Create a positive definite covariance matrix for S1
A1 = np.random.randn(N, N)
S1 = A1 @ A1.T + np.eye(N)

# Create mean vectors
m0 = np.random.randn(N)
m1 = np.random.randn(N)

ARGS = {
    "m0": m0,
    "S0": S0,
    "m1": m1,
    "S1": S1,
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
linear_schedule Ran
ran; our contract draft was wrong, not the code
LucasAlegre/mbcd/mbcd/utils/util.py
code served (permissive licence) · get_code("adae040054a625aa")
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

torch.manual_seed(0)

ARGS = {
    "initial_value": 0.001
}
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
normalize Ran
ran, honoured the contract we drafted
LucasAlegre/mbcd/mbcd/utils/dataset.py
code served (permissive licence) · get_code("f608d785cedcce04")
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
import numpy as np

torch.manual_seed(0)

# Create small tensors for the normalize function
data = torch.randn(2, 4)  # batch size 2, dimension 4
mean = torch.randn(4)     # mean for each dimension
std = torch.randn(4).abs() + 0.1  # std for each dimension (positive)

ARGS = {
    "data": data,
    "mean": mean,
    "std": std,
}
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
ortho_init Ran
ran; our contract draft was wrong, not the code
LucasAlegre/mbcd/mbcd/models/fc.py
code served (permissive licence) · get_code("0cb9b8299fe38738")
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 numpy as np

# Set seed for reproducibility
np.random.seed(0)

# The ortho_init function takes a scale parameter
# The returned _ortho_init function takes shape, dtype, and partition_info
# We need to test the ortho_init function by calling it and then using the returned initializer

scale_value = 2.0

ARGS = {
    "scale": scale_value
}
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 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
termination_fn_hopper_roboschool Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LucasAlegre/mbcd/mbcd/models/fake_env.py
code served (permissive licence) · get_code("e7212f3e6b7280b5")
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, 1) 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 test data for the termination function
# The function expects:
# - obs: shape (batch_size, obs_dim) with batch_size=2
# - act: shape (batch_size, act_dim) with batch_size=2
# - next_obs: shape (batch_size, obs_dim) with batch_size=2

batch_size = 2
obs_dim = 11  # Hopper observation dimension
act_dim = 3   # Hopper action dimension

# Create obs: batch_size x obs_dim
obs = np.random.randn(batch_size, obs_dim).astype(np.float32)

# Create act: batch_size x act_dim
act = np.random.randn(batch_size, act_dim).astype(np.float32)

# Create next_obs: batch_size x obs_dim
# Need to ensure:
# - next_obs[:, 0] is z coordinate (height)
# - next_obs[:, 7] is pitch angle
# - All values are finite
next_obs = np.random.randn(batch_size, obs_dim).astype(np.float32)
# Set z values (index 0) to be > 0.8 - 1.25 = -0.45
next_obs[:, 0] = np.array([0.5, 0.6], dtype=np.float32)
# Set pitch values (index 7) to be < 1.0
next_obs[:, 7] = np.array([0.3, 0.4], dtype=np.float32)
# Ensure all values are finite
next_obs = np.nan_to_num(next_obs, nan=0.0, posinf=0.5, neginf=-0.5)

ARGS = {
    "obs": obs,
    "act": act,
    "next_obs": next_obs,
}
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, 1) — shape (2, 1) 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
termination_fn_hopper Not yet run
unverified (harvested, no recorded run)
LucasAlegre/mbcd/mbcd/models/fake_env.py
code served (permissive licence) · get_code("dc8918b0020c572d")
How it ran

no invocation recorded.

total_episode_reward_logger Not yet run
unverified (harvested, no recorded run)
LucasAlegre/mbcd/mbcd/sac_mbcd.py
code served (permissive licence) · get_code("7f8faab22d304fad")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 3 later) and 9 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
format_samples_for_training 7 other papers
4 dated earlier, 1 the same month, 2 later · 1 only as an assembly brick
2005.13239 (2020-05)
MOPO: Model-based Offline Policy Optimization
2006.13916 (2020-06)
Off-Dynamics Reinforcement Learning: Training for Transfer with Domain Classifiers
2010.09546 (2020-10)
Model-based Policy Optimization with Unsupervised Model Adaptation
and 4 more not named here
get_required_argument 6 other papers
5 dated earlier, 1 later
1805.12114 (2018-05)
Deep Reinforcement Learning in a Handful of Trials using Probabilistic Dynamics Models
2006.13916 (2020-06)
Off-Dynamics Reinforcement Learning: Training for Transfer with Domain Classifiers
2007.01995 (2020-07)
Bidirectional Model-based Policy Optimization
and 3 more not named here
ortho_init 4 other papers
3 dated earlier, 1 later · 2 only as an assembly brick
2001.03415 (2020-01)
Multi-Agent Interactions Modeling with Correlated Policies
2010.07916 (2020-10)
Multi-Agent Trust Region Policy Optimization
2103.12300 (2021-03)
Drop-Bottleneck: LEARNING DISCRETE COMPRESSED REPRESENTATION FOR NOISE-ROBUST EXPLORATION
and 1 more not named here

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

Non-stationary environments are challenging for reinforcement learning algorithms. If the state transition and/or reward functions change based on latent factors, the agent is effectively tasked with optimizing a behavior that maximizes performance over a possibly infinite random sequence of Markov Decision Processes (MDPs), each of which drawn from some unknown distribution. We call each such MDP a context. Most related works make strong assumptions such as knowledge about the distribution over contexts, the existence of pre-training phases, or a priori knowledge about the number, sequence, or boundaries between contexts. We introduce an algorithm that efficiently learns policies in non-stationary environments. It analyzes a possibly infinite stream of data and computes, in real-time, high-confidence change-point detection statistics that reflect whether novel, specialized policies need to be created and deployed to tackle novel contexts, or whether previously-optimized ones might be reused. We show that (i) this algorithm minimizes the delay until unforeseen changes to a context are detected, thereby allowing for rapid responses; and (ii) it bounds the rate of false alarm, which is important in order to minimize regret. Our method constructs a mixture model composed of a (possibly infinite) ensemble of probabilistic dynamics predictors that model the different modes of the distribution over underlying latent MDPs. We evaluate our algorithm on high-dimensional continuous reinforcement learning problems and show that it outperforms state-of-the-art (model-free and model-based) RL algorithms, as well as state-of-the-art meta-learning methods specially designed to deal with non-stationarity.

For agents

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

get_harvested_code_for_paper("2105.09452")
get_code_for_paper("2105.09452")
have("2105.09452")

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

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

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

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

Connect an agent — have() is free.