[Paper Review] NICE: An Algorithm for Nearest Instance Counterfactual Explanations
NICE is a novel, model-agnostic algorithm for generating counterfactual explanations in heterogeneous tabular data that ensures 100% coverage, efficiency, and compatibility with any classification model. It works by iteratively incorporating features from a nearest unlike neighbor to generate counterfactuals, outperforming state-of-the-art methods in sparsity, proximity, and plausibility across 40 datasets.
In this paper we suggest NICE: a new algorithm to generate counterfactual explanations for heterogeneous tabular data. The design of our algorithm specifically takes into account algorithmic requirements that often emerge in real-life deployments: (1) the ability to provide an explanation for all predictions, (2) being able to handle any classification model (also non-differentiable ones), and (3) being efficient in run time. More specifically, our approach exploits information from a nearest unlike neighbour to speed up the search process, by iteratively introducing feature values from this neighbour in the instance to be explained. We propose four versions of NICE, one without optimization and, three which optimize the explanations for one of the following properties: sparsity, proximity or plausibility. An extensive empirical comparison on 40 datasets shows that our algorithm outperforms the current state-of-the-art in terms of these criteria. Our analyses show a trade-off between on the one hand plausibility and on the other hand proximity or sparsity, with our different optimization methods offering users the choice to select the types of counterfactuals that they prefer. An open-source implementation of NICE can be found at https://github.com/ADMAntwerp/NICE.
Motivation & Objective
- Address the lack of efficient, model-agnostic counterfactual explanation algorithms suitable for real-world deployment in high-stakes domains like credit scoring and fraud detection.
- Ensure all predictions can be explained, overcoming the limitation of existing methods that fail to generate explanations for some instances.
- Achieve computational efficiency to support real-time decision-making in high-throughput environments such as customs or loan processing.
- Provide users with customizable counterfactuals optimized for sparsity, proximity, or plausibility, enabling trade-off-aware explanation selection.
- Develop a method that works with non-differentiable models and heterogeneous tabular data, enhancing practical applicability.
Proposed method
- Initiate the counterfactual search from a nearest unlike neighbor (a correctly classified instance from the opposite class), leveraging its proximity to the instance to be explained.
- Iteratively modify the instance to be explained by replacing its feature values with those from the nearest unlike neighbor, one feature at a time.
- Use a greedy, iterative approach to identify the minimal set of feature changes that induce a class change, ensuring efficiency and convergence.
- Implement four variants of NICE: one baseline and three optimized for sparsity, proximity, or plausibility using tailored reward functions.
- Apply feature-wise perturbations only to features present in the original instance, ensuring plausibility and avoiding unrealistic changes.
- Generalize the method to multiclass settings by modifying the reward function to handle multiple class targets, preserving full coverage.
Experimental results
Research questions
- RQ1Can a counterfactual explanation algorithm achieve 100% coverage across all predictions in real-world deployment scenarios?
- RQ2How can counterfactual generation be made efficient and scalable for high-throughput applications such as customs or credit scoring?
- RQ3What is the trade-off between sparsity, proximity, and plausibility in counterfactual explanations, and can users be given control over this trade-off?
- RQ4Can a model-agnostic algorithm generate high-quality counterfactuals for non-differentiable models and heterogeneous tabular data?
- RQ5How does NICE compare to state-of-the-art methods across multiple evaluation metrics, including alternative proximity and plausibility measures?
Key findings
- NICE outperforms existing state-of-the-art counterfactual algorithms in all three key objectives: sparsity, proximity, and plausibility across 40 diverse datasets.
- A strong correlation exists between sparsity and proximity, indicating that the primary trade-off in counterfactual generation lies between these two properties and plausibility.
- The algorithm achieves 100% coverage, ensuring every instance—especially those with negative predictions—can be explained, satisfying legal and operational requirements.
- NICE maintains superior performance even when evaluated with alternative proximity and plausibility metrics from the literature, confirming robustness.
- The different optimization variants of NICE allow users to select explanations tailored to their needs, such as minimal feature changes (sparsity), closeness to the original instance (proximity), or realistic, plausible changes (plausibility).
- Empirical results confirm that NICE is computationally efficient, making it suitable for real-time deployment in high-volume decision systems.
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.