Title: Spectral-Risk Safe Reinforcement Learning with Convergence Guarantees
Venue: NeurIPS 2024
Accepted: yes
Keywords: Safe Reinforcement Learning

Risk Constraint

Spectral Risk Measure
Abstract: The field of risk-constrained reinforcement learning (RCRL) has been developed to effectively reduce the likelihood of worst-case scenarios by explicitly handling risk-measure-based constraints.
However, the nonlinearity of risk measures makes it challenging to achieve convergence and optimality.
To overcome the difficulties posed by the nonlinearity, we propose a spectral risk measure-constrained RL algorithm, spectral-risk-constrained policy optimization (SRCPO), a bilevel optimization approach that utilizes the duality of spectral risk measures.
In the bilevel optimization structure, the outer problem involves optimizing dual variables derived from the risk measures, while the inner problem involves finding an optimal policy given these dual variables.
The proposed method, to the best of our knowledge, is the first to guarantee convergence to an optimum in the tabular setting.
Furthermore, the proposed method has been evaluated on continuous control tasks and showed the best performance among other RCRL algorithms satisfying the constraints.
Our code is available at https://github.com/rllab-snu/Spectral-Risk-Constrained-RL.

Spectral-Risk Safe Reinforcement Learning with Convergence Guarantees

Abstract

The field of risk-constrained reinforcement learning (RCRL) has been developed to effectively reduce the likelihood of worst-case scenarios by explicitly handling risk-measure-based constraints. However, the nonlinearity of risk measures makes it challenging to achieve convergence and optimality. To overcome the difficulties posed by the nonlinearity, we propose a spectral risk measureconstrained RL algorithm, spectral-risk-constrained policy optimization (SRCPO) , a bilevel optimization approach that utilizes the duality of spectral risk measures. In the bilevel optimization structure, the outer problem involves optimizing dual variables derived from the risk measures, while the inner problem involves finding an optimal policy given these dual variables. The proposed method, to the best of our knowledge, is the first to guarantee convergence to an optimum in the tabular setting. Furthermore, the proposed method has been evaluated on continuous control tasks and showed the best performance among other RCRL algorithms satisfying the constraints. Our code is available at https://github.com/rllab-snu/Spectral-Risk-Constrained-RL .

1 Introduction

Safe reinforcement learning (Safe RL) has been extensively researched [2, 15, 25], particularly for its applications in safety-critical areas such as robotic manipulation [3, 17] and legged robot locomotion [28]. In safe RL, constraints are often defined by the expectation of the discounted sum of costs [2, 25], where cost functions are defined to capture safety signals. These expectation-based constraints can leverage existing RL techniques since the value functions for costs follow the Bellman equation. However, they inadequately reduce the likelihood of significant costs, which can result in worst-case outcomes, because expectations do not capture information on the tail distribution. In real-world applications, avoiding such worst-case scenarios is particularly crucial, as they can lead to irrecoverable damage.

In order to avoid worst-case scenarios, various safe RL methods [10, 26] attempt to define constraints using risk measures, such as conditional value at risk (CVaR) [20] and its generalized form, spectral risk measures [1]. Yang et al. [26] and Zhang and Weng [30] have employed a distributional critic to estimate the risk constraints and calculate policy gradients. Zhang et al. [32] and Chow et al. [10] have introduced auxiliary variables to estimate CVaR. These approaches have effectively prevented worst-case outcomes by implementing risk constraints. However, the nonlinearity of risk measures makes it difficult to develop methods that ensure optimality. To the best of our knowledge, even for well-known risk measures such as CVaR, existing methods only guarantee local convergence [10, 32]. This highlights the need for a method that ensures convergence to a global optimum.

In this paper, we introduce a spectral risk measure-constrained RL (RCRL) algorithm called spectralrisk-constrained policy optimization (SRCPO) . Spectral risk measures, including CVaR, have a dual form expressed as the expectation over a random variable [7]. Leveraging this duality, we propose a bilevel optimization framework designed to alleviate the challenges caused by the nonlinearity of risk measures. This framework consists of two levels: the outer problem , which involves optimizing a dual variable that originates from the dual form of spectral risk measures, and the inner problem , which aims to find an optimal policy for a given dual variable. For the inner problem, we define novel risk value functions that exhibit linearity in performance difference and propose a policy gradient method that ensures convergence to an optimal policy in tabular settings. The outer problem is potentially non-convex, so gradient-based optimization techniques are not suitable for global convergence. Instead, we propose a method to model and update a distribution over the dual variable, which also ensures finding an optimal dual variable in tabular settings. As a result, to the best of our knowledge, we present the first algorithm that guarantees convergence to an optimum for the RCRL problem. Moreover, the proposed method has been evaluated on continuous control tasks with both single and multiple constraints, demonstrating the highest reward performance among other RCRL algorithms satisfying constraints in all tasks. Our contributions are summarized as follows:

We propose a bilevel optimization framework for RCRL, effectively addressing the complexities caused by the nonlinearity of risk measures.

The proposed method demonstrates convergence and optimality in tabular settings.

The proposed method has been evaluated on continuous control tasks with both single and multiple constraints, consistently outperforming existing RCRL algorithms.

2 Related Work

RCRL algorithms can be classified according to how constraints are handled and how risks are estimated. There are two main approaches to handling constraints: the Lagrangian [26, 29, 32] and the primal [15, 30] approaches. The Lagrangian approach deals with dual problems by jointly updating dual variables and policies, which can be easily integrated into the existing RL framework. In contrast, the primal approach directly tackles the original problem by constructing a subproblem according to the current policy and solving it. Subsequently, risk estimation can be categorized into three types. The first type [29, 32] uses an auxiliary variable to precisely estimate CVaR through its dual form. Another one [26, 30] approximates risks as the expectation of the state-wise risks calculated using a distributional critic [8]. The third one [15] approximates CVaR by assuming that cost returns follow Gaussians. Despite these diverse methods, they only guarantee convergence to local optima. In the field of risk-sensitive RL, Bäuerle and Glauner [7] have proposed an algorithm for spectral risk measures that ensures convergence to an optimum. They introduced a bilevel optimization approach, like our method, but did not provide a method for solving the outer problem. Furthermore, their approach to the inner problem is value-based, making it complicated to extend to RCRL, which typically requires a policy gradient approach.

3 Backgrounds

3.1 Constrained Markov Decision Processes

A constrained Markov decision process (CMDP) is defined as ⟨ S, A, P, ρ, γ, R, { C i } N i =1 ⟩ , where S is a state space, A is an action space, P is a transition model, ρ is an initial state distribution, γ is a discount factor, R : S × A × S ↦→ [ -R max , R max ] is a reward function, C i : S × A × S ↦→ [0 , C max ] is a cost function, and N is the number of cost functions. A policy π : S ↦→P ( A ) is defined as a mapping from the state space to the action distribution. Then, the state distribution given π is defined as d π ρ ( s ) := (1 -γ ) ∑ ∞ t =0 γ t P ( s t = s ) , where s 0 ∼ ρ , a t ∼ π ( ·| s t ) , and s t +1 ∼ P ( ·| s t , a t ) for ∀ t . The state-action return of π is defined as:

The state return and the return are defined, respectively, as:

The returns for a cost, Z π C i , Y π C i , and G π C i , are defined by replacing the reward with the i th cost. Then, a safe RL problem can be defined as maximizing the reward return while keeping the cost returns below predefined thresholds to ensure safety.

3.2 Spectral Risk Measures

In order to reduce the likelihood of encountering the worst-case scenario, it is required to incorporate risk measures into constraints. Conditional value at risk (CVaR) is a widely used risk measure in finance [20], and it has been further developed into a spectral risk measure in [1], which provides a more comprehensive framework. A spectral risk measure with spectrum σ is defined as:

where σ is an increasing function, σ ≥ 0 , ∫ 1 0 σ ( u ) du = 1 , and F X is the cumulative density function (CDF) of the random variable X . By appropriately defining the function σ , various risk measures can be established, and examples are as follows:

where α ∈ [0 , 1) represents a risk level, and the measures become risk neutral when α = 0 . Furthermore, it is known that the spectral risk measure has the following dual form [7]:

where g : R ↦→ R is an increasing convex function, and g ∗ ( y ) := sup x xy -g ( x ) is the convex conjugate function of g . For example, CVaR is expressed as CVaR α ( X ) = inf β E [ 1 α ( X -β ) + ] + β , where g ( x ) = ( x -β ) + / (1 -α ) , and the integral part of the conjugate function becomes β . We define the following sub-risk measure corresponding to the function g as follows:

Then, R σ ( X ) = inf g R g σ ( X ) . Note that the integral part is independent of X and only serves as a constant value of risk. As a result, the sub-risk measure can be expressed using the expectation, so it provides computational advantages over the original risk measure in many operations. We will utilize this advantage to show optimality of the proposed method.

3.3 Augmented State Spaces

As mentioned by Zhang et al. [32], a risk-constrained RL problem is non-Markovian, so a historyconditioned policy is required to solve the problem. Also, Bastani et al. [6] showed that an optimal history-conditioned policy can be expressed as a Markov policy defined in a newly augmented state space, which incorporates the discounted sum of costs as part of the state. To follow these results, we define an augmented state as follows:

Then, the CMDP is modified as follows:

and the policy π ( ·| ¯ s ) is defined on the augmented state space.

4 Proposed Method

The risk measure-constrained RL (RCRL) problem is defined as follows:

where d i is the threshold of the i th constraint. Due to the nonlinearity of the risk measure, achieving an optimal policy through policy gradient techniques can be challenging. To address this issue, we

propose solving the RCRL problem by decomposing it into two separate problems. Using a feasibility function F , 2 the RCRL problem can be rewritten as follows:

where (a) is the inner problem, (b) is the outer problem, and { g i } N i =1 is denoted as a dual variable. It is known that if the cost functions are bounded and there exists a policy that satisfies the constraints of (5), there exists an optimal dual variable [7], which transforms the supremum into the maximum in (6). Then, the RCRL problem can be solved by 1) finding optimal policies for various dual variables and 2) selecting the dual variable corresponding to the policy that achieves the maximum expected reward return while satisfying the constraints.

The inner problem is then a safe RL problem with sub-risk measure constraints. However, although the sub-risk measure is expressed using the expectation as in (3), the function g causes nonlinearity, which makes difficult to develop a policy gradient method. To address this issue, we propose novel risk value functions that show linearity in the performance difference between two policies. Through these risk value functions, we propose a policy update rule with convergence guarantees for the inner problem in Section 5.2.

The search space of the outer problem is a function space, rendering it impractical. To address this challenge, we appropriately parameterize the function g i using a parameter β i ∈ B ⊂ R M -1 in Section 6.1. Then, we can solve the outer problem through a brute-force approach by searching the parameter space. However, it is computationally prohibitive, requiring exponential time regarding to the number of constraints and the dimension of the parameter space. Consequently, it is necessary to develop an efficient method for solving the outer problem. Given the difficulty of directly identifying an optimal β ∗ , we instead model a distribution ξ to estimate the probability of a given β being optimal. We then propose a method that ensures convergence to an optimal distribution ξ ∗ , which deterministically samples an optimal β ∗ , in Section 6.2.

By integrating the proposed methods to solve the inner and outer problems, we finally introduce an RCRL algorithm called spectral-risk-constrained policy optimization (SRCPO) . We can obtain an optimal β ∗ by solving the outer problem and a set of optimal policies { π ∗ β | β ∈ B } by solving the inner problem, ultimately achieving the optimal policy π ∗ β ∗ of (5). An overview of SRCPO is presented in Algorithm 1, and a detailed pseudo-code of the proposed method is described in Algorithm 2. In the subsequent sections, we will provide details of the proposed methods to solve both the inner and the outer problems, respectively.

5 Inner Problem: Safe RL with Sub-Risk Measure

In this section, we propose a policy gradient method to solve the inner problem, defined as:

where constraints consist of the sub-risk measures, defined in (3). In the remainder of this section, we first introduce risk value functions to calculate the policy gradient of the sub-risk measures, propose a policy update rule, and finally demonstrate its convergence to an optimum in tabular settings.

5.1 Risk Value Functions

In order to derive the policy gradient of the sub-risk measure, we first define risk value functions. To this end, using the fact that e i,t = ∑ t -1 j =0 γ j c i,j /γ t and b t = γ t , where { e i,t } N i =1 and b t is defined in the augmented state ¯ s t , we expand the sub-risk measure of the i th cost as follows:

where f X is the probability density function (pdf) of a random variable X . To capture the value of the sub-risk measure, we can define risk value functions as follows:

Using the convexity of g , we present the following lemma on the bounds of the risk value functions: Lemma 5.1. Assuming that a function g is differentiable, V π i,g (¯ s ) and Q π i,g (¯ s, a ) are bounded by [ g ( e i b ) , g ( e i b + bC max / (1 -γ ))] , and | Q π i,g (¯ s, a ) -V π i,g (¯ s ) | ≤ bC , where C = C max 1 -γ g ′ ( C max 1 -γ ) and ¯ s = ( s, { e i } N i =1 , b ) .

The proof is provided in Appendix A. Lemma 5.1 means that the value of Q π i,g (¯ s, a ) -V π i,g (¯ s ) is scaled by b . To eliminate this scale, we define a risk advantage function as follows:

Now, we introduce a theorem on the difference in the sub-risk measure between two policies.

Theorem 5.2. Given two policies, π and π ′ , the difference in the sub-risk measure is:

The proof is provided in Appendix A. Since Theorem 5.2 also holds for the optimal policy, it is beneficial for showing optimality, as done in policy gradient algorithms of traditional RL [4]. Additionally, to calculate the advantage function, we use a distributional critic instead of directly estimating the risk value functions. This process is described in detail in Section 7.

5.2 Policy Update Rule

In this section, we derive the policy gradient of the sub-risk measure and introduce a policy update rule to solve the inner problem. Before that, we first parameterize the policy as π θ , where θ ∈ Θ , and denote the objective function as E [ G π θ R ] = J R ( π ) = J R ( θ ) and the i th constraint function as R g i σ i ( G π θ C i ) = J C i ( π ) = J C i ( θ ) . Then, using (8) and the fact that E a ∼ π ( ·| ¯ s ) [ A π i,g (¯ s, a )] = 0 , the policy gradient of the i th constraint function is derived as follows:

Now, we propose a policy update rule as follows:

where ζ t is a learning rate, F ( θ ) is Fisher information matrix, A † is Moore-Penrose inverse matrix of A , { λ t, 1 , ..., λ t,N , ν t } ⊂ [0 , λ max ] are weights, and λ t,i = 0 for i ∈ { i | J C i ( θ ) ≤ d i } and ∑ i λ t,i = 1 when the constraints are not satisfied. There are various possible strategies for determining λ t,i and ν t , which makes the proposed method generalize many primal approach-based safe RL algorithms [2, 15, 25]. Several options for determining λ t,i and ν t , as well as our strategy, are described in Appendix B.

5.3 Convergence Analysis

We analyze the convergence of the proposed policy update rule in a tabular setting where both the augmented state space and action space are finite. To demonstrate convergence in this setting, we use the softmax policy parameterization [4] as follows:

Then, we can show that the policy converges to an optimal policy if updated by the proposed method.

Theorem 5.3. Assume that there exists a feasible policy π f such that J C i ( π f ) ≤ d i -η for ∀ i , where η > 0 . Then, if a policy is updated by the proposed update rule with a learning rate ζ t that follows the Robbins-Monro condition [19], it will converge to an optimal policy of the inner problem.

The proof is provided in Appendix A.1, and the assumption of the existence of a feasible policy is commonly used in convergence analysis in safe RL [5, 12, 15]. Through this result, we can also demonstrate convergence of existing primal approach-based safe RL methods, such as CPO [2], PCPO [27], and P3O [31], 3 by identifying proper λ t,i and ν t strategies for these methods. We also provide an analysis of the convergence rate of the proposed method in Appendix A.2, employing a similar approach used in [25].

6 Outer Problem: Dual Optimization for Spectral Risk Measure

In this section, we propose a method for solving the outer problem that can be performed concurrently with the policy update of the inner problem. To this end, since the domain of the outer problem is a function space, we first introduce a procedure to parameterize the functions, allowing the problem to be practically solved. Subsequently, we propose a method to find an optimal solution for the parameterized outer problem.

6.1 Parameterization

Searching the function space of g is challenging. To address this issue, we discretize the spectrum function as illustrated in Figure 1 since the discretization allows g to be expressed using a finite number of parameters. The discretized spectrum is then formulated as:

where 0 ≤ η j ≤ η j +1 , 0 ≤ α j ≤ α j +1 ≤ 1 , and M is the number of discretizations. The proper values of η j and α j can be achieved by minimizing the norm of the function space, expressed as:

Now, we can show that the difference between the original risk measure and its discretized version is bounded by the inverse of the number of discretizations.

Lemma 6.1 (Approximation Error) . The difference between the original risk measure and its discretized version is:

The proof is provided in Appendix A. Lemma 6.1 means that as the number of discretizations increases, the risk measure converges to the original one. Note that the discretized version of the risk measure is also a spectral risk measure, indicating that the discretization process projects the original risk measure into a specific class of spectral risk measures. Now, we introduce a parameterization method as detailed in the following theorem:

Theorem 6.2. Let us parameterize the function g using a parameter β ∈ B ⊂ R M -1 as:

where β [ j ] ≤ β [ j +1] for j ∈ { 1 , .., M -2 } . Then, the following is satisfied:

According to Remark 2.7 in [7], the infimum function in (2) exists and can be expressed as an integral of the spectrum function if the reward and cost functions are bounded. By using this fact, Theorem 6.2 can be proved, and details are provided in Appendix A. Through this parameterization, the RCRL problem is now expressed as follows:

