Abstract
Natural Language Inference (NLI) models are often treated as black boxes, with existing explanation methods focusing on individual word importance rather than the cross-sentence relationships critical to the task. We introduce AREC (Alignment Rationale Explanation for Co-attention based models), a post-hoc method that identifies sparse, human-readable word-pair alignments. By optimizing a multi-part loss function that includes a novel contiguity constraint, AREC produces explanations that are both faithful to the underlying model and highly interpretable for humans. Our results across multiple benchmarks demonstrate that AREC outperforms traditional attribution methods in both faithfulness and readability.
Introduction
Natural Language Inference (NLI) requires determining the logical relationship between a premise and a hypothesis. While deep learning models excel at this task, understanding their decision-making process is difficult. Traditional explanation tools like LIME or simple attention maps highlight individual words, but NLI is fundamentally a cross-sentence task. To understand why a model predicts a "contradiction," one must see how it relates specific words in the premise to words in the hypothesis.
Existing methods often produce noisy explanations that fail to capture these crucial word-pair relationships. We propose Alignment Rationales—sparse, readable sets of word-pair alignments—as a more effective way to interpret NLI systems.
The AREC Method
AREC is a post-hoc explanation method designed for models utilizing co-attention mechanisms. It operates by learning a binary mask for the model's internal co-attention matrix, effectively "shutting off" unimportant alignments while preserving the model's original prediction.
Technical Components
- Differentiable Optimization: To handle the non-differentiable nature of binary masks, AREC employs the HardConcrete distribution, allowing for continuous optimization during training before snapping to discrete values.
- Multi-Part Loss Function: The optimization objective balances three key factors:
- Fidelity ($L_0$): Ensures the masked model's output remains consistent with the original.
- Compactness ($L_1$): Encourages the explanation to be as concise as possible.
- Contiguity ($L_2$): A novel phrase-level loss that penalizes non-rectangular clusters in the alignment map, significantly improving human readability.
- Dynamic Weighting: The system automatically adjusts the balance between faithfulness and readability based on how well the mask preserves model accuracy.
Experimental Evaluation
We evaluated AREC across four major NLI benchmarks: SNLI (standard large-scale), eSNLI (including human rationales), BNLI (stress tests with minimal word changes), and HANS (designed to expose shallow heuristics).
Key Results
AREC demonstrates superior performance across both quantitative and qualitative metrics. As shown in the comprehensive evaluation table below, AREC consistently achieves the lowest AORC (Area Over Reservation Curve) scores, indicating higher faithfulness than baselines like LIME or Integrated Gradients.
- Human-Approved Readability: In a blind study, human annotators rated AREC explanations at approximately 4.0/5.0, whereas traditional gradient-based methods struggled around 1.5/5.0.
- Exposing and Fixing Heuristics: AREC revealed that models like BERT often fail the HANS dataset by aligning identical words regardless of grammatical roles. By applying "guided masks" based on Semantic Role Labeling (SRL), we improved BERT’s accuracy on HANS non-entailment cases from 16.59% to 70.21% without retraining.
Conclusion and Limitations
AREC provides a significant step forward in making NLI models interpretable by focusing on alignments rather than isolated words. While currently optimized for co-attention architectures, future work will focus on making the method model-agnostic and applying the alignment rationale concept to other cross-sentence tasks like Machine Translation. Despite its higher computational cost compared to simple gradient methods, the gains in faithfulness and human readability make it a powerful tool for model diagnostics.
Summary updated