Abstract: Counterfactual explanations can be obtained by identifying the smallest change made to an input vector to influence a prediction in a positive way from a user’s viewpoint; for example, from ’loan rejected’ to ’awarded’ or from ’high risk of cardiovascular disease’ to ’low risk’. Previous approaches would not ensure that the produced counterfactuals be proximate (i.e., not local outliers) and connected to regions with substantial data density (i.e., close to correctly classified observations), two requirements known as counterfactual faithfulness. Our contribution is twofold. First, drawing ideas from the manifold learning literature, we develop a framework, called C-CHVAE, that generates faithful counterfactuals. Second, we suggest to complement the catalog of counterfactual quality measures using a criterion to quantify the degree of difficulty for a certain counterfactual suggestion. Our real world experiments suggest that faithful counterfactuals come at the cost of higher degrees of difficulty.
The Challenge of Realistic Explanations
When an AI denies a loan or a medical treatment, users want to know: "What would I need to change to get a 'yes' next time?" These are counterfactual explanations.
The problem is that many current algorithms suggest changes that are mathematically correct but practically impossible. For example, an AI might tell a 20-year-old that they would have been approved if they had 10 years of professional experience—a suggestion that is a "local outlier" (impossible for that person) and not "connected" to the actual distribution of successful applicants. This paper tackles the challenge of attainability: ensuring that counterfactuals are not just "close" in a geometric sense, but are "faithful" to the data manifold—the regions where real data actually lives.
The C-CHVAE Framework
The authors introduce the Counterfactual Conditional Heterogeneous Autoencoder (C-CHVAE). This framework ensures faithfulness by searching for explanations in a compressed latent space rather than raw data.
How it Works:
- The Autoencoder Foundation: A Variational Autoencoder (VAE) compresses complex, "heterogeneous" tabular data (a mix of numbers, categories, and counts) into a lower-dimensional latent space.
- Latent Search: Instead of tweaking the input features directly, the model perturbs the latent representation ($\hat{z}_i + \delta_i$). When the decoder turns that latent code back into a suggestion, it naturally looks like a "typical" observation from the training data.
- Handling Constraints: The model distinguishes between immutable features ($x^p$, like age) and free features ($x^f$, like savings). C-CHVAE generates suggestions for free features conditioned on the immutable ones.
- Heterogeneous Likelihoods: To handle tabular data properly, a "factorized decoder" applies different statistical models (e.g., Poisson for counts, Log-Normal for income) to different features, ensuring the output values are realistic.
Measuring "Attainability"
The authors discovered a crucial tension: The Faithfulness-Difficulty Trade-off. "Faithful" counterfactuals (those that look like real people) often require more significant changes than "unfaithful" ones. To be realistic, a user might have to change their features more than a simple mathematical optimizer would suggest.
To quantify this, they propose a new metric for the "degree of difficulty" based on percentile shifts. If a suggestion requires a user to move from the 50th percentile of income to the 95th, that is objectively "harder" than moving to the 60th.
Experimental Results
The authors evaluated C-CHVAE on synthetic datasets and real-world financial data (GMSC and HELOC).
- Superior Faithfulness: C-CHVAE consistently outperformed existing methods (like AR, GS, and HCLS) in terms of proximity (not being an outlier) and connectedness (being near actual successful cases).
- Outlier Prevention: On the GMSC data, C-CHVAE's outlier scores were up to 20 percentage points better than competing methods.
- Visual Proof: In synthetic tests, while other methods suggested points in "no-man's land," C-CHVAE's suggestions clustered neatly within the high-density regions of the actual data distribution, as seen in the visualization above.
Conclusion and Future Work
While C-CHVAE is a significant step forward in making AI explanations realistic, the authors note several areas for future research. These include formalizing the trade-off between autoencoder complexity and faithfulness, explicitly ranking feature importance for the user, and incorporating causal models to ensure that changing one feature doesn't imply an impossible change in another.
Summary updated