Introduction
Most interpretability methods in Natural Language Processing (NLP), such as gradient saliency or LIME, attempt to explain a model's decision by identifying all features that contributed to a predicted label. However, human explanations are naturally contrastive. We rarely ask for a complete causal history; instead, we ask why one specific outcome occurred instead of another (e.g., "Why is this person classified as a dentist rather than a surgeon?").
Standard "complete" explanations often suffer from two primary issues:
- Cognitive Overload: They include factors that are necessary for the prediction but not discriminative (e.g., "having a medical degree" explains both dentists and surgeons).
- Ambiguity: Without a "foil" (the alternative class), it is difficult to determine if a feature is globally important or specifically relevant to a particular classification error.
This paper introduces a framework for generating contrastive explanations by isolating the features that differentiate a "fact" (the predicted label) from a "foil" (the alternative).
Methodology
The core technical contribution is a projection-based method designed to isolate contrastive information within the latent space of a neural network.
Latent Projection
For a classifier with a final linear layer $W$, the logit for any class $i$ is the dot product of the latent representation $h_x$ and the class weights $w_i$. To identify features differentiating class $y^*$ (the fact) from $y'$ (the foil), the authors define a contrastive direction $u = w_{y^*} - w_{y'}$. By projecting $h_x$ onto this vector $u$, they derive a "contrastive representation" $C(h_x)$ containing only the information the model uses to choose the fact over the foil.
Interventions and Metrics
To quantify the importance of specific factors, the authors employ two intervention strategies:
- Masking: Replacing specific tokens with a
<mask>token. - Amnesic Probing: Utilizing null-space projection to remove abstract concepts (e.g., gender) from the representation.
The impact is measured using a Contrastive Metric ($\delta_{p,q}^{contr}$), which tracks the change in the normalized probability of the fact versus the foil following an intervention. This allows for the ranking of features by their specific "contrastive power."
Key Insights and Results
The framework was evaluated on the BIOS dataset (professional biographies) and NLI benchmarks (MultiNLI/SNLI).
Pruning Irrelevance
Contrastive explanations naturally omit shared features. In the BIOS dataset, a "medical degree" is a causal factor for predicting physician, but it is not a contrastive factor when the foil is surgeon, as both professions require it. This demonstrates that feature utility is relative to the contrastive context.
NLI and Linguistic Cues
The analysis of Natural Language Inference (NLI) tasks revealed how models utilize specific linguistic heuristics. As shown in the table below, "negation" words are strongly contrastive for distinguishing contradiction from entailment (0.195) but are significantly less relevant when distinguishing contradiction from neutral (0.051).
Debugging and Bias
By setting the model's incorrect prediction as the "fact" and the ground truth as the "foil," researchers can identify the specific "distractor" features that led to an error. Additionally, the method highlighted gender bias in the BIOS dataset; for instance, the model relies heavily on gender information to distinguish between semantically similar but gender-imbalanced professions like paralegal and attorney.
Conclusion and Future Work
While the current framework effectively prunes irrelevant information, it assumes a linear final decision layer and currently handles only one foil at a time. Future research may extend this to subspace projections for multiple foils and explore the generation of counterfactual text to actively flip model decisions. By aligning model interpretability with the contrastive nature of human reasoning, this framework provides a more intuitive and actionable path for model debugging and auditing.
Summary updated