Maximum Likelihood Constraint Inference for Inverse Reinforcement Learning

Dexter R. R. Scobee, S. Shankar Sastry

Traditional Inverse Reinforcement Learning (IRL) often attempts to explain complex expert behavior by inferring equally complex reward functions. This paper, presented at ICLR 2020, offers a fresh perspective: it shifts the focus from what an agent wants to do to what an agent is forbidden from doing. The authors argue that behavior is frequently better explained by a combination of simple, nominal rewards paired with hard constraints, and they introduce a principled, maximum-likelihood framework to identify these hidden constraints from expert demonstrations.

The Problem: Hidden Constraints

In standard Reinforcement Learning, tasks are defined using a reward function. IRL reverses this process, observing an expert's behavior to deduce the underlying reward function they were optimizing.

However, standard IRL approaches often result in overly complex reward functions that attempt to "bake in" environmental obstacles or safety rules as soft penalties. In reality, many tasks are governed by hard constraints—actions or states an agent simply must avoid (e.g., a car should never drive on the sidewalk, regardless of the potential reward shortcut).

An agent navigating a grid world, altering its path to avoid a latent constraint (red zone).

The primary challenge is that these constraints are often "latent"; they aren't explicitly coded into the environment's observable state. This paper addresses the mathematical gap of how to infer and rank these hidden constraints based purely on observed expert behavior.

Methodology: Iterative Constraint Inference

The authors build their approach on the foundation of Maximum Entropy (MaxEnt) IRL, introducing several key innovations:

  1. Augmented Feature Space: To treat all types of restrictions equally, the authors represent states, actions, and environmental features as a single "augmented feature" set. This unified mathematical representation allows the algorithm to seamlessly consider both state constraints (e.g., "don't enter this area") and action constraints (e.g., "don't perform this maneuver").
  2. Likelihood Maximization: The core principle is that a "good" constraint makes the expert's demonstrated trajectories look highly likely, while simultaneously making alternative, high-reward paths that the expert avoided look impossible.
  3. Feature Accrual (Algorithm 1): The authors modify the standard "forward pass" of MaxEnt IRL. Instead of merely counting how often a feature is encountered, they calculate the probability that a trajectory hits a feature at least once, which is crucial for evaluating hard constraints.
  4. Greedy Iterative Inference (Algorithm 2): Because finding the optimal set of constraints is an NP-hard combinatorial problem, the authors treat it as a "Maximum Coverage Problem." They employ a greedy algorithm that iteratively selects the single most likely constraint, adds it to the model, and repeats the process until the difference between the model's predicted behavior and the expert demonstrations (measured via KL-divergence) falls below a specified threshold.
The greedy iterative inference process: starting from a nominal MDP, constraints are sequentially added to align the model's optimal path with the expert's demonstration.

Experimental Validation

The paper evaluates the proposed framework across both synthetic and real-world datasets:

  • Synthetic Grid World: In a 9x9 grid where a simulated agent moves toward a goal, the environment was seeded with specific "forbidden" zones and actions. The algorithm successfully recovered state, action, and feature-based constraints, even when they overlapped.
  • Human Obstacle Avoidance: To test real-world applicability, the authors collected trajectory data from 16 volunteers walking across a room. After recording a baseline to learn the nominal reward (getting to the other side), an obstacle was introduced. By observing the new walking paths, the algorithm successfully "detected" the physical obstacle's location solely through the lens of human movement.

Remarkably, the greedy approach proved highly data-efficient. Even with a small number of demonstrations (10-20 trajectories), the algorithm significantly reduced KL-divergence, yielding an inferred model that closely matched real behavior.

Key Insights and Limitations

The most significant takeaway is the realization that constraints often provide more succinct explanations than rewards. Instead of a convoluted reward map, a simple rule like "don't step on the red tiles" can perfectly explain complex routing behavior. The algorithm effectively formalizes the logic of infeasibility: "What is the most likely reason the expert avoided this obvious shortcut?"

However, the framework does have limitations:

  • The "Perfect Expert" Assumption: The current math assumes the expert never violates a constraint. If an expert accidentally clips a forbidden zone, the algorithm may fail to recognize it as a hard constraint. Future work will need to "soften" this requirement.
  • Nominal Model Dependency: The method requires an accurate "nominal" reward function as a starting point. If the baseline assumption of what the agent is trying to achieve is fundamentally wrong, the inferred constraints will be nonsensical.
  • Deterministic Focus: While the appendix provides approximations for stochastic environments, the primary derivations assume deterministic transitions.

Ultimately, this maximum-likelihood framework provides a principled way to rank and identify latent constraints, opening promising new frontiers for IRL, including the potential to eventually learn complex, history-dependent rules.

Summary updated

BibTeX
@inproceedings{scobee2020maximum,
  author = {Dexter R. R. Scobee and S. Shankar Sastry},
  title = {{Maximum Likelihood Constraint Inference for Inverse Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure