SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2008.01976 · 2020

Robust Deep Reinforcement Learning through Adversarial Loss

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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, 1 violated it and 1 has no contract verdict; 5 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/2008.01976.json · badge: /api/ran/2008.01976.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
tuomaso/radial_rl canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
tuomaso/radial_rl_v2 canonical (classifier label)
classifier basis: census
2 ran · 0 no recorded run
FunctionStatusWhere it lives
safe_mean Ran
ran, honoured the contract we drafted
tuomaso/radial_rl_v2/Procgen/eval_procgen.py
pointer only (licence: NONE); the stored copy get_code serves, from jlwu002/bcl, is pointer only (licence: NONE) · get_code("9e4158212d676038")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, tuomaso/radial_rl_v2 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.

activation_bound Ran
ran; our contract draft was wrong, not the code
tuomaso/radial_rl/A3C/ibp.py
code served (permissive licence) · get_code("69017b3a991e0815")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple neural network layer that can be called on tensors
layer = nn.Linear(4, 3)

# Create prev_upper and prev_lower tensors
# These should be compatible with the layer's input dimension (4)
prev_upper = torch.randn(2, 4)
prev_lower = torch.randn(2, 4)

ARGS = {
    "layer": layer,
    "prev_upper": prev_upper,
    "prev_lower": prev_lower
}
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 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
initial_bounds Ran
ran, violated the contract we drafted
tuomaso/radial_rl/A3C/ibp.py
code served (permissive licence) · get_code("cfb1c3dd218b92f0")
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 5, 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 torch

torch.manual_seed(0)

# x0 is a tensor of shape (b, c, h, w)
# The function performs simple arithmetic operations on it
x0 = torch.randn(2, 3, 4, 5)

# epsilon is a scalar value for the perturbation bounds
epsilon = 0.1

ARGS = {
    "x0": x0,
    "epsilon": epsilon,
}
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 tuple, ndim 5, 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
process_frame Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tuomaso/radial_rl/A3C/environment.py
code served (permissive licence) · get_code("23ff92a17dc4fd23")
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 3, dtype family float, shape (1, 80, 80) 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 a sample frame: height x width x channels (BGR)
# The function expects:
# - frame[crop1:crop2+160, :160] to work, so height must be > crop2+160
# - frame.mean(2) means 3 channels (color image)
frame = np.random.randint(0, 256, size=(400, 160, 3), dtype=np.uint8)

# Create conf dict with required keys
conf = {
    'crop1': 50,
    'crop2': 100,
    'dimension2': 80
}

ARGS = {
    'frame': frame,
    'conf': conf
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (1, 80, 80) — shape (1, 80, 80) 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
read_config Ran
ran; our contract draft was wrong, not the code
tuomaso/radial_rl/A3C/utils.py
code served (permissive licence) · get_code("4000c95fa330f2ce")
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 JSON config file
temp_dir = tempfile.mkdtemp()
config_file_path = os.path.join(temp_dir, "config.json")

config_data = {
    "model": "test_model",
    "learning_rate": 0.001,
    "batch_size": 32,
    "epochs": 10,
    "layers": [64, 128, 256]
}

with open(config_file_path, 'w') as f:
    json.dump(config_data, f)

ARGS = {
    "file_path": config_file_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
record_game Ran
ran on a synthesized input
tuomaso/radial_rl/A3C/evaluate.py
code served (permissive licence) · get_code("081882af810c4967")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(12, 16)
        self.fc2 = nn.Linear(16, 4)
    
    def forward(self, x):
        x = x.view(x.size(0), -1)
        hidden = torch.relu(self.fc1(x))
        output = self.fc2(hidden)
        return hidden, output

class SimpleEnv:
    def __init__(self):
        self.step_count = 0
        self.max_steps = 3
    
    def reset(self):
        self.step_count = 0
        return np.random.rand(3, 4).astype(np.float32)
    
    def step(self, action):
        self.step_count += 1
        next_state = np.random.rand(3, 4).astype(np.float32)
        reward = 1.0
        done = self.step_count >= self.max_steps
        info = True if done else False
        return next_state, reward, done, info

class Args:
    def __init__(self):
        self.gpu_id = -1

curr_model = SimpleModel()
env = SimpleEnv()
args = Args()

ARGS = {
    'curr_model': curr_model,
    'env': env,
    'args': args
}
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 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
rollout_one_step Ran
ran; our contract draft was wrong, not the code
tuomaso/radial_rl_v2/Procgen/train_procgen.py
pointer only (licence: NONE); the stored copy get_code serves, from jlwu002/bcl, is pointer only (licence: NONE) · get_code("9e82818c554c73e8")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, tuomaso/radial_rl_v2 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.

weighted_bound Ran
ran; our contract draft was wrong, not the code
tuomaso/radial_rl/A3C/ibp.py
code served (permissive licence) · get_code("eba320329ae9cb63")
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 torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small linear layer for testing
linear_layer = nn.Linear(4, 3)

# Create small tensors for prev_upper and prev_lower
# Shape: (batch=2, features=4) for linear, or (batch=2, channels=4, height=5, width=5) for conv2d
prev_upper_linear = torch.randn(2, 4)
prev_lower_linear = torch.randn(2, 4)

# Create a small Conv2d layer for testing
conv_layer = nn.Conv2d(in_channels=4, out_channels=3, kernel_size=3, stride=1, padding=1)

# Create small tensors for conv2d
prev_upper_conv = torch.randn(2, 4, 5, 5)
prev_lower_conv = torch.randn(2, 4, 5, 5)

# Test with linear layer
ARGS = {
    "layer": linear_layer,
    "prev_upper": prev_upper_linear,
    "prev_lower": prev_lower_linear,
}
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 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
atari_env Not yet run
unverified (harvested, no recorded run)
tuomaso/radial_rl/A3C/environment.py
code served (permissive licence) · get_code("a225ca9d1701067e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 8 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 8 later) and 1 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
activation_bound 5 other papers
1 dated earlier, 4 later
1907.09470 (2019-07)
Characterizing Attacks on Deep Reinforcement Learning
2111.06063 (2021-11)
On the Equivalence between Neural Network and Support Vector Machine
2402.02165 (2024-02)
Towards Optimal Adversarial Robust Q-learning with Bellman Infinity-error
and 2 more not named here
read_config 5 other papers
2 dated earlier, 3 later
1809.00397 (2018-09)
Visual Transfer between Atari Games using Competitive Reinforcement Learning
2002.03519 (2020-02)
Self-Attentive Associative Memory
2402.02165 (2024-02)
Towards Optimal Adversarial Robust Q-learning with Bellman Infinity-error
and 2 more not named here
initial_bounds 4 other papers
1 dated earlier, 3 later
1907.09470 (2019-07)
Characterizing Attacks on Deep Reinforcement Learning
2111.06063 (2021-11)
On the Equivalence between Neural Network and Support Vector Machine
2402.02165 (2024-02)
Towards Optimal Adversarial Robust Q-learning with Bellman Infinity-error
and 1 more not named here
weighted_bound 4 other papers
1 dated earlier, 3 later
1907.09470 (2019-07)
Characterizing Attacks on Deep Reinforcement Learning
2402.02165 (2024-02)
Towards Optimal Adversarial Robust Q-learning with Bellman Infinity-error
2403.04050 (2024-03)
Belief-Enriched Pessimistic Q-Learning against Adversarial State Perturbations
and 1 more not named here
atari_env 1 other paper
1 later
2406.04724 (2024-06)
ON MINIMIZING ADVERSARIAL COUNTERFACTUAL ER-ROR IN ADVERSARIAL RL
process_frame 1 other paper
1 later
2406.04724 (2024-06)
ON MINIMIZING ADVERSARIAL COUNTERFACTUAL ER-ROR IN ADVERSARIAL RL
rollout_one_step 1 other paper
1 later
2206.10057 (2022-06)
Robust Deep Reinforcement Learning through Bootstrapped Opportunistic Curriculum
safe_mean 1 other paper
1 later
2206.10057 (2022-06)
Robust Deep Reinforcement Learning through Bootstrapped Opportunistic Curriculum

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

Recent studies have shown that deep reinforcement learning agents are vulnerable to small adversarial perturbations on the agent's inputs, which raises concerns about deploying such agents in the real world. To address this issue, we propose RADIAL-RL, a principled framework to train reinforcement learning agents with improved robustness against $l_p$-norm bounded adversarial attacks. Our framework is compatible with popular deep reinforcement learning algorithms and we demonstrate its performance with deep Q-learning, A3C and PPO. We experiment on three deep RL benchmarks (Atari, MuJoCo and ProcGen) to show the effectiveness of our robust training algorithm. Our RADIAL-RL agents consistently outperform prior methods when tested against attacks of varying strength and are more computationally efficient to train. In addition, we propose a new evaluation method called Greedy Worst-Case Reward (GWC) to measure attack agnostic robustness of deep RL agents. We show that GWC can be evaluated efficiently and is a good estimate of the reward under the worst possible sequence of adversarial attacks. All code used for our experiments is available at https://github.com/tuomaso/radial_rl_v2.

For agents

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

get_harvested_code_for_paper("2008.01976")
get_code_for_paper("2008.01976")
have("2008.01976")

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

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

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

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

Connect an agent — have() is free.