Controlling Underestimation Bias in Constrained Reinforcement Learning for Safe Exploration

Shiqing Gao, Jiaxin Ding, Luoyi Fu, Xinbing Wang

TL;DR

Constrained Reinforcement Learning (CRL) algorithms frequently violate safety constraints during training because function approximation noise causes them to underestimate risks. To solve this, the authors introduce Memory-driven Intrinsic Cost Estimation (MICE), a framework inspired by human "flashbulb memory" that stores past unsafe states and dynamically injects an adaptive safety bias. MICE drastically reduces constraint violations across standard benchmarks while maintaining competitive reward performance.

What Problem Does This Paper Address?

In Reinforcement Learning (RL), we are familiar with the overestimation bias problem: because agents try to maximize rewards, function approximation noise systematically biases value estimates upward (a challenge famously addressed by Double DQN and TD3).

However, in Constrained Reinforcement Learning (CRL)—where the agent must maximize rewards while keeping a safety cost below a certain threshold—the opposite happens. Because the policy actively tries to minimize costs, optimization noise disrupts the zero-mean assumption and introduces a persistent underestimation bias.

Figure 2: Underestimation bias across environments. The x- axis is time steps, the y-axis is the cost value estimate minus the true value, and the dashed line is the zero deviation.

As a result, highly dangerous, high-cost states deceptively appear safe to the agent. Enticed by high rewards, the agent repeatedly wanders into unsafe territory during training, causing frequent constraint violations that make deployment in real-world safety-critical systems (like robotics or autonomous driving) impossible.

Methods

The authors propose MICE (Memory-driven Intrinsic Cost Estimation) to counteract this underestimation bias by introducing a controlled, adaptive overestimation buffer in high-risk zones.

Figure 1: Structure of MICE. Underestimation of cost value in high-cost regions causes constraint violations. The Flashbulb Memory records high-cost regions by storing previously explored unsafe states. The intrinsic cost is computed through the pseudo-count of the current state’s visit to high-cost regions in memory. The trust region ensures the alignment of the stored high-cost regions with the current policy. The extrinsic-intrinsic cost critic mitigates underestimation in high-cost regions.

MICE consists of four core components:

  1. Flashbulb Memory Module ($M$): Mimicking how humans vividly recall dangerous experiences, this module stores previously explored unsafe states. To keep computation efficient, states are compressed into a lower-dimensional latent space using a random projection layer that preserves relative Euclidean distances.
  2. Intrinsic Cost ($c^I$): The intrinsic cost of a state is calculated as a pseudo-count of how frequently the agent has visited similar high-cost regions in its memory, computed using $k$-nearest neighbors ($N_k$).
  3. Extrinsic-Intrinsic Cost Critic ($Q^{EI}_C$): MICE augments the standard environmental cost ($c^E$) with the intrinsic cost scaled by a balancing factor ($\beta$).
  4. Adaptive Bias Correction: To prevent the agent from becoming overly conservative, MICE dynamically updates the balancing factor $\beta$ at each step. If the critic underestimates the cost, $\beta$ increases to boost the safety signal; if it overestimates excessively, $\beta$ decreases.

The authors integrate this framework into two standard CRL optimization paradigms, creating MICE-CPO (a trust-region primal method) and MICE-PIDLag (a primal-dual method).

Datasets

The authors evaluated MICE on two widely used safe RL benchmarks:

  • Safety Gym: Four continuous control navigation tasks involving Point and Car agents executing Goal (navigating to targets while avoiding hazards) and Circle (moving along a circular path without crossing boundaries) tasks.
  • Safety MuJoCo: Four physics-based locomotion tasks (SafetyAntVelocity, SafetyHalfCheetahVelocity, SafetyHumanoidVelocity, and SafetyHopperVelocity) where agents are penalized for exceeding strict velocity limits.

Key Insights and Ideas

  • Bias Asymmetry: While underestimation bias hurts standard RL performance, it is actively dangerous in CRL. Conversely, a slight overestimation bias in high-risk regions acts as a beneficial safety buffer, discouraging reckless exploration.
  • Mitigating Catastrophic Forgetting: Neural networks naturally suffer from catastrophic forgetting, meaning an agent might forget a hazard it encountered early in training. The flashbulb memory acts as a persistent anchor, generating anticipatory cost signals that keep the agent away from previously discovered dangers.
  • Trust-Region Alignment: By constraining policy updates within a trust region, MICE ensures that the current policy remains close to the distribution of samples stored in the flashbulb memory, keeping the pseudo-counts accurate and relevant.

Key Results

MICE demonstrated exceptional safety improvements without compromising on the agent's ability to gather rewards:

Figure 3: Comparison of MICE to baselines on Safety Gym. The x-axis is the total number of training steps, the y-axis is the average return or constraint. The solid line is the mean and the shaded area is the standard deviation. The dashed line is the constraint threshold which is 25.
  • Drastic Violation Reduction: In Safety Gym tasks, MICE significantly reduced cumulative training costs compared to standard baselines like CPO, CUP, and PIDLag, consistently keeping the agent near or below the safety threshold.
  • Zero-Violation Locomotion: In Safety MuJoCo environments, MICE maintained near-zero constraint violations throughout the entire training lifecycle, matching the safety profiles of state-augmentation methods (Saute, Simmer) while achieving superior reward convergence.
  • Empirical Bias Correction: Validation experiments confirmed that the cost estimation error in MICE successfully converged toward zero deviation, proving that the adaptive $\beta$ mechanism effectively neutralizes underestimation.

Limitations and Future Work

  • Noisy Environments: The current experimental setup assumes that environmental extrinsic costs are clean and noise-free. In real-world applications, cost signals can be highly noisy. The authors suggest using expected cumulative costs as a memory inclusion criterion to mitigate this, but it remains to be thoroughly tested.
  • The Catch-22 of Safe Exploration: MICE relies on storing previously encountered unsafe states. In real-world deployments, even a single initial violation could be catastrophic. The authors note that future work could involve initializing the flashbulb memory using offline datasets combined with importance resampling to ensure safety from day one.

Summary updated

BibTeX
@inproceedings{gao2025controlling,
  author = {Shiqing Gao and Jiaxin Ding and Luoyi Fu and Xinbing Wang},
  title = {{Controlling Underestimation Bias in Constrained Reinforcement Learning for Safe Exploration}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=nq5bt0mRTC},
}
Figure