[Paper Review] Robust Counterfactual Explanations for Tree-Based Ensembles
This paper proposes RobX, a post-processing framework that enhances the robustness of counterfactual explanations for tree-based ensembles like XGBoost by leveraging a novel metric, Counterfactual Stability, which quantifies resilience to model retraining. RobX iteratively refines counterfactuals generated by any base method, achieving near-100% validity after model changes while maintaining realistic and low-cost perturbations.
Counterfactual explanations inform ways to achieve a desired outcome from a machine learning model. However, such explanations are not robust to certain real-world changes in the underlying model (e.g., retraining the model, changing hyperparameters, etc.), questioning their reliability in several applications, e.g., credit lending. In this work, we propose a novel strategy -- that we call RobX -- to generate robust counterfactuals for tree-based ensembles, e.g., XGBoost. Tree-based ensembles pose additional challenges in robust counterfactual generation, e.g., they have a non-smooth and non-differentiable objective function, and they can change a lot in the parameter space under retraining on very similar data. We first introduce a novel metric -- that we call Counterfactual Stability -- that attempts to quantify how robust a counterfactual is going to be to model changes under retraining, and comes with desirable theoretical properties. Our proposed strategy RobX works with any counterfactual generation method (base method) and searches for robust counterfactuals by iteratively refining the counterfactual generated by the base method using our metric Counterfactual Stability. We compare the performance of RobX with popular counterfactual generation methods (for tree-based ensembles) across benchmark datasets. The results demonstrate that our strategy generates counterfactuals that are significantly more robust (nearly 100% validity after actual model changes) and also realistic (in terms of local outlier factor) over existing state-of-the-art methods.
Motivation & Objective
- To address the lack of robustness in existing counterfactual explanations for tree-based ensembles, which often become invalid upon model retraining or hyperparameter changes.
- To quantify the stability of counterfactuals under model perturbations, especially in non-smooth, non-differentiable models like XGBoost.
- To develop a post-processing strategy that enhances robustness without compromising realism or cost, ensuring counterfactuals remain valid across model updates.
- To provide theoretical guarantees on the probability of counterfactual invalidation under model changes, improving trust in high-stakes applications like credit lending.
Proposed method
- Introduces a novel metric, Counterfactual Stability $ R_{ ilde{ heta}}(x, M) $, which quantifies how likely a counterfactual $ x $ is to remain valid under model retraining by measuring its stability in the parameter space.
- Defines Conservative Counterfactuals as nearest neighbors in the dataset on the opposite side of the decision boundary that also satisfy a minimum stability threshold $ R_{ ilde{ heta}}(x, M) \\_ \geq \tau $, providing theoretical robustness guarantees.
- Proposes RobX as a post-processing algorithm that iteratively refines any base counterfactual (e.g., from FT, FOCUS, NN, FACE) by moving it toward the conservative counterfactual while minimizing $ L_1 $ or $ L_2 $ cost.
- Employs a stability-based refinement loop that checks whether the current counterfactual passes the $ R_{ ilde{ heta}}(x, M) \geq \tau $ condition, ensuring robustness through iterative improvement.
- Uses local outlier factor (LOF) as a proxy for realism, ensuring refined counterfactuals remain close to data manifold and avoid outlying perturbations.
- Applies the method across benchmark datasets (HELOC, German Credit), comparing against state-of-the-art base methods and alternative strategies like increasing the model threshold $ \gamma $.
Experimental results
Research questions
- RQ1How can we quantify the robustness of a counterfactual explanation to model retraining in tree-based ensembles, which are non-smooth and non-differentiable?
- RQ2Can we design a post-processing framework that improves the robustness of existing counterfactual generation methods without increasing cost or reducing realism?
- RQ3What is the theoretical guarantee on the probability of counterfactual invalidation under model changes, and how can it be leveraged in practice?
- RQ4How does the performance of RobX compare to baseline methods and alternative robustness strategies (e.g., increasing model threshold $ \gamma $) in terms of validity, cost, and realism?
Key findings
- RobX achieves nearly 100% validity of counterfactuals after model retraining across multiple datasets, significantly outperforming base methods like FOCUS, FT, and NN, which saw validity drop to as low as 65.7%.
- For the HELOC dataset, FOCUS with $ \gamma = 0.8 $ achieved 83.9% validity, but with RobX, validity increased to 98.0% while only slightly increasing $ L_1 $ cost from 0.74 to 2.20.
- On the German Credit dataset, RobX increased validity from 65.7% (base FOCUS) to 96.5% with minimal cost increase, and achieved 100% validity at $ \gamma = 0.99 $, compared to 97.7% for base FOCUS.
- RobX improved both robustness and cost for FACE, a data-manifold-based method, with only a minor increase in $ L_1 $ cost and a slight improvement in LOF, indicating enhanced realism.
- The strategy of increasing the model threshold $ \gamma $ to improve robustness was found to be impractical due to poor realism (low LOF) and long computation times, sometimes failing to find any counterfactual.
- Counterfactuals generated by RobX maintained low $ L_1 $ and $ L_2 $ costs (e.g., $ L_1 $ cost increased by only 1.0–1.5 units on average) while achieving near-perfect validity, demonstrating a strong trade-off improvement.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.