This paper, presented at NeurIPS 2023, tackles a fundamental human question in the context of AI: "What if I had done something differently?" Specifically, it focuses on finding the best alternative sequence of actions for a past event in complex, real-world environments.
Executive Summary
The authors develop a framework to find "counterfactually optimal" action sequences in environments with continuous states (like medical vitals). They prove the problem is computationally hard (NP-Hard) but provide an efficient A* search algorithm that uses Lipschitz continuity to find the best "what-if" scenarios in clinical data.
The Challenge of Continuous Counterfactuals
In fields like medicine, experts often look back at a patient's journey to see if a different treatment plan could have led to a better outcome. This process is known as counterfactual reasoning.
While Reinforcement Learning (RL) is highly effective at finding policies for the future, it struggles with retrospective analysis of the past. Previous methods for finding these "optimal counterfactuals" only worked in environments with a finite, discrete number of states (like a board game). However, the real world is continuous—blood pressure, heart rate, and oxygen levels don't jump between a few fixed values; they flow along a spectrum.
The primary challenge is that in a continuous space, there are infinite possible states. This makes it mathematically difficult to "invert" a past event to see what would have happened under different conditions without the search space exploding.
Methodology: SCMs and A* Search
The authors bridge this gap using two main pillars:
- Bijective Structural Causal Models (SCMs): To ask a counterfactual question, you must first account for "luck" or unobserved factors (noise). The authors use a class of models where, if you know the state transition that happened, you can uniquely calculate exactly what the "noise" was. By holding this noise constant, they can simulate an alternative reality where only the doctor's actions changed.
- A* Search with Lipschitz Bounds: Finding the best sequence of actions among millions of possibilities is an NP-Hard problem. To solve it, the authors use the A search algorithm. The "secret sauce" is their consistent heuristic function*. By assuming the environment is "Lipschitz continuous" (meaning small changes in state lead to predictable, bounded changes in future outcomes), they can calculate a mathematical upper bound on the potential reward. This allows the algorithm to prune away millions of sub-optimal paths and focus only on the most promising "what-if" scenarios.
Experimental Setup
The researchers evaluated their method using the MIMIC-III dataset, a massive, de-identified collection of clinical data from the Beth Israel Deaconess Medical Center.
- Cohort: 15,992 patients treated for sepsis.
- State Space: 13 features, including the SOFA score (an indicator of organ failure) and vital signs.
- Action Space: 25 discrete combinations of dosages for vasopressors and intravenous fluids.
Key Insights
- The Complexity Jump: The authors discovered a significant theoretical gap: while finding optimal counterfactuals in discrete spaces can be done in polynomial time, doing so in continuous spaces is NP-Hard.
- Noise Inversion: For a counterfactual to be "fair," you have to assume the patient's underlying, unobserved physiology (the "noise") remains the same. The use of bijective SCMs is what makes this "noise inversion" possible.
- Anchor Sets: To make the A* search fast, they use "anchor sets"—a collection of previously seen or simulated states—to help estimate the Lipschitz bounds. They found that a Monte Carlo approach to picking these anchors works best in practice.
Results and Clinical Validation
- Efficiency: Despite the theoretical NP-Hardness, the A algorithm is remarkably efficient. In a search space of over 3 million possible action sequences*, the algorithm was able to find the optimal one in just a few seconds on average.
- Clinical Validation: The model found that for the median patient, clinicians were already near-optimal (only 5% potential improvement). However, it identified a subset of "interesting cases" (about 1% of the data) where a different sequence of actions could have improved outcomes by more than 15%.
- Plausible Alternatives: In one case study of a sepsis patient, the model suggested that administering fluids earlier and switching to vasopressors later would have significantly reduced organ failure—a strategy that aligns with some modern medical literature on septic shock.
Limitations and Future Directions
- The "No Confounding" Assumption: The model assumes we have recorded all the important variables. In reality, a doctor might see something (like a patient's skin color or "gut feeling") that isn't in the data. If these "hidden confounders" exist, the counterfactual might be inaccurate.
- Model Sensitivity: The results are only as good as the underlying causal model. If the SCM doesn't perfectly capture how a drug affects a patient, the "optimal" counterfactual it suggests might be a "hallucination" of the model rather than a real medical insight.
- Future Work: The authors suggest moving toward models that can handle "unobserved confounding" and developing algorithms that provide "approximation guarantees" to run even faster on massive datasets.
Summary updated