where β i ∈ B ⊂ R M -1 is a parameter of the i th constraint. In the remainder of the paper, we denote the constraint function R β i ˜ σ i ( G π C i ) as J C i ( π ; β ) , where β = { β i } N i =1 , and the policy for β as π β .

6.2 Optimization

To obtain the supremum of β in (12), a brute-force search can be used, but it demands exponential time relative to the dimension of β . Alternatively, β can be directly optimized via gradient descent; however, due to the difficulty in confirming the convexity of the outer problem, optimal convergence cannot be assured. To resolve this issue, we instead propose to find a distribution on β , called a sampler ξ ∈ P ( B ) N , that outputs the likelihood that a given β is optimal.

For detailed descriptions of the sampler ξ , the probability of sampling β is expressed as ξ ( β ) = ∏ N i =1 ξ [ i ]( β i ) , where ξ [ i ] is the i th element of ξ , and β i is β [ i ] . The sampling process is denoted by β ∼ ξ , where each component is sampled according to β i ∼ ξ [ i ] . Implementation of this sampling process is similar to the stick-breaking process [23] due to the condition β i [ j ] ≤ β i [ j + 1] for j ∈ { 1 , ..., M -2 } . Initially, β i [1] is sampled within [0 , C max / (1 -γ )] , and subsequent values β i [ j +1] are sampled within [ β i [ j ] , C max / (1 -γ )] . Then, our target is to find the following optimal distribution:

where β ∗ is an optimal solution of the outer problem (12). Once we obtain the optimal distribution, β ∗ can be achieved by sampling from ξ ∗ .

In order to obtain the optimal distribution, we propose a novel update process by parameterizing the sampler and building a loss function. First, we parameterize the sampler as ξ ϕ , where ϕ ∈ Φ , and define the following function:

It is known that for sufficiently large K > 0 , the optimal policy of the inner problem, π ∗ β , is also the solution of max π J ( π ; β ) , which means J R ( π ∗ β ) = max π J ( π ; β ) [31]. Using this fact, we build a target distribution for the sampler as: ¯ ξ t ( β ) ∝ exp( J ( π β ,t ; β )) , where π β ,t is the policy for β at time-step t . Then, we define a loss function using the cross-entropy ( H ) as follows:

Finally, we present an update rule along with its convergence property in the following theorem.

Theorem 6.3. Let us assume that the space of β is finite and update the sampler according to the following equation:

where ζ is a learning rate, and F † ( ϕ ) is the pseudo-inverse of Fisher information matrix of ξ ϕ . Then, under a softmax parameterization, the sampler converges to an optimal distribution defined in (13).

The proof is provided in Appendix A. As the loss function consists of the current policy π β ,t , the sampler can be updated simultaneously with the policy update.

RewardSum↑

CostRate1↓

CostRate3↓

aikago-vo

1.00

1.00

0.6

200

0.75

0.75

0.4

(ours)

400

0.50

0.50

AA

0.2

CPPO

5

-600

0.25

0.25

0

1

2

4

5

0.00

0

1

2

3

4

5

0.00

0

1

2

3

4

5

0.0

0

1

2

3

4

5

CVaR-CPO

Environmental steps

1e6

Environmental steps

1e6

Environmental steps

1e6

Environmental steps

1e6

SDAC

RewardSum↑

CostRate1↓

CostRate3↓

0

1.00

1.00

0.6

Cassie-vo

200

0.75

0.75

0.4

WCSAC-D

-400

0.50

0.50

SDPO

-600

0.25

0.25

0.2

Threshold

0

1

2

3

4

5

0.00

0

1

2

3

4

5

0.00

0

1

2

3

4

5

0.0

0

1

2

3

4

5

Environmental steps

1e6

Environmental steps

1e6

Environmental steps

1e6

Environmental steps

1e6

7 Practical Implementation

In order to calculate the policy gradient defined in (9), it is required to estimate the risk value functions. Instead of modeling them directly, we use quantile distributional critics [11] Z C i ,ψ (¯ s, a ; β ) : ¯ S × A × B N ↦→ R L , which approximate the pdf of Z π β C i (¯ s, a ) using L Dirac delta functions and are parameterized by ψ ∈ Ψ . Then, the risk value function can be approximated as:

and V π β i,g (¯ s ) can be achieved from E a ∼ π β ( ·| ¯ s ) [ Q π β i,g (¯ s, a )] . The distributional critics are trained to minimize the quantile regression loss [11] and details are referred to Appendix C. Additionally, to implement ξ ϕ , we use a truncated normal distribution N ( µ, σ 2 , a, b ) [9], where [ a, b ] is the sampling range. Then, the sampling process of ξ ϕ can be implemented as follows:

Additional details of the practical implementation are provided in Appendix C.

8 Experiments and Results

Tasks. The experiments are conducted on the Safety Gymnasium tasks [14] with a single constraint and the legged robot locomotion tasks [15] with multiple constraints. In the Safety Gymnasium, two robots-point and car-are used to perform two tasks: a goal task, which involves controlling the robot to reach a target location, and a button task, which involves controlling the robot to press a designated button. In these tasks, a cost is incurred when the robot collides with an obstacle. In the legged robot locomotion tasks, bipedal and quadrupedal robots are controlled to track a target velocity while satisfying three constraints related to body balance, body height, and foot contact timing. For more details, please refer to Appendix D.

Baselines. Many RCRL algorithms use CVaR to define risk constraints [15, 29, 32]. Accordingly, the proposed method is evaluated and compared with other algorithms under the CVaR constraints with α = 0 . 75 . Experiments on other risk measures are performed in Section 8.1. The baseline algorithms are categorized into three types based on their approach to estimating risk measures. First, CVaRCPO [32] and CPPO [29] utilize auxiliary variables to estimate CVaR. Second, WCSAC-Dist [26] and SDPO [30] approximate the risk measure R σ ( G π C ) with an expected value E s ∼D [ R σ ( Y π C ( s ))] . Finally, SDAC [15] approximates G π C as a Gaussian distribution and uses the mean and standard deviation of G π C to estimate CVaR. The hyperparameters and network structure of each algorithm are detailed in Appendix D. Note that both CVaR-CPO and the proposed method, SRCPO, use the augmented state space. However, for a fair comparison with other algorithms, the policy and critic networks of these methods are modified to operate on the original state space.

Results. Figures 2 and 3 show the training curves for the locomotion tasks and the Safety Gymnasium tasks, respectively. The reward sum in the figures refers to the sum of rewards within an episode,

SafetyPointGoall-vo

SafetyCarGoal1-vo

SafetyPointButtonl-vo

SafetyCarButtonl-vo

Reward Sum

1

30

20

20

30

15

10

5.0

7.5

(ours)

10

10

5

2.5

CPPO

0

0

0

0.0

CVaR-CPO

0

1

2

3

4

5

0

1

2

3

4

5

0.0

0.2

0.4

0.6

0.81.0

0.0

0.2

0.4

0.6

0.8

1.0

Environmental steps1e6

Environmental steps 1e6

Environmental steps 1e7

Environmental steps1e7

SDAC

0.08

0.100

0.20

Rate

→0.075

0.06

0.075

0.15

WCSAC-D

0.050

0.04

0.050

0.10

SDPO

0.025

0.02

0.025

0.05

Threshold

0.000

0

1

2

3

4

5

0.00

0

1

2

3

4

0.000

6.0

0.2

0.4

0.6

0.8

1.0

0.00

6.0

0.2

0.4

0.6

0.8

1.0

Environmental steps 1e6

Environmental steps 1e6

Environmental steps 1e7

Environmental steps1e7

le-2

3.0

Rate

2.5

Distribution

50

75

06

99

Distribution

50

75

06

99

2.0

Cost

1.5

50

75

06

99

50

75

06

99

1.0

50

75

90

99

50

75

06

99

12

14

1618

20

22

24

26

RewardSum

0.00

0.02

0.04

0.06

0.08

0.10

0.00

0.02

0.04

0.06

0.08

0.10

Wang α=0.5

CVaR α=0.5

Pow α=0.5

CostRate

CostRate

CVaR α=0.75

Pow α=0.75

Wang

CVaR

Pow

CVaR

CVaR

CVaR

CVaR α=0.9

Pow α=0.9

α=1.0

α=0.75

α=0.75

α=0.9

α=0.75

α=0.5

while the cost rate is calculated as the sum of costs divided by the episode length. In all tasks, the proposed method achieves the highest rewards among methods whose cost rates are below the specified thresholds. These results are likely because only the proposed method guarantees optimality. Specifically in the locomotion tasks, an initial policy often struggles to stabilize the balance of the robot, resulting in high costs from the start. Given this challenge, it is more susceptible to falling into local optima compared to other tasks, which enables the proposed method to outperform other baseline methods. Note that WCSAC-Dist shows the highest rewards in the Safety Gymnasium tasks, but the cost rates exceed the specified thresholds. This issue seems to arise from the approach to estimating risk constraints. WCSAC-Dist estimates the constraints based on the expected risk for each state, but it is lower than the original risk measure, leading to constraint violations.

