Counterfactual Explanations in Sequential Decision Making Under Uncertainty

Stratis Tsirtsis, Abir De, Manuel Gomez Rodriguez

TL;DR: This paper introduces a framework for generating counterfactual explanations in sequential decision-making environments, such as medical treatments or education. By combining Markov Decision Processes (MDPs) with the Gumbel-Max structural causal model, the authors developed a polynomial-time dynamic programming algorithm that finds the best "what-if" sequence of actions—differing from the original by only a few steps—to achieve a better outcome.

The Challenge of Sequential Decisions

Most research on "counterfactual explanations" focuses on static, one-off decisions. For instance, if a bank denies your loan, a counterfactual explanation might be: "If your income were $5,000 higher, your loan would have been approved."

However, many high-stakes decisions are sequential. In healthcare, a doctor doesn't just make one decision; they prescribe a series of treatments over weeks or months. If a patient doesn't recover, the doctor needs to know which small set of changes in the treatment sequence would have most likely led to a better prognosis.

The challenge in sequential settings is twofold:

  1. Dependency: Actions taken at time $t$ affect the state at $t+1$, creating a chain reaction.
  2. Uncertainty: We don't know exactly how the environment would have reacted to a different action (stochasticity). We need a causal model to estimate these "alternative realities" reliably.

Bridging Reinforcement Learning and Causal Inference

To address these challenges, the authors bridge the gap between reinforcement learning and causal inference using two primary tools.

Sequential causal model illustrating states, actions, and unobserved variables over time.

First, they utilize the Gumbel-Max Structural Causal Model (SCM) to model how states transition. This specific causal model is chosen because it possesses "counterfactual stability." Intuitively, this means that if a specific state transition was likely in the real world, it remains relatively likely in the counterfactual world unless an action specifically changes the odds.

Second, they define a Counterfactual MDP, an "enhanced" state space that tracks both the current environment state ($s$) and the number of actions changed so far ($l$).

Using these tools, they propose a dynamic programming approach to find the optimal counterfactual policy. Unlike a standard policy that maximizes future rewards, this policy looks for an alternative sequence of actions that:

  • Differs by at most $k$ actions from the observed sequence.
  • Maximizes the expected improvement in the final outcome.
  • Is guaranteed to be optimal across all possible realizations of the counterfactual dynamics.

The algorithm runs efficiently in polynomial time $O(n^2 m T k)$, where $n$ is the number of states, $m$ is the number of actions, $T$ is the time horizon, and $k$ is the allowed number of changes.

Key Insights and Real-World Application

The researchers evaluated their approach using both synthetic MDP environments and real-world clinical data from a trial on Cognitive Behavioral Therapy (CBT) for depression. The CBT dataset included 73 patients, tracking 5 levels of depression severity and 11 different discussion themes across 10–20 weekly sessions.

  • Actionability through Constraints: By limiting the number of changes to $k$, the explanations remain "close" to what actually happened, making them more interpretable and actionable for human experts.
  • Clinical Sanity Check: In the CBT dataset, the algorithm frequently suggested replacing "Cognitive Restructuring Techniques" (CRT) with "Behavioral Activation" (BHA) during periods where a patient's symptoms worsened. A consulted clinical psychologist confirmed this was a sensible recommendation: CRT is often too difficult for patients in a severe depressive state, whereas BHA is a standard, more accessible alternative.
  • The Value of Uncertainty: A surprising finding was that counterfactual explanations are actually more valuable in high-uncertainty environments. In these cases, the "gap" between the observed outcome and what could have happened is often larger, providing more room for insight.
Average counterfactual improvement across different levels of uncertainty and allowed changes.

Key Results

  • Performance: In the synthetic experiments, the relative improvement in outcomes increased steadily as the allowed number of changes ($k$) increased.
  • Real-World Impact: For the CBT dataset, the optimal counterfactual policy showed that for 20% of patients, a different sequence of just 3 actions could have improved the average outcome by more than 3%.
  • Efficiency: Despite the complexity of sequential modeling, the algorithm is highly efficient, taking an average of only 62 seconds to process a single realization.

Limitations and Future Work

While promising, the current model is limited to discrete states and actions. Extending this to continuous spaces (like dosages of medicine) remains an open challenge. Additionally, the model assumes the environment is a Markov Decision Process (where the future depends only on the current state). Real-world medical or social processes often have "memory" that might require semi-Markov models. Finally, while the clinical psychologist provided a qualitative "thumbs up," formal user studies are needed to see if these explanations practically help practitioners make better decisions in real-time.

Summary updated

BibTeX
@inproceedings{tsirtsis2021counterfactual,
  author = {Stratis Tsirtsis and Abir De and Manuel Gomez Rodriguez},
  title = {{Counterfactual Explanations in Sequential Decision Making Under Uncertainty}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=M5h1l1SldlF},
}
Figure