Generation of Policy-Level Explanations for Reinforcement Learning

Nicholay Topin, Manuela Veloso

TL;DR

Reinforcement Learning (RL) agents are often "black boxes" that are difficult to trust. This paper introduces Abstracted Policy Graphs (APGs), a novel way to summarize an agent's entire strategy as a concise Markov chain of abstract states, allowing humans to understand not just a single decision, but the agent's long-term plan and the features that drive it.

What Problem Does This Paper Address?

Deep Reinforcement Learning has achieved remarkable success, but its lack of interpretability is a major hurdle for real-world deployment. Current "Explainable AI" (XAI) techniques for RL typically focus on local explanations—like saliency maps that show which pixels in a single frame influenced a specific move.

However, these methods fail to provide a "big picture" view. They don't explain the sequence of decisions or how an agent expects the environment to evolve. To truly trust an autonomous system, a human supervisor needs to understand the agent's overall competency and its intended trajectory. The authors aim to bridge this gap by creating a global, policy-level abstraction.

Methods

The core contribution is the Abstracted Policy Graph (APG). Think of an APG as a high-level map where:

  • Nodes are "abstract states" (groups of similar real-world states).
  • Edges represent actions and the probability of transitioning between these abstract states.
Figure 1: An example Abstract Policy Graph with edge la- bels indicating transition probabilities. The abstract state identifier is shown within each node, and the action taken is written adjacent to the node.

To build these graphs, the authors propose an algorithm called APG Gen. It works by:

  1. Grouping by Action: Initially, states are grouped based on what action the current policy takes.
  2. Feature Importance Splitting: It uses a measure called FIRM (Feature Importance Ranking Measure) to identify which features most impact the agent's state-value function ($V_\pi$). If a feature significantly changes the expected future reward, the algorithm splits the abstract state along that feature.
  3. Markov Chain Construction: Once states are sufficiently refined, the algorithm uses observed transition data to calculate the probabilities of moving from one abstract state to another.

Crucially, APG Gen is model-agnostic; it only requires a learned policy, a value function, and a set of transitions (which are usually already available from the training process).

Datasets

The authors evaluate their method using a novel synthetic benchmark called PrereqWorld.

  • PrereqWorld: This domain simulates a multi-step manufacturing task where an agent must create items that have specific prerequisites. It is designed to have a scalable state space and controllable stochasticity (randomness).
  • Unlike standard benchmarks, PrereqWorld allows the authors to precisely control the underlying logic, making it easier to verify if the generated APG correctly identifies the "true" important features and dependencies of the task.

Key Insights and Ideas

  • Value as a Proxy for Similarity: The "aha moment" here is using the state-value function ($V_\pi$) as the basis for abstraction. If two states have similar values, the agent likely expects similar future outcomes from them, making them good candidates for grouping.
  • Efficiency through Binary Features: By focusing on binary features for the splitting process, the authors proved a favorable worst-case time complexity of $O(|F|^2 |tr\_samples|)$, where $F$ is the number of features.
  • Sub-linear Scaling: One of the most important findings is that the size of the explanation (the number of nodes in the APG) grows much slower than the actual state space. As the problem gets exponentially more complex, the policy summary remains relatively compact.

Key Results

  • High Accuracy: In experiments with PrereqWorld, APG Gen correctly identified important features over 98% of the time when given 80% of the state transitions. Even with only 10% of the states sampled, accuracy remained above 93%.
  • Predictive Power: The APGs were able to accurately predict the agent's future actions several steps ahead, even in stochastic environments, though accuracy naturally dips slightly as the prediction horizon increases.
Figure 5: Action prediction for increasing time horizon.
  • Compactness: Figure 6 demonstrates that while the state space grows exponentially, the number of abstract states in the APG grows sub-linearly, confirming that the method effectively extracts a compact representation of the policy.
Figure 6: Comparison of explanation versus state-space size.

Limitations and Future Work

While promising, the current approach has a few limitations:

  • Deterministic Policies: The current APG Gen algorithm is designed for deterministic policies. Extending this to stochastic policies is a logical next step.
  • Binary Feature Reliance: The efficiency of the splitting logic relies on binary features. While continuous features can be discretized, a more native handling of continuous spaces could improve performance.
  • Human Factors: The authors acknowledge that while the graphs are mathematically sound, they need to be "restructured" to be truly understood by non-experts. They mention ongoing user studies to evaluate different presentation formats for these explanations.

Summary updated

Abstract

Though reinforcement learning has greatly benefited from the incorporation of neural networks, the inability to verify the correctness of such systems limits their use. Current work in explainable deep learning focuses on explaining only a single decision in terms of input features, making it unsuitable for explaining a sequence of decisions. To address this need, we introduce Abstracted Policy Graphs, which are Markov chains of abstract states. This representation concisely summarizes a policy so that individual decisions can be explained in the context of expected future transitions. Additionally, we propose a method to generate these Abstracted Policy Graphs for deterministic policies given a learned value function and a set of observed transitions, potentially off-policy transitions used during training. Since no restrictions are placed on how the value function is generated, our method is compatible with many existing reinforcement learning methods. We prove that the worst-case time complexity of our method is quadratic in the number of features and linear in the number of provided transitions, $O(|F|^2 |tr\_samples|)$. By applying our method to a family of domains, we show that our method scales well in practice and produces Abstracted Policy Graphs which reliably capture relationships within these domains.
BibTeX
@inproceedings{topin2019generation,
  author = {Nicholay Topin and Manuela Veloso},
  title = {{Generation of Policy-Level Explanations for Reinforcement Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.33012514},
}
Figure