SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.02829 · NeurIPS · 2022

RORL: Robust Offline Reinforcement Learning via Conservative Smoothing

Zhaoran Wang, Chongjie Zhang, Chenjia Bai, Lei Han, Rui Yang, Xiaoteng Ma

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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 5 have no contract verdict; 0 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/2206.02829.json · badge: /api/ran/2206.02829.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
yangrui2015/rorl canonical (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
get_obs_mean_std Ran
ran on a synthesized input
yangrui2015/rorl/attackers/data_mean_std.py
code served (permissive licence) · get_code("75bf04014baa9e16")
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, 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

# The function signature based on the context provided
def get_obs_mean_std(env_name):
    """
    This function returns observation mean and std for a given environment.
    Based on the code, it takes an env_name and returns mean and std arrays.
    """
    obs_mean_dict = {
        'halfcheetah-expert-v2': np.array([-0.0448938, 0.03229331, 0.06037571, -0.17081636, -0.19480342, -0.05755221, 0.09699936, 0.03238247, 11.04674, -0.08001192, -0.3236391, 0.3636905, 0.42418915, 0.408233, 1.1076112, -0.48774815, -0.07378904], dtype=np.float32),
        'walker2d-expert-v2': np.array([1.23850238, 0.195760176, -0.104799464, -0.185960338, 0.229559347, 0.0227993485, -0.373786807, 0.338166147, 3.924613, -0.00483204611, 0.0251609739, -0.00504571013, -0.0172384977, -0.481454253, 0.000488845399, -0.000719817239, 0.00351484329], dtype=np.float32),
        'hopper-expert-v2': np.array([1.348851, -0.11204933, -0.55070853, -0.13163613, -0.0031308, 2.6067436, 0.02230332, -0.0165702, -0.06813174, -0.05349138, 0.04012826], dtype=np.float32),
    }
    
    obs_std_dict = {
        'halfcheetah-expert-v2': np.array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1], dtype=np.float32),
        'walker2d-expert-v2': np.array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1], dtype=np.float32),
        'hopper-expert-v2': np.array([0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1], dtype=np.float32),
    }
    
    return obs_mean_dict.get(env_name), obs_std_dict.get(env_name)


ARGS = {
    'env_name': 'halfcheetah-expert-v2'
}
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, 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
get_policy_kl Ran
ran on a synthesized input
yangrui2015/rorl/attackers/attacker.py
code served (permissive licence) · get_code("c8d4b850e6428750")
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 1, dtype family float, shape (2,) 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 torch.nn as nn
from torch.distributions import Normal

torch.manual_seed(0)

class SimplePolicy(nn.Module):
    def __init__(self, obs_dim, action_dim):
        super().__init__()
        self.fc = nn.Linear(obs_dim, action_dim * 2)
        self.action_dim = action_dim
    
    def stochastic_policy(self, observation):
        batch_size = observation.shape[0]
        output = self.fc(observation)
        mean = output[:, :self.action_dim]
        log_std = output[:, self.action_dim:]
        # Return tuple with at least 4 elements: (elem1, mean, log_std, elem4, *rest)
        return (torch.zeros(batch_size), mean, log_std, torch.zeros(batch_size))

policy = SimplePolicy(obs_dim=3, action_dim=4)
observation = torch.randn(2, 3)
noised_obs = torch.randn(2, 3)

