Introduction: The Reliability Gap in Recourse
Counterfactual explanations—which suggest how to change an input to flip a model's prediction—are crucial in high-stakes machine learning applications like loan approvals or medical diagnoses. For example, if a loan is denied, a counterfactual might say: "If your annual income were $10,000 higher, your loan would have been approved." This provides a path for "recourse," giving users actionable steps to change their outcome.
However, machine learning models in production are rarely static; they are frequently retrained on new data or fine-tuned. A major reliability gap exists: a counterfactual generated for "Model A" might fail to produce the desired outcome on a retrained "Model B," even if Model B was trained on nearly identical data or just started with a different random seed. This counterfactual invalidation means a user could spend a year increasing their income only to find the retrained model still denies them.
The "Cost" Fallacy in Deep Networks
Prior work on simpler linear models suggested a straightforward heuristic: to make a counterfactual more robust, simply increase its "cost" (i.e., push it further across the decision boundary). However, the authors prove that in deep networks, this "further is safer" approach is a fallacy.
Because deep learning decision boundaries are complex and non-linear, moving away from one boundary might accidentally push the counterfactual closer to a different, hidden boundary. The empirical results support this, showing that cost and consistency are poorly correlated in deep models ($R^2$ values often below 0.05). You can have a very "expensive" (distant) counterfactual that remains highly unstable.
Stable Neighbor Search (SNS)
To solve this instability, the authors introduce Stable Neighbor Search (SNS). The core idea is that the stability of an explanation is tied to the local geometry of the model. SNS aims to find a counterfactual $x_c$ that satisfies two conditions:
- High Confidence: The model is very certain about the prediction at $x_c$ (e.g., sitting in a "well" of 99% confidence rather than on a 50/50 edge).
- Low Lipschitz Constant (Smoothness): The model’s prediction doesn't change rapidly in the neighborhood of $x_c$.
Mathematically, SNS operationalizes this by maximizing the area under the curve of the model's output along a path from the origin to the counterfactual. This encourages the search to find "flat," stable regions of the decision space that are less likely to shift during model retraining or fine-tuning.
Experimental Results
The authors evaluated SNS on several standard tabular classification benchmarks, including financial risk datasets (German Credit, Taiwanese Credit-Default, FICO HELOC) and medical datasets (Seizure, Cardiotocography, Warfarin Dosing). They tested consistency across Random Seed (RS) changes and Leave-One-Out (LOO) variations in the training data.
The results demonstrate that SNS dramatically outperforms standard counterfactual generation methods:
- Massive Invalidation Reduction: On the HELOC dataset, standard methods had invalidation rates as high as 61%. SNS reduced this to 0% in many cases.
- Zero Invalidation: SNS achieved 0% invalidation across LOO differences for the German Credit, CTG, Warfarin, and HELOC datasets.
- The Trade-off: While SNS counterfactuals are generally more "costly" (further from the original point) than minimal-distance methods, they are significantly less costly than other manifold-based methods while remaining far more consistent.
Limitations and Future Work
While highly effective, SNS comes with a computational cost. It requires calculating integrals (approximated by summations) over paths, which is more expensive than simple gradient descent. Furthermore, the current study is limited to tabular data; extending these consistent explanations to high-dimensional data like images or natural language remains an open challenge. Finally, the method does not currently account for causal relationships between features, which is an important requirement for truly actionable real-world recourse.
Summary updated