[Paper Review] Latent-CF: A Simple Baseline for Reverse Counterfactual Explanations
Latent-CF proposes a simple yet effective baseline for reverse counterfactual explanations by optimizing in the latent space of a variational autoencoder, achieving a balance between computational efficiency, sparsity, and in-distribution counterfactuals. It outperforms feature-space gradient methods in distributional fidelity and matches or exceeds more complex models like Prototypes in sparsity and realism across MNIST and Lending Club datasets.
In the environment of fair lending laws and the General Data Protection Regulation (GDPR), the ability to explain a model's prediction is of paramount importance. High quality explanations are the first step in assessing fairness. Counterfactuals are valuable tools for explainability. They provide actionable, comprehensible explanations for the individual who is subject to decisions made from the prediction. It is important to find a baseline for producing them. We propose a simple method for generating counterfactuals by using gradient descent to search in the latent space of an autoencoder and benchmark our method against approaches that search for counterfactuals in feature space. Additionally, we implement metrics to concretely evaluate the quality of the counterfactuals. We show that latent space counterfactual generation strikes a balance between the speed of basic feature gradient descent methods and the sparseness and authenticity of counterfactuals generated by more complex feature space oriented techniques.
Motivation & Objective
- To address the growing need for actionable, interpretable explanations in high-stakes AI decisions, especially under regulations like GDPR.
- To propose a simple, efficient baseline for generating counterfactual explanations that balances sparsity, computational speed, and data distribution adherence.
- To evaluate counterfactual quality using metrics focused on in-distribution, sparsity, and computational efficiency.
- To demonstrate that latent space optimization outperforms feature-space gradient methods in producing realistic and sparse counterfactuals.
- To establish a benchmark for future counterfactual generation methods using a principled evaluation framework.
Proposed method
- Train a variational autoencoder (VAE) on the same training data used for the classifier to learn a compact, disentangled latent representation.
- Encode the input sample into the latent space using the trained encoder.
- Optimize the latent code via gradient descent to minimize the prediction loss for the target class while maintaining proximity to the original latent code.
- Decode the optimized latent code to generate the final counterfactual sample in the original input space.
- Use a differentiable classifier to compute gradients in the latent space, enabling end-to-end optimization.
- Apply regularization and clipping to ensure counterfactuals remain close to the original sample and preserve data distribution properties.
Experimental results
Research questions
- RQ1Can latent space optimization produce counterfactuals that are both sparse and in-distribution, outperforming feature-space gradient methods?
- RQ2How does the computational efficiency of latent space optimization compare to more complex feature-based methods like Prototypes?
- RQ3Does using a variational autoencoder instead of a standard autoencoder provide significant improvements in counterfactual quality?
- RQ4How do counterfactuals generated by Latent-CF compare to those from feature gradient descent in terms of feature perturbation patterns and realism?
- RQ5To what extent does the latent space representation preserve meaningful, actionable changes for individual decision-making?
Key findings
- Latent-CF generates counterfactuals that are significantly more in-distribution than feature gradient descent methods, which produce out-of-distribution changes, especially on image edges.
- The method achieves high sparsity, with fewer than 10% of pixels changed in MNIST counterfactuals, compared to over 50% in FGD-based methods.
- Latent-CF maintains consistent performance across high- and low-dimensional data, outperforming feature-space methods in both MNIST and Lending Club tabular data.
- Feature gradient descent methods (FGD, FGD+C, FGD+MAD) produce highly correlated perturbations, often decreasing multiple risk factors simultaneously, which may not reflect realistic behavioral changes.
- Prototypes and Latent-CF produce more diverse, sample-specific counterfactuals that condition on the input’s joint distribution, unlike the uniform perturbation patterns of FGD-based methods.
- Regularizing the latent space provides minimal benefit in key metrics, though it may help slightly in high-dimensional settings.
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.