8.1 Study on Various Risk Measures

In this section, we analyze the results when constraints are defined using various risk measures. To this end, we train policies in the point goal task under constraints based on the CVaR α and Pow α risk measures defined in (2), as well as the Wang risk measure [24]. Although the Wang risk measure is not a spectral but a distortion risk measure, our parameterization method introduced in Section 6.1 enables it to be approximated as a spectral risk measure, and the visualization of this process is provided in Appendix E. We conduct experiments with three risk levels for each risk measure and set the constraint threshold as 0 . 025 . Evaluation results are presented in Figure 4, and training curves are provided in Appendix E. Figure 4 (Right) shows intuitive results that increasing the risk level effectively reduces the likelihood of incurring high costs. Similarly, Figure 4 (Left) presents the trend across all risk measures, indicating that higher risk levels correspond to lower cost rates and decreased reward performance. Finally, Figure 4 (Middle) exhibits the differences in how each risk measure addresses worst-case scenarios. In the spectrum formulation defined in (1), CVaR applies a

uniform penalty to the tail of the cost distribution above a specified percentile, whereas measures like Wang and Pow impose a heavier penalty at higher percentiles. As a result, because CVaR imposes a relatively milder penalty on the worst-case outcomes compared to other risk measures, it shows the largest intervals between the 50 th and 99 th percentiles.

9 Conclusions and Limitations

In this work, we introduced a spectral-risk-constrained RL algorithm that ensures convergence and optimality in a tabular setting. Specifically, in the inner problem, we proposed a generalized policy update rule that can facilitate the development of a new safe RL algorithm with convergence guarantees. For the outer problem, we introduced a notion called sampler , which enhances training efficiency by concurrently training with the inner problem. Through experiments in continuous control tasks, we empirically demonstrated the superior performance of the proposed method and its capability to handle various risk measures. However, convergence to an optimum is shown only in a tabular setting, so future research may focus on extending these results to linear MDPs or function approximation settings. Furthermore, since our approach can be applied to risk-sensitive RL, future work can also implement the proposed method in this area.

Acknowledgments and Disclosure of Funding

This work was partly supported by Institute of Information & Communications Technology Planning &Evaluation (IITP) grant funded by the Korea government (MSIT) (No. 2019-0-01190, [SW Star Lab] Robot Learning: Efficient, Safe, and Socially-Acceptable Machine Learning, 70%) and the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. RS-2023-00211357, Smart Assembler: Robot Active Learning for Unseen Parts Assembly, 30%)

References

Carlo Acerbi. Spectral measures of risk: A coherent representation of subjective risk aversion. Journal of Banking & Finance , 26(7):1505-1518, 2002.

Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. Constrained policy optimization. In Proceedings of International Conference on Machine Learning , pages 22-31, 2017.

Patrick Adjei, Norman Tasfi, Santiago Gomez-Rosero, and Miriam AM Capretz. Safe reinforcement learning for arm manipulation with constrained Markov decision process. Robotics , 13(4): 63, 2024.

Alekh Agarwal, Sham M Kakade, Jason D Lee, and Gaurav Mahajan. On the theory of policy gradient methods: Optimality, approximation, and distribution shift. Journal of Machine Learning Research , 22(98):1-76, 2021.

Qinbo Bai, Amrit Singh Bedi, Mridul Agarwal, Alec Koppel, and Vaneet Aggarwal. Achieving zero constraint violation for constrained reinforcement learning via primal-dual approach. In Proceedings of the AAAI Conference on Artificial Intelligence , pages 3682-3689, 2022.

Osbert Bastani, Jason Yecheng Ma, Estelle Shen, and Wanqiao Xu. Regret bounds for risksensitive reinforcement learning. In Advances in Neural Information Processing Systems , pages 36259-36269, 2022.

Nicole Bäuerle and Alexander Glauner. Minimizing spectral risk measures applied to Markov decision processes. Mathematical Methods of Operations Research , 94(1):35-69, 2021.

Marc G. Bellemare, Will Dabney, and Rémi Munos. A distributional perspective on reinforcement learning. In Proceedings of International Conference on Machine Learning , pages 449-458, 2017.

John Burkardt. The truncated normal distribution. Department of Scientific Computing Website, Florida State University , 1(35):58, 2014.

Yinlam Chow, Mohammad Ghavamzadeh, Lucas Janson, and Marco Pavone. Risk-constrained reinforcement learning with percentile risk criteria. Journal of Machine Learning Research , 18 (1):6070-6120, 2017.

Will Dabney, Mark Rowland, Marc Bellemare, and Rémi Munos. Distributional reinforcement learning with quantile regression. In Proceedings of the AAAI Conference on Artificial Intelligence , 2018.

Dongsheng Ding, Kaiqing Zhang, Tamer Basar, and Mihailo Jovanovic. Natural policy gradient primal-dual method for constrained Markov decision processes. In Advances in Neural Information Processing Systems , pages 8378-8390, 2020.

Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In Proceedings of International Conference on Machine Learning , pages 1861-1870, 2018.

Jiaming Ji, Borong Zhang, Xuehai Pan, Jiayi Zhou, Juntao Dai, and Yaodong Yang. Safetygymnasium. GitHub repository , 2023.

Dohyeong Kim, Kyungjae Lee, and Songhwai Oh. Trust region-based safe distributional reinforcement learning for multiple constraints. In Advances in Neural Information Processing Systems , 2023.

Dohyeong Kim, Mineui Hong, Jeongho Park, and Songhwai Oh. Scale-invariant gradient aggregation for constrained multi-objective reinforcement learning. arXiv preprint arXiv:2403.00282 , 2024.

Puze Liu, Haitham Bou-Ammar, Jan Peters, and Davide Tateo. Safe reinforcement learning on the constraint manifold: Theory and applications. arXiv preprint arXiv:2404.09080 , 2024.

Yongshuai Liu, Jiaxin Ding, and Xin Liu. IPO: Interior-point policy optimization under constraints. In Proceedings of the AAAI Conference on Artificial Intelligence , pages 4940-4947, 2020.

Herbert Robbins and Sutton Monro. A stochastic approximation method. The Annals of Mathematical Statistics , pages 400-407, 1951.

R Tyrrell Rockafellar, Stanislav Uryasev, et al. Optimization of conditional value-at-risk. Journal of Risk , 2:21-42, 2000.

John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of International Conference on Machine Learning , pages 1889-1897. PMLR, 2015.

John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347 , 2017.

Jayaram Sethuraman. A constructive definition of Dirichlet priors. Statistica Sinica , pages 639-650, 1994.

Shaun S Wang. A class of distortion operators for pricing financial and insurance risks. Journal of Risk and Insurance , pages 15-36, 2000.

Tengyu Xu, Yingbin Liang, and Guanghui Lan. CRPO: A new approach for safe reinforcement learning with convergence guarantee. In Proceedings of International Conference on Machine Learning , pages 11480-11491, 2021.

Qisong Yang, Thiago D Simão, Simon H Tindemans, and Matthijs TJ Spaan. Safety-constrained reinforcement learning with a distributional safety critic. Machine Learning , 112(3):859-887, 2023.

Tsung-Yen Yang, Justinian Rosca, Karthik Narasimhan, and Peter J. Ramadge. Projection-based constrained policy optimization. In Proceedings of International Conference on Learning Representations , 2020.

Tsung-Yen Yang, Tingnan Zhang, Linda Luu, Sehoon Ha, Jie Tan, and Wenhao Yu. Safe reinforcement learning for legged locomotion. In Proceedings of IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) , pages 2454-2461, 2022.

Chengyang Ying, Xinning Zhou, Hang Su, Dong Yan, Ning Chen, and Jun Zhu. Towards safe reinforcement learning via constraining conditional value-at-risk. In Proceedings of International Joint Conference on Artificial Intelligence , 2022.

Jianyi Zhang and Paul Weng. Safe distributional reinforcement learning. In Proceedings of Distributed Artificial Intelligence , pages 107-128, 2022.

Linrui Zhang, Li Shen, Long Yang, Shixiang Chen, Bo Yuan, Xueqian Wang, and Dacheng Tao. Penalized proximal policy optimization for safe reinforcement learning. arXiv preprint arXiv:2205.11814 , 2022.

Qiyuan Zhang, Shu Leng, Xiaoteng Ma, Qihan Liu, Xueqian Wang, Bin Liang, Yu Liu, and Jun Yang. CVaR-constrained policy optimization for safe reinforcement learning. IEEE Transactions on Neural Networks and Learning Systems , 2024.

A Proofs

Lemma 5.1. Assuming that a function g is differentiable, V π i,g (¯ s ) and Q π i,g (¯ s, a ) are bounded by [ g ( e i b ) , g ( e i b + bC max / (1 -γ ))] , and | Q π i,g (¯ s, a ) -V π i,g (¯ s ) | ≤ bC , where C = C max 1 -γ g ′ ( C max 1 -γ ) and ¯ s = ( s, { e i } N i =1 , b ) .

Proof. Since 0 ≤ Y π C i (¯ s ) , Z π C i (¯ s, a ) ≤ C max / (1 -γ ) ,

when z < be i or z > be i + bC max / (1 -γ ) . Using the fact that g is an increasing and convex function,

Likewise, Q π i,g (¯ s, a ) also satisfies the above property. As a result,

Then, the maximum of | Q π i,g (¯ s, a ) -V π i,g (¯ s ) | is g ( be i + bC max / (1 -γ )) -g ( be i ) . Since b = γ t and e i = ∑ t -1 k =0 γ k C i ( s k , a k , s k +1 ) /γ t , where t is the current time step,

Consequently,

Theorem 5.2. Given two policies, π and π ′ , the difference in the sub-risk measure is:

Proof. Since the following equation is satisfied:

we can say Q π i,g (¯ s, a ) = E ¯ s ′ ∼ P ( ·| ¯ s,a ) [ V π i,g (¯ s ′ )] . Using this property,

Using the definition of V π i,g i (¯ s t ) and the dominated convergence theorem,

By combining (15) and (16),

Lemma 6.1 (Approximation Error) . The difference between the original risk measure and its discretized version is:

Proof. The difference is:

The value of (11) is || σ -˜ σ || 1 and is smaller than the value of the following problem:

since the search space is smaller than the original one. As the value of (17) is smaller than max u | σ ( u ) -˜ σ ( u ) | ≤ σ (1) /M , || σ -˜ σ || 1 ≤ σ (1) /M . Consequently,

Theorem 6.2. Let us parameterize the function g using a parameter β ∈ B ⊂ R M -1 as:

where β [ j ] ≤ β [ j +1] for j ∈ { 1 , .., M -2 } . Then, the following is satisfied:

Proof. Since g β ( x ) is an increasing convex function, R ˜ σ ( X ) ≤ R g β ˜ σ ( X ) =: R β ˜ σ ( X ) . In addition, according to Remark 2.7 in [1], there exists ˜ g such that ˜ g = arg inf g R g ˜ σ ( X ) , and its derivative is expressed as ˜ g ′ = ˜ σ ( F X ( x )) . Using this fact, we can formulate ˜ g by integrating its derivative as follows:

where C is a constant. Since for any constant C , R ˜ g ˜ σ ( X ) has the same value due to the integral part of ˜ g ∗ in (3), we set C as zero. Also, we can express ˜ g ( x ) as g ˜ β ( x ) , where ˜ β [ j ] is F -1 X ( α j ) due to the definition of g β . As a result, the following is satisfied:

Theorem 6.3. Let us assume that the space of β is finite and update the sampler according to the following equation:

where ζ is a learning rate, and F † ( ϕ ) is the pseudo-inverse of Fisher information matrix of ξ ϕ . Then, under a softmax parameterization, the sampler converges to an optimal distribution defined in (13).

Proof. Since we assume that the space of β is finite, the sampler can be expressed using the softmax parameterization as follows:

If we update the parameter of the sampler as described in (14), the following is satisfied as in the natural policy gradient:

Furthermore, due to Theorem 5.3, if a policy π β ,t is updated by the proposed method, the policy converges to an optimal policy π ∗ β ,t . Then, if β is not optimal,

since lim t →∞ J ( π β ,t ; β ) -J ( π β ∗ ,t ; β ) = J ( π ∗ β ; β ) -J ( π ∗ β ∗ ; β ) < 0 . As a result,

Thus, ξ ϕ t converges to an optimal sampler.

A.1 Proof of Theorem 5.3

Our derivation is based on the policy gradient works by Agarwal et al. [4] and Xu et al. [25]. Due to the softmax policy parameterization, the following is satisfied:

where Z t (¯ s ) := ∑ a ∈ A π t ( a | ¯ s ) exp( θ t +1 (¯ s, a ) -θ t (¯ s, a )) . By the natural policy gradient,

Before proving Theorem 5.3, we first present several useful lemmas.

Lemma A.1. log Z t (¯ s ) is non-negative.

Proof. Due to the advantage functions in (19), ∑ a ∈ A π t ( a | ¯ s )( θ t +1 (¯ s, a ) -θ t (¯ s, a )) = 0 . Using the fact that a logarithmic function is concave,

Lemma A.2. D TV ( π t +1 ( ·| ¯ s ) , π t ( ·| ¯ s )) ≤ max a | θ t +1 (¯ s, a ) -θ t (¯ s, a ) | ≤ || θ t +1 -θ t || ∞ .

Proof. Using the Pinsker's inequality,

where (i) follows Lemma A.1, and (ii) follows the fact that ∑ a ∈ A π t ( a | ¯ s )( θ t +1 (¯ s, a ) -θ t (¯ s, a )) = 0 . As a result,

Theorem 5.3. Assume that there exists a feasible policy π f such that J C i ( π f ) ≤ d i -η for ∀ i , where η > 0 . Then, if a policy is updated by the proposed update rule with a learning rate ζ t that follows the Robbins-Monro condition [19], it will converge to an optimal policy of the inner problem.

Proof. We divide the analysis into two cases: 1) when the constraints are satisfied and 2) when the constraints are violated. First, let us consider the case where the constraints are satisfied. In this case, the policy is updated as follows:

Using Theorem 5.2,

where (i) follows Hölder's inequality, and (ii) follows Lemma A.2. Using (18) and (20),

where (i) is from the fact that d π ρ (¯ s ) = (1 -γ ) ∑ t γ t P (¯ s t = ¯ s ) ≥ (1 -γ ) ρ (¯ s ) . By combining (21) and (22), the following is satisfied for any ρ :

Then, the following is satisfied for any policy ˆ π :

where (i) follows (23) by substituting ρ into d ˆ π ρ . Now, let us consider the second case where constraints are violated. In this case, the policy is updated as follows:

As (21) derived in the first case,

Using (18) and (25),

By combining (26) and (27), the following is satisfied for any ρ :

As in (24), the following is satisfied for any policy ˆ π :

Now, the main inequalities for both cases have been derived. Let us denote by N the set of time steps in which the constraints are not violated. This means that if t ∈ N , J C i ( π t ) ≤ d i ∀ i . Then, using

(24) and (29), we have:

If t / ∈ N and λ t,i > 0 , J C i ( π t ) > d i and ∑ i λ t,i = 1 . Thus, ∑ i λ t,i ( J C i ( π f ) -J C i ( π t )) ≤ -η . By substituting ˆ π into π f in (30),

For brevity, we denote D KL ( π f || π 0 ) = ∑ ¯ s ∈ ¯ S d π f ρ (¯ s ) D KL ( π f ( ·| ¯ s ) || π 0 ( ·| ¯ s )) . Since ∑ t/ ∈N ζ t = ∑ t ζ t -∑ t ∈N ζ t , (30) can be modified as follows:

It can be simplified as follows:

If π 0 is set with positive values in all actions, D KL (ˆ π || π 0 ) is bounded for ∀ ˆ π . Additionally, due to the Robbins-Monro condition, RHS converges to some real number as T goes to infinity. Since η ∑ t ζ t in LHS goes to infinity, ∑ t ∈N ζ t ( J R ( π f ) -J R ( π t ) -η ) must go to minus infinity. It means that

∑ t ∈N ζ t = ∞ since | J R ( π ) | ≤ R max / (1 -γ ) . By substituting ˆ π into π ∗ in (30),

Since ∑ i λ t,i ( J C i ( π ∗ ) -J C i ( π t )) ≤ 0 for t / ∈ N , the above equation is rewritten as follows:

Since ∑ t ∈N ζ t = ∞ and the Robbins-Monro condition is satisfied, the following must be held:

where N [ t ] is the t th element of N . Consequently, the policy converges to an optimal policy.

A.2 Convergence Rate

In this section, we analyze the convergence rate of the proposed method. We adopt the finite-time analysis done by Xu et al. [25], and to do this, we make a few minor modifications to the policy update rule described in Section 5.2 as follows:

where η is a positive number. Then, we can show the convergence rate of the proposed method.

Theorem A.3. Let us set ζ = (1 -γ ) 2 . 5 / √ T and η = (2 D + 20 K 2 ) / ((1 -γ ) 2 . 5 √ T ) , where D := ∑ s d π ∗ ρ ( s ) D KL ( π ∗ ( ·| s ) || π 0 ( ·| s )) and K := max( Nλ max C max , λ max R max , R max , 1) . Then, the followings are satisfied:

Proof. By subtituting | J R ( π ∗ ) -J R ( π t ) | ≤ 2 R max / (1 -γ ) and | J C i ( π ∗ ) -J C i ( π t ) | ≤ 2 C max / (1 -γ ) into (30),

Using the definition of K ,

Given that D +2 Tζ 2 K 2 ( ζ +1) 2 / (1 -γ ) 5 +2 Tζ 2 K/ (1 -γ ) ≤ ζηT/ 2 , one of the following must hold: 1) |N| ≥ T/ 2 or 2) ∑ t ∈N ( J R ( π ∗ ) -J R ( π t )) ≤ 0 . Let us assume that neither condition is satisfied. Then,

which leads to a contradiction. Therefore, one of the two conditions must hold. Furthermore, if we assume |N| = 0 , it follows that ζηT ≤ ζηT/ 2 , which is also a contradiction. Hence, |N| ̸ = 0 . If |N| ≥ T/ 2 ,

The above inequality also holds for ∑ t ∈N ( J R ( π ∗ ) -J R ( π t )) ≤ 0 . Consequently,

B Weight Selection Strategy

In this section, we first identify ν t and λ t,i for existing primal approach-based safe RL algorithms and present our strategy. For the existing methods, we analyze several safe RL algorithms including constrained policy optimization (CPO, [2]), projection-based constrained policy optimization (PCPO, [27]), constraint-rectified policy optimization (CRPO, [25]), penalized proximal policy optimization (P3O, [31]), interior-point policy optimization (IPO, [18]), and safe distributional actor-critic (SDAC, [15]). Since the policy gradient is obtained differently depending on whether the constraints are satisfied (CS) or violated (CV), we analyze the existing methods for each of the two cases.

Case 1: Constraints are satisfied (CS). First, CPO [2] and SDAC [15] find a direction of the policy gradient by solving the following linear programming with linear and quadratic constraints (LQCLP):

where ϵ is a trust region size. The LQCLP can be addressed by solving the following dual problem:

where g ∗ ( λ, ν ) = 1 ν F † ( θ t ) ( ∇ J R ( θ t ) -∑ i λ i ∇ J C i ( θ t )) . Then, the policy is updated in the following direction:

which results in λ t,i = min( λ ∗ i /ζ t , λ max ) . P3O [31], PCPO [27], and CRPO [25] update the policy only using the objective function in this case as follows:

IPO [18] update a policy in the following direction:

where κ is a penalty coefficient. As a result, λ t,i is computed as min( κ/ (( d i -J C i ( θ t )) ζ t ) , λ max ) .

Case 2: Constraints are violated (CV). CPO, PCPO and IPO did not handle the constraint violation in multiple constraint settings, so we exclude them in this case. First, SDAC finds a recovery direction by solving the following quadratic programming (QP):

where we will denote { i | J C i ( θ t ) > d i } by I CV . The QP can be addressed by solving the following dual problem:

where g ∗ ( λ ) = -F † ( θ t ) ∑ i ∈ I CV λ i ∇ J C i ( θ t ) . Then, the policy is updated in the following direction:

If there is only a single constraint, PCPO is compatible with SDAC. Next, CRPO first selects a violated constraint, whose index denoted as k , and calculates the policy gradient to minimize the selected constraint as follows:

If there is only a single constraint, CPO is compatible with CRPO. Finally, P3O update the policy in the following direction:

which results in ν t = min(1 / ( ζ t κ | I CV | ) , λ max ) , and λ t,i = 1 / | I CV | if i ∈ I CV else 0 .

Implementation of trust region method. To this point, we have obtained the direction of the policy gradient g t , allowing the policy to be updated to θ t + ζ t g t . If we want to update the policy using a trust region method, as introduced in TRPO [21], we can adjust the learning rate ζ t as follows:

where ϵ t is a trust region size following the Robbins-Monro condition, g min and g max are hyperparamters, and Clip( x, a, b ) = min(max( x, a ) , b ) . By adjusting the learning rate, the policy can be updated mostly within the trust region, defined as { θ t + g | g T F ( θ t ) g ≤ ϵ 2 t } , while the learning rate still satisfies the Robbins-Monro condition. Accordingly, we also need to modify λ t,i for the CS case and ν t for the CV case, as they are expressed with the learning rate ζ t . We explain this modification process by using SDAC as an example. The direction of the policy gradient of SDAC for the CS case expressed as follows:

where ζ t in (31) is replaced with ϵ t . The learning rate ζ t is then calculated using g t and (32). Now, we need to express g t as F † ( θ t )( ∇ J R ( θ t ) -ζ t ∑ i λ t,i ∇ J C i ( θ t )) . To this end, we can use ζ t = ϵ t /C , where C = Clip( √ g T t F ( θ t ) g t , g min , g max ) . Consequently, λ t,i is expressed as follows:

and the maximum of λ t,i and ν t is adjusted to g max λ max .

Proposed strategy. Now, we introduce the proposed strategy for determining λ t,i and ν t . We first consider the CV case. Kim et al. [15] empirically showed that processing multiple constraints simultaneously at each update step effectively projects the current policy onto a feasible set of policies.

Therefore, we decide to use the same strategy as SDAC, which deals with constraints simultaneously, and it is written as follows:

where λ ∗ = arg max λ ≥ 0 1 2 g ∗ ( λ ) T F ( θ t ) g ∗ ( λ ) + ∑ i ∈ I CV λ i ( ∇ J C i ( θ t ) T g ∗ ( λ ) + J C i ( θ t ) -d i ) and g ∗ ( λ ) = -F † ( θ t ) ∑ i ∈ I CV λ i ∇ J C i ( θ t ) . Next, let us consider the CS case. We hypothesize that concurrently addressing both constraints and objectives when calculating the policy gradient can lead to more stable constraint satisfaction. Therefore, CPO, SDAC, and IPO can be suitable candidates. However, CPO and SDAC methods require solving the LQCLP whose dual problem is nonlinear, and IPO can introduce computational errors when J C i ( θ t ) is close to d i . To address these challenges, we propose to calculate the policy gradient direction by solving a QP instead of an LQCLP. By applying a concept of transforming objectives into constraints [16] to the safe RL problem, we can formulate the following QP:

where e := ϵ t √ ∇ J R ( θ t ) T F † ( θ t ) ∇ J R ( θ t ) . According to [16], e represents the maximum value of ∇ J R ( θ t ) T g when g is within the trust region, { g | g T F ( θ t ) g ≤ ϵ 2 t } . Therefore, the transformed constraint, ∇ J R ( θ t ) T g ≥ e , has the same effect of improving the objective function J R ( θ ) within the trust region. The QP is then addressed by solving the following dual problem:

where g ∗ ( λ, ν ) = F † ( θ t )( ν ∇ J R ( θ t ) -∑ i ∈ I CV λ i ∇ J C i ( θ t )) . Then, the policy is updated in the following direction:

and the learning rate is calculated using (32) to ensure that the policy is updated within the trust region. Finally, λ t,i is expressed as C min( λ ∗ i / ( ν ∗ ϵ t ) , λ max ) , where C = Clip( √ g T t F ( θ t ) g t , g min , g max ) .

C Implementation Details

In this section, we present a practical algorithm that utilizes function approximators, such as neural networks, to tackle more complex tasks. The comprehensive procedure is presented in Algorithm 2.

First, it is necessary to train individual policies for various β , so we model a policy network to be conditioned on β , expressed as π θ ( a | ¯ s ; β ) . This network structure enables the implementation of policies with various behaviors by conditioning the policy on different β values. In order to train this β -conditioned policy across a broad range of the β space, a ϵ -greedy strategy can be used. At the beginning of each episode, β is sampled uniformly with a probability of ϵ ; otherwise, it is sampled using the sampler ξ ϕ . In our implementation, we did not use the uniform sampling process by setting ϵ = 0 to reduce fine-tuning efforts, but it can still be used to enhance practical performance.

After collecting rollouts with the sampled β , the critic, policy, and sampler need to be updated. For the critic, a distributional target is calculated using the TD( λ ) method [15], and we update the critic networks to minimize the quantile regression loss [11], defined as follows:

where ρ l ( u ) := u · ( l -1 u< 0 ) , and ˆ Z C i (¯ s, a ; β ) is the target distribution of Z C i ,ψ (¯ s, a ; β ) . The policy gradient for a specific β can be calculated according to the update rule described in Section

Algorithm 2 Spectral-Risk-Constrained Policy Optimization (SRCPO)

Input: Policy parameter θ , sampler parameter ϕ , critic parameter ψ , and replay buffer D .

for epochs = 1 to P do for episodes = 1 to E do

if u ≤ ϵ , where u ∼ U [0 , 1] , then

Sample

β

from a uniform distribution:

where

β

i

[0] = 0

.

else

end if

Collect a trajectory τ = { ¯ s t , a t , r t , { c i,t } N i =1 } T t =0 using π θ ( a | ¯ s ; β ) , and store ( β , τ ) in D .

end for

for updates = 1 to U do

Sample ( β , τ ) ∼ D .

Update the critics, Z R,ψ (¯ s, a ; β ) and Z C i ,ψ (¯ s, a ; β ) , using the quantile regression loss. Calculate the policy gradient of π θ ( a | ¯ s ; β ) using the update rule, described in Section 5.2, and store it to G θ .

Calculate the gradient of the sampler ξ ϕ using the update rule, described in (14), and store it to G ϕ .

end for

Update the policy parameter by the average of G θ

.

Update the sampler parameter by the average of G ϕ .

end for

Output: π θ ( ·|· ; β ) , where β ∼ ξ ϕ .

