TL;DR
This paper introduces a novel framework for explaining Reinforcement Learning (RL) policies by moving beyond simple correlations to true causality. By leveraging Structural Causal Models (SCMs) and counterfactual reasoning, the authors quantify how specific state features—and even past actions—causally influence an agent's decisions over time.
What Problem Does This Paper Address?
Reinforcement Learning (RL) is increasingly deployed in high-stakes areas like healthcare and finance, yet many of its most powerful algorithms (like Deep RL) are "black boxes." Existing Explainable RL (XRL) methods often rely on associational techniques, such as saliency maps, which highlight features correlated with an action.
However, as the saying goes, "correlation does not imply causation." An associational method might highlight a feature that is merely a bystander to the actual cause, leading to misleading explanations. Furthermore, standard methods often ignore the temporal nature of RL—how a decision today is influenced by a state of affairs from several steps ago. This paper aims to provide "why" explanations that are grounded in causal reality and temporal context.
Methods
The authors propose a two-step causal explanation mechanism:
- SCM Training: They first learn the structural functions of a Structural Causal Model (SCM) using historical trajectory data. This model defines the "physics" of the environment and the policy, mapping how states and actions influence one another. They assume the "skeleton" (the graph structure) is known but learn the functional relationships (often using neural networks).
- Counterfactual Intervention: To find the importance of a feature, they don't just look at data; they ask "what if?" Using the SCM, they perform a counterfactual intervention: they perturb a specific state feature ($S_t^{(i)} + \delta$) and calculate how much the resulting action or Q-value would have changed compared to the original scenario.
The paper introduces two specific metrics:
- Action-based Importance: Measures the direct change in the predicted action.
- Q-value-based Importance: Measures the change in the expected long-term reward (Q-value), which is particularly useful for discrete action spaces where small perturbations might not flip the final choice but significantly alter the "confidence" of the agent.
- Cascading SCMs: To handle temporal importance, they "cascade" the SCM over multiple time steps, allowing them to trace the influence of a state at time $t-n$ on an action at time $t$.
Datasets
The framework was evaluated across four distinct simulation environments:
- Crop Irrigation: A custom environment where an agent manages water levels based on humidity, radiation, and crop weight.
- Collision Avoidance: A car-following scenario where an agent must decide when to brake or accelerate to reach a goal safely.
- Blackjack: A simplified version of the classic card game (via OpenAI Gym) to test discrete action spaces.
- Lunar Lander: A more complex OpenAI Gym environment requiring the agent to land a spacecraft using multiple engines.
Key Insights and Ideas
- Total vs. Direct Effects: Associational methods usually only capture the direct link between a feature and an action. Causal methods capture total effects. For example, in the crop model, humidity affects the action directly and indirectly by changing the crop's weight. The causal model accounts for both.
- Explaining the "Unseen": Causal models can quantify the importance of variables that aren't even part of the agent's input state, provided they are part of the environment's causal chain (e.g., explaining an action via "precipitation" even if the agent only sees "humidity").
- Temporal Sensitivity: In the Lunar Lander task, the model correctly identified that the "angle" of the craft is more important during the "adjusting phase" than the "freefall phase," providing a nuanced look at how policy priorities shift during a mission.
- Counterfactuals for Discrete Actions: In Blackjack, the authors found that action-based importance is often "bursty" (zero until a threshold is hit). Q-value-based importance provided a much smoother and more intuitive explanation of the agent's "reasoning."
Key Results
- Accuracy over Saliency: In the Collision Avoidance task, saliency maps assigned zero importance to the car's position ($X_t$) because the policy only explicitly looked at distance to the end ($D_t$). The causal method correctly identified $X_t$ as highly important because it is the physical cause of $D_t$.
- Quantifiable Temporal Impact: In Blackjack, the authors demonstrated that the importance of a past action ($a_\tau$) increases as $\tau$ gets closer to the current time $t$, confirming that recent decisions have a higher causal "weight" on the current state than distant ones.
- Robustness: Sensitivity analysis showed that while the absolute importance values change with the perturbation size ($\delta$), the relative ranking of feature importance remains stable, suggesting the method is robust for qualitative explanation.
Limitations and Future Work
- Known Skeleton Assumption: The current work assumes the causal graph (which variable affects which) is known beforehand. In many real-world RL problems, discovering this graph is itself a major challenge.
- High-Dimensional States: The SCMs used here struggle with raw pixel data (e.g., Atari games). The authors suggest integrating causal representation learning to extract low-dimensional causal features from images in the future.
- SCM Accuracy: The quality of the explanation is entirely dependent on the accuracy of the trained SCM. If the model of the environment is wrong, the "why" will be wrong too. Future work could involve quantifying the uncertainty of these causal explanations.
Summary updated