Towards Causal Temporal Reasoning for Markov Decision Processes

Milad Kazemi, Nicola Paoletti · DOI

Introduction

Autonomous systems are increasingly deployed in complex environments where safety and reliability are paramount. Traditionally, formal verification techniques like Temporal Logic (TL) have been used to evaluate whether these systems meet specific safety criteria under fixed configurations. However, standard TL lacks the expressive power to handle "what-if" scenarios—specifically interventions and counterfactuals. For instance, one might ask: "Would the robot have avoided the collision if it had switched to a more conservative policy five seconds ago?"

This paper introduces Probabilistic CounterFactual Temporal Logic (PCFTL), a novel framework that bridges formal verification and causal inference. PCFTL allows researchers to reason about system behavior across different configurations, enabling both forward-looking interventional analysis and retrospective counterfactual reasoning within Markov Decision Processes (MDPs).

Methodology

The core of the proposed framework is the extension of Bounded Probabilistic Computation Tree Logic (BPCTL*) into PCFTL. This logic introduces a generalized counterfactual operator, $I_{@t}.P_{\bowtie p}(\phi)$, where $t=0$ denotes an intervention and $t>0$ denotes a counterfactual based on past observations.

Structural Causal Models for MDPs

To enable counterfactual reasoning, a standard MDP must be reinterpreted as a Structural Causal Model (SCM). While standard MDPs define transitions via a probability matrix, SCMs explicitly separate the deterministic dynamics from the exogenous noise.

Causal graph representation of a Markov Decision Process (MDP) as a Structural Causal Model (SCM).

As shown in Figure 1, the SCM representation introduces exogenous variables $U_t$ that capture the environmental randomness. This structure allows for "abduction"—inferring the specific noise context of a past event—before "predicting" the outcome of a hypothetical policy change. The authors utilize the Gumbel-Max trick to ensure "counterfactual stability," meaning small changes in policy do not lead to erratic jumps in counterfactual outcomes.

Statistical Model Checking

Verification is performed using Statistical Model Checking (SMC). Rather than exhaustive proof, the framework employs Monte-Carlo sampling and Wald’s Sequential Probability Ratio Test (SPRT). This approach allows for determining if a property holds with high statistical confidence while remaining computationally tractable for complex environments.

Evaluation and Results

The framework was evaluated on two primary benchmarks: a custom Reach-Avoid Grid-world and the MiniGrid Library (including Empty, DoorKey, GoToDoor, and Fetch environments).

Key findings include:

  • Efficiency: The SMC procedure typically reached a verdict in fewer than 125 Monte-Carlo realizations for MiniGrid tasks, demonstrating its practical utility.
  • Policy Comparison: In the DoorKey environment, PCFTL successfully quantified the safety gap between optimal and undertrained policies, even when reasoning about rare, high-risk trajectories.
  • Soundness: Sanity checks confirmed that the counterfactual inference accurately matched post-interventional distributions, validating the Gumbel-Max SCM translation.

Discussion and Future Work

A significant insight from this work is the role of the SCM as the "missing link" for counterfactual reasoning in MDPs. By explicitly calculating the "Causal Effect" ($\Delta$ operator), the logic provides a direct bridge to metrics like the Average Treatment Effect (ATE) used in other scientific fields.

However, several challenges remain. The current statistical approach scales poorly with deeply nested counterfactual formulas, and the framework is presently tailored for discrete-state MDPs. Future work will focus on extending these methods to continuous state spaces and Partially Observable MDPs (POMDPs), as well as exploring symbolic verification methods to provide absolute guarantees beyond statistical estimates.

In conclusion, PCFTL represents a significant step toward robust causal reasoning for autonomous systems, providing a formal language to ask and answer the critical "what-if" questions that define safe and reliable AI.

Summary updated

BibTeX
@inproceedings{kazemi2025towards,
  author = {Milad Kazemi and Nicola Paoletti},
  title = {{Towards Causal Temporal Reasoning for Markov Decision Processes}},
  booktitle = {Research},
  year = {2025},
  doi = {10.1017/cbp.2025.2},
}
Figure