Return Capping: Sample Efficient CVaR Policy Gradient Optimisation

Harry Mead, Clarissa Costen, Bruno Lacerda, Nick Hawes

Abstract

Training risk-averse Reinforcement Learning (RL) agents using Conditional Value at Risk (CVaR) typically suffers from extreme sample inefficiency due to the practice of discarding the majority of training data. This paper introduces "Return Capping," a novel methodology that retains all trajectory data by capping maximum returns. We demonstrate that maximizing this capped expected return is mathematically equivalent to CVaR optimization. Our empirical results across various risk-aware benchmarks show that Return Capping significantly improves sample efficiency and convergence robustness compared to standard CVaR policy gradient methods.

1. Introduction

In safety-critical domains such as autonomous driving, healthcare, and finance, Reinforcement Learning (RL) agents must prioritize the avoidance of catastrophic outcomes over the maximization of average performance. Conditional Value at Risk (CVaR) has emerged as a standard metric for risk-aversion, focusing on the expected return of the worst $\alpha$ proportion of outcomes (e.g., the bottom 5%). However, optimizing for CVaR using standard Policy Gradient (PG) methods is notoriously difficult because these methods typically ignore the "successful" trajectories that fall outside the risk threshold, leading to a massive waste of environment interactions.

2. The Problem: Data Inefficiency in Risk-Averse RL

Standard CVaR-PG approaches optimize the risk metric by sampling a batch of trajectories and performing updates using only the subset of trajectories whose returns fall below the $\alpha$-quantile (the Value at Risk, or VaR). This approach introduces three primary failure modes:

  1. Sample Inefficiency: By discarding $1-\alpha$ of the data (often 95% or more), the agent requires significantly more environment steps to learn.
  2. Blindness to Success: Because the agent never "sees" the gradients from high-return trajectories, it cannot learn the specific sequences of actions that lead to successful, safe outcomes.
  3. Vanishing Gradients: In environments where the "tail" of the distribution is flat (e.g., many different trajectories result in the same failure penalty), the gradient signal disappears, causing training to stall.

3. Methodology: Return Capping

To address these limitations, we propose Return Capping. Instead of filtering out high-performing trajectories, we utilize the entire batch of data but truncate the total returns at a specific threshold, $C$.

3.1 Theoretical Equivalence

The core contribution of this work is the mathematical proof that if the cap $C$ is set to the VaR of the optimal CVaR policy, then maximizing the expected capped return is strictly equivalent to maximizing the CVaR itself. This allows us to transform a risk-averse objective into a standard expected-value objective that is compatible with existing, highly optimized RL algorithms.

3.2 Dynamic Cap Adjustment

Since the optimal VaR is unknown a priori, our algorithm approximates it dynamically during training. After each policy update, the agent calculates the VaR of the current batch and updates the cap $C$ using an exponential moving average. To ensure the method works with standard temporal difference learning and reward-to-go calculations, we adjust the step-by-step environment rewards so their sum matches the capped trajectory return.

3.3 CVaR-PPO Baseline

As a secondary contribution, we introduce CVaR-PPO, a baseline that applies Proximal Policy Optimization (PPO) clipping logic exclusively to the worst $\alpha$ proportion of trajectories. This serves as a more modern comparison point than traditional vanilla CVaR-PG.

4. Experimental Evaluation

We evaluated Return Capping across several environments designed to test the trade-off between risk-neutral and risk-averse strategies:

  • Betting Game: A wagering task where the high-EV strategy is risky, but the high-CVaR strategy is conservative.
  • Guarded Maze: A navigation task where the shortest path is subject to high-variance penalties (the "guard"), while a longer path is safe.
  • Modified Lunar Lander: An environment where landing on one side of the map yields high average rewards but high variance, whereas the other side is consistently safe.

5. Results and Discussion

5.1 Sample Efficiency and Convergence

Return Capping consistently outperformed both CVaR-PG and CVaR-PPO in terms of convergence speed. In the Discrete Guarded Maze, Return Capping reached the optimal risk-averse policy in approximately half the environment steps required by CVaR-PPO.

5.2 Robustness

The method demonstrated superior stability. In the continuous Guarded Maze, standard CVaR-PG failed to find the goal in any of the six test runs, and CVaR-PPO failed in 50% of runs. In contrast, Return Capping achieved a 100% success rate. By retaining all data, the agent avoids the "blindness to success" problem, allowing it to navigate toward the goal even when the risk threshold is strictly enforced.

5.3 Overcoming Local Optima

In the modified Lunar Lander, baseline methods often became trapped in overly conservative behaviors (e.g., hovering indefinitely to avoid a crash). Return Capping successfully learned to complete the landing task safely, proving that it can balance risk-aversion with goal directedness more effectively than methods that discard successful data.

6. Limitations and Future Work

The primary sensitivity of Return Capping lies in the initialization of the minimum cap ($C^M$). If $C^M$ is set too high, the agent may initially follow a risk-neutral gradient and settle into a local optimum before the cap can adjust. Future research will focus on automated methods for $C^M$ initialization and the potential for "Soft Risk" annealing, where the risk level $\alpha$ is gradually tightened during training to further stabilize the learning process.

7. Conclusion

Return Capping provides a theoretically grounded and practically efficient framework for risk-averse RL. By transforming the CVaR objective into a capped expectation, we enable agents to learn from every interaction, solving the long-standing problem of data waste in safety-critical policy optimization.

Summary updated

BibTeX
@inproceedings{mead2025return,
  author = {Harry Mead and Clarissa Costen and Bruno Lacerda and Nick Hawes},
  title = {{Return Capping: Sample Efficient CVaR Policy Gradient Optimisation}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=ebf2IYBrZO},
}
Figure