Table of Contents
Fetching ...

DISCOVER: A Solver for Distributional Counterfactual Explanations

Yikai Gu, Lele Cao, Bo Zhao, Lei Lei, Lei You

Abstract

Counterfactual explanations (CE) explain model decisions by identifying input modifications that lead to different predictions. Most existing methods operate at the instance level. Distributional Counterfactual Explanations (DCE) extend this setting by optimizing an optimal transport objective that balances proximity to a factual input distribution and alignment to a target output distribution, with statistical certification via chance constrained bounds. However, DCE relies on gradient based optimization, while many real-world tabular pipelines are dominated by non-differentiable models. We propose DISCOVER, a model-agnostic solver for distributional counterfactual explanations. DISCOVER preserves the original DCE objective and certification while replacing gradient descent with a sparse propose-and-select search paradigm. It exploits a sample-wise decomposition of the transport objective to compute per-row impact scores and enforce a top-$k$ intervention budget, focusing edits on the most influential samples. To guide candidate generation without predictor gradients, DISCOVER introduces an OT-guided cone sampling primitive driven by input-side transport geometry. Experiments on multiple tabular datasets demonstrate strong joint alignment of input and output distributions, extending distributional counterfactual reasoning to modern black box learning pipelines. A code repository is available at https://github.com/understanding-ml/DCE.

DISCOVER: A Solver for Distributional Counterfactual Explanations

Abstract

Counterfactual explanations (CE) explain model decisions by identifying input modifications that lead to different predictions. Most existing methods operate at the instance level. Distributional Counterfactual Explanations (DCE) extend this setting by optimizing an optimal transport objective that balances proximity to a factual input distribution and alignment to a target output distribution, with statistical certification via chance constrained bounds. However, DCE relies on gradient based optimization, while many real-world tabular pipelines are dominated by non-differentiable models. We propose DISCOVER, a model-agnostic solver for distributional counterfactual explanations. DISCOVER preserves the original DCE objective and certification while replacing gradient descent with a sparse propose-and-select search paradigm. It exploits a sample-wise decomposition of the transport objective to compute per-row impact scores and enforce a top- intervention budget, focusing edits on the most influential samples. To guide candidate generation without predictor gradients, DISCOVER introduces an OT-guided cone sampling primitive driven by input-side transport geometry. Experiments on multiple tabular datasets demonstrate strong joint alignment of input and output distributions, extending distributional counterfactual reasoning to modern black box learning pipelines. A code repository is available at https://github.com/understanding-ml/DCE.
Paper Structure (45 sections, 2 theorems, 31 equations, 8 figures, 4 tables, 4 algorithms)

This paper contains 45 sections, 2 theorems, 31 equations, 8 figures, 4 tables, 4 algorithms.

Key Result

Proposition 3.1

For fixed OT plans $\mu=\{\mu^{(k)}\}_{k=1}^N$ and $\nu$, the certified objective admits an exact row-wise decomposition $Q(x,\mu,\nu,\eta)=\sum_{i=1}^n q_i,$ where $q_i^{(x)}$, $q_i^{(y)}$, and $q_i$ are defined above. In particular, $Q_x(x,\mu)=\sum_{i=1}^n q_i^{(x)}$ and $Q_y(x,\nu)=\sum_{i=1}^n

Figures (8)

  • Figure 1: Overview of DISCOVER. DISCOVER preserves the DCE objective $Q$ and its certification layer. At each iteration it computes per-sample impact scores $\{q_i\}$ derived from the current OT-based objective, and selects a top-$k$ active set that defines an explicit intervention budget. It then generates $M$ candidate counterfactual distributions by editing only the selected samples using a shared OT-guided cone sampling primitive. Among the $M$ candidates, DISCOVER selects the one with the smallest certified objective value $Q$ and repeats until the iteration budget is exhausted.
  • Figure 2: Per-sample input-side OT distances on COMPAS with an MLP. Distances are sorted in descending order within each method, highlighting the top-10 largest values. All methods share the same y-axis scale for fair comparison.
  • Figure 3: Empirical CDFs of model output distributions on COMPAS with an MLP. Shown are the factual outputs, the target distribution, and counterfactual outputs produced by different methods.
  • Figure 4: Optimization dynamics of DISCOVER across datasets and model architectures. Each subplot shows $\mathrm{OT}(x)$, $\mathrm{OT}(y)$, and the objective $Q$ over iterations. $\mathrm{OT}(x)$ (blue) measures input-side Wasserstein distance, and $\mathrm{OT}(y)$ (orange) measures output-side distance to the target. Solid lines denote the mean over five random seeds, with shaded regions indicating standard deviation. Results show stable and consistent convergence across datasets, models, and solver settings.
  • Figure 5: Sample-level counterfactual shifts produced by DISCOVER on the Cardio dataset. Points denote factual (blue) and counterfactual (red) samples in the weight--systolic blood pressure plane, with arrows indicating the update direction and magnitude. Point size encodes diastolic blood pressure (ap_lo), and color reflects the corresponding reduction in predicted risk.
  • ...and 3 more figures

Theorems & Definitions (2)

  • Proposition 3.1: Row-wise decomposition of the certified objective
  • Proposition 3.2: Monotonicity of the propose-and-select step