Abstract
We introduce an approach for understanding control policies represented as recurrent neural networks. Recent work has approached this problem by transforming such recurrent policy networks into finite-state machines (FSM) and then analyzing the equivalent minimized FSM. While this led to interesting insights, the minimization process can obscure a deeper understanding of a machine's operation by merging states that are semantically distinct. To address this issue, we introduce an analysis approach that starts with an unminimized FSM and applies more-interpretable reductions that preserve the key decision points of the policy. We also contribute an attention tool to attain a deeper understanding of the role of observations in the decisions. Our case studies on 7 Atari games and 3 control benchmarks demonstrate that the approach can reveal insights that have not been previously noticed.
Introduction
Deep reinforcement learning (RL) frequently employs recurrent neural networks (RNNs), such as LSTMs or GRUs, to manage tasks requiring temporal memory. Despite their effectiveness, these networks often function as "black boxes," making it difficult to discern the underlying logic of their decision-making processes. Previous research attempted to address this by discretizing the RNN’s memory and observations into a Finite-State Machine (FSM), specifically a Moore Machine.
However, the standard practice of "minimizing" these machines to their simplest mathematical form often sacrifices human interpretability. Minimization can merge states that are logically equivalent in terms of output but semantically distinct in the context of the environment (e.g., different spatial configurations of game objects). This paper proposes a framework to simplify these representations through "interpretable reductions" and "functional pruning," preserving the strategic "why" behind an agent's actions.
Methodology
The proposed analysis pipeline consists of three primary stages designed to transform a complex RNN policy into a human-readable FSM.
- Interpretable Reductions: Instead of algorithmic minimization, the authors apply heuristic rules to reduce visual clutter. This includes collapsing non-branching state sequences into "macro arcs," unrolling single-traversal loops, and removing non-essential startup or termination sequences.
- Differential Attention: To pinpoint the cause of branching at decision points, the authors utilize a modified version of Integrated Gradients. By comparing observations that lead to different states, they generate saliency maps that highlight the specific pixels responsible for the policy's divergence.
- Functional Pruning: This stage acts as a strategic stress test. By systematically removing branches at decision points and monitoring performance, the authors can distinguish between truly strategic decisions and artifactual branches that do not impact the agent's success.
Key Insights and Results
The application of this framework to Atari 2600 games and classic control benchmarks yielded several surprising findings.
The "Open-Loop" Illusion in Atari
A significant discovery was that for all seven Atari games tested (including Pong and Breakout), the agents could be pruned down to zero decision points without any loss in performance. This reveals that many high-performing Atari agents are essentially executing "open-loop" scripts—playing by internal timing and memory rather than reacting dynamically to visual stimuli. While previous minimization techniques suggested these agents required no memory, this new analysis shows they use memory to maintain these scripts.
Strategic Complexity in Control Tasks
In contrast to the Atari agents, classic control tasks like Acrobot and CartPole required reactive strategies. Their FSMs remained complex even after pruning, showing clear decision thresholds based on physical parameters like joint velocity. LunarLander proved to be the most complex, with functional pruning failing to significantly reduce the number of decision points (remaining between 184 and 230). This indicates that in stochastic environments, the agent's reliance on observations is genuinely strategic.
Conclusion
This work demonstrates that algorithmic minimization is not always the optimal path to interpretability. By focusing on functional pruning and interpretable reductions, the authors uncovered that many RL agents learn "scripts" rather than reactive policies. While effective for deterministic environments like many Atari games, this approach also highlights the increased strategic demands of stochastic control tasks. Future research may focus on training methods that encourage more naturally interpretable and data-efficient state representations.
Summary updated