Home Knowledge Base Counterfactual Explanations

Counterfactual Explanations are the explainability technique that answers "what minimal change to this input would flip the model's prediction?" — providing actionable, human-intuitive explanations grounded in the logic of causal reasoning that users can directly act upon to change outcomes.

What Are Counterfactual Explanations?

Why Counterfactual Explanations Matter

Desirable Properties of Counterfactuals

Validity: The counterfactual input must actually achieve the desired prediction.

Proximity: Minimize the change from the original input — smallest possible modification (L1 or L2 distance on features, number of changed features).

Sparsity: Change as few features as possible — explanations with one or two changed features are more interpretable than those changing many.

Feasibility: Changes must be realistic and actionable. "Increase age by -5 years" is impossible; "Get a credit card" is feasible.

Diversity: Multiple counterfactuals covering different plausible paths to the desired outcome — "You could get approved by either (A) increasing income OR (B) reducing debt."

Methods for Finding Counterfactuals

DICE (Diverse Counterfactual Explanations):

Wachter et al. (2017):

Growing Spheres:

Prototype-Based:

LLM-Generated Counterfactuals:

Applications

DomainDecisionCounterfactual Example
CreditLoan denied"If income +$5k, approve"
MedicalHigh cancer risk"If BMI -3, risk drops to low"
HiringResume rejected"If 1 more year of experience, shortlisted"
InsuranceHigh premium"If no accidents last 3 years, premium -20%"
Criminal justiceHigh recidivism risk"If employed + in treatment, low risk"

Counterfactual vs. Other Explanation Methods

MethodQuestion AnsweredActionable?Causal?
SHAPWhich features mattered?PartiallyNo
LIMEWhat drove this prediction locally?PartiallyNo
CounterfactualWhat needs to change?YesApproximate
Integrated GradientsWhich input elements influenced output?NoNo

Limitations and Challenges

Counterfactual explanations are the explanation format that transforms AI decisions into actionable guidance — by framing explanations in terms of "what needs to change" rather than "what drove the current outcome," counterfactuals give individuals the knowledge and agency to influence AI-mediated decisions about their lives, making AI systems partners in human empowerment rather than opaque arbiters of fate.

counterfactualminimal changeexplain

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.