Explainable Reinforcement Learning via a Causal World Model

Zhongwei Yu, Jingqing Ruan, Dengpeng Xing

Abstract

Researchers have developed a novel framework that learns an interpretable "causal world model" from scratch to explain reinforcement learning (RL) agent decisions. By using causal discovery and attention-based networks, the system generates "causal chains" that trace an action's impact through environmental variables to final rewards, all without sacrificing the high performance required for model-based learning.

Introduction

Reinforcement Learning (RL) agents are notoriously "black boxes." While we can see an agent's performance, understanding why it chose a specific action is difficult, especially since actions often have long-term effects that don't manifest immediately. Existing Explainable AI (XAI) tools like saliency maps are often insufficient for sequential decision-making because they don't capture temporal dependencies or the underlying dynamics of the environment. Previous attempts to use causal models for explanation usually required human experts to provide the causal structure beforehand and often resulted in low-accuracy models. This paper tackles the "interpretability-performance trade-off" by learning an accurate, causal structure directly from interaction data.

The Causal World Model Framework

The authors propose a three-stage framework to build a bridge between explainability and learning:

  1. Causal Discovery: Instead of relying on a human expert, the framework uses Conditional Independence Tests (CITs)—specifically "Fast CIT"—to identify the causal relationships between current states/actions and future states/outcomes. This results in a sparse, bipartite causal graph that identifies which variables actually influence one another.
  2. Attention-based Inference Networks: To quantify these relationships, the authors designed a specialized neural network architecture. It uses influence weights (attention) to model how much an action affects specific state variables. This allows a standard Structural Causal Model (SCM) to be converted into an Action Influence Model (AIM), which is specifically tuned to explain the "levers" an agent pulls.
  3. Causal Chain Analysis: By tracing paths through the discovered graph, the system generates "causal chains." For example: Action A → Velocity → Position → Reward. This allows for both factual explanations ("Why did you do A?") and contrastive explanations ("Why A instead of B?").
Overview of the proposed framework for causal discovery and explanation.

Crucially, this model is accurate enough to be used in Model-Based Reinforcement Learning (MBRL), meaning the agent can learn its policy using the same model used for its explanations.

Experimental Evaluation

The framework was evaluated across several diverse environments, including Vacuum World, Lunarlander (Continuous & Discrete), Build-Marine (StarCraft II), and Cartpole.

Causal graphs recovered for Lunarlander and Build-Marine environments.

Key results include:

  • Structure Recovery: The proposed method achieved 99.3% accuracy in recovering ground-truth causal dependencies, significantly outperforming dense models.
  • MBRL Performance: In environments like Build-Marine and Cartpole, the explainable causal model achieved learning performance nearly identical to non-explainable models. This suggests that agent power does not need to be sacrificed for human understanding.
  • Filtering Spurious Correlations: Causal discovery acts as a filter, pruning illogical connections (e.g., thinking "time" causes "supply depots") that purely attention-based models often find.

Conclusion and Future Work

The authors prove that a sparser, causal graph can find a "sweet spot" where the model remains highly accurate while staying interpretable. Because the agent is trained using the causal world model, the resulting explanations are "faithful" to the agent's actual logic, rather than being a post-hoc guess.

A primary limitation is the requirement for a "known factorization" of the environment, meaning variables (e.g., position, money) must be predefined. Future work aims to integrate representation learning to automatically discover these variables from raw data and to use causal structures more aggressively to guide the learning process.

Summary updated

BibTeX
@inproceedings{yu2023explainable,
  author = {Zhongwei Yu and Jingqing Ruan and Dengpeng Xing},
  title = {{Explainable Reinforcement Learning via a Causal World Model}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.24963/ijcai.2023/505},
}
Figure