Freeze the Mean, Keep the Noise: Safe Exploration Near Constraint Boundaries

A reinforcement learning agent that must respect a safety budget, such as a robot allowed only a few collisions per episode, faces two opposite failures. Its policy can become nearly deterministic too early, which is called entropy collapse: it stops trying new actions and settles on a mediocre solution. Or it can become safe so effectively that it never again visits the edge of the unsafe region. The learned model of cost then forgets where that edge is, and costs spike late in training. Two families of methods address pieces of this. Maximum entropy RL rewards the policy for staying random. Trust region methods cap how far the policy may move in one update. Recent work argues that the second family is unnecessary once the first is done well. This proposal argues that the claim fails exactly where safety matters, and it says why.

Our observation is simple. For the Gaussian policies used in continuous control, entropy depends only on the spread of the action distribution and not at all on its center. An update can therefore slide the mean action straight across a safety boundary while entropy stays constant. We propose to treat the two parts separately. The mean is held by a per-state trust region whose radius shrinks as the predicted safety margin shrinks. The spread is governed by a trajectory-level entropy budget that keeps the policy stochastic near the boundary, mostly along directions that do not raise cost. The hypothesis is that this produces a steady supply of near-boundary, budget-respecting data. That data would keep the cost model calibrated, solving the "safety paradox" without the deliberately reckless second policy that the current best fix requires.

Core Claim

Is the Trust Region Necessary? Robust Entropy Adaptation Suffices for Continuous Control (ACE) adapts the Soft Actor-Critic (SAC) temperature using disagreement between its two critics. It proves that bounding entropy change implicitly bounds the Kullback–Leibler (KL) divergence between successive diagonal-Gaussian policies, and it reports that a trust-region dual multiplier "stayed at exactly zero across 3,500 measurements." That evidence comes entirely from unconstrained benchmarks.

The KL divergence between two Gaussians with equal covariance is $\tfrac{1}{2}(\mu'-\mu)^\top\Sigma^{-1}(\mu'-\mu)$, where $\mu$ and $\mu'$ are the old and new mean actions and $\Sigma$ is the shared covariance. Entropy change is zero in this case. So any entropy-based bound on KL must rely on the optimizer not producing large mean shifts at fixed spread. In unconstrained control that may hold in practice. In a constrained Markov decision process (CMDP), where a separate cost signal must stay under a budget, the cost critic's gradient can be steep at the boundary, and a large mean shift there is precisely the failure mode.

Our first claim is falsifiable. Under a CMDP, the ACE-style trust-region probe multiplier becomes nonzero, and its nonzero values concentrate in states whose predicted cost-to-go lies within a small margin of the budget. Our second, constructive claim is that a learner which bounds the mean per state, with a margin-scaled radius, while explicitly maintaining spread will achieve two things over training compared with Lagrangian SAC. It will have lower cost spikes, measured as the maximum episode cost over the final 20% of training. It will also have lower cost-critic error on boundary states. We expect it to approach the late-training stability of Breaking Safety Paradox with Feasible Dual Policy Iteration (FDPI) while never running a policy whose objective is to violate constraints.

Relation to Prior Work

Several papers motivate the gap. FDPI identifies the safety paradox: a safer policy starves its feasibility critic of violation data. FDPI fixes it with a dual policy that maximizes violations within a KL ball of the primal policy. It reports that "SAC-FDPI maintains a violation sample ratio in the replay buffer that is roughly an order of magnitude higher (~10x)" than the baseline, which "drops below 1%." The cost of this fix is that the data-collecting policy is reckless by design. We aim to obtain boundary data from bounded stochasticity instead.

Mind Your Entropy (TECRL/DSAC-E) replaces per-step entropy bonuses with a trajectory-level entropy constraint tracked by a separate entropy critic. It shows that entropy falls in unstable states and rises in stable ones, but it has no cost constraint and no trust region. We reuse its separate entropy critic and add a cost critic that modulates where the entropy budget is spent.

