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.
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.
MICE consists of four core components:
- 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.
- 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$).
- 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$).
- 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
PointandCaragents executingGoal(navigating to targets while avoiding hazards) andCircle(moving along a circular path without crossing boundaries) tasks. - Safety MuJoCo: Four physics-based locomotion tasks (
SafetyAntVelocity,SafetyHalfCheetahVelocity,SafetyHumanoidVelocity, andSafetyHopperVelocity) 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:
- 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