Table of Contents
Fetching ...

Distributional Counterfactual Explanations With Optimal Transport

Lei You, Lele Cao, Mattias Nilsson, Bo Zhao, Lei Lei

TL;DR

This work reframes counterfactual explanations from pointwise edits to distributional shifts by leveraging optimal transport (OT) to align counterfactual and factual distributions. It introduces distributional counterfactual explanations (DCE) formulated as a chance-constrained optimization using the sliced Wasserstein distance $\mathcal{SW}^2$ and the Wasserstein distance $\mathcal{W}^2$, with statistical confidence guarantees via quantile-based intervals. The Discount algorithm, based on Riemannian optimization, balances input similarity and output alignment through adaptive $\eta$ and two strategies (Set Shrinking and Interval Narrowing), with proofs of partial optimality and convergence rate. Empirically, Discount achieves superior distributional proximity and favorable input-output distributional trade-offs across multiple datasets and models, demonstrating practical utility for strategic decision-making and governance of model behavior under distributional shifts.

Abstract

Counterfactual explanations (CE) are the de facto method for providing insights into black-box decision-making models by identifying alternative inputs that lead to different outcomes. However, existing CE approaches, including group and global methods, focus predominantly on specific input modifications, lacking the ability to capture nuanced distributional characteristics that influence model outcomes across the entire input-output spectrum. This paper proposes distributional counterfactual explanation (DCE), shifting focus to the distributional properties of observed and counterfactual data, thus providing broader insights. DCE is particularly beneficial for stakeholders making strategic decisions based on statistical data analysis, as it makes the statistical distribution of the counterfactual resembles the one of the factual when aligning model outputs with a target distribution\textemdash something that the existing CE methods cannot fully achieve. We leverage optimal transport (OT) to formulate a chance-constrained optimization problem, deriving a counterfactual distribution aligned with its factual counterpart, supported by statistical confidence. The efficacy of this approach is demonstrated through experiments, highlighting its potential to provide deeper insights into decision-making models.

Distributional Counterfactual Explanations With Optimal Transport

TL;DR

This work reframes counterfactual explanations from pointwise edits to distributional shifts by leveraging optimal transport (OT) to align counterfactual and factual distributions. It introduces distributional counterfactual explanations (DCE) formulated as a chance-constrained optimization using the sliced Wasserstein distance and the Wasserstein distance , with statistical confidence guarantees via quantile-based intervals. The Discount algorithm, based on Riemannian optimization, balances input similarity and output alignment through adaptive and two strategies (Set Shrinking and Interval Narrowing), with proofs of partial optimality and convergence rate. Empirically, Discount achieves superior distributional proximity and favorable input-output distributional trade-offs across multiple datasets and models, demonstrating practical utility for strategic decision-making and governance of model behavior under distributional shifts.

Abstract

Counterfactual explanations (CE) are the de facto method for providing insights into black-box decision-making models by identifying alternative inputs that lead to different outcomes. However, existing CE approaches, including group and global methods, focus predominantly on specific input modifications, lacking the ability to capture nuanced distributional characteristics that influence model outcomes across the entire input-output spectrum. This paper proposes distributional counterfactual explanation (DCE), shifting focus to the distributional properties of observed and counterfactual data, thus providing broader insights. DCE is particularly beneficial for stakeholders making strategic decisions based on statistical data analysis, as it makes the statistical distribution of the counterfactual resembles the one of the factual when aligning model outputs with a target distribution\textemdash something that the existing CE methods cannot fully achieve. We leverage optimal transport (OT) to formulate a chance-constrained optimization problem, deriving a counterfactual distribution aligned with its factual counterpart, supported by statistical confidence. The efficacy of this approach is demonstrated through experiments, highlighting its potential to provide deeper insights into decision-making models.
Paper Structure (29 sections, 7 theorems, 50 equations, 8 figures, 2 tables, 3 algorithms)

This paper contains 29 sections, 7 theorems, 50 equations, 8 figures, 2 tables, 3 algorithms.

Key Result

Proposition 3.1

Consider any measure $z \in \mathcal{P}(\mathbb{R})$ with an empirical measure $\hat{\mathbf{z}} = \{z_i\}_{i=1}^n$, and a measure $z' \in \mathcal{P}(\mathbb{R})$ with an empirical measure $\hat{\mathbf{z}}' = \{z'_j\}_{j=1}^n$. Let $\xi(n)$ be any function of the sample size $n$. Suppose that the Then, for any measures $\mathbf{x}, \mathbf{x}' \in \mathcal{P}(\mathbb{R}^d)$ with corresponding e

Figures (8)

  • Figure 1: Consider a retail business aiming to understand how a machine learning model $b$ predicts individual customer spending for revenue forecasting, based on discount rates $d$ and product recommendations $r$. Based on any observed model outputs, the business asks to understand how adjusting the entire distributions of discounts and recommendations would impact the prediction towards another pattern. Such insights are crucial for 1) making strategic operational decisions and 2) verifying whether the model behavior aligns with the real-world causal relationships. This calls for , which allows the business to find explanations to the model at the distribution level— not just individual instances. To answer the "what-if" question, the counterfactual $d$ and $r$ that the business seeks should resemble the observed factual $d$ and $r$. This is because drastic deviations from current practices may be impractical, and similarity ensures actionable recourse. Traditional , including group or global method, fail in this aspect.
  • Figure 2: [German-Credit, DNN] The x-axis is feature/target value and the y-axis is quantile/quantities. The first plot "Risk" shows the model's output distribution. The second plot "All Features" shows the quantiles of the 1D projected (by $\Theta$) factual and counterfactual distributions. The other plots show marginal distributions for each feature, where numerical ones are shown by quantile and categorical by histogram. Factual risk (average) is 31.3% and counterfactual 17.5%.
  • Figure 3: [Cardiovascular Disease, DNN] Convergence of Discount with Interval Narrowing. The optimization starts from a point that is near to the factual $\mathbf{x}'$. At the beginning $\eta$ stays at $r=1$ due to the violation of the chance constraint of $y$, such that the optimization leans entirely towards bringing $y$ to $y^{*}$ closer gradually. When $\overline{\mathcal{W}^2}$ is below $U_2$ at iteration $57$, a feasible solution is found. Then $\eta$ is optimized within $[l,r]$ to balance the gaps $U_{x}-\overline{\mathcal{SW}^2}$ and $U_{y}-\overline{\mathcal{W}^2}$, until the algorithm converges.
  • Figure 4: [Cardiovascular Disease] The models are trained on all features whereas the optimization is performed only on age, weight, and height.
  • Figure 5: [German-Credit, DNN] Risk with respect to credit amount, age, and duration (indicated by the size of each point). The models are trained on all features whereas the DCE optimization is performed only on credit amount, age, and duration.
  • ...and 3 more figures

Theorems & Definitions (10)

  • Proposition 3.1
  • Theorem 3.2
  • Theorem 4.1
  • Theorem 5.1
  • Theorem B.1: Theorem \ref{['thm:interval']} in the main text
  • proof
  • Theorem C.1: Theorem \ref{['thm:optimality']} in the main text
  • proof
  • Theorem E.1: Theorem \ref{['thm:convergence_combined']} in the main text
  • proof