Three papers supply methods. Fabian Otto et al. embed exact per-state trust-region projections into the policy network, with separate mean and covariance bounds. We use that projection, and our change is to make the mean radius depend on the cost margin. Vuong et al. and Chuheng Zhang et al. show that batch-average KL lets a policy change catastrophically on a few bottleneck states. Safety boundaries are such bottlenecks, which is why we need per-state enforcement.

Some prior work constrains the design. When Maximum Entropy Misleads Policy Optimization (SAC-AdaEnt) shows that a uniform entropy bonus can drag an agent toward high-action-volume states that end in irrecoverable failure. This appears to contradict keeping the policy noisy near a boundary. We address it directly. Our spread is not maximized near the boundary. It is held at a floor and shaped to be anisotropic: it contracts along the action direction in which predicted cost increases fastest, and remains free in the perpendicular directions. Whether that suffices is an empirical question, and one ablation tests it.

Finally, constrained trust-region methods occupy nearby ground but leave spread unmanaged. Constrained Policy Optimization (CPO) solves a linearized constrained step inside a KL ball. Embedding Safety into RL (C-TRPO) warps the KL divergence with a barrier so that trust regions cannot leave the safe set. First Order Constrained Optimization in Policy Space (FOCOPS) projects a Boltzmann target back to the network. TRC and SDAC ( Trust Region-Based Safe Distributional Reinforcement Learning for Multiple Constraints) add tail-risk or distributional cost models. All of these constrain how the whole distribution moves. None separately preserves exploration spread inside the safe set, and none targets the late-training forgetting that FDPI documents.

Research Program

The method builds on a SAC-style learner with three critics: reward $Q_r$, trajectory entropy $Q_e$ (as in TECRL), and cost $Q_c$. Define the margin at state $s$ as $m(s) = \epsilon - \mathbb{E}_{a\sim\pi}[Q_c(s,a)]$, where $\epsilon$ is the cost budget.

The policy update is an Otto-style per-state projection. It applies two bounds:

$$\tfrac{1}{2}(\mu_{\text{new}}-\mu_{\text{old}})^\top\Sigma_{\text{old}}^{-1}(\mu_{\text{new}}-\mu_{\text{old}}) \le \delta_\mu \,\sigma\!\big(m(s)/\tau\big), \qquad \mathcal{H}(\pi_{\text{new}}(\cdot|s)) \ge h_{\min}(s).$$

Here $\delta_\mu$ is the base mean step, $\sigma$ is the logistic function, and $\tau$ sets how sharply the mean radius shrinks as the margin goes to zero. $h_{\min}(s)$ is a per-state entropy floor. Ordinary Lagrangian handling of the cost budget sits on top of this.

The entropy floor is distributed by the trajectory entropy constraint. The covariance is reshaped so that its variance along the normalized action-gradient of $Q_c$ is capped. The cap is chosen so that a first-order estimate of the expected cost increase from noise stays below the slack $m(s)$. Remaining entropy is placed in the orthogonal directions.

Two analyses accompany the method. The first extends ACE's probe. Using ACE itself, with a Lagrangian cost term added, we log the trust-region multiplier and split each nonzero value into its mean-shift and covariance components. We then bin these by margin. This tests the first claim directly. The second analysis measures cost-critic calibration over training. We sample states from the current visitation distribution near the boundary and compare $Q_c$ against Monte Carlo cost-to-go computed from 50 rollouts per state in simulation.

Baselines

The naive reference is SAC with a Lagrangian cost multiplier and standard automatic temperature tuning, plus PPO-Lagrangian. Safety Gymnasium reports that in velocity tasks "PPO-Lag achieved a 98% reduction in safety violations compared to standard PPO, with only a 45% drop in total reward." For the stronger PID-stabilized variant, CPPO-PID, we also run that paper's implementation.

The strongest competitor on the safety-paradox question is SAC-FDPI. It reports "the lowest constraint violations (near-zero) across all 14 environments" and a roughly tenfold higher buffer violation ratio than its baseline. It is the only method designed to prevent late-training forgetting, which makes it the bar to meet. We run it with identical networks, the same replay size, and the same environment-step budget. Every environment step taken by its dual policy counts toward training cost and toward the step budget. Without that accounting the comparison would hide the cost of its reckless data collection.

