TL;DR
This paper introduces COCKATIEL, a novel post-hoc XAI technique for NLP models that uses Non-Negative Matrix Factorization (NMF) to discover interpretable concepts and Sensitivity Analysis to rank their importance. COCKATIEL provides human-aligned, faithful explanations for complex Transformer models without requiring retraining, addressing the growing need for transparency in AI.
What Problem Does This Paper Address?
The increasing complexity of NLP models, particularly Transformer architectures, has made their decision-making processes opaque. While attention maps and traditional attribution methods have been proposed for interpretability, recent research suggests they can be unreliable. This lack of transparency is problematic for several reasons: it hinders our ability to identify and mitigate potential biases in AI systems, which can have serious consequences in real-world applications. Furthermore, for AI to gain widespread acceptance, humans need to understand why a model makes a particular prediction. Existing concept-based XAI methods often require human input to define concepts or are limited to specific model architectures like CNNs. COCKATIEL aims to bridge this gap by offering a model-agnostic, unsupervised approach to discover and explain concepts used by NLP models.
Methods
COCKATIEL is a three-part, post-hoc, model-agnostic XAI technique:
- Unsupervised Concept Discovery ("Concept part"): This phase leverages Non-Negative Matrix Factorization (NMF) on the activations of the model's last layer (specifically, layers with non-negative activation functions like ReLU). NMF decomposes the activation matrix into two lower-rank matrices: one representing the concepts (W) and another quantifying their presence in each input (U). This allows the discovery of concepts without relying on attention mechanisms or specific model architectures.
- Concept Importance Estimation ("Ranking part"): To understand which discovered concepts are most influential for the model's predictions, COCKATIEL employs Sensitivity Analysis, specifically using Total Sobol indices. This method quantifies the contribution of each concept, including its interactions with other concepts, to the model's output variance. This provides a ranking of concepts by their importance.
- Instance-Level Explanation Generation ("Interpretable elements part"): This phase focuses on explaining how specific words or clauses contribute to a particular concept. COCKATIEL adapts the "Occlusion" method, where parts of the input (words or clauses) are masked, and the impact on the concept's activation is measured. This allows for fine-grained explanations, highlighting the "interpretable elements" associated with each concept.
Datasets
- Beer Reviews Dataset: Used for evaluating concept alignment with human annotations across different aspects (Appearance, Aroma, Palate, Taste, Overall). This dataset contains reviews with commentary and aspect-specific ratings.
- IMDB Dataset: A collection of 50,000 movie reviews (25K positive, 25K negative) used for evaluating explanation faithfulness and qualitative analysis.
Key Insights and Ideas
- Unsupervised Concept Discovery for NLP: COCKATIEL demonstrates that NMF can effectively discover meaningful, abstract concepts from the latent representations of NLP models without requiring human-defined concepts or relying on attention mechanisms.
- Faithfulness Beyond Attribution: By using sensitivity analysis and occlusion, COCKATIEL provides explanations that are not only interpretable but also demonstrably faithful to the model's internal workings, showing that the identified concepts genuinely influence predictions.
- Model Agnosticism is Key: The technique's applicability to any neural network with non-negative activations (like ReLU) makes it highly versatile for explaining a wide range of NLP models, including Transformers and LSTMs.
- Human Alignment is Achievable: The method successfully discovers concepts that align with human intuition in sentiment analysis tasks, suggesting that the learned concepts reflect human-like reasoning patterns.
Key Results
- Superior Concept Alignment: On the beer review task, COCKATIEL achieved better precision, recall, and F1 scores in aligning discovered concepts with human annotations compared to state-of-the-art rationalization techniques.
- Faithful Explanations: Fidelity metrics (deletion and insertion curves) on the IMDB dataset showed that COCKATIEL's concepts are indeed important for the model's predictions, outperforming random concept rankings.
- Qualitative Examples: The paper provides illustrative examples of concepts discovered for both RoBERTa and LSTM models on sentiment analysis tasks, showcasing how these concepts (e.g., "the favorite movie," "technically good/interesting movie") provide intuitive explanations for model predictions.
Limitations and Future Work
- Concept Interpretation: While COCKATIEL extracts abstract concepts, their interpretation and labeling currently require human supervision. The authors suggest leveraging topic modeling to add objectivity to this labeling process.
- Excerpt Extraction Function Choice: The choice of excerpt extraction functions (τ1 and τ2) for concept discovery and occlusion was made empirically. The authors acknowledge that optimal choices might vary depending on the dataset, text format, and model expressivity, and suggest exploring different combinations for desired granularity.
- Simulatability: The paper focused on meaningfulness and fidelity. The authors suggest future work should also test "simulatability," which measures an explanation's capacity to help humans predict model behavior.
Summary updated