5.2. Consequently, the policy is updated using the policy gradient calculated with β and rollouts, which are extracted from the replay buffer. Finally, the gradient of the sampler for a given β can be calculated as in (14), so the sampler is updated with the average of gradients, which are calculated across multiple β .

D Experimental Details

In this section, we provide details on tasks, network structure, and hyperparameter settings.

D.1 Task Description

There are two environments, legged robot locomotion [15] and Safety Gymnasium [14], and whose rendered images are presented in Figure 5.

Legged Robot Locomotion. The legged robot locomotion tasks aim to control bipedal and quadrupedal robots to maintain a specified target velocity, which consists of linear velocity in the X and Y directions and rotational velocity in the Z direction, without falling. Each robot takes actions as PD target joint positions at a frequency of 50 Hz, and a PD controller in each joint operates at 500 Hz. The dimension of the action space corresponds to the number of motors: ten for the bipedal robot and 12 for the quadrupedal robot. The state space includes the command, gravity vector, current joint positions and velocities, foot contact phase, and a history of the joint positions and

β

i

[

j

]

∼

U

(

β

i

[

j

-

1]

, C

/

(1

-

γ

))

∀

i

and

∀

j

,

velocities. The reward function is defined as the negative of the squared Euclidean distance between the current velocity and the target velocity. There are three cost functions to prevent robots from falling. The first cost is to balance the robot, which is formulated as 1 g [2] / || g || 2 ≥ cos( π/ 12) , where g is the gravity vector. This function is activated when the base frame of the robot is tilted more than 15 degrees. The second cost is to maintain the height of the robot above a predefined threshold, which is expressed as 1 h ≤ b , where h is the height of the robot, and b is set as 0 . 7 in the bipedal robot and 0 . 35 in the quadrupedal robot. The third cost is to match the foot contact state with the desired timing. It is defined as the average number of feet that do not touch the floor at the desired time. We set the thresholds for these cost functions as 0 . 025 / (1 -γ ) , 0 . 025 / (1 -γ ) , and 0 . 4 / (1 -γ ) , respectively, where (1 -γ ) converts the threshold value from an average time horizon scale to an infinite time horizon scale.

Safety Gymnasium. We use the goal and button tasks in the Safety Gymnasium [14], and both tasks employ point and car robots. The goal task is to control the robot to navigate to a target goal position without passing hazard area. The button task is to control the robot to push a designated button among several buttons without passing hazard area or hitting undesignated buttons. The dimension of the action space is two for all tasks. The state space dimensions are 60, 72, 76, and 88 for the point goal, car goal, point button, and car button tasks, respectively. For more details on the action and state, please refer to [14]. The reward function is defined to reduce the distance between the robot and either the goal or the designated button, with a bonus awarded at the moment of task completion. When the robot traverses a hazard area or collides with an obstacle, it incurs a cost of one, and the threshold for this cost is set as 0 . 025 / (1 -γ ) .

D.2 Network Structure

Across all algorithms, we use the same network architecture for the policy and critics. The policy network is structured to output the mean and standard deviation of a normal distribution, which is then squashed using the Tanh function as done in SAC [13]. The critic network is based on the quantile distributional critic [11]. Details of these structures are presented in Table 1. For the sampler ξ ϕ , we define a trainable variable ϕ ∈ R N × ( M -1) and represent the mean of the truncated normal distribution as µ i,ϕ [ j ] = exp( ϕ [ i, j ]) . To reduce fine-tuning efforts, we fix the standard deviation of the truncated normal distribution to 0 . 05 .

D.3 Hyperparameter Settings

The hyperparameter settings for all algorithms applied to all tasks are summarized in Table 2.

E Additional Experimental Results

E.1 Computational Resources

All experiments were conducted on a PC whose CPU and GPU are an Intel Xeon E5-2680 and NVIDIA TITAN Xp, respectively. The training time for each algorithm on the point goal task is reported in Table 3.

E.2 Experiments on Various Risk Measures

We have conducted studies on various risk measures in the main text. In this section, we first describe the definition of the Wang risk measure [24], show the visualization of the discretization process, and finally present the training curves of the experiments conducted in Section 8.1.

The Wang risk measure is defined as follows [24]:

Φ is the cumulative distribution function (CDF) of the standard normal distribution, and χ is called a distortion function. It can be expressed in the form of the spectral risk measure as follows:

and ϕ is the pdf of the standard normal distribution. Since σ α ( u ) goes to infinity when u is approaching one, σ α ( u ) at u = 1 is not defined. Thus, it is not a spectral risk measure. Nevertheless, our

parameterization method introduced in Section 6.1 can project Wang α onto a discretized class of spectral risk measures.

The discretization process can be implemented by minimizing (11), and the results are shown in Figure 6. In this process, the number of discretizations M is set to five. Additionally, visualizations of other risk measures are provided in Figure 7, and the optimized values of the parameters for the discretized spectrum, which are introduced in (10), are reported in the Table 4. Note that CVaR is already an element of the discretized class of spectral risk measures, as observed in Figure 7. Therefore, CVaR can be precisely expressed using a parameter with M = 1 .

Finally, we conducted experiments on the point goal task to check how the results are changed according to the risk level and the type of risk measures. The training curves for these experiments are shown in Figure 8.

Wang α =0.5

Wang α =1.0

Wang α = 1.5

Original

6

Original

Original

Discretized

Discretized

20

Discretized

Spectrum

b

2

Spectrum

b

4

Spectrum

b

10

1

2

S

Q

8.0

0.2

0.4

0.6

0.8

1.0

0

0.0

0.2

0.4

0.6

0.8

1.0

0

0.0

0.2

0.4

0.6

0.8

1.0

u

u

u

Pow α =0.5

Pow α =0.75

Pow α =0.9

2

4

10

Original

Original

Original

Spectrum a

Spectrum o

Spectrum o

Discretized

Discretized

Discretized

1

2

5

0

0

0

0.0

0.2

0.4

0.6

0.8

1.0

0.0

0.2

0.4

0.6

0.8

1.0

0.00

0.25

0.50

0.75

1.00

u

u

u

CVaRα=0.5

CVaRα=0.75

CVaRα=0.9

2

4

10

Original

Original

Original

Spectrum

a

Discretized

Spectrum

b

Discretized

Spectrum

b

Discretized

1

2

5

0

0

0

0.0

0.2

0.4

0.6

0.8

1.0

0.0

0.2

0.4

0.6

0.8

1.0

0.00

0.25

0.50

0.75

1.00

u

u

u

Powriskmeasure

CVaRriskmeasure

Wangriskmeasure

30

30

↑

30

Reward Sum

Reward Sum

Reward Sum

20

20

10

10

10

0

0

0

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

Environmental steps 1e6

Environmentalsteps

61e6

Environmental steps

1e6

0.08

0.08

0.08

→

→

→

Rate

0.06

Rate

0.06

Rate

0.06

0.04

0.04

0.04

Cost

Cost

Cost

0.02

0.02

0.02

0.00

0.00

0.00

0

1

2

3

4

5

0

1

2

3

4

5

0

1

2

3

4

5

Environmentalsteps

1e6

Environmentalsteps

1e6

Environmentalsteps

1e6

α=0.5

α=0.75

α=0.9

α=0.5

α=0.75

一

α=0.9

α=0.5

一

α=1.0

α=1.5

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [Yes]

Justification: The main claims in the abstact and introduction reflect the contributions of the paper.

Guidelines:

The answer NA means that the abstract and introduction do not include the claims made in the paper.

The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.

The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.

It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [Yes]

Justification: We have discussed the limitations in the last section of the main text.

Guidelines:

The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.

The authors are encouraged to create a separate "Limitations" section in their paper.

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.

The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.

The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.

The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.

If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.

While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.

3. Theory Assumptions and Proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [Yes]

Justification: We have provided the full set of assumptions and a proof, which is presented in Section A.

Guidelines:

The answer NA means that the paper does not include theoretical results.

All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced.

All assumptions should be clearly stated or referenced in the statement of any theorems.

The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.

Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.

Theorems and Lemmas that the proof relies upon should be properly referenced.

4. Experimental Result Reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: We have enclosed the code and provided the pseudo-code for reproducibility in Appendix C.

Guidelines:

The answer NA means that the paper does not include experiments.

If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.

If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.

Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.

While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example

(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.

(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.

(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).

(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [Yes]

Justification: We have enclosed the code.

Guidelines:

The answer NA means that paper does not include experiments requiring code.

Please see the NeurIPS code and data submission guidelines ( https://nips.cc/ public/guides/CodeSubmissionPolicy ) for more details.

While we encourage the release of code and data, we understand that this might not be possible, so 'No' is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).

The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ( https: //nips.cc/public/guides/CodeSubmissionPolicy ) for more details.

The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.

The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.

At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).

Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.

6. Experimental Setting/Details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: The experimental setting and details are provided in Appendix D.

Guidelines:

The answer NA means that the paper does not include experiments.

The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.

The full details can be provided either with the code, in appendix, or as supplemental material.

7. Experiment Statistical Significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [Yes]

Justification: We have reported the standard deviation of experimental results.

Guidelines:

The answer NA means that the paper does not include experiments.

The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).

The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)

The assumptions made should be given (e.g., Normally distributed errors).

It should be clear whether the error bar is the standard deviation or the standard error of the mean.

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.

For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).

