Table of Contents
Fetching ...

Counterfactual Training: Teaching Models Plausible and Actionable Explanations

Patrick Altmeyer, Aleksander Buszydlik, Arie van Deursen, Cynthia C. S. Liem

TL;DR

Counterfactual Training (CT) introduces a training regime that couples a differentiable classifier to on-the-fly counterfactual explanations, with objectives that enforce faithfulness, plausibility, and actionability under explicit mutability and domain constraints. By integrating a contrastive divergence term and an adversarial robustness term into the loss, CT aligns learned representations with meaningful explanations and leverages nascent counterfactuals as adversarial signals, yielding more plausible and actionable counterfactuals and improved robustness. The approach is validated across nine datasets with multiple CE generators, showing substantial reductions in implausibility ($IP$, $IP^*$) and costs of actionability, while preserving predictive performance and enhancing adversarial resilience. These results suggest CT as a practical route to building models that provide inherently useful explanations, with broader implications for algorithmic recourse, fairness considerations, and real-world decision systems.

Abstract

We propose a novel training regime termed counterfactual training that leverages counterfactual explanations to increase the explanatory capacity of models. Counterfactual explanations have emerged as a popular post-hoc explanation method for opaque machine learning models: they inform how factual inputs would need to change in order for a model to produce some desired output. To be useful in real-world decision-making systems, counterfactuals should be plausible with respect to the underlying data and actionable with respect to the feature mutability constraints. Much existing research has therefore focused on developing post-hoc methods to generate counterfactuals that meet these desiderata. In this work, we instead hold models directly accountable for the desired end goal: counterfactual training employs counterfactuals during the training phase to minimize the divergence between learned representations and plausible, actionable explanations. We demonstrate empirically and theoretically that our proposed method facilitates training models that deliver inherently desirable counterfactual explanations and additionally exhibit improved adversarial robustness.

Counterfactual Training: Teaching Models Plausible and Actionable Explanations

TL;DR

Counterfactual Training (CT) introduces a training regime that couples a differentiable classifier to on-the-fly counterfactual explanations, with objectives that enforce faithfulness, plausibility, and actionability under explicit mutability and domain constraints. By integrating a contrastive divergence term and an adversarial robustness term into the loss, CT aligns learned representations with meaningful explanations and leverages nascent counterfactuals as adversarial signals, yielding more plausible and actionable counterfactuals and improved robustness. The approach is validated across nine datasets with multiple CE generators, showing substantial reductions in implausibility (, ) and costs of actionability, while preserving predictive performance and enhancing adversarial resilience. These results suggest CT as a practical route to building models that provide inherently useful explanations, with broader implications for algorithmic recourse, fairness considerations, and real-world decision systems.

Abstract

We propose a novel training regime termed counterfactual training that leverages counterfactual explanations to increase the explanatory capacity of models. Counterfactual explanations have emerged as a popular post-hoc explanation method for opaque machine learning models: they inform how factual inputs would need to change in order for a model to produce some desired output. To be useful in real-world decision-making systems, counterfactuals should be plausible with respect to the underlying data and actionable with respect to the feature mutability constraints. Much existing research has therefore focused on developing post-hoc methods to generate counterfactuals that meet these desiderata. In this work, we instead hold models directly accountable for the desired end goal: counterfactual training employs counterfactuals during the training phase to minimize the divergence between learned representations and plausible, actionable explanations. We demonstrate empirically and theoretically that our proposed method facilitates training models that deliver inherently desirable counterfactual explanations and additionally exhibit improved adversarial robustness.
Paper Structure (66 sections, 1 theorem, 15 equations, 69 figures, 9 tables, 1 algorithm)

This paper contains 66 sections, 1 theorem, 15 equations, 69 figures, 9 tables, 1 algorithm.

Key Result

Proposition 3.1

Let $f_\theta(\mathbf{x})=\mathcal{S}(\mathbf{M}_\theta(\mathbf{x}))=\mathcal{S}(\Theta\mathbf{x})$ denote a linear classifier with softmax activation $\mathcal{S}$ where $y\in\{1,...,K\}=\mathcal{K}$, $\mathbf{x} \in \mathbb{R}^D$ and $\Theta$ is the matrix of coefficients with $\theta_{k,d}=\Theta

Figures (69)

  • Figure 1: Counterfactual explanations (stars) for linear classifiers trained under different regimes on synthetic data: (a) conventional training, all mutable; (b) CT, all mutable; (c) conventional, age immutable; (d) CT, age immutable. The linear decision boundary is shown in green along with training data colored according to ground-truth labels: $y^-=\text{"loan withheld"}$ (blue) and $y^+=\text{"loan provided"}$ (orange). Class and feature annotations (debt and age) are for illustrative purposes.
  • Figure 2: Plausibility: BL (top row) vs CT using the ECCCo generator (bottom row) counterfactuals for a randomly selected factual from class "0" (in blue). CT produces more plausible counterfactuals than BL.
  • Figure 3: Actionability: Sample visual explanations (integrated gradients) for all classes in the MNIST dataset. Top and bottom rows of images show the results for BL and CT, respectively. Mutability constraints are imposed on the five top and five bottom rows of pixels. CT is less sensitive to protected features.
  • Figure 4: Test accuracies on adversarially perturbed data with varying perturbation sizes for the non-synthetic datasets. Different training objectives are distinguished by color and shape: (1) BL---the weak baseline; (2) CT---the full CT objective; (3) AR---a partial CT objective without contrastive divergence; (4) CD---a partial CT objective without adversarial loss. Top and bottom rows show the results for FGSM and PGD (40 steps at step size $\eta=0.01$), respectively.
  • Figure 5: Percentage reductions in implausibility for the partial (AR, CD) and full (CT) objectives compared to the weak baseline. The results for $\text{IP}$ and $\text{IP}^*$ are shown in the top and bottom graphs, respectively, and the datasets are differentiated by color.
  • ...and 64 more figures

Theorems & Definitions (3)

  • Definition 3.1: Model Explainability
  • Proposition 3.1: Protecting Immutable Features
  • proof