Inverse Reinforcement Learning of Autonomous Behaviors Encoded as Weighted Finite Automata

Tianyu Wang, Nikolay Atanasov

Introduction

Designing cost functions for autonomous agents is a notoriously difficult task, especially when behaviors involve complex, multi-stage logic. For example, an agent might need to "pick up a key, unlock a door, and then reach a goal while avoiding obstacles." Traditional Inverse Reinforcement Learning (IRL) methods often assume a "flat" reward structure, which fails to capture the compositional nature of such tasks. Without an explicit model of task logic, agents frequently struggle with long-horizon dependencies, often getting stuck or failing to understand the necessary sequence of sub-goals.

Overview of the WFA-IRL approach, mapping environment trajectories to states in a Weighted Finite Automaton.

To address this, the authors introduce WFA-IRL, a framework that learns both the high-level logical structure and the low-level cost functions of a task from expert demonstrations. By representing task logic as a Weighted Finite Automaton (WFA), the system can effectively model and imitate complex behaviors that traditional IRL methods find challenging.

The WFA-IRL Framework

The WFA-IRL approach consists of two primary components integrated into a differentiable learning loop.

1. Learning Task Logic via Spectral Learning

Instead of relying on black-box models like Recurrent Neural Networks (RNNs), WFA-IRL utilizes Spectral Learning to extract a WFA from demonstration sequences. The WFA serves as a high-level supervisor, tracking the progress of the task through discrete states. This representation is more interpretable than an RNN and demonstrates superior sample efficiency, requiring fewer demonstrations to learn the underlying logic.

2. Differentiable Planning and Cost Learning

The agent operates in a "Product Space," which is the Cartesian product of the environment's Markov Decision Process (MDP) and the learned WFA. In this combined space, the agent uses a shortest-path planning algorithm (such as Dijkstra or A*) to determine the optimal path toward a success state.

The differentiable planning architecture used to learn cost functions by backpropagating error through the sequence of WFA states.

To refine the low-level cost functions, the framework employs a subgradient descent method. By comparing the expert's demonstrated actions to the agent's planned trajectory, the system "backpropagates" the error through the planning algorithm. This allows for the end-to-end training of a neural network that represents the cost function, ensuring it aligns with the expert's behavior within the logical constraints of the WFA.

Experimental Evaluation

The framework was evaluated using the MiniGrid environment, focusing on three distinct tasks requiring logical reasoning:

  • T1 (MultiRoom): Requires picking up a key, unlocking a door, and reaching a goal.
  • T2 (Sequential Doors): Involves opening a sequence of three doors to reach a goal.
  • T3 (Blocked Unlock): Requires moving a blocking object before unlocking a door and picking up a box.

Key Results and Insights

WFA-IRL demonstrated significant improvements over standard imitation learning baselines:

  • Performance: The method achieved near-perfect mean episode returns (0.73 to 0.79), matching expert performance across all tasks.
  • Comparison to Baselines: It substantially outperformed Behavioral Cloning (BC) and Generative Adversarial Imitation Learning (GAIL). For instance, in Task T3, GAIL only achieved a return of 0.34, whereas WFA-IRL reached 0.73.
  • Generalization: Because the agent plans based on learned costs rather than simply reacting to visual inputs, it generalizes well to new room layouts, provided the underlying task logic remains consistent.
  • Importance of Logic: Ablation studies confirmed that the explicit WFA component is essential; removing it led to a significant drop in performance, as the agent lost the ability to handle long-horizon dependencies.

Conclusion and Future Work

WFA-IRL provides a robust bridge between formal methods and deep reinforcement learning. However, several avenues for future research remain. Currently, the model assumes a known labeling function for events (e.g., knowing when a door is opened). Future iterations could aim to learn these labels directly from raw sensor data. Additionally, the spectral learning process involves constructing a Hankel matrix, which may face scalability challenges as task complexity increases. Despite these limitations, the integration of WFAs into the IRL pipeline represents a major step forward in teaching autonomous systems to understand and execute complex, multi-stage behaviors.

Summary updated

BibTeX
@inproceedings{wang2022inverse,
  author = {Tianyu Wang and Nikolay Atanasov},
  title = {{Inverse Reinforcement Learning of Autonomous Behaviors Encoded as Weighted Finite Automata}},
  booktitle = {IEEE/RSJ International Conference on Intelligent Robots and Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=tQsrI6Ob60},
}
Figure