SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2205.05138 · NeurIPS · 2022

Efficient Risk-Averse Reinforcement Learning

Shie Mannor, Yinlam Chow, Ido Greenberg, Mohammad Ghavamzadeh

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 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 7 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2205.05138.json · badge: /api/ran/2205.05138.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
fictivename/cesor_ppo community (classifier label)
classifier basis not recorded on the link
9 ran · 1 no recorded run
ido90/CeSoR marked official in Papers with Code
Papers with Code archive
2 ran · 1 no recorded run
FunctionStatusWhere it lives
alpha_scheduler Ran
ran, honoured the contract we drafted
ido90/CeSoR/GCVaR.py
code served (permissive licence) · get_code("86e963f7b7e3adbd")
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 numpy as np

ARGS = {
    "iter": 5,
    "alpha": 0.1,
    "soft_cvar": 0.5,
    "n_iters": 100,
    "skip_iters": 10,
    "resolution": 0.01
}
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 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
boolean_argument Ran
ran on a synthesized input
fictivename/cesor_ppo/config/args_khazad_dum_varibad.py
code served (permissive licence) · get_code("ecc112d81d06387e")
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 bool, ndim 0, dtype family float, 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
from distutils.util import strtobool

torch.manual_seed(0)

# Analyzing the function:
# def boolean_argument(value):
#     """Convert a string value to boolean."""
#     return bool(strtobool(value))
#
# The function takes a single parameter 'value' which should be a string
# that strtobool can parse (e.g., "yes", "no", "true", "false", "1", "0", etc.)

ARGS = {
    "value": "true"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
distutils, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, 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
create_mlp Ran
ran; our contract draft was wrong, not the code
fictivename/cesor_ppo/stable_baselines3/common/torch_layers.py
pointer only (licence: MIT); the stored copy get_code serves, from whbyeon/ERAM-ARAM, is pointer only (licence: NONE) · get_code("2059f84e6efc564f")
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 whbyeon/ERAM-ARAM, 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.

cyan Ran
ran on a synthesized input
fictivename/cesor_ppo/launch_sweep.py
code served (permissive licence) · get_code("13e8fba090dd2ac4")
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 str. 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
from colorama import Style, Fore

# The function 'cyan' takes a single parameter 'msg' which should be a string
# It uses string concatenation and formatting operations on msg
# So we need to provide a valid string argument

msg = "Hello, World!"

ARGS = {
    "msg": msg
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
colorama, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
env_step Ran
ran on a synthesized input
fictivename/cesor_ppo/utils/helpers.py
code served (permissive licence) · get_code("80fc122d961f23c2")
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 numpy as np

torch.manual_seed(0)

class MockEnv:
    def step(self, action):
        # Returns (next_obs, reward, done, infos)
        next_obs = torch.randn(2, 4)
        reward = torch.randn(2)
        done = False
        infos = {}
        return next_obs, reward, done, infos
    
    def get_belief(self):
        return np.random.randn(2, 3).astype(np.float32)
    
    def get_task(self):
        return np.random.randn(2, 5).astype(np.float32)

class MockArgs:
    def __init__(self):
        self.norm_actions_post_sampling = True
        self.pass_belief_to_policy = True
        self.pass_task_to_policy = True
        self.decode_task = False

env = MockEnv()
action = torch.randn(2, 4, requires_grad=True)
args = MockArgs()

ARGS = {
    'env': env,
    'action': action,
    '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
get_actor_critic_arch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
fictivename/cesor_ppo/stable_baselines3/common/torch_layers.py
pointer only (licence: MIT); the stored copy get_code serves, from whbyeon/ERAM-ARAM, is pointer only (licence: NONE) · get_code("f2ded9c22d608f44")
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 whbyeon/ERAM-ARAM, 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.

get_args Ran
ran on a synthesized input
fictivename/cesor_ppo/config/args_khazad_dum_varibad.py
code served (permissive licence) · get_code("85e29bef821e4c23")
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 Namespace. 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 numpy as np
import argparse
from distutils.util import strtobool

torch.manual_seed(0)

def boolean_argument(value):
    """Convert a string value to boolean."""
    return bool(strtobool(value))

ARGS = {
    'rest_args': []
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
distutils, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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
quantile Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ido90/CeSoR/GCVaR.py
code served (permissive licence) · get_code("39c3d160a2608b68")
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 1, dtype family float, shape (3,) 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

# Set up arguments for the quantile function
x = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
q = np.array([0.25, 0.5, 0.75])
w = np.array([1.0, 1.0, 1.0, 1.0, 1.0])
is_sorted = False
estimate_underlying_quantile = False

ARGS = {
    'x': x,
    'q': q,
    'w': w,
    'is_sorted': is_sorted,
    'estimate_underlying_quantile': estimate_underlying_quantile
}
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 1, dtype family float, shape (3,) — shape (3,) 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
reset_env Ran
ran on a synthesized input
fictivename/cesor_ppo/utils/helpers.py
code served (permissive licence) · get_code("09c0cd83d9a903cb")
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 numpy as np

torch.manual_seed(0)

# Stand-in environment class
class StandInEnv:
    def __init__(self, num_processes, state_dim, belief_dim, task_dim):
        self.num_processes = num_processes
        self.state_dim = state_dim
        self.belief_dim = belief_dim
        self.task_dim = task_dim
        self._state = torch.randn(num_processes, state_dim)
        self._belief = np.random.randn(belief_dim).astype(np.float32)
        self._task = np.random.randn(task_dim).astype(np.float32)
    
    def reset(self, index=None):
        if index is None:
            return self._state.clone()
        else:
            self._state[index] = torch.randn(self.state_dim)
            return self._state[index].clone()
    
    def get_belief(self):
        return self._belief
    
    def get_task(self):
        return self._task
    
    def set_task(self, tasks):
        pass

# Stand-in CEM class
class StandInCEM:
    def sample(self):
        return (torch.randn(4), None)

# Stand-in args class
class Args:
    def __init__(self, num_processes, pass_belief_to_policy, pass_task_to_policy):
        self.num_processes = num_processes
        self.pass_belief_to_policy = pass_belief_to_policy
        self.pass_task_to_policy = pass_task_to_policy

num_processes = 2
state_dim = 4
belief_dim = 3
task_dim = 5

env = StandInEnv(num_processes, state_dim, belief_dim, task_dim)
args = Args(num_processes=num_processes, pass_belief_to_policy=True, pass_task_to_policy=True)
indices = None
state = None
cem = StandInCEM()

ARGS = {
    'env': env,
    'args': args,
    'indices': indices,
    'state': state,
    'cem': cem
}
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
squash_action Ran
ran on a synthesized input
fictivename/cesor_ppo/utils/helpers.py
code served (permissive licence) · get_code("c9ed03000a43a992")
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

torch.manual_seed(0)

class Args:
    def __init__(self, norm_actions_post_sampling):
        self.norm_actions_post_sampling = norm_actions_post_sampling

action = torch.randn(2, 4)

args = Args(norm_actions_post_sampling=True)

ARGS = {
    "action": action,
    "args": args
}
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 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
yellow Ran
ran on a synthesized input
fictivename/cesor_ppo/launch_sweep.py
code served (permissive licence) · get_code("aa0a3b5212b8b5ad")
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 str. 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 numpy as np
from colorama import Style, Fore

# The function 'yellow' takes a single parameter 'msg' which should be a string
# It applies colorama styling to the message and returns the styled string

ARGS = {
    "msg": "Hello, World!"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
colorama, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
GCVaR Not yet run
unverified (harvested, no recorded run)
ido90/CeSoR/GCVaR.py
code served (permissive licence) · get_code("afa5dec3b7dd3040")
How it ran

no invocation recorded.

mujoco_wrapper Not yet run
unverified (harvested, no recorded run)
fictivename/cesor_ppo/environments/wrappers.py
code served (permissive licence) · get_code("fcfceb90cb8b29ef")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 10 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
get_actor_critic_arch 4 other papers
2 dated earlier, 2 later
2010.14484 (2020-10)
One Solution is Not All You Need: Few-Shot Extrapolation via Structured MaxEnt RL
2111.03941 (2021-11)
Time Discretization-Invariant Safe Action Repetition for Policy Gradient Methods
2406.07826 (2024-06)
The Max-Min Formulation of Multi-Objective Reinforcement Learning: From Theory to a Model-Free Algorithm
and 1 more not named here
create_mlp 2 other papers
2 later
2406.07826 (2024-06)
The Max-Min Formulation of Multi-Objective Reinforcement Learning: From Theory to a Model-Free Algorithm
2510.20235 (2025-10)
Multi-Objective Reinforcement Learning with Max-Min Criterion: A Game-Theoretic Approach
quantile
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1703.03400 (2017-03)
Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks

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-23.

Repositories linked to this paper

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

Abstract

In risk-averse reinforcement learning (RL), the goal is to optimize some risk measure of the returns. A risk measure often focuses on the worst returns out of the agent's experience. As a result, standard methods for risk-averse RL often ignore high-return strategies. We prove that under certain conditions this inevitably leads to a local-optimum barrier, and propose a mechanism we call soft risk to bypass it. We also devise a novel cross entropy module for sampling, which (1) preserves risk aversion despite the soft risk; (2) independently improves sample efficiency. By separating the risk aversion of the sampler and the optimizer, we can sample episodes with poor conditions, yet optimize with respect to successful strategies. We combine these two concepts in CeSoR -Cross-entropy Soft-Risk optimization algorithm -which can be applied on top of any risk-averse policy gradient (PG) method. We demonstrate improved risk aversion in maze navigation, autonomous driving, and resource allocation benchmarks, including in scenarios where standard risk-averse PG completely fails. Our results and CeSoR implementation are available on Github. The stand-alone cross entropy module is available on PyPI.

For agents

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

get_harvested_code_for_paper("2205.05138")
get_code_for_paper("2205.05138")
have("2205.05138")

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

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

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

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

Connect an agent — have() is free.