Learning Behavioral Soft Constraints from Demonstrations

Arie Glazier, Andrea Loreggia, Nicholas Mattei, Taher Rahgooy, Francesca Rossi, Brent VenablearXiv 2022

TL;DR

Researchers have developed MESC-IRL, a novel Inverse Reinforcement Learning method that learns both "hard" (forbidden) and "soft" (penalized) behavioral constraints from human demonstrations. Unlike previous methods, it excels in non-deterministic environments and allows AI agents to transfer learned ethical or social norms to entirely new settings.

What Problem Does This Paper Address?

In the real world, humans constantly balance personal goals with societal rules. We might speed during a medical emergency or take a shortcut across the grass if we're late, weighing the "cost" of breaking a rule against the benefit of our objective.

For AI to work effectively alongside humans, it needs to understand these trade-offs. Most existing Inverse Reinforcement Learning (IRL) techniques focus on learning a single reward function or identifying "hard" constraints (actions that are strictly forbidden). However, many real-world constraints are "soft"—they carry a penalty but aren't impossible. Furthermore, most prior work assumes a perfectly predictable (deterministic) world. This paper tackles the challenge of learning these nuanced, soft constraints in noisy, non-deterministic environments and ensuring they can be applied in new contexts.

Methods

The authors propose Max Entropy Inverse Soft-Constraint IRL (MESC-IRL). The core idea is to decompose the agent's reward into two parts:

  1. Nominal Reward ($R^N$): The basic goal-oriented reward (e.g., "get to the destination").
  2. Residual Reward ($R^R$): The penalty incurred for violating constraints.

By observing demonstrations, the algorithm uses a Maximum Entropy framework to find the simplest set of constraints (the minimal $R^R$) that explains the observed behavior.

A key innovation is the transition from raw penalties to probabilities. The authors use a logistic distribution to estimate the likelihood that a specific state, action, or feature is actually a constraint. This probabilistic view allows the agent to handle different reward scales and evaluate its confidence in a learned rule.

An example gridworld where an agent must navigate from $s_0$ to $s_G$ while avoiding various soft constraints (colored squares and specific actions).

Datasets

The method was evaluated using a custom Gridworld environment. This setup included:

  • Action Constraints: Penalties for specific movement directions.
  • Occupancy Constraints: Penalties for entering specific grid cells.
  • Feature Constraints: Penalties associated with state features, such as the color of a square (e.g., "avoid blue squares").
  • Non-deterministic transitions: A 10% chance that an action fails and results in a random move, simulating real-world unpredictability.

Key Insights and Ideas

  • Soft Constraints are More Realistic: Hard constraints (infinite penalty) are often too brittle. Soft constraints allow for "rational violations" in extreme cases, mirroring human behavior.
  • Feature-Based Learning Enables Transfer: Instead of just learning that "Cell (5,5) is bad," the agent learns that "Blue cells are bad." This allows it to carry that knowledge into a new grid where blue cells are in different locations.
  • Minimalism via Entropy: The Max Entropy approach acts as a "Occam's Razor," preventing the agent from hallucinating constraints where none exist by seeking the most "spread out" (uncertain) distribution that still fits the data.

Key Results

  • State-of-the-Art Performance: In deterministic settings with hard constraints, MESC-IRL performed on par with or better than previous specialized methods, achieving lower false-positive rates in identifying constraints.
  • Robustness to Noise: The method successfully recovered soft constraints even in non-deterministic environments where "accidental" constraint violations might occur in the demonstrations.
  • Effective Transfer Learning: Agents that transferred learned constraints to a new grid layout converged significantly faster and achieved higher total rewards than agents starting from scratch.
Performance comparison showing that MESC-IRL achieves lower False Positive Rates and better aligns with demonstrations (KL-Divergence) as the number of demonstrations increases.

Limitations and Future Work

While powerful, the current work has a few boundaries:

  • Discrete Spaces: The experiments were conducted in discrete Gridworlds. The authors aim to expand this to continuous action spaces (like robotic arm control) in the future.
  • Known Nominal Rewards: The method currently assumes we already know the agent's basic goal (the nominal reward). A promising future direction is learning both the goal and the constraints simultaneously when both are unknown.
  • Complexity: Testing in more complex, high-dimensional environments remains a necessary next step to prove real-world scalability.

Summary updated

BibTeX
@misc{glazier2022learning,
  author = {Arie Glazier and Andrea Loreggia and Nicholas Mattei and Taher Rahgooy and Francesca Rossi and Brent Venable},
  title = {{Learning Behavioral Soft Constraints from Demonstrations}},
  year = {2022},
  eprint = {2202.10407},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2202.10407},
}
Figure