Safe Reinforcement Learning through Meta-learned Instincts

Djordje Grbic, Sebastian Risi

TL;DR

Reinforcement Learning (RL) often fails in the real world because its "trial-and-error" nature leads to catastrophic mistakes during exploration. This paper introduces Meta-Learned Instinctual Networks (MLIN), a framework that combines a plastic, learning policy with an evolved, fixed "instinct" network that suppresses dangerous actions, allowing agents to adapt to new goals rapidly without ever stepping into a hazard zone.

What Problem Does This Paper Address?

The "Achilles' heel" of deep reinforcement learning is exploration. To find an optimal policy, agents typically inject noise into their actions to try new things. In a simulation, driving off a cliff is a minor data point; in a real-world factory or a self-driving car, it’s a disaster.

Current "Safe RL" methods often rely on heavy penalties in the reward function, but these are notoriously difficult to tune—too small a penalty and the agent ignores the danger; too large and the agent becomes "paralyzed" and never learns. The authors look to nature for a solution: animals don't learn to fear predators through trial and error; they are born with instincts that prevent them from trying dangerous behaviors in the first place.

Methods

The authors propose a dual-network architecture called Meta-Learned Instinctual Networks (MLIN):

  1. The Policy Network (Plastic): This network is responsible for learning the specific task (e.g., "go to the green dot"). Its weights are updated during the agent's "lifetime" using standard RL (specifically, Proximal Policy Optimization or PPO).
  2. The Instinctual Network (Fixed): This network is evolved over generations using a Genetic Algorithm (GA). Crucially, its weights do not change during the agent's lifetime.

The Modulation Mechanism: The instinctual network doesn't just suggest actions; it modulates the policy network. It outputs a "suppression signal" ($s$) between 0 and 1.

  • If $s$ is near 0, the policy network's action dominates.
  • If $s$ is near 1, the instinctual network "mutes" the policy and replaces it with a hardcoded instinctual action ($a_i$).

This allows evolution to "hardwire" safety into the agent's hardware while leaving the "software" (the policy) free to learn how to reach new goals.

Datasets

The researchers evaluated MLIN on a custom 2D navigation benchmark designed to test safe adaptation:

  • The Task: An agent starts in the center of a map and must navigate to one of four goal positions. The agent cannot see the goal and must find it through reward signals.
  • The Hazards: Four "no-go" zones are placed between the start and the goals. Entering these zones results in a large negative penalty.
  • Inputs: The agent receives its $(x, y)$ coordinates and 8 "range-finder" sensors that detect the proximity of hazard zones.

Key Insights and Ideas

  • Safety as a Meta-Prior: Instead of treating safety as a constraint to be learned, MLIN treats it as a "meta-prior." The instinctual network acts as a safety "shield" that is refined over evolutionary time, not through individual experience.
  • Redirection, Not Just Stopping: Interestingly, the evolved instincts didn't just stop the agent near hazards; they learned to "steer" the agent around them, effectively redirecting the noisy exploratory actions of the policy network into safe directions.
  • Separation of Concerns: By separating the "what is dangerous" (instinct) from the "how to achieve the goal" (policy), the agent can adapt to a new goal in a single gradient update without needing to re-learn that the hazard zones are still dangerous.

Key Results

The authors compared MLIN against pure RL and standard Meta-Learning (MAML-style) without instincts:

  • Superior Safety: MLIN achieved an average of only 0.05 hazard violations, compared to 75.9 for pure RL. Even standard meta-learning without instincts struggled to consistently avoid hazards while reaching the goal.
  • Faster Adaptation: MLIN reached the goals much more accurately than the baselines. In terms of "distance fitness" (where higher/less negative is better), MLIN scored -3.9, while standard meta-learning lagged at -11.3.
  • Ablation Success: When the researchers "turned off" the policy network and ran only the instinctual network, the agent still successfully avoided all hazard zones, proving the instinctual network had truly learned the spatial map of danger.

Limitations and Future Work

  • Static Hazards: In this study, the hazard zones were in fixed locations across all tasks. It remains to be seen how well an instinctual network can generalize to dynamic or procedurally generated hazards.
  • Complexity of Evolution: Training via Genetic Algorithms in an "outer loop" is computationally expensive. Scaling this to high-dimensional inputs (like raw pixels) or complex robotic joints will be a significant challenge.
  • Future Benchmarks: The authors plan to test MLIN on more rigorous environments, such as the OpenAI Safety Gym, which features more complex physics and diverse safety constraints.

Summary updated

Abstract

An important goal in reinforcement learning is to create agents that can quickly adapt to new goals while avoiding situations that might cause damage to themselves or their environments. One way agents learn is through exploration mechanisms, which are needed to discover new policies. However, in deep reinforcement learning, exploration is normally done by injecting noise in the action space. While performing well in many domains, this setup has the inherent risk that the noisy actions performed by the agent lead to unsafe states in the environment. Here we introduce a novel approach called Meta-Learned Instinctual Networks (MLIN) that allows agents to safely learn during their lifetime while avoiding potentially hazardous states. At the core of the approach is a plastic network trained through reinforcement learning and an evolved "instinctual" network, which does not change during the agent's lifetime but can modulate the noisy output of the plastic network. We test our idea on a simple 2D navigation task with no-go zones, in which the agent has to learn to approach new targets during deployment. MLIN outperforms standard meta-trained networks and allows agents to learn to navigate to new targets without colliding with any of the no-go zones. These results suggest that meta-learning augmented with an instinctual network is a promising new approach for safe AI, which may enable progress in this area on a variety of different domains.
BibTeX
@inproceedings{grbic2020safe,
  author = {Djordje Grbic and Sebastian Risi},
  title = {{Safe Reinforcement Learning through Meta-learned Instincts}},
  booktitle = {ALIFE},
  year = {2020},
  doi = {10.1162/isal\_a\_00318},
}

Loading related content...

Figure