TL;DR
This paper introduces AFRAI-RL, a framework that actively learns the underlying structure of complex, history-dependent (non-Markovian) reward functions during reinforcement learning. By using the $L^*$ active learning algorithm to distill high-level knowledge into human-readable Finite Reward Automata, the authors achieve significantly faster convergence and better interpretability than state-of-the-art deep RL baselines.
What Problem Does This Paper Address?
Standard Reinforcement Learning (RL) typically assumes the Markov property: the reward you get depends only on your current state and action. However, real-world tasks are often non-Markovian, where rewards depend on a specific sequence of past events (e.g., "pick up the mail, then go to the office, but only if you already grabbed the key").
Deep RL can technically handle these tasks using Recurrent Neural Networks (RNNs), but this approach suffers from two major flaws:
- Sample Inefficiency: It takes a massive amount of trial-and-error data to "stumble" upon the correct sequence of events.
- Lack of Interpretability: The resulting policy is a "black box," making it impossible for a human to verify what the agent thinks the rules of the task are.
Methods
The authors propose Active Finite Reward Automaton Inference and Reinforcement Learning (AFRAI-RL). The core idea is to treat the reward function as a formal language that can be learned through active questioning.
Key Components:
- Finite Reward Automata (FRA): A type of Mealy machine that tracks high-level "states" of a task (e.g., "Mail Picked Up" vs. "Key Found").
- The $L^*$ Algorithm: An active learning method that learns an automaton by interacting with a "teacher." In this case, the RL agent acts as the teacher by exploring the environment to answer two types of queries:
- Membership Queries: "Does this specific sequence of actions result in a reward?"
- Equivalence Queries: "Is my current hypothesis of the reward rules correct, or is there a counterexample?"
- Dual Q-Learning: The agent maintains two separate Q-functions. One ($q_m$) incentivizes the agent to explore specifically to answer the $L^*$ queries, while the other ($q_h$) focuses on finding the optimal policy for the current hypothesized reward structure.
Datasets
The approach was evaluated on two classic grid-world benchmarks modified for non-Markovian tasks:
- Office World: A 9x12 grid where the agent must complete complex delivery sequences (e.g., visit locations $a, b, a,$ then $c$ in order).
- Minecraft World: A 21x21 grid requiring multi-step crafting tasks, such as collecting specific materials (string, stone, iron) in a precise order before heading to a workbench to build a hammer or spear.
Key Insights and Ideas
- Universal Expressivity: The authors prove that FRAs can represent any non-Markovian bounded reward function with finite values and can approximate continuous reward functions with arbitrary precision.
- Active vs. Passive Inference: Unlike previous methods that passively observe data (like JIRP), AFRAI-RL actively seeks out the information it needs to complete its model of the reward function. This targeted exploration is what drives the massive jump in efficiency.
- Guaranteed Convergence: The paper provides a theoretical lower bound for episode length that ensures the agent will almost surely converge to the optimal policy in the limit.
- Interpretability by Design: Because the reward structure is learned as a finite state machine, a human can look at the resulting FRA and see exactly how the agent understands the task's logic.
Key Results
The authors compared AFRAI-RL against three strong baselines: JIRP-SAT, LRM-QRM, and PPO2.
- Speed: In the Office World, AFRAI-RL converged to an optimal policy at least 88.8% faster than the best baseline.
- Success Rate: On the most complex tasks, the baseline methods (including deep RL like PPO2) often failed to converge entirely within the training budget, whereas AFRAI-RL consistently found the optimal policy.
- Robustness: The agent was able to self-correct its internal model of the reward function even if its initial hypotheses were incorrect.
Limitations and Future Work
- Labeling Dependency: The method assumes that the environment provides correct "labels" for events (e.g., the environment must tell the agent "you are at location $a$"). Future work aims to handle scenarios where labels might be noisy or incorrect.
- Model-Free Constraints: The current framework is model-free. The authors suggest that moving to a model-based framework could further improve sample efficiency by allowing the agent to "plan" its queries.
- Multi-Agent Scaling: The current study focuses on a single agent. Extending this to collaborative or competitive multi-agent settings is a noted future direction.
Summary updated