<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Actor-free Policy via Convex Optimization</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ruoqi Zhang</string-name>
          <email>ruoqi.zhang@it.uu.se</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jens Sjölund</string-name>
          <email>jens.sjolund@it.uu.se</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Uppsala University, Department of Information Technology</institution>
          ,
          <addr-line>Box 337, SE-751 05, Uppsala</addr-line>
          ,
          <country country="SE">Sweden</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Traditional reinforcement learning methods optimize agents without considering safety, potentially resulting in unintended consequences. In this paper, we propose an optimal actor-free policy that optimizes a risk-sensitive criterion based on the conditional value at risk. The risk-sensitive objective function is modeled using an input-convex neural network ensuring convexity with respect to the actions and enabling the identification of globally optimal actions through simple gradientfollowing methods. Experimental results demonstrate the eficacy of our approach in maintaining efective risk control.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Risk-sensitive Actor-free Policy</title>
      <p>
        Over the past decade, reinforcement learning (RL) has
In this study, we focus on learning a risk-sensitive
actorachieved notable advancements [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Nonetheless,
tradifree policy within a safety-constrained framework. The
tional RL agents interact with their environment without
aim of the agent is to optimize future returns,
maintainaccounting for safety, potentially leading to unintended
ing compliance with safety cost constraints. The
riskand severe consequences in real-world applications. Safe
sensitive objective function is structured using an
inputRL addresses these concerns by ensuring that the learn- convex neural network [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], guaranteeing convexity with
ing process is both efective and safe. An intuitive way
respect to the actions (inputs). As a result, a globally
is to learn the policy subject to safety constraints, ac- optimal action can be identified.
counting for both parametric and inherent uncertainties
within the model and its environment [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>
        In this paper, we explore this approach by training
a policy that optimizes a risk-sensitive criterion based
on the conditional value at risk (CVaR). Traditional RL
algorithms typically aim to maximize the expected value
over all future cost-returns [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. By emphasizing the tail of
events.
      </p>
      <p>
        Additionally, we propose an actor-free architecture
in which the action is implicitly defined as the
solution to a convex optimization problem approximating
the risk-sensitive criterion. This eliminates the need for
incremental actor learning, which often necessitates
hyperparameter tuning and tricks to stabilize the training
process. With our actor-free approach, the policy aligns
optimally with the approximated criterion. This deviates
from prior research on CVaR-based safe RL [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ], which
uses a neural network to approximate the actor. Key to
our approach is to parameterize the risk-sensitive
objective function using an input-convex neural network [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ],
plicitly penalizes infrequent occurrences of catastrophic
the future cost-return distribution, our learned policy ex- state space,  ∈
Consequently, simple gradient-following techniques can
ensuring convexity with respect to the actions (inputs). space  under the policy  .
be used to find a globally optimal action.
      </p>
      <sec id="sec-2-1">
        <title>2.1. Constrained Markov Decision</title>
      </sec>
      <sec id="sec-2-2">
        <title>Processes</title>
        <p>We model the RL agent and its environment as a
constrained Markov Decision Process (CMDP), represented
by a tuple (, , , , , ,  ) where  ∈
R is the
 ×  →
 :  ×  →
 ×  →
safety threshold and</p>
        <p>R is the action space,  :  ×
R is the probabilistic transition function,</p>
        <p>R is the immediate reward function,  :
R is the immediate cost function,  ∈ R is the
∈ (0.0, 1.0) is the discount factor.</p>
        <p>The goal of the agent under the CMDP framework is to
learn a policy that maximizes the expected return given
an upper bound  on the (safety violation) cost,
maximize
E∼   ,∼  ()
∑︁  (, ) ≤ .</p>
        <p>]︃
]︃
(1)
where   is the stationary distribution over the state
at Risk</p>
      </sec>
      <sec id="sec-2-3">
        <title>2.2. Safety Critic with Conditional Value</title>
        <p>
          In CMDP, the safety violation costs are usually the
(in)finite-horizon discounted future cost-return as shown
in (1). However, only considering the expected value is
inmethods prefer a policy with lower cost, but also higher
variance, over a policy with slightly higher cost but much
lower variance. In other words, since higher variance
amounts to higher risk, the policy is not risk-averse. To
incorporate risk, we replace the expectation in the safety
violation cost with the Conditional Value at Risk (CVaR)
[
          <xref ref-type="bibr" rid="ref7">7</xref>
          ], a widely recognized risk measure that quantifies the
amount of tail risk. More precisely, CVaR is defined as
the expected reward of the worst  -percentile cases,
Γ (, ,  ) =. CVaR () = E [︀  |  ≥  − 1(1 −  )]︀
where 
a random variable and  − 1(1 −  ) is the  -percentile.
        </p>
        <p>
          ∈ (0, 1] is used to define the risk level,  is
Calculating the CVaR measure directly for lengthy time
horizons using, for example, sampling would be
excessively costly [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. Instead, we follow [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] and model
the distribution of cost-return (, ) as a Gaussian
distribution
        </p>
        <p>
          ︀(  (, ),  2 (, ))︀ where  (, ) =
=
E [∑︀∞
future cost-return and  2 (, ) its variance. This
Gaus − (, ) |  = ,  = ] is the expected
sian distribution leads to a closed-form CVaR measure of
future cost-return [
          <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
          ]
Γ  (, ,  ) =  (, ) +

( ) 
Φ(  )   (, ),
where  is the standard normal distribution, and Φ( · ) is
its CDF. Our risk-sensitive criterion can be written as,
maximize
        </p>
        <p>problem is a nonsmooth exact penalty formulation of
the constrained problem in (4). It is well-known that
for suficiently large</p>
        <p>the two problems have the same
solution [10]. Moreover, since this problem is convex,
ifnding a globally optimal action is tractable.</p>
        <p>We first define the PICNN over state-action pairs
 (, ;  ) where  is convex in action  but not convex
in state . Figure 1 illustrates the simple convex
net(2)
work structure used in our paper. As shown in the figure,
output 3 can be calculated by forwarding the network,
0 = , +1 = ˜(˜ + ˜),
1 = 0(0 + 0 + 0),
 = 0, 1
+1 = (</p>
        <p>
          +  + ),  = 1, 2 (6)
where  are weight matrices,  are bias terms,  is the
nonlinear activation function and 3 is the output of
the network which is made convex in the input  by
restricting the weight matrices 0 and  to be
nonnegative and the activation function  to be convex and
non-decreasing, e.g. a rectified linear unit (ReLU).
where  (, ) = E [∑︀∞
=
 − (, )| = ,  =
] is the expected future return. To learn the mean and
variance of cost-to-go, a distributional critic is learned
with 2-Wasserstein distance as the loss function [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ].
        </p>
      </sec>
      <sec id="sec-2-4">
        <title>2.3. Optimal Actor-free Policy via Input</title>
      </sec>
      <sec id="sec-2-5">
        <title>Convex Neural Network</title>
        <p>
          Policy gradient algorithms typically feature an
actorcritic structure, utilizing two distinct neural networks
known as the actor and the critic [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. The critic estimates
the reward-to-go or cost-to-go and the actor seeks to
infer the action  to maximize the estimation from the
critic. However, if the optimal action w.r.t the critic can
be easily identified, the need for modeling the actor is
eliminated. This can be achieved through
parameterization of the reward with Partially Input Convex Neural
Networks (PICNNs) [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. We utilize two PICNNs, one to
return distribution (, ) and  (, ). In this way,
the policy is actor-free since the optimal action * can be
determined directly by minimizing
        </p>
        <p>* = arg min − (, ) +  max{0, Γ(, ) − } (5)
approximate − (, ) and another to estimate the cost- to the distance between the reference signal and the
s
a
˜
W</p>
        <p>1
Wzs
0
Wza
0
Wza
1
Wza
2
u</p>
        <p>1
z
1
˜
W</p>
        <p>2
Wzu
0
Wzz
1
u</p>
        <p>2
z
2</p>
        <p>Wzu
1
Wzz
2
z
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Experiment</title>
      <p>The above method was evaluated in simulation on a
continuous control task: cascade water tank level control.</p>
      <p>As depicted in Figure 2a, the task is to maintain a
specific water level in the lower tank by changing the
input signal  represents the voltage to the pump. The
state of the system includes the heights of the two tanks,
() = [︀ 1()</p>
      <p>2()]︀  and the output is () = 2().</p>
      <p>The reward function contains two parts, one related
output, and the other to the cost incurred by a critical
event. To introduce a risk element, we define a “critical”
event as the level of the upper tank exceeding crit = 10
cm. Thus the reward and cost functions are defined as
(a) The water tank
(b) Training cost-return
(c) Training return
(d) Evaluation
(, ) = −| 2 − |, and (, ) = 1 − crit, respec- by a Gaussian distribution in order to get a closed-from
tively. The long-term safety threshold  is set to − 250. of CVaR. Future research could explore a more general
The system was discretized using the Euler method in the distribution.
simulation, with a sampling period of 2 seconds. Unlike
a real-world tank, there are no upper bounds for 1, 2
in the simulation. References</p>
      <p>
        Our learning algorithm to update reward critic and
safety critic is based on Twin Delayed Deep
Deterministic policy gradient algorithm (TD3) [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] to avoid
overestimating Q-values. As mentioned in Section 2.2, we use
a reward critic and a distributional safety critic. Further,
the policy is actor-free; the optimal action is found by a
gradient descent algorithm, Adam [11].
      </p>
      <p>We compare our method with its actor-critic version,
CVaR-TD3, using a standard neural network instead of
the PICNNs for actor, critic, and safety critic. The training
results are illustrated in Figure 2 and Figure 2b with two
metrics, average episodic returns, and average episodic
cost-returns. It can be observed that CVaR-TD3 has a
much higher variance, potentially attributed to the neural
network-structured actor getting stuck in poor local
minima, while our approach can identify the globally optimal
action, aided by the PICNNs. Careful tuning of the
hyperparameters could potentially mitigate this. Figure 2d
shows the evaluation of the learned policy. To highlight
the diferences between the methods, the state 1, 2
is clipped with a maximum value 20. We observe that
our method with  = 0.1 exhibits a more conservative
behavior, striving to maintain a safe distance from the
critical level (dashed red). Consequently, our approach
is also slightly farther from the goal level (dashed blue),
which is close to the critical level.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>V.</given-names>
            <surname>Mnih</surname>
          </string-name>
          , et al.,
          <article-title>Human-level control through deep reinforcement learning</article-title>
          ,
          <source>Nature</source>
          <volume>518</volume>
          (
          <year>2015</year>
          )
          <fpage>529</fpage>
          -
          <lpage>533</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>J.</given-names>
            <surname>Garcıa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Fernández</surname>
          </string-name>
          ,
          <article-title>A comprehensive survey on safe reinforcement learning</article-title>
          ,
          <source>Journal of Machine Learning Research</source>
          <volume>16</volume>
          (
          <year>2015</year>
          )
          <fpage>1437</fpage>
          -
          <lpage>1480</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Ha</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Tan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Levine</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Tan</surname>
          </string-name>
          ,
          <article-title>Learning to walk in the real world with minimal human efort</article-title>
          ,
          <source>in: Conference on Robot Learning</source>
          , PMLR,
          <year>2021</year>
          , pp.
          <fpage>1110</fpage>
          -
          <lpage>1120</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Q.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T. D.</given-names>
            <surname>Simão</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. H.</given-names>
            <surname>Tindemans</surname>
          </string-name>
          , M. T. Spaan, WCSAC:
          <article-title>Worst-case soft actor critic for safetyconstrained reinforcement learning</article-title>
          ,
          <year>2021</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Y. C.</given-names>
            <surname>Tang</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. Zhang</surname>
          </string-name>
          , R. Salakhutdinov,
          <article-title>Worst cases policy gradients</article-title>
          ,
          <source>in: Conference on Robot Learning</source>
          , PMLR,
          <year>2020</year>
          , pp.
          <fpage>1078</fpage>
          -
          <lpage>1093</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>B.</given-names>
            <surname>Amos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Xu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. Z.</given-names>
            <surname>Kolter</surname>
          </string-name>
          ,
          <article-title>Input convex neural networks</article-title>
          ,
          <source>in: International Conference on Machine Learning, PMLR</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>146</fpage>
          -
          <lpage>155</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>P.</given-names>
            <surname>Artzner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Delbaen</surname>
          </string-name>
          ,
          <string-name>
            <surname>J.-M. Eber</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Heath</surname>
          </string-name>
          ,
          <article-title>Coherent measures of risk</article-title>
          ,
          <source>Mathematical finance 9</source>
          (
          <year>1999</year>
          )
          <fpage>203</fpage>
          -
          <lpage>228</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Tamar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Glassner</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Mannor</surname>
          </string-name>
          ,
          <article-title>Optimizing the CVaR via sampling</article-title>
          ,
          <source>in: Proceedings of the AAAI Conference on Artificial Intelligence</source>
          , volume
          <volume>29</volume>
          ,
          <year>2015</year>
          , pp.
          <fpage>2993</fpage>
          -
          <lpage>2999</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>S.</given-names>
            <surname>Fujimoto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Hoof</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Meger</surname>
          </string-name>
          ,
          <article-title>Addressing function approximation error in actor-critic methods, 4</article-title>
          . Conclusions in: International conference on machine learning,
          <source>PMLR</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>1587</fpage>
          -
          <lpage>1596</lpage>
          .
          <article-title>We proposed a risk-sensitive actor-free policy with a [10]</article-title>
          <string-name>
            <given-names>S.</given-names>
            <surname>Wright</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Nocedal</surname>
          </string-name>
          , et al.,
          <article-title>Numerical optimization, CVaR criterion</article-title>
          .
          <source>The criterion is parameterized with input- Springer Science</source>
          <volume>35</volume>
          (
          <year>1999</year>
          )
          <article-title>7. convex neural networks ensuring convexity with respect</article-title>
          [11]
          <string-name>
            <given-names>D. P.</given-names>
            <surname>Kingma</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Ba</surname>
          </string-name>
          ,
          <article-title>Adam: A method for stochastic to the actions. Thus, the globally optimal action can be optimization, in: 3rd International Conference on found easily by simple gradient-descent methods</article-title>
          .
          <source>In the Learning Representations, ICLR</source>
          ,
          <year>2015</year>
          .
          <article-title>paper, future return and cost-return are approximated</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>