If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.

8. Experiments Compute Resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [Yes]

Justification: We have described the computational resources in Section E.

Guidelines:

The answer NA means that the paper does not include experiments.

The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.

The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.

The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).

9. Code Of Ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

Justification: The paper conforms with the NeurIPS Code of Ethics.

Guidelines:

The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.

If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.

The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).

10. Broader Impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [NA]

Justification: This work has no societal impact.

Guidelines:

The answer NA means that there is no societal impact of the work performed.

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.

Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.

The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.

If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [NA]

Justification: This work has no such risks.

Guidelines:

The answer NA means that the paper poses no such risks.

Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.

Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.

We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [Yes]

Justification: We have cited the benchmark papers and included the licence for assets in the code.

Guidelines:

The answer NA means that the paper does not use existing assets.

The authors should cite the original paper that produced the code package or dataset.

The authors should state which version of the asset is used and, if possible, include a URL.

The name of the license (e.g., CC-BY 4.0) should be included for each asset.

For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

If this information is not available online, the authors are encouraged to reach out to the asset's creators.

13. New Assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [NA]

Justification: This work does not release new assets.

Guidelines:

The answer NA means that the paper does not release new assets.

Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.

The paper should discuss whether and how consent was obtained from people whose asset is used.

At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.

14. Crowdsourcing and Research with Human Subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

Justification: This works does not involve crowdsourcing nor research with human subjects.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.

According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.

15. Institutional Review Board (IRB) Approvals or Equivalent for Research with Human Subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Justification: This work does not involve crowdsourcing nor research with human subjects.

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.

We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper considers spectral-risk safe RL algorithm with convergence guarantee. In particular, the paper considers a constrained MDP approach where the objective is to maximize the expected cumulative reward subject to the constraint that the spectral-risk measure is below a certain threshold. The main challenge lies in solving the optimization problem as it requires solve a bi-level optimization framework. The paper proposes first proposes a policy gradient based approach for solving the inner problem, and then proposes a gradient-based approach to sample according to the optimal spectral risk-measure.\n\nSTRENGTHS:\n1. Developing a safe RL policy with spectral risk measure is important research problem.\n\n2. The paper provides convergence guarantees and effective policies.\n\n3. The paper also provides practical approaches for implementation. The empirical performance is good.\n\nWEAKNESSES:\n1. The paper is a little-bit dense to parse everything. \n\n2. While the paper provides a convergence guarantee, the paper did not provide any non-asymptotic rates for convergence. In particular, the sample-complexity guarantee has not been provided.\n\nQUESTIONS:\n1. In order to solve the inner-optimization problem, the paper considers a primal-dual type algorithm for solving the feasibility function. What types of feasibility functions $F$ have been considered? Can the authors provide some outline on how the dual-variable updates as shown in Appendix B ensure feasibility?\n\n2. For solving the outer optimization, the paper relies on minimizing the loss function. However, optimal policy that maximizes $J(\\pi,\\beta)$ is difficult because of the non-linearity in the feasibility function. Hence, the reviewer did not get how the algorithm solves the inner-optimization problem which seems to be different compared to the inner-optimization problem described in Section 5. \n\n3. The convergence result (Theorem 6.3) relies on the Robbins-Monroe condition. Is it satisfied (in particular, for the optimization framework considered in Section 6 which is different from Section 5)?\n\nLIMITATIONS:\nNot as such.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-08"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper proposes a spectral risk measure-constrained RL algorithm, called spectral-risk-constrained policy optimization (SRCPO). This algorithm leverages the duality of spectral risk measures and treats the risk-constrained RL problem as a bilevel optimization. In this bilevel optimization problem, the outer problem is to optimize dual variables derived from the risk measures, while the inner problem is to find an optimal policy given these dual variables. The proposed algorithm is the first to guarantee convergence to an optimum in the tabular setting. Furthermore, the authors conduct experiments on continuous control tasks, and show that the proposed algorithm achieves the best performance among the compared RCRL algorithms.\n\nSTRENGTHS:\n1.\tThe studied problem, i.e., spectral risk measure-constrained RL, is well-motivated and can be applied to safety-critical scenarios, e.g., healthcare and finance.\n2.\tThis paper is very well-written and easy to follow.\n3.\tThe authors design a general algorithm framework and provide the convergence guarantee for a family of spectral risk-constrained RL problems. \n4.\tEmpirical evaluations are also provided to demonstrate the performance superiority of the proposed algorithm in practice.\n\nWEAKNESSES:\n1.\tThe idea of handling risk-sensitive RL by solving an inner problem (i.e., find an optimal policy under a fixed dual variable) and an outer problem (i.e., optimize dual variables) is not new. This idea appears in prior risk-sensitive RL works, e.g., (although these prior works may not consider constraints)\n\n[1] Wang, Kaiwen, et al. \"Near-minimax-optimal risk-sensitive reinforcement learning with cvar.\" International Conference on Machine Learning, 2023.\n\n[2] Chen, Yu, et al. \"Provably Efficient Iterated CVaR Reinforcement Learning with Function Approximation and Human Feedback.\" International Conference on Learning Representations, 2023.\n\n2.\tThe current format of Algorithm 1 is not clear enough. The specific algorithm steps should be included, e.g., the policy update, the distribution update (how to find $\\xi$) and the sampling.\n3.\tIt seems that Theorems 5.3 and 6.3 are the theoretical guarantees for the inner and outer problems, respectively. Can the authors give the theoretical guarantee of the overall performance for the spectral risk measure-constrained RL problem?\n4.\tThe provided results only state that the algorithm will converge to the optimal policy. Can the authors comment on the convergence rate or sample complexity?\n\nQUESTIONS:\nPlease see the weaknesses above.\n\nLIMITATIONS:\nPlease see the weaknesses above.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 3, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-10"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nIn this paper, the authors have considered the framework of risk-constrained reinforcement learning (RCRL) by tackling risk-measure-based constraints. The non-linearity of risk meaures makes the  convergence of RL schemes challenging. In this paper, a spectral risk measure-constarined RL algorithm is proposed. The proposed algorithm is based on a bilevel optimization. The outer problem deals with optimization of dual variables, while the inner one finds the optimal solution given the a set of dual variables. The authors claims that the proposed scheme is the first method which convergs to optimality for tabular MDP problems. Simulation results are presented where the proposed methods are tested on continuous control tasks.\n\nSTRENGTHS:\nThe paper is well-written and easy to follow. The results and claims presented in the paper appears to be correct.\n\nWEAKNESSES:\nThere are some limitations with respect to the constructed loss function and scalability of the adopted linear interpolation mechanism.\n\nQUESTIONS:\n1. The proposed approach approximates the spectrum by a discretized spectrum. What is the gap in performance with respect to the optimal solution of the original system? Although in Theorem 6.2, it is derived that as $M$ becomes large, performance gap reduces to zero,  how does this $M$ scale as the number of states and actions increases?\n\n2. The intuition behind the sampling process and why it works is not clear.\n\n3. What is the rationale behind the loss function proposed by the authors? Why is the loss function novel? Is there any other loss function for which the scheme does work well? If yes, can the authors come up with a more general loss function? If no, then this is a limitation of the work that it works for only a specific type of loss function (constructed by the authors).\n\nLIMITATIONS:\nYes", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2024-07-12"}

comments: SUMMARY:
The paper provides the new spectral-risk-costrained policy optimization algorithm, that uses the duality of spectral measures, and bilevel optimization approach to address the risk constrained reinforcement learning problem, solving the inner primal problems and outer dual problem. The paper provides global convergence guarantees in the tabular setting. The paper supports the results with the experimental comparisons to other methods.

STRENGTHS:
The paper is well written, despite many complex notions used in the flow, they all are clearly introduced. The theoretical result seems to be solid and important to the community. The idea to solve the dual problem of the risk-constrained rl  using a sampler distribution seems to be novel too. The proofs are provided, however I did not check them carefully. The experiments demonstrate a good performance of the proposed method.

WEAKNESSES:
There are several things which are not very clearly defined and a few minor typos that I noticed. 

line 88: F_X is not defined, I believe it is a probability function?
line 168: where the log in eq. (9) comes from?

Conflicting notations: 
- Now, aplha is used both for denoting the learning rate and the risk parameter. Maybe, the authors could use different notations for these notions. 
- F is probably a probability function, and then a feasibility function (line 114). 
- in theorem 6.2 i is used to iterate over the discretization 1:M-1,  but later used to iterate over constraints 1:N, and j is used for discretizations. maybe use j in thm. 6.2 and other places consistently too?  

Typos: 

line 102: an -> a

QUESTIONS:
all questions are above in the weaknesses section

LIMITATIONS:
The limitations are discussed. There is no potential negative societal impact.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 4
DATE: 2024-07-12