Abstract
Reinforcement Learning (RL) policies often exhibit unnecessary complexity, making them difficult to interpret and verify. This paper proposes a novel method for ranking the importance of states within a policy by adapting Spectrum-Based Fault Localization (SBFL) from software engineering. By identifying "critical" states where the trained policy is essential for success, we can prune up to 90% of an agent's unique decisions while maintaining near-peak performance. Our results across diverse benchmarks, including Atari and MiniGrid, demonstrate that SBFL-based ranking significantly outperforms frequency-based and random baselines, offering a path toward more explainable and efficient RL agents.
Introduction
While Reinforcement Learning has achieved remarkable success in complex tasks, the resulting policies are often "black boxes." A typical agent may make thousands of decisions during an episode, yet it remains unclear which of these are pivotal and which are merely redundant or trivial. This lack of transparency is a significant barrier to deploying RL in safety-critical domains where human trust and interpretability are paramount.
The authors argue that RL policies are needlessly complex. Many states encountered by an agent do not require the full "intelligence" of a deep neural network; instead, a simple default rule—such as repeating the previous action—might suffice. The challenge lies in distinguishing these "filler" states from the "Aha!" moments where specific policy actions are required to avoid failure or secure a reward.
Methodology: Borrowing from Software Debugging
To address this, the researchers adapted Spectrum-Based Fault Localization (SBFL), a technique traditionally used in software testing to pinpoint buggy lines of code. In SBFL, developers analyze which code segments are executed during successful versus failed test runs. A line of code that is frequently executed during failures but rarely during successes is flagged as "suspicious."
The authors applied this logic to RL through a four-step process:
- Mutant Executions: They introduced "mutants" into the agent's behavior. At any given state, there is a probability that the agent ignores its trained policy and instead executes a default action (e.g., "repeat previous action").
- Success vs. Failure Labeling: Thousands of these mutant trajectories were recorded and labeled as "pass" (high reward) or "fail" (low reward/crash).
- Importance Ranking: Using SBFL formulas like Ochiai or Tarantula, the researchers calculated an "importance score" for every state. A state is deemed critical if taking the default action there consistently leads to a "fail" label, whereas following the original policy leads to a "pass."
- Policy Pruning: Finally, they constructed "pruned policies" that utilize the complex neural network only for the top-ranked states, reverting to the simple default action elsewhere.
Experimental Setup
The methodology was evaluated on several standard RL benchmarks:
- MiniGrid: A grid-world environment where agents navigate to a goal using a limited cone of vision.
- CartPole: A classic control task requiring the agent to balance a pole on a cart.
- Atari Games: A suite of 26 games (e.g., Breakout, Pong) to test scalability to high-dimensional visual inputs. For these games, state abstraction functions were used to keep the ranking process tractable.
Key Results and Discussion
The core finding is the existence of an "80/20 rule" for RL: a small fraction of states typically accounts for the bulk of an agent's performance.
Performance of Pruned Policies
The SBFL-based ranking proved highly effective at identifying these critical states. In Breakout, for instance, the agent required the original policy in only 10% of states to recover 90% of its original reward. In CartPole, this figure was 31%, and in MiniGrid, it was 49%.
Importance vs. Frequency
A critical insight from the study is that the most frequently visited states are not necessarily the most important. A "Frequency of Visit" baseline performed poorly across all tasks. In CartPole, the agent spends most of its time in the center where the pole is nearly upright—a state that is easy to manage. The truly critical states occur when the pole is at a steep angle, requiring precise intervention to prevent a fall. SBFL successfully identifies these rare but vital moments.
Conclusion
By ranking policy decisions, we can effectively "compress" an agent's logic, making its strategy more accessible to human analysis. Instead of auditing thousands of decisions, a human observer can focus on the 10-30% of states where the agent's unique policy is truly required. While future work is needed to refine default actions and conduct user studies, this research provides a robust framework for peeling back the layers of RL "black boxes" to reveal the essential decision-making core.
Summary updated