Safe reinforcement learning usually assumes someone has written down a numerical cost for every unsafe state and a budget for how much cost is allowed. In practice that cost is exactly what nobody can write down. Recent work replaces it with a cost model learned from human comparisons of trajectories ("which of these two runs was more dangerous?"). This removes the hand-engineering, but it creates a new risk. The agent now explores against a learned cost that is least accurate in the region it is about to enter, which is the edge of the safe set, where it has seen few or no violations. We propose an exploration method that treats the learned cost's uncertainty as a first-class source of danger. It stays pessimistic about states where the cost model is unsure, and it spends its limited human queries on comparisons that sharpen the safety boundary the policy is pushing against.
Put plainly, the agent should not trust a learned safety judge more than the judge deserves, and it should ask the human about the cases right at the edge. The goal is to show that this combination cuts real training-time violations and the number of human labels compared with the obvious pipeline, which first learns a cost model and then hands it to an off-the-shelf safe explorer. We also want to identify the regime where the obvious pipeline is good enough.
Core Claim
Two lines of work meet here without touching. Safe Reinforcement Learning with Preference-based Constraint Inference (PbCRL) learns a constrained Markov decision process (CMDP) cost from pairwise preferences. A CMDP is a decision problem where reward is maximized subject to an expected-cost budget. PbCRL shows that the standard Bradley-Terry pairwise model, which assumes symmetric logistic noise, underestimates heavy-tailed safety costs and labels hazardous policies as safe. It fixes this with a dead-zone mechanism around the threshold and a signal-to-noise loss. However, its online phase still runs ordinary constrained RL updates, so it makes no attempt to limit violations while learning. Off-Policy Safe Reinforcement Learning with Cost-Constrained Optimistic Exploration (COX-Q) does the opposite. It explores sample-efficiently off-policy and avoids cost spikes by shrinking action-space steps near the budget and by using quantile critics. But it needs a ground-truth cost from the simulator.
Our claim is that when the cost itself is learned, the main source of training-time violations shifts. It is no longer environment stochasticity, which COX-Q's quantiles handle. It is epistemic error in the preference-learned cost. That error concentrates at the boundary because of the "safety paradox" identified in Breaking Safety Paradox with Feasible Dual Policy Iteration: safer policies produce fewer violations, so they give the feasibility estimate less information. Folding the cost model's posterior spread into the exploration constraint, and choosing preference queries to shrink that spread where the next policy update will go, should beat both components used separately.
Research Program
The cost model is an ensemble of $K$ deep networks. Each member is trained on human trajectory comparisons with PbCRL's heavy-tailed likelihood (dead zone plus signal-to-noise loss) rather than Bradley-Terry. The cost is deliberately non-linear in raw observations. This contrasts with Safe Imitation Learning via Fast Bayesian Reward Inference from Preferences and High-Confidence Policy Improvement from Human Feedback. Both obtain their confidence bounds by keeping the reward linear over frozen features, and both use a Bradley-Terry likelihood that PbCRL shows is misspecified for safety. We give up their formal guarantees in exchange for a cost model that can represent interacting hazards. We measure calibration empirically instead of assuming it.
The cost critic is distributional over two sources at once: return randomness from the environment, and which ensemble member is the true cost. An action is admissible for exploration only if
$$q_{1-\alpha}\big(C_k(s,a,z)\big) \le d,$$
where $C_k(s,a,z)$ is the discounted cost-to-go under ensemble member $k$ and return quantile $z$, $q_{1-\alpha}$ takes the upper $(1-\alpha)$ quantile over the joint draw of $k$ and $z$, and $d$ is the budget. COX-Q's action-space gradient alignment and quantile truncation supply the update rule unchanged; the only change is that the cost distribution now includes epistemic spread from the preference model. The reward signal remains the environment's task reward. Only the cost, the part that is hardest to engineer by hand, is learned.
Queries are chosen by boundary targeting. At each query round, we take short trajectory segments from the replay buffer and from rollouts of the candidate next policy. We score each segment pair by how much the ensemble disagrees about whether each segment's cost exceeds the dead-zone threshold, weighted by how likely the next policy is to visit those states. The top pairs go to the labeler. This differs from ActiveDPO: Active Direct Preference Optimization for Sample-Efficient Alignment, which selects queries to improve a reward. Our selection is tied to the constraint threshold and to where the policy is heading.
Both components address the safety paradox. Exploration stops where the ensemble is unsure, and queries are placed there, so knowledge of the boundary grows ahead of the policy rather than behind it. The method still needs a feasible initial policy, inherited from Constrained Markov Decision Processes via Backward Value Functions and COX-Q. It also needs a small offline preference set to initialize the ensemble, as in PbCRL's first training stage.
Baselines
The naive reference point is hand-crafted reward shaping: PPO with a fixed penalty on the benchmark's unsafe indicator, swept over a grid of penalty weights. The Safety-Gymnasium benchmark (Safety Gymnasium: A Unified Safe Reinforcement Learning Benchmark) reports that PPO-Lag achieves "a 98% reduction in safety violations compared to standard PPO, with only a 45% drop in total reward." We also include PPO-Lag and CPPO-PID with the true cost, run through the SafePO library, as oracle references for how good safety can be when the cost is known.
The strongest competitor is the decoupled pipeline. PbCRL's two-stage cost model is trained on the same preference budget and frozen, and its prediction is then given to COX-Q as if it were the simulator cost. This is the configuration a careful practitioner would build today, and it is the one most likely to match us. No reported result found on Lacuna for training-time violations of PbCRL or COX-Q on Safety-Gymnasium. The file reports only that PbCRL's inferred cost "converged almost exactly to the safety threshold" at the end of training, and that it reached an 82.1% versus 76.5% harmlessness win rate over Safe RLHF in text. A second competitor is PbCRL run end to end with its own online fine-tuning.
All methods get identical environment-step budgets and identical preference budgets (100, 300, and 1000 labels). They share the same initial offline preference set, the same network sizes, and the same hyperparameter sweep of roughly 20 configurations per method.
The ablations isolate each ingredient. The first uses the ensemble mean instead of the epistemic quantile. The second replaces boundary-targeted queries with uniformly random queries. The third swaps the heavy-tailed likelihood for Bradley-Terry. The fourth makes the cost linear over frozen self-supervised features, in the Bayesian REX style.
Beating the pipeline means two things at matched final reward (within 5% of normalized reward). First, a statistically significant reduction in cumulative true-cost violations during training, across 10 seeds. Second, reaching the pipeline's violation level with at most half the labels.
Why not just…?
Why not just plug PbCRL's cost into COX-Q? This is the real threat, and it is the main baseline. If the offline preferences already cover the states the policy will reach, a frozen cost model may be accurate enough, and the pipeline should match us. We therefore vary offline coverage on purpose. In one condition, the offline preferences come from trajectories near the final policy's state distribution. In the other, they come only from conservative early policies. The prediction is no gap in the first condition and a large gap in the second. If the gap is absent even in the low-coverage condition, the epistemic machinery is unnecessary, and we will report that.
Why not just add a fixed penalty and run PPO? The file's evidence is consistent. Penalties are either too weak, so the agent accepts catastrophes, or too strong, so it freezes (Quanyi Li et al.). Safe RLHF: Safe Reinforcement Learning from Human Feedback found that constrained optimization dominates reward shaping on the Pareto curve. Shaping also presupposes the hand-written cost we are trying to avoid. We include the penalty sweep so readers can see its full reward-violation trade-off curve.
Why not just use a Bradley-Terry ensemble with Lagrangian PPO, as Safe RLHF does? Lagrangian methods enforce the budget only on average and only as training converges, and they oscillate, which is why CPPO-PID was introduced. Bradley-Terry also underestimates heavy-tailed costs, per PbCRL. The likelihood ablation and the Safe RLHF-style baseline separate these two failure sources. Training-time violation curves will show whether the oscillations matter in practice.
Why not just ask a vision-language model to label the comparisons? CoRe: Combined Rewards with Vision-Language Model Feedback for Preference-Aligned Reinforcement Learning shows that such feedback is coarse, costs money and time per task, and carries perceptual biases. It also offers no safety constraint. This choice is orthogonal to ours: a vision-language model could replace the labeler inside our query loop. We leave that out of scope, because the question here is which comparisons to ask about, not who answers them.
Proposed Experiments
The main suite uses Safety-Gymnasium PointGoal, CarButton, and PointPush (navigation with hazards), plus the velocity-constrained Ant and Doggo tasks. Brax Safe Velocity tests fast iteration, and SMARTS driving checks transfer to multi-hazard settings. The labeler is simulated from the benchmark's ground-truth cost passed through a heavy-tailed transform, so that collisions compound. We also corrupt a fraction of labels to test robustness, in the spirit of DROPJ's corruption test in Safe Reward Learning from Human Preferences and Justifications. A small study with 3 to 5 real human labelers on PointGoal checks that the simulated-labeler conclusions hold.
We measure cumulative training-time true cost, number of episodes over budget, final normalized reward and cost, labels used, and the cost model's Type II error rate on held-out near-boundary segments. We also check calibration: whether violations actually occur at roughly rate $\alpha$ when the joint quantile says they should.
Three outcomes decide the proposal. The first is the coverage-shift comparison against the frozen pipeline described above. The second is the query ablation: boundary-targeted queries should reduce Type II error near the threshold faster per label than random queries. The third is the calibration plot: if the epistemic quantile is badly miscalibrated, the safety story fails even if average violations drop. If all three come out as predicted, the result is a concrete recipe for safe exploration without a hand-written cost. If the pipeline matches us under coverage shift, the honest conclusion is that learned costs can simply be dropped into existing safe explorers, and that conclusion is also worth publishing.
References
- Safe Reinforcement Learning with Preference-based Constraint Inference
- Off-Policy Safe Reinforcement Learning with Cost-Constrained Optimistic Exploration
- Breaking Safety Paradox with Feasible Dual Policy Iteration
- Safe Imitation Learning via Fast Bayesian Reward Inference from Preferences
- High-Confidence Policy Improvement from Human Feedback
- ActiveDPO: Active Direct Preference Optimization for Sample-Efficient Alignment
- Constrained Markov Decision Processes via Backward Value Functions
- Safety Gymnasium: A Unified Safe Reinforcement Learning Benchmark
- MetaDrive: Composing Diverse Driving Scenarios for Generalizable Reinforcement Learning
- Safe RLHF: Safe Reinforcement Learning from Human Feedback
- CoRe: Combined Rewards with Vision-Language Model Feedback for Preference-Aligned Reinforcement Learning
- Safe Reward Learning from Human Preferences and Justifications