Constraint-Aware Reward Relabeling for Offline Safe Reinforcement Learning

Yassine Chemingui, Aryan Deshwal, Thanh Nguyen-Tang, Alan Fern, Jana DoppaOpenReview 2026 · Submission to ICLR 2026 · Rejected

TL;DR

The paper introduces CARL (Constraint-aware Reward Relabeling), a minimalist wrapper for offline safe reinforcement learning. By relabeling rewards with heavy penalties for any state-action pair predicted to be unsafe, CARL allows standard offline RL algorithms to satisfy strict safety constraints without the stability issues or hyperparameter tuning typical of Lagrangian-based methods.

What Problem Does This Paper Address?

In safety-critical domains like healthcare or autonomous driving, reinforcement learning (RL) cannot afford the "trial and error" of online exploration. Offline Safe RL (OSRL) attempts to learn optimal policies from fixed, pre-collected datasets while respecting safety budgets (e.g., "don't exceed $X$ amount of collision force").

The authors identify two major hurdles in current OSRL:

  1. Algorithmic Complexity: Most existing methods rely on Lagrangian multipliers or dual-gradient updates. These are notoriously difficult to tune and often lead to unstable training or overly conservative policies, especially when the safety budget is very tight.
  2. Data Utilization: Discarding unsafe trajectories from a dataset reduces the information available for learning. Conversely, treating them naively can lead to dangerous deployment behavior.

Methods

CARL shifts the problem from a constrained optimization (maximizing reward subject to cost) to an unconstrained one by reformulating the reward function itself.

The core of CARL is an iterative, two-step "wrapper" that can be placed around almost any batch-update offline RL algorithm (like TD3-BC or IQL):

  1. Cost Evaluation: The algorithm uses an off-policy evaluation (OPE) procedure to update a "cost critic" ($Q_c$). This critic estimates the expected future cost for a given state-action pair under the current policy.
  2. Reward Relabeling: For every transition in a sampled batch, the algorithm checks the cost critic. If the estimated cost exceeds the user-defined budget ($\kappa$), the original reward is replaced with a large negative penalty ($-V_{max}$). If it’s within the budget, the original reward is kept.
  3. Policy Update: The underlying offline RL backbone then updates the policy using this "relabeled" batch.

Crucially, the authors found that setting the number of updates for the critic and policy to one ($M=K=1$) per batch prevents the oscillations common in safe RL, allowing the policy and the cost critic to "co-evolve" smoothly.

Datasets

The authors evaluated CARL using the DSRL (Datasets for Safe RL) benchmark suite, which includes:

  • Bullet-Safety-Gym: Tasks like Car-Run, Drone-Circle, and Ant-Run using the PyBullet physics engine.
  • Safety-Gymnasium: More complex MuJoCo-based tasks like Point-Goal and Car-Circle.
  • Velocity Tasks: Forward-motion tasks with speed constraints (HalfCheetah-Velo, Swimmer-Velo).

These datasets are particularly challenging because they contain a mix of safe and unsafe trajectories, requiring the agent to distinguish between high-reward/high-risk behavior and safe/optimal behavior.

Key Insights and Ideas

  • State-Action-Wise Safety: Instead of just trying to be safe "on average" (expectation), CARL aims for safety at every state-action pair the policy encounters. This is a stronger, more robust requirement for real-world deployment.
  • The Power of Binary Penalties: By using a fixed large penalty rather than a scaling Lagrangian multiplier, CARL "clamps" the error signal. This makes the method remarkably robust to noise and inaccuracies in the cost critic's estimations.
  • Learning Safety from Danger: One of the most surprising findings is that CARL can learn a safe policy even when trained exclusively on unsafe trajectories. By relabeling the high-cost transitions as "bad," the agent learns to navigate the boundaries of the safe region even if it has never seen a full "safe" episode.
  • Hyperparameter Minimalism: Unlike prior methods that require tuning penalty coefficients or dual learning rates, CARL introduces no additional task-specific hyperparameters beyond the safety budget itself.

Key Results

  • Superior Safety: CARL was the only method to satisfy cost constraints across all Bullet-based tasks. In the more difficult Safety-Gymnasium tasks, it remained safe in 8 out of 11 scenarios, outperforming all baselines in consistency.
  • High Utility: Safety didn't come at the cost of performance. CARL consistently ranked as the best or second-best safe method in terms of cumulative reward.
  • Backbone Agnostic: The authors demonstrated that CARL works effectively whether the underlying "engine" is TD3-BC (an actor-critic method) or IQL (an advantage-weighted regression method).
  • Robustness to Noise: In ablation studies, CARL maintained safety even when 20% of the safety labels provided by the cost critic were intentionally flipped (noisy).

Limitations and Future Work

  • Theoretical Gap: While the $M=K=1$ incremental update is empirically stable across all benchmarks, the authors note that formal theoretical convergence guarantees for this specific iterative structure remain an open research problem.
  • OPE Dependence: While robust, CARL still ultimately depends on the cost critic. If the off-policy evaluation is catastrophically wrong (e.g., 50% noise), the safety mechanism fails.
  • Dataset Coverage: Like all offline RL methods, CARL's performance is bounded by the diversity of the offline dataset. If the dataset doesn't contain enough information to distinguish safe boundaries, the relabeling might not be effective.

Summary updated

Abstract

Offline safe reinforcement learning (OSRL) considers the problem of learning reward-maximizing policies for a pre-defined cost constraint from a fixed dataset. This paper proposes a simple and effective approach referred to as Constraint-aware Reward (Re)Labeling (CARL), that can be wrapped around existing offline RL algorithms. CARL is an iterative approach that alternates between two steps for each sampled batch of data to ensure state-action-wise safety constraints. First, update cost evaluation function using an off-policy evaluation procedure. Second, update policy using relabeled rewards (assign large penalty) for state-action pairs which are detected unsafe based on cost estimates. CARL is a minimalist approach, doesn’t introduce any additional hyperparameters, and allows us to leverage strong off-the-shelf offline RL algorithms. Experimental results on the DSRL benchmark tasks demonstrate that CARL reliably enforces safety constraints under small cost budgets, while achieving high rewards.
BibTeX
@misc{chemingui2026constraint,
  author = {Yassine Chemingui and Aryan Deshwal and Thanh Nguyen-Tang and Alan Fern and Jana Doppa},
  title = {{Constraint-Aware Reward Relabeling for Offline Safe Reinforcement Learning}},
  year = {2026},
  url = {https://openreview.net/forum?id=klB3AvQZqJ},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2026},
}
Figure