ARGS = {
    "policy": policy,
    "observation": observation,
    "noised_obs": noised_obs
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
load_dataset Ran
ran on a synthesized input
yangrui2015/rorl/experiment_utils/utils.py
code served (permissive licence) · get_code("159455d9b3af1142")
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 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 numpy as np

class StandInEnv:
    def __init__(self):
        self._max_episode_steps = 5
    
    def get_dataset(self, **kwargs):
        # Create a small dataset with 10 timesteps
        num_steps = 10
        obs_dim = 4
        action_dim = 3
        
        dataset = {
            'observations': np.random.randn(num_steps, obs_dim).astype(np.float32),
            'actions': np.random.randn(num_steps, action_dim).astype(np.float32),
            'rewards': np.random.randn(num_steps).astype(np.float32),
            'terminals': np.zeros(num_steps, dtype=bool),
            'timeouts': np.zeros(num_steps, dtype=bool),
        }
        # Mark some episodes as terminal
        dataset['terminals'][4] = True
        dataset['terminals'][9] = True
        
        return dataset

env = StandInEnv()

ARGS = {
    'env': env,
    'terminate_on_end': False,
}
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 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
load_exp_data Ran
ran on a synthesized input
yangrui2015/rorl/experiment_utils/utils.py
code served (permissive licence) · get_code("a31ef623997c87b7")
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 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 json
import tempfile
import shutil

# Create a temporary directory structure for the experiment
temp_dir = tempfile.mkdtemp()
exp_path = os.path.join(temp_dir, 'test_exp')
os.makedirs(exp_path, exist_ok=True)

# Create variant.json file
variant_data = {
    'exp_name': 'test_experiment',
    'learning_rate': 0.001,
    'batch_size': 32,
    'num_epochs': 10
}
variant_json_path = os.path.join(exp_path, 'variant.json')
with open(variant_json_path, 'w') as f:
    json.dump(variant_data, f)

# Create progress.csv file
progress_csv_path = os.path.join(exp_path, 'progress.csv')
with open(progress_csv_path, 'w') as f:
    f.write('iteration,loss,accuracy\n')
    f.write('0,0.5,0.8\n')

# Create offline_itr_2000.pt file (dummy pytorch checkpoint)
pkl_path = os.path.join(exp_path, 'offline_itr_2000.pt')
with open(pkl_path, 'w') as f:
    f.write('dummy checkpoint')

ARGS = {
    'exp_path': exp_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
load_json Ran
ran on a synthesized input
yangrui2015/rorl/experiment_utils/utils.py
code served (permissive licence) · get_code("c0cd96043462cd86")
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 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 json
import tempfile
import os

# Create a temporary directory and JSON file for testing
temp_dir = tempfile.mkdtemp()
params_file_dir = os.path.join(temp_dir, 'experiment_001')
os.makedirs(params_file_dir, exist_ok=True)

params_json_path = os.path.join(params_file_dir, 'params.json')

# Create a valid JSON file with test data
test_data = {
    'learning_rate': 0.001,
    'batch_size': 32,
    'epochs': 10,
    'model_type': 'transformer',
    'args_data': {'extra': 'will_be_deleted'}
}

with open(params_json_path, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    'params_json_path': params_json_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
optimize_para Not yet run
unverified (harvested, no recorded run)
yangrui2015/rorl/attackers/attacker.py
code served (permissive licence) · get_code("de96789724b92f83")
How it ran

no invocation recorded.

Also present in other papers' code

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

Offline reinforcement learning (RL) provides a promising direction to exploit massive amount of offline data for complex decision-making tasks. Due to the distribution shift issue, current offline RL algorithms are generally designed to be conservative in value estimation and action selection. However, such conservatism can impair the robustness of learned policies when encountering observation deviation under realistic conditions, such as sensor errors and adversarial attacks. To trade off robustness and conservatism, we propose Robust Offline Reinforcement Learning (RORL) with a novel conservative smoothing technique. In RORL, we explicitly introduce regularization on the policy and the value function for states near the dataset, as well as additional conservative value estimation on these states. Theoretically, we show RORL enjoys a tighter suboptimality bound than recent theoretical results in linear MDPs. We demonstrate that RORL can achieve stateof-the-art performance on the general offline RL benchmark and is considerably robust to adversarial observation perturbations.

For agents

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

get_harvested_code_for_paper("2206.02829")
get_code_for_paper("2206.02829")
have("2206.02829")

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

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

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

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

Connect an agent — have() is free.