Risk-Averse Constrained Reinforcement Learning with Optimized Certainty Equivalents

Jane H. Lee, Baturay Saglam, Spyridon Pougkakiotis, Amin Karbasi, Dionysis Kalogerias

Introduction

Standard Reinforcement Learning (RL) typically focuses on optimizing for average performance. While effective in many domains, this risk-neutral approach is potentially dangerous in high-stakes scenarios—such as autonomous driving or medical robotics—where rare, catastrophic failures carry significant weight. In these contexts, an agent that performs perfectly 99% of the time but crashes in the remaining 1% may have a high "average" reward but is practically unusable.

This paper addresses the challenge of Risk-Averse Constrained RL (CRL), where agents must maximize rewards while strictly adhering to safety constraints under uncertainty. The authors introduce a framework that manages tail risks in both objectives and constraints, providing a theoretically sound method for training provably safer agents.

Optimized Certainty Equivalents and Reward-Based Risk

The proposed framework utilizes Optimized Certainty Equivalents (OCEs), a versatile family of risk measures that includes the widely used Conditional Value-at-Risk (CVaR). A key innovation of this work is the distinction between return-based and reward-based risk.

Most existing risk-averse methods apply risk measures to the total cumulative return at the end of an episode. In contrast, this paper applies risk measures to the occupancy measure (reward-based risk). This approach captures "per-stage" risk, making the agent sensitive to dangerous events at specific moments in time and space, rather than just the aggregate volatility of an entire trajectory.

Mathematical Framework and Exact Duality

A significant hurdle in constrained RL is the "duality gap"—the mathematical discrepancy that often arises when converting a constrained problem into an unconstrained one using Lagrangian multipliers. Many existing methods rely on approximations that do not perfectly map back to the original safety requirements.

The authors mathematically prove that their risk-averse formulation exhibits exact Lagrangian duality. As shown in the table above, the risk-averse primal problem can be transformed into a dual problem involving auxiliary risk variables ($t$) and occupancy measures ($\nu^\pi$) without losing exactness. This ensures that solving the dual minimax problem yields the true solution to the original risk-constrained problem.

The Modular Wrapper Algorithm

Leveraging this exact duality, the authors introduce a modular algorithm: Reward-Based SGDA with Risk Constraints. This method acts as a wrapper around standard, off-the-shelf RL solvers like Proximal Policy Optimization (PPO).

The algorithm dynamically modifies the environment's reward function using dual variables ($\lambda$) and auxiliary risk variables ($t$). While the inner RL solver updates the policy to maximize this modified reward, an outer Stochastic Gradient Descent Ascent (SGDA) loop updates the safety and risk parameters. This modularity allows practitioners to incorporate risk-aversion into existing RL pipelines with minimal architectural changes.

Experimental Evaluation

The framework was evaluated using the Safety-Gymnasium benchmark, a standard suite for safe RL. The researchers tested agents on various tasks, including Point, HalfCheetah, Hopper, Swimmer, and Walker2d, under two primary constraint types:

  1. Safe Navigation: Avoiding obstacles and adhering to environmental rules.
  2. Safe Velocity: Adhering to strict speed limits.

To simulate real-world stochasticity and test the limits of risk management, the authors injected 5% zero-mean Gaussian noise into the agents' actions.

Key Results

  • Strict Constraint Satisfaction: In navigation tasks, the proposed method achieved zero constraint violations. In comparison, a standard risk-neutral PPO agent recorded between 38 and 206 violations per episode, highlighting the inadequacy of average-case optimization for safety.
  • Accurate Risk Tracking: In velocity-constrained tasks, the auxiliary variable ($t$) converged precisely to the empirical $\beta$-upper quantile of the velocity distribution. This empirical result validates the mathematical theory, proving the agent can accurately bound its worst-case behaviors.
  • Robustness: Despite the introduced environmental noise, the agents maintained stable learning curves and high evaluation rewards over 18 million training steps.

Conclusion and Future Work

This work bridges the gap between theoretical optimization and applied safe RL by providing a framework that is both mathematically rigorous and practically implementable. By focusing on per-stage risk and proving exact duality, the authors offer a path toward RL agents that are not just high-performing on average, but reliably safe in the face of uncertainty.

Future research directions include addressing the computational intensity of the nested optimization loops and investigating whether strong duality holds unconditionally without the specific constraint qualifications assumed in this study.

Summary updated

BibTeX
@inproceedings{lee2025risk,
  author = {Jane H. Lee and Baturay Saglam and Spyridon Pougkakiotis and Amin Karbasi and Dionysis Kalogerias},
  title = {{Risk-Averse Constrained Reinforcement Learning with Optimized Certainty Equivalents}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=wrFaF1gA6R},
}
Figure