SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.07614 · NeurIPS · 2022

Towards Data-Driven Offline Simulations for Online Reinforcement Learning

John Langford, Alex Lamb, Shengpu Tang, Dipendra Misra, Paul Mineiro, Felipe Vieira Frujeri, Sebastian Kochman

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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; 2 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2211.07614.json · badge: /api/ran/2211.07614.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
microsoft/rl-offline-simulation canonical (classifier label)
classifier basis: classifier_2025
3 ran · 1 no recorded run
FunctionStatusWhere it lives
evalMC_psrs Ran
ran, honoured the contract we drafted
microsoft/rl-offline-simulation/offsim4rl/evaluators/psrs.py
code served (permissive licence) · get_code("f60fabf65eb1e114")
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, ndim 2, 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

class SimpleEnv:
    """Minimal environment that satisfies the function's requirements."""
    
    def __init__(self, num_states=5, max_steps=10):
        self.num_states = num_states
        self.max_steps = max_steps
        self.current_state = 0
        self.step_count = 0
    
    def reset(self, seed=None):
        """Reset environment and return initial state."""
        self.step_count = 0
        self.current_state = 0
        return self.current_state
    
    def step(self, action):
        """Execute one step of the environment."""
        self.step_count += 1
        
        # Transition to next state
        next_state = (self.current_state + 1) % self.num_states
        
        # Generate reward
        reward = float(self.step_count)
        
        # Check if episode is done
        done = self.step_count >= self.max_steps
        
        # Info dict with action
        info = {'a': action}
        
        return next_state, reward, done, info


# Create a simple policy: maps state -> action
# For this simple env, we just use state index as action
pi = {
    0: 0,
    1: 1,
    2: 0,
    3: 1,
    4: 0,
}

# Create environment
env = SimpleEnv(num_states=5, max_steps=10)

# Set up arguments
ARGS = {
    'env': env,
    'n_episodes': 3,
    'pi': pi,
    'gamma': 0.99,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
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
qlearn_psrs Ran
ran; our contract draft was wrong, not the code
microsoft/rl-offline-simulation/offsim4rl/evaluators/psrs.py
code served (permissive licence) · get_code("40a51f1569ee663c")
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

class SimpleEnv:
    """Minimal environment for Q-learning."""
    def __init__(self, nS=5, nA=3):
        self.nS = nS
        self.nA = nA
        self.current_state = 0
        self.step_count = 0
    
    def reset(self, seed=None):
        self.current_state = 0
        self.step_count = 0
        return self.current_state
    
    def step(self, action):
        self.step_count += 1
        next_state = (self.current_state + 1) % self.nS
        reward = 1.0
        done = self.step_count >= 3
        info = {'a': action}
        self.current_state = next_state
        return next_state, reward, done, info

def simple_behavior_policy(Q_slice, params):
    """Simple epsilon-greedy policy."""
    epsilon = params.get('epsilon', 0.1)
    nA = Q_slice.shape[1]
    if np.random.random() < epsilon:
        action = np.random.randint(0, nA)
    else:
        action = np.argmax(Q_slice[0])
    return np.array([action])

env = SimpleEnv(nS=5, nA=3)
n_episodes = 2
behavior_policy = simple_behavior_policy
gamma = 0.99
alpha = 0.1
epsilon = 0.1
Q_init = None
save_Q = 0

ARGS = {
    'env': env,
    'n_episodes': n_episodes,
    'behavior_policy': behavior_policy,
    'gamma': gamma,
    'alpha': alpha,
    'epsilon': epsilon,
    'Q_init': Q_init,
    'save_Q': save_Q,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
z_expSARSA Ran
ran; our contract draft was wrong, not the code
microsoft/rl-offline-simulation/offsim4rl/agents/tabular.py
code served (permissive licence) · get_code("5ebeb5b96a7e9409")
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

class SimpleEnv:
    """Minimal environment matching the function's usage."""
    def __init__(self, nS=5, nA=3):
        self.nS = nS
        self.nA = nA
        self._state = 0
    
    def reset(self, seed=None):
        if seed is not None:
            np.random.seed(seed)
        self._state = np.random.randint(0, self.nS)
        return self._state
    
    def seed(self, seed):
        np.random.seed(seed)
    
    def step(self, action):
        # Return (next_state, reward, done, info)
        self._state = np.random.randint(0, self.nS)
        reward = np.random.randn()
        done = np.random.rand() < 0.1
        info = {'step_info': 'test'}
        return self._state, reward, done, info


def latent_state_identity(state):
    """Maps state to latent state (identity function for this test)."""
    return state


env = SimpleEnv(nS=5, nA=3)

n_episodes = 2

# Policy: pi[z] gives probability distribution over actions for latent state z
pi = {
    0: np.array([0.5, 0.3, 0.2]),
    1: np.array([0.2, 0.5, 0.3]),
    2: np.array([0.3, 0.2, 0.5]),
    3: np.array([0.4, 0.4, 0.2]),
    4: np.array([0.25, 0.25, 0.5]),
}

gamma = 0.99

alpha = 0.1

Q_init = None

memory = None

save_Q = 0

show_tqdm = False

seed = 42

latent_state_func = latent_state_identity

ARGS = {
    'env': env,
    'n_episodes': n_episodes,
    'pi': pi,
    'gamma': gamma,
    'alpha': alpha,
    'Q_init': Q_init,
    'memory': memory,
    'save_Q': save_Q,
    'show_tqdm': show_tqdm,
    'seed': seed,
    'latent_state_func': latent_state_func,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
expSARSA_psrs Not yet run
unverified (harvested, no recorded run)
microsoft/rl-offline-simulation/offsim4rl/evaluators/psrs.py
code served (permissive licence) · get_code("aa50e630f09e94e4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 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-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

Modern decision-making systems, from robots to web recommendation engines, are expected to adapt: to user preferences, changing circumstances or even new tasks. Yet, it is still uncommon to deploy a dynamically learning agent (rather than a fixed policy) to a production system, as it's perceived as unsafe. Using historical data to reason about learning algorithms, similar to offline policy evaluation (OPE) applied to fixed policies, could help practitioners evaluate and ultimately deploy such adaptive agents to production. In this work, we formalize offline learner simulation (OLS) for reinforcement learning (RL) and propose a novel evaluation protocol that measures both fidelity and efficiency of the simulation. For environments with complex high-dimensional observations, we propose a semi-parametric approach that leverages recent advances in latent state discovery in order to achieve accurate and efficient offline simulations. In preliminary experiments, we show the advantage of our approach compared to fully non-parametric baselines. The code to reproduce these experiments will be made available at https://github.com/microsoft/rl-offline-simulation.

For agents

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

get_harvested_code_for_paper("2211.07614")
get_code_for_paper("2211.07614")
have("2211.07614")

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

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

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

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

Connect an agent — have() is free.