Finding Regions of Counterfactual Explanations via Robust Optimization

Donato Maragno, Jannis Kurtz, Tabea E. Röber, Rob Goedhart, Ş. Ilker Birbil, Dick den Hertog

TL;DR

This paper introduces a robust optimization framework to generate regions of counterfactual explanations rather than single points. This approach ensures that "algorithmic recourse"—the steps a user takes to change a model's decision—remains valid even if the user's actions are slightly imprecise, and it provides the first globally optimal, provably convergent method for non-differentiable models like Random Forests and Gradient Boosting Machines.

What Problem Does This Paper Address?

Imagine a bank's AI rejects your loan application. A standard Counterfactual Explanation (CE) might tell you: "If your salary were exactly \$50,001, your loan would be approved."

There are two major issues with this:

  1. Fragility: CEs usually sit right on the decision boundary. If you increase your salary to \$50,000.50 instead of \$50,001 due to a small error or rounding, the "recourse" might fail, and you're still rejected.
  2. Lack of Agency: Most methods provide one specific point. A user might find it impossible to change one specific feature but easy to change another.

While some researchers have tried to find "robust" CEs, their methods are often heuristics (guesses that might not be optimal) or only work for differentiable models like Neural Networks. This paper tackles the challenge of finding the closest region of valid explanations for both smooth models and "jumpy," non-differentiable models like Decision Trees.

Methods

The authors employ an iterative Adversarial Approach borrowed from the field of robust optimization. The process works like a game between two components:

  1. The Master Problem (MP): This searches for the closest point to the original data that satisfies a specific set of "scenarios" (perturbations).
  2. The Adversarial Problem (AP): This takes the current best point and tries to find a "worst-case" small change (within a defined "uncertainty set" like a box or a circle) that would flip the prediction back to the original, undesired class.

If the Adversary finds a way to "break" the explanation, that scenario is added to the Master Problem, and the loop repeats.

Figure 1: A robust CE region (white) for a neural network. The grey box represents the uncertainty set around the RCE point; every point in that box is guaranteed to be in the target class.

A key technical hurdle is that Decision Trees are discontinuous (they have sharp "jumps" at split points), which breaks standard convergence proofs. The authors solve this by creating a Lipschitz continuous extension—essentially a "smoothed" version of the tree's decision function—that allows the algorithm to converge mathematically while maintaining the original model's logic.

Datasets

The method was evaluated on three standard machine learning benchmarks:

  • Banknote Authentication: 4 features (detecting forgeries).
  • Diabetes: 8 features (predicting disease onset).
  • Ionosphere: 34 features (classifying radar returns from the atmosphere).

Key Insights and Ideas

  • Recourse Robustness $\neq$ Model Robustness: The authors prove that an explanation robust to user implementation errors is not necessarily robust to changes in the model's parameters (e.g., if the model is retrained). These are distinct challenges. Figure 2: An example showing that a recourse-robust CE (the red circle) can be invalidated by a slightly perturbed model (the dotted blue line).

  • Global Optimality for Trees: This is the first method to provide deterministic robustness guarantees for tree-based ensembles (Random Forests, GBMs).

  • The "Lipschitz Trick": By mathematically smoothing the boundaries of decision tree leaves, the authors can use powerful Mixed-Integer Linear Programming (MILP) solvers to find the absolute best robust region.
  • Complexity vs. Features: The study found that the number of features in a dataset matters less for computation time than the complexity (depth and number of trees) of the ML model itself.
Figure 2: An example showing that a recourse-robust CE (the red circle) can be invalidated by a slightly perturbed model (the dotted blue line).

Key Results

  • Reliability: In head-to-head tests against existing state-of-the-art methods for Neural Networks, the proposed algorithm achieved 100% validity and robustness across almost all tests, whereas previous heuristic methods often fell short (sometimes failing to find a robust solution in 70-100% of cases for larger robustness requirements).
  • Efficiency: While solving the "Master Problem" becomes exponentially harder as more adversarial scenarios are added, the algorithm typically converges in a manageable number of iterations (often under 20) for moderately sized models.
  • Heuristic Speedup: The authors also proposed a faster "Heuristic Variant" that restricts the robust region to a single leaf of a decision tree. While not always globally optimal, it is significantly faster and provides a good trade-off for real-time applications.

Limitations and Future Work

  • Scalability: As models get very large (e.g., hundreds of deep trees), the Master Problem becomes computationally expensive to solve. The authors suggest investigating more efficient model formulations to speed this up.
  • Categorical Features: Currently, the model treats categorical features (like "Gender" or "Marital Status") as immutable. Future work aims to incorporate "mutable" categorical features, which would require handling non-convex, discrete uncertainty sets.
  • User Perception: While mathematically robust, it remains to be seen how actual human users perceive these "regions" of explanation compared to traditional point-based CEs.

Summary updated

BibTeX
@article{maragno2024finding,
  author = {Donato Maragno and Jannis Kurtz and Tabea E. Röber and Rob Goedhart and Ş. Ilker Birbil and Dick den Hertog},
  title = {{Finding Regions of Counterfactual Explanations via Robust Optimization}},
  journal = {INFORMS J. Comput.},
  year = {2024},
  doi = {10.1287/ijoc.2023.0153},
}
Figure