Abstract
Text documents can be described by a number of abstract concepts such as semantic category, writing style, or sentiment. Machine learning (ML) models have been trained to automatically map documents to these abstract concepts, allowing to annotate very large text collections, more than could be processed by a human in a lifetime. Besides predicting the text's category very accurately, it is also highly desirable to understand how and why the categorization process takes place. In this paper, we demonstrate that such understanding can be achieved by tracing the classification decision back to individual words using layer-wise relevance propagation (LRP), a recently developed technique for explaining predictions of complex non-linear classifiers. We train two word-based ML models, a convolutional neural network (CNN) and a bag-of-words SVM classifier, on a topic categorization task and adapt the LRP method to decompose the predictions of these models onto words. Resulting scores indicate how much individual words contribute to the overall classification decision. This enables one to distill relevant information from text documents without an explicit semantic information extraction step. We further use the word-wise relevance scores for generating novel vector-based document representations which capture semantic information. Based on these document vectors, we introduce a measure of model explanatory power and show that, although the SVM and CNN models perform similarly in terms of classification accuracy, the latter exhibits a higher level of explainability which makes it more comprehensible for humans and potentially more useful for other applications.
Introduction: The "Black Box" Challenge in NLP
In the current era of "Big Data," machine learning models have become indispensable for processing and categorizing massive text collections. However, high-performing models—particularly deep neural networks—often operate as "black boxes." While a researcher might know a model is 80% accurate, the underlying logic for a specific classification remains opaque. This lack of transparency poses significant hurdles for model trust, debugging, and the extraction of actionable knowledge.
Existing interpretability methods have historically focused on computer vision, identifying specific pixels that trigger a classification. This research addresses the gap in Natural Language Processing (NLP), proposing a framework to identify which specific words in a document are "relevant" to a model's decision without requiring manual, rule-based semantic extraction.
Methodology: Layer-wise Relevance Propagation (LRP)
The core of this approach is the adaptation of Layer-wise Relevance Propagation (LRP) to the text domain. Unlike traditional sensitivity analysis, which uses gradients to measure how small changes in input affect output, LRP "redistributes" the final prediction score backwards through the model's layers.
LRP operates on a conservation principle: the total relevance score at the input (the words) must equal the model's final output score. This allows for a granular decomposition of the decision process. The study evaluates two primary architectures:
- Convolutional Neural Network (CNN): A word-embedding-based model capable of capturing local semantic patterns.
- Support Vector Machine (SVM): A traditional Bag-of-Words classifier.
To quantify explainability, the authors introduce the Explanatory Power Index (EPI). This metric measures how well the "reasons" (relevance scores) provided by a model actually cluster by topic. By using LRP scores to weight word embeddings, the researchers create "document summary vectors" that represent the semantic core of a text.
Experimental Setup and Datasets
The study utilizes the 20Newsgroups dataset, a standard NLP benchmark containing approximately 18,000 posts across 20 categories (e.g., sci.space, comp.graphics). This dataset provides a rigorous environment for testing fine-grained topic categorization.
Key Insights: Accuracy vs. Explainability
The most striking finding is that raw accuracy is a deceptive metric. Both the CNN and SVM performed almost identically, achieving approximately 80% accuracy. However, their internal logic differed significantly:
- Semantic Generalization: The CNN, leveraging word2vec embeddings, could attribute relevance to words unseen during training if they were semantically similar to known relevant terms. The SVM, tied to a fixed vocabulary, lacked this flexibility.
- LRP vs. Sensitivity Analysis (SA): The authors demonstrate that LRP is superior to gradient-based SA. While SA identifies local sensitivity, LRP identifies actual contribution to the final decision. Crucially, LRP can identify "negative relevance"—words that actively argue against a specific classification.
- Visualizing Semantics: When projecting document vectors into 2D space using PCA, LRP-weighted vectors formed significantly tighter and cleaner clusters by topic compared to standard TF-IDF or uniform weighting.
Results
- Classification Performance: The SVM (80.10%) and the best CNN (80.19%) were statistically tied in accuracy.
- Explanatory Power: The CNN2 achieved an EPI of 0.8076, significantly outperforming the SVM's 0.7978.
- Validation via Word Deletion: To prove LRP's accuracy, the authors performed deletion experiments. Removing words in order of their LRP relevance caused model accuracy to plummet far faster than random deletion or deletion based on sensitivity analysis, confirming that LRP successfully pinpoints the most influential tokens.
Conclusion and Future Directions
This research demonstrates that LRP provides a robust framework for opening the black box of text classification. While the study focused on CNNs and SVMs, the authors suggest that LRP can be adapted to more complex architectures like RNNs and LSTMs. Future work may explore mapping relevance to higher-level structures like phrases or sentences and investigating how these explanations can assist humans in designing more efficient, interpretable classifiers.
Summary updated