[Paper Review] Counterfactual Explanations Using Optimization With Constraint Learning
This paper proposes CE-OCL, a novel optimization-based framework for generating counterfactual explanations using constraint learning to satisfy multiple practical criteria simultaneously. By integrating trust regions and incumbent solutions, CE-OCL achieves superior performance across proximity, diversity, data manifold closeness, and actionability, outperforming state-of-the-art methods on benchmark datasets including German Credit Data.
To increase the adoption of counterfactual explanations in practice, several criteria that these should adhere to have been put forward in the literature. We propose counterfactual explanations using optimization with constraint learning (CE-OCL), a generic and flexible approach that addresses all these criteria and allows room for further extensions. Specifically, we discuss how we can leverage an optimization with constraint learning framework for the generation of counterfactual explanations, and how components of this framework readily map to the criteria. We also propose two novel modeling approaches to address data manifold closeness and diversity, which are two key criteria for practical counterfactual explanations. We test CE-OCL on several datasets and present our results in a case study. Compared against the current state-of-the-art methods, CE-OCL allows for more flexibility and has an overall superior performance in terms of several evaluation metrics proposed in related work.
Motivation & Objective
- To address the gap in existing counterfactual explanation methods that fail to simultaneously satisfy key practical criteria such as proximity, diversity, actionability, and data manifold closeness.
- To develop a generic and flexible framework that can systematically incorporate multiple interpretability criteria into a unified optimization model.
- To introduce novel modeling techniques—specifically trust regions and incumbent-based diversity—to enhance realism and variety in generated counterfactuals.
- To set new benchmarks in counterfactual explanation quality by evaluating on standard datasets like German Credit Data under comprehensive metrics.
- To demonstrate that optimization with constraint learning (OCL) is a scalable and effective paradigm for generating actionable, realistic, and diverse counterfactuals.
Proposed method
- CE-OCL formulates counterfactual generation as a constrained optimization problem, where the objective function minimizes distance to the factual instance, sparsity, and deviation from target predictions.
- It employs a trust region approach to ensure generated counterfactuals remain close to the data manifold by constraining feature values within a neighborhood of observed training data.
- The framework uses incumbent solutions from prior optimization iterations to promote diversity by preventing repeated feature changes across multiple counterfactuals.
- Constraint learning enables the integration of complex criteria such as actionability and causality by learning implicit constraints from data or domain knowledge.
- The method supports both categorical and continuous features, with coherence preserved via proper encoding and decoding mechanisms during optimization.
- A multi-stage optimization model is used, progressively adding constraints (e.g., sparsity, actionability, causality) to refine counterfactuals in a structured manner.
Experimental results
Research questions
- RQ1Can an optimization framework with constraint learning effectively satisfy all major criteria for practical counterfactual explanations in a unified manner?
- RQ2How does the use of trust regions improve data manifold closeness and realism in generated counterfactuals?
- RQ3To what extent can incumbent solutions in iterative optimization enhance diversity in counterfactual explanations?
- RQ4How does CE-OCL compare to state-of-the-art methods in terms of validity, proximity, sparsity, diversity, and actionability metrics?
- RQ5Can the proposed framework be flexibly extended to incorporate additional criteria such as causality and coherence?
Key findings
- CE-OCL achieved 1.00 validity score across all evaluation parts, confirming that all generated counterfactuals correctly predict the desired outcome.
- In Part F, which included causality and data manifold closeness, the proximity metric reached 0.77 (on a normalized scale), indicating strong closeness to the factual instance.
- The diversity metric based on feature-wise differences reached 0.10 in Part F, showing effective generation of varied counterfactuals despite optimization constraints.
- For the German Credit Data case study, CE-OCL generated counterfactuals with improved sparsity (0.78) and proximity (0.77) while satisfying actionability and causality constraints.
- Compared to prior methods, CE-OCL demonstrated superior performance in multiple evaluation metrics, including diversity and data manifold closeness, especially when all criteria were enforced.
- The framework successfully generated counterfactuals that respected actionability constraints, such as limiting changes to features like 'savings' and 'employment duration' to valid ranges.
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.