An agent learning by trial and error in a real robot faces two problems that pull in opposite directions. When the task only pays out at the very end, with a single "success" signal and nothing before it, the agent must wander widely to find that payout. When some states are dangerous, the agent must not wander into them. The usual fix for the first problem is to reward the agent for visiting states its models are unsure about. That fix makes the second problem worse, because rarely visited states near hazards are exactly where models are most unsure. The usual fix for the second problem, a cost constraint that the agent learns to respect, has its own failure. Once the agent becomes safe it stops seeing near-violations, its estimate of what is dangerous decays, and costs spike late in training.
We propose one exploration signal that addresses both. The agent keeps an ensemble of cost predictors, several networks trained to forecast future safety cost whose disagreement measures how little data covers a state. It acts only where a pessimistic estimate (mean plus a multiple of the disagreement) keeps the episode within its safety budget. Inside that certified region it is rewarded for going where the cost predictors disagree most. Visiting such a state shrinks the disagreement there, which tightens the pessimistic bound, which makes the certified region larger. The agent therefore learns the shape of the safety boundary from the inside, without deliberately crossing it. Expanding the safe region also widens the area the agent can search for a sparse task reward.
Core Claim
Our claim is about which uncertainty to explore. In a constrained problem with sparse reward, the most useful exploration target is the epistemic uncertainty of the cost model, restricted to states the model still certifies as safe. Rewarding that uncertainty does two jobs at once. It keeps a steady supply of boundary-adjacent data, which counters the late-training collapse of the cost critic, and it expands the safe reachable set outward so that sparse goals behind narrow passages become reachable. A generic novelty bonus, or a pessimistic cost bound alone, does neither job reliably.
The closest prior work divides the problem without solving it. Breaking Safety Paradox with Feasible Dual Policy Iteration (FDPI) diagnoses the critic-starvation problem and motivates this proposal. Its remedy is a second policy that actively seeks constraint violations, which we refuse to do. Uncertainty-Guided Exploration and Stable Planning for Sparse-Reward Manipulation from Limited Demonstrations (QUEST) uses ensemble dynamics disagreement first as a bonus and later as a penalty, on a time schedule. It has no cost constraint and needs 10 demonstrations. We instead split bonus and penalty by region rather than by time, apply them to a cost model, and use no demonstrations. Safe Reinforcement Learning via Recovery-based Shielding with Gaussian Process Dynamics Models certifies exploration with Gaussian-process confidence ellipsoids, but it needs a precomputed linear backup controller, assumes dense reward, and grows conservative in higher dimensions. We give up its formal guarantee in exchange for a learned, scalable certificate that we measure empirically.
Mechanism
We augment the state with the safety budget remaining, as in Enhancing Safe Exploration Using Safety State Augmentation. This makes the cost already spent visible to the agent, the "cost-so-far" quantity that Constrained Markov Decision Processes via Backward Value Functions uses to turn an episode-level budget into a check at every state.
Let $Q_c^1,\dots,Q_c^M$ be an ensemble of cost-to-go critics, with mean $\mu_c(s,a)$ and standard deviation $\sigma_c(s,a)$. Let $z$ be the remaining budget. An action is certified when
$$ m(s,a) = \mathbb{1}\left[\mu_c(s,a) + \kappa\,\sigma_c(s,a) \le z\right] = 1, $$
where $\kappa \ge 0$ sets how pessimistic the certificate is. The agent is trained on the shaped reward
$$ \tilde r(s,a) = r(s,a) + m(s,a)\left[\eta\,\sigma_c(s,a) + \beta\,\sigma_{d}(s,a)\right], $$
where $r$ is the sparse task reward and $\sigma_d$ is ensemble disagreement of a dynamics model, the conventional novelty term that drives reward discovery. The constants $\eta, \beta \ge 0$ weight the two bonuses. The $\eta\,\sigma_c$ term is the new ingredient.
During data collection, an uncertified action proposed by the policy is replaced. We sample candidate actions and execute the one with the lowest upper cost bound. This is a learned fallback, not a hand-derived controller.
One assumption must be stated honestly. At the start, $\sigma_c$ is large everywhere, so nothing is certified. We break this deadlock with a weak prior: short stretches of near-zero action from the start state are treated as safe. This is far weaker than the fully verified safe baseline policy required by Safe Exploration Incurs Nearly No Additional Sample Complexity for Reward-Free RL, whose theory we take as motivation that tethered safe exploration need not be costly in samples.
Cost-model disagreement can be inflated by genuinely random costs, the noisy-TV problem raised by Beyond Noisy-TVs: Noise-Robust Exploration Via Learning Progress Monitoring. To guard against this, we include a variant that replaces $\sigma_c$ with its recent rate of decrease, so the agent is rewarded for learning progress rather than raw disagreement.
Research Program
We build the method on Soft Actor-Critic, an off-policy learner, with a 5-member cost ensemble, matching the ensemble size QUEST found sufficient. Two analyses come before the main benchmark comparison.
The first measures certified-set growth over training. We estimate it as the fraction of a fixed probe grid of states that the certificate accepts, and check that it tracks the true safe set without overshooting it.
The second tests the safety-paradox mechanism directly. We record the fraction of replay data lying within a small distance of the true cost boundary in the last 10% of training. We also record the calibration of the cost critic on held-out boundary states.
FDPI reports that this boundary fraction "drops below 1%" for its baseline and is roughly 10 times higher for FDPI. Those numbers set the target range. Our method should approach FDPI's boundary coverage while incurring near-zero violations to get it.
Baselines
The naive reference is SAC-Lagrangian with the sparse reward plus a large fixed collision penalty. Safety Gymnasium documents that penalty-style and Lagrangian methods either fail to hold thresholds or oscillate. Safe Policy Exploration Improvement via Subgoals reports SAC-Lagrangian at 0% success in POLAMP narrow-corridor navigation, so this baseline shows whether a task is genuinely hard.
The strongest competitor on the safety-paradox question is FDPI. It is the only method in the file that keeps the cost critic accurate late in training, and it reports near-zero constraint violations for SAC-FDPI across 14 Safety-Gymnasium environments. FDPI was evaluated with dense reward, so we run it on our sparsified tasks with its dual policy unchanged. We count every violation its dual policy causes, since those happen in the real environment. Beating it means equal or better final success and late-training cost, with substantially fewer total training-time violations.
The strongest competitor on sparse-reward safe navigation is SPEIS, the subgoal hierarchy from the same SPEIS paper. It reports 84% success and about 3% collisions in POLAMP, against over 20% collisions for standard methods. Beating it means matching 84% success on POLAMP while lowering training-time collisions, without its hand-built spatial subgoals.
We also include SafeDreamer (SafeDreamer), a world-model method for constrained problems, given an RND novelty bonus. This represents the strong model-based route.
All methods share the environment-step budget, network sizes, and a matched hyperparameter search of equal trial count. Results are reported over at least 5 seeds.
The decisive ablation keeps everything except the cost-uncertainty bonus, setting $\eta=0$. This leaves pessimistic certification plus masked dynamics novelty. A second ablation removes the mask $m$, giving unrestricted optimism.
Why not just…?
Why not just add an RND curiosity bonus to PPO-Lagrangian? Curiosity is highest at rarely visited states, which near hazards are, so it pushes the agent toward violations. The Lagrangian then corrects only after costs have already been incurred. The file's analysis of Lagrangian methods (Revisiting Safe Exploration in Safe Reinforcement learning; Safety Gymnasium) predicts heavy early violations. We run this baseline and expect it to find goals but lose clearly on cumulative training cost.
Why not just use a pessimistic cost bound with an ordinary novelty bonus? This is the real threat, and it is exactly our $\eta=0$ ablation. Masked dynamics novelty might expand the safe set on its own. If it matches our method on boundary coverage, late-training cost spikes, and corridor success, the core claim is false and the contribution reduces to "pessimistic certification works." We expect the gap to show in two places: late training, when dynamics novelty has saturated but cost uncertainty near the boundary has not, and tasks where safe and unsafe regions look alike dynamically.
Why not just use FDPI with a shield, or reweight rare violations in the replay buffer? FDPI shows that replay reweighting is passive. It can only resample violations already collected, and that pool shrinks toward zero. Shielding FDPI's dual policy removes the very violations it is designed to collect, so it collapses to an unguided explorer. We include a shielded-FDPI run to confirm this.
Proposed Experiments
We sparsify Safety-Gymnasium Goal and Button navigation tasks so that reward is a binary signal on reaching the goal, keeping per-step hazard cost. We use POLAMP narrow corridors, where SAC-Lagrangian gets 0% and SPEIS 84%. We use all four Circle2D difficulty tiers to study how the certified set grows in a setting simple enough to visualize.
The metrics are final success rate, cumulative training-time cost, peak cost over the last 20% of training (the spike FDPI targets), boundary fraction of replay, and cost-critic calibration error.
The decisive checks are three. First, the full method must beat the $\eta=0$ ablation on late-training cost spikes and on corridor success; otherwise we abandon the claim. Second, its training-time violations must be well below FDPI's at comparable boundary coverage. Third, the certified set must not overshoot the true safe set by more than a small margin across $\kappa$ values, which shows whether ensemble disagreement is trustworthy enough to certify with. A stress test adds random cost noise in one region, to see whether the learning-progress variant avoids the stalling that raw disagreement would cause there.
References
- Breaking Safety Paradox with Feasible Dual Policy Iteration
- Uncertainty-Guided Exploration and Stable Planning for Sparse-Reward Manipulation from Limited Demonstrations
- Safe Reinforcement Learning via Recovery-based Shielding with Gaussian Process Dynamics Models
- Enhancing Safe Exploration Using Safety State Augmentation
- Constrained Markov Decision Processes via Backward Value Functions
- Safe Exploration Incurs Nearly No Additional Sample Complexity for Reward-Free RL
- Beyond Noisy-TVs: Noise-Robust Exploration Via Learning Progress Monitoring
- Safety Gymnasium: A Unified Safe Reinforcement Learning Benchmark
- Safe Policy Exploration Improvement via Subgoals
- SafeDreamer: Safe Reinforcement Learning with World Models
- Revisiting Safe Exploration in Safe Reinforcement learning