Clustered Policy Decision Ranking

Mark Levin, Hana Chockler

TL;DR

This paper introduces a novel method for understanding complex Reinforcement Learning (RL) policies by clustering states and ranking these clusters based on their contribution to the overall reward. This approach aims to simplify policies without sacrificing performance, making them more interpretable and potentially easier to debug.

What Problem Does This Paper Address?

Reinforcement Learning (RL) agents often learn policies that are incredibly complex, making it difficult for humans to understand why an agent makes certain decisions. While RL excels at maximizing rewards, this single objective can lead to policies with many non-intuitive actions. It's challenging to pinpoint which specific decisions are crucial for achieving the reward and which are redundant. This complexity is a major hurdle for the widespread adoption of RL in real-world applications where interpretability and trust are paramount. The paper tackles this by proposing a method to identify and rank groups of states that are collectively important for policy performance, moving beyond single-state analysis.

Methods

The core of this paper is a novel method for Clustered Policy Decision Ranking. Here's a breakdown of their approach:

  1. Random Sampling & Mutation: They start by generating many trajectories from the trained RL policy. To understand state importance, they introduce a "mutation" concept: instead of following the policy's action in a given state, the agent might repeat its previous action. This is controlled by a mutation rate ($\mu$). They collect data from suites of trajectories generated with different mutation rates.
  2. TF-IDF Vectorization: To quantify the importance of states within these trajectories, they adapt the Term Frequency-Inverse Document Frequency (TF-IDF) technique, commonly used in natural language processing. They vectorize states based on their frequency within specific "documents" (clusters of states) and their "rarity" across the entire set of trajectories, incorporating reward information to emphasize states that lead to high or low rewards when mutated.
  3. Principal Component Analysis (PCA) for Cluster Extraction: PCA is applied to the vectorized state data. PCA helps identify the principal components that capture the most variance in the data. They then extract clusters of states corresponding to the top principal components, effectively grouping states that co-vary significantly and are important for reward attainment.
  4. Ranking Clusters: These extracted clusters are then ranked based on the performance of a simplified policy where only the states within that cluster are "restored" (i.e., the policy's original action is taken), while all other states are mutated. Clusters that lead to higher rewards when restored are ranked higher.

Datasets

The paper evaluates their method on the following environments:

  • MiniGrid: A grid-world environment designed for RL research.
  • Atari Games: Specifically, they tested on Bowling, Krull, and Hero from Atari Zoo. For Atari, they applied standard pre-processing steps: cropping borders, grey-scaling, down-sampling to 18x14, and reducing pixel intensity precision to manage the large state space.

Key Insights and Ideas

  • Beyond Single-State Importance: The paper argues that focusing on individual states for importance is insufficient, especially in complex environments. Grouping states that act synergistically is a more powerful way to understand policy behavior.
  • Clustering as a Simplification Tool: The extracted clusters can be used to create simpler policies. By only allowing the policy to act in states belonging to the top-ranked clusters and defaulting to a simpler action (like repeating the previous action) elsewhere, they can achieve significant policy simplification.
  • TF-IDF Adaptation for RL: The novel adaptation of TF-IDF to vectorize states based on their contribution to reward and their co-occurrence in trajectories is a key methodological innovation.
  • PCA for Identifying Synergistic States: PCA proves effective in identifying groups of states that, when considered together, have a substantial impact on policy performance.

Key Results

  • Competitive Performance: Their "clustered" ranking methods (specifically "cluster+", "cluster-", and "cluster+-") often outperform traditional methods like SBFL (Spectrum-Based Fault Localization) and Rand (Random Sampling) in terms of restoring reward with a smaller fraction of states.
  • Outperforming Baselines: In environments like Bowling and Krull, their clustering approaches demonstrated superior performance compared to SBFL, often achieving a high percentage of the original reward with significantly fewer restored states.
  • FreqVis Comparison: While FreqVis (a method that restores states based on their frequency) is effective, the clustered methods can sometimes match or even surpass it, particularly when considering the "actions restored" metric. For instance, in Krull, the "cluster-" method kept pace with FreqVis, and "cluster+" outperformed it.
  • Policy Simplification: They successfully demonstrated that pruned policies (using their ranked clusters) could maintain high performance, indicating the effectiveness of their ranking for simplification.

Limitations and Future Work

  • User Study Needed: The authors acknowledge that a user study would be ideal to fully demonstrate the effectiveness of policy simplification for explainable AI, but this is outside the scope of the current paper.
  • Feature-Based Encoders: They suggest that their clustering method would likely perform even better when used with feature-based encoders (e.g., using advanced techniques like the CLIP algorithm) rather than simple state abstractions like grey-scaling or discretizing. This could potentially uncover "pseudo-features" that are crucial for policy performance.
  • Portfolio Approach: They recommend using a portfolio of techniques (including their clustering method) for policy simplification, as different methods may be better suited to different environments.

Summary updated

BibTeX
@inproceedings{levin2023clustered,
  author = {Mark Levin and Hana Chockler},
  title = {{Clustered Policy Decision Ranking}},
  booktitle = {XAI4DRL @ AAAI},
  year = {2023},
  url = {https://openreview.net/forum?id=oCMegMkrzE},
}
Figure