On violations during training, the strongest constrained trust-region competitors are SDAC and C-TRPO. SDAC reports "1.78 times fewer constraint violations compared to the next-best baseline" in Safety Gym. For C-TRPO, no reported numeric result was found on Lacuna, so we will rerun it. On the Circle tasks, FOCOPS reports a Humanoid-Circle reward of 1106.1 under a cost limit of 50, against 671.0 for CPO, and this is the reference value there.

Two ablations isolate the key ingredients. The first is ACE+Lagrangian, which uses entropy adaptation with no trust region at all. The second is our method with a fixed, margin-independent mean radius. A further ablation replaces the anisotropic covariance with an isotropic one.

All methods receive the same number of environment steps and a matched hyperparameter search of 20 configurations per method on two held-out tasks. Results are reported over 10 seeds with bootstrap confidence intervals.

Beating the strongest baseline would mean three things. First, matching SAC-FDPI's final return and final cost within confidence intervals. Second, strictly lower total training-time cost once dual-policy steps are counted. Third, no late-training cost spike, defined as an episode cost above $2\epsilon$ in the last 20% of training, in at least as many tasks as SAC-FDPI.

Why not just…?

Why not just bolt a Lagrangian cost term onto ACE? This is the most natural reading of ACE's result, and it is our first ablation. If its trust-region probe multiplier stays at zero under constraints, and its late-training cost matches ours, then our first claim is false. In that case the margin-scaled mean bound adds nothing, and we would say so. The mean-shift argument predicts otherwise, but only the probe experiment settles it.

Why not just oversample the violation transitions already in the replay buffer? This is a real threat to the second claim. Prioritized replay of old near-boundary data costs nothing in safety. However, FDPI's finding is that the violation ratio drops below 1%. Those few samples also come from earlier policies whose visitation differs from the current one, so they cover the current boundary poorly. We include prioritized-violation replay on top of SAC-Lagrangian as a baseline. If it matches our cost-critic calibration on current-policy boundary states, then the exploration mechanism is unnecessary.

Why not just raise SAC's temperature or set a fixed entropy floor everywhere? SAC-AdaEnt shows that uniform entropy pressure misleads policies at the edge of instability: standard SAC stayed "near -2000" against roughly -1250 for SAC-AdaEnt on vehicle tracking. CPO with a fixed bonus inherits the same problem and adds second-order cost. We run SAC-Lagrangian with a fixed floor matched to our average entropy. The isotropic ablation then shows whether shaping the spread, rather than its amount, is what matters.

Why not just use FDPI, since training happens in simulation anyway? In simulation FDPI is a fair answer, which is why it is the main baseline. Our claim is narrower. We aim to get comparable critic calibration from a single policy whose every action respects a margin-scaled bound, which is a precondition for training on hardware. Safe Exploration via Policy Priors achieves zero-collision hardware training but needs an existing safe prior. Our method needs none, though it offers no hard guarantee.

Proposed Experiments

The main suite is Safety-Gymnasium navigation tasks (Goal, Button, and Push, on the Point, Car, and Ant robots) together with its six velocity-constrained locomotion tasks. We add the Circle tasks used by FOCOPS for the comparison against 1106.1. The cost budgets are those of the Safety-Gymnasium defaults.

Each method is reported on five measures: final return, final episode cost, cumulative training cost (dual-policy steps included), the buffer's near-boundary and violation sample ratio over time, and cost-critic error against Monte Carlo ground truth in margin-binned states.

There are three decisive checks. The first is the ACE probe split into mean and covariance components. Our first claim requires nonzero multiplier mass concentrated at low margin and dominated by the mean term. The second is the safety-paradox curve. Our second claim requires a buffer boundary-sample ratio that does not decay late in training, together with lower boundary-state critic error than SAC-Lagrangian and prioritized replay. The third tests whether the entropy trap reappears: the isotropic ablation should show more failures than the anisotropic version on Ant and Car velocity tasks, where the cost rises steeply with action.

If the first check fails, the paper becomes a negative result extending ACE's redundancy finding to CMDPs, which is still worth reporting. If the second fails while the first holds, the margin-scaled trust region is still a contribution on its own, and the exploration claim is dropped.