SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.11927 · ICML · 2022

Constrained Variational Policy Optimization for Safe Reinforcement Learning

Bo Li, Wei Liu, Zhiwei Wu, Ding Zhao, Zuxin Liu, Zhepeng Cen, Vladislav Isenbaev

arXiv · PDF · Open in the Atlas

Code that ran

5 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 3 failures of our instrument; 6 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-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/2201.11927.json · badge: /api/ran/2201.11927.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
liuzuxin/cvpo-safe-rl canonical (classifier label)
classifier basis: classifier_2025
3 ran · 3 no recorded run
zifanwu/cal community
Papers with Code archive
2 ran · 3 no recorded run
FunctionStatusWhere it lives
bt Ran
ran; our contract draft was wrong, not the code
liuzuxin/cvpo-safe-rl/safe_rl/policy/cvpo.py
pointer only (licence: GPL-3.0) · get_code("7a753817cb0801b7")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, liuzuxin/cvpo-safe-rl, is not in the permissive set Syntology serves inline. 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.

GaussianPolicy Ran
ran on a synthesized input · constructed an object; no result was computed
zifanwu/cal/agent/cal.py
code served (permissive licence) · get_code("a2295f0701fc2bfc")
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 an instance of its own class, GaussianPolicy: the run constructed the object and did not call it, so no result was computed. 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 minimal args object
class Args:
    pass

args = Args()

# Create a minimal action_space object
class ActionSpace:
    def __init__(self):
        self.high = torch.tensor([1.0, 1.0, 1.0])
        self.low = torch.tensor([-1.0, -1.0, -1.0])

action_space = ActionSpace()

# Define ARGS with all parameters for GaussianPolicy.__init__
ARGS = {
    'args': args,
    'num_inputs': 4,
    'num_actions': 3,
    'hidden_dim': 8,
    'action_space': action_space,
}
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 GaussianPolicy — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GaussianPolicy 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
QcEnsemble Ran
ran on a synthesized input · constructed an object; no result was computed
zifanwu/cal/agent/cal.py
code served (permissive licence) · get_code("3af5f12862afaf0b")
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 an instance of its own class, QcEnsemble: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

ARGS = {
    "state_size": 4,
    "action_size": 3,
    "ensemble_size": 2,
    "hidden_size": 256,
}
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 QcEnsemble — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a QcEnsemble 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
btr Ran
ran; our contract draft was wrong, not the code
liuzuxin/cvpo-safe-rl/safe_rl/policy/cvpo.py
pointer only (licence: GPL-3.0) · get_code("548253ae95d04e97")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, liuzuxin/cvpo-safe-rl, is not in the permissive set Syntology serves inline. 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.

safe_inverse Ran
ran; our contract draft was wrong, not the code
liuzuxin/cvpo-safe-rl/safe_rl/policy/cvpo.py
pointer only (licence: GPL-3.0) · get_code("dff135af934deab2")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, liuzuxin/cvpo-safe-rl, is not in the permissive set Syntology serves inline. 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.

Agent Not yet run
unverified (harvested, no recorded run)
zifanwu/cal/agent/cal.py
code served (permissive licence) · get_code("e5ff05aed073a821")
How it ran

no invocation recorded.

CALAgent Not yet run
unverified (harvested, no recorded run)
zifanwu/cal/agent/cal.py
code served (permissive licence) · get_code("af538492c9636821")
How it ran

no invocation recorded.

gen_data_dir_name Not yet run
unverified (harvested, no recorded run)
liuzuxin/cvpo-safe-rl/script/experiment.py
pointer only (licence: GPL-3.0) · get_code("0160612bd4e4291b")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, liuzuxin/cvpo-safe-rl, is not in the permissive set Syntology serves inline. 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. No invocation recorded.

gen_exp_name Not yet run
unverified (harvested, no recorded run)
liuzuxin/cvpo-safe-rl/script/experiment.py
pointer only (licence: GPL-3.0) · get_code("ab8d61d136e13ca0")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, liuzuxin/cvpo-safe-rl, is not in the permissive set Syntology serves inline. 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. No invocation recorded.

init_weights Not yet run
unverified (harvested, no recorded run)
zifanwu/cal/agent/cal.py
code served (permissive licence) · get_code("c596497eefe6dd51")
How it ran

no invocation recorded.

trial_name_creator Not yet run
unverified (harvested, no recorded run)
liuzuxin/cvpo-safe-rl/script/experiment.py
pointer only (licence: GPL-3.0) · get_code("d134ec4327fe1db7")
How it ran

The body of this sample is withheld: GPL-3.0, as GitHub detects it on this paper's repository, liuzuxin/cvpo-safe-rl, is not in the permissive set Syntology serves inline. 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. No invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 5 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 5 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.

FunctionAlso present inEarliest-datedOthers named
init_weights
brick of this paper's assembly: helper
2 other papers
2 later
2210.07573 (2022-10)
Model-based Safe Deep Reinforcement Learning via a Constrained Proximal Policy Optimization Algorithm
2401.14758 (2024-01)
Off-Policy Primal-Dual Safe Reinforcement Learning
Agent
brick of this paper's assembly: helper
1 other paper
1 later
2203.11176 (2022-03)
One After Another: Learning Incremental Skills for a Changing World
bt 1 other paper
1 later
2301.10923 (2023-01)
Trust Region-Based Safe Distributional Reinforcement Learning for Multiple Constraints
btr 1 other paper
1 later
2301.10923 (2023-01)
Trust Region-Based Safe Distributional Reinforcement Learning for Multiple Constraints
safe_inverse 1 other paper
1 later
2301.10923 (2023-01)
Trust Region-Based Safe Distributional Reinforcement Learning for Multiple Constraints

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

Safe reinforcement learning (RL) aims to learn policies that satisfy certain constraints before deploying them to safety-critical applications. Previous primal-dual style approaches suffer from instability issues and lack optimality guarantees. This paper overcomes the issues from the perspective of probabilistic inference. We introduce a novel Expectation-Maximization approach to naturally incorporate constraints during the policy learning: 1) a provable optimal non-parametric variational distribution could be computed in closed form after a convex optimization (E-step); 2) the policy parameter is improved within the trust region based on the optimal variational distribution (M-step). The proposed algorithm decomposes the safe RL problem into a convex optimization phase and a supervised learning phase, which yields a more stable training performance. A wide range of experiments on continuous robotic tasks shows that the proposed method achieves significantly better constraint satisfaction performance and better sample efficiency than baselines. The code is available at https://github.com/ liuzuxin/cvpo-safe-rl.

For agents

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

get_harvested_code_for_paper("2201.11927")
get_code_for_paper("2201.11927")
have("2201.11927")

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

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

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

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

Connect an agent — have() is free.