[Paper Review] Exploring Counterfactual Explanations Through the Lens of Adversarial Examples: A Theoretical and Empirical Analysis
This paper establishes theoretical and empirical connections between counterfactual explanations and adversarial examples, demonstrating that many state-of-the-art methods for generating counterfactuals are mathematically equivalent or highly similar to adversarial attack algorithms under specific conditions. It derives upper bounds on solution distances and validates through experiments that manifold-based methods like NAE and C-CHVAE produce highly similar outputs to counterfactuals, raising critical questions about the design and trustworthiness of counterfactual explanations in high-stakes AI systems.
As machine learning (ML) models become more widely deployed in high-stakes applications, counterfactual explanations have emerged as key tools for providing actionable model explanations in practice. Despite the growing popularity of counterfactual explanations, a deeper understanding of these explanations is still lacking. In this work, we systematically analyze counterfactual explanations through the lens of adversarial examples. We do so by formalizing the similarities between popular counterfactual explanation and adversarial example generation methods identifying conditions when they are equivalent. We then derive the upper bounds on the distances between the solutions output by counterfactual explanation and adversarial example generation methods, which we validate on several real-world data sets. By establishing these theoretical and empirical similarities between counterfactual explanations and adversarial examples, our work raises fundamental questions about the design and development of existing counterfactual explanation algorithms.
Motivation & Objective
- To investigate the theoretical and empirical connections between counterfactual explanation and adversarial example generation methods.
- To identify conditions under which counterfactual explanation and adversarial attack methods are mathematically equivalent.
- To bound the distance between solutions generated by counterfactual and adversarial methods for locally linear models.
- To evaluate the empirical similarity of outputs across real-world datasets using metrics like match rate and rank correlation.
- To raise fundamental questions about the trustworthiness and design of counterfactual explanations in high-stakes AI applications.
Proposed method
- Formalizing the optimization objectives of counterfactual and adversarial methods to identify equivalence conditions under shared constraints and loss functions.
- Deriving theoretical upper bounds on the L2 distance between solutions of counterfactual explanation (e.g., SCFE, C-CHVAE) and adversarial attack (e.g., C&W, DeepFool, NAE) methods for locally linear models.
- Using a match rate metric $d_{\text{match}}$ to evaluate empirical similarity between counterfactual and adversarial examples, with thresholds $\theta \in \{0.02, 0.05, 0.1\}$.
- Applying Spearman rank correlation $\rho$ to assess agreement in feature importance rankings between perturbations from counterfactual and adversarial methods.
- Conducting extensive experiments on real-world tabular datasets (e.g., COMPAS, Adult, German Credit) using logistic regression and neural network classifiers.
- Comparing manifold-based methods (NAE, C-CHVAE) with non-manifold methods (DeepFool, C&W) to evaluate the role of data manifold constraints in solution similarity.
Experimental results
Research questions
- RQ1Under what conditions are counterfactual explanation and adversarial example generation methods mathematically equivalent?
- RQ2How close are the solutions produced by counterfactual explanation and adversarial attack algorithms in terms of L2 distance?
- RQ3To what extent do counterfactual and adversarial methods agree on the importance of input features, as measured by rank correlation?
- RQ4How does the inclusion of manifold constraints affect the similarity between counterfactual and adversarial solutions?
- RQ5What are the implications of these similarities for the trust and reliability of counterfactual explanations in high-stakes AI systems?
Key findings
- The SCFE method shows high match rates with DeepFool and C&W adversarial attacks, especially at low thresholds ($\theta = 0.02$), indicating strong empirical similarity.
- Manifold-based methods such as NAE and C-CHVAE produce significantly more similar solutions to counterfactuals than non-manifold methods, as evidenced by higher $d_{\text{match}}$ values.
- Rank correlation $\rho$ between perturbations from counterfactual and adversarial methods reaches up to 1.00 for methods in the same category, indicating near-identical feature importance rankings.
- Theoretical bounds confirm that C&W and SCFE solutions are within a bounded distance for locally linear models, supporting their equivalence under specific hyperparameter settings.
- C-CHVAE and NAE are shown to be equivalent under certain generative model configurations, with bounded solution distances.
- Empirical results validate theoretical findings across diverse datasets, including COMPAS, Adult, and German Credit, using both logistic regression and neural network models.
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.