Explaining Classes through Word Attribution

Samuel Rönnqvist, Amanda Myntti, Aki-Juhani Kyröläinen, Sampo Pyysalo, Veronika Laippala, Filip GinterarXiv 2021

Introduction

Deep learning models are often criticized as "black boxes," providing little insight into the logic behind their predictions. While techniques like Integrated Gradients (IG) offer local explanations for individual instances—such as identifying why a specific text is labeled a "Recipe"—they fail to provide a global understanding of what defines an entire category. Researchers from TurkuNLP have addressed this gap by developing a method to aggregate local attributions into stable, class-level keywords, revealing how models perceive different web genres.

Methodology

The proposed pipeline extracts linguistically meaningful descriptors through a three-step process:

  1. Train and Explain: The team repeatedly (N=100) creates random stratified splits of the training and development data. For each split, an XLM-R model is fine-tuned, and IG is applied to the validation set to generate attribution scores for every token.
  2. Aggregate Attributions: Average attribution scores are calculated for word-class pairs, focusing only on "true positive" predictions and selecting the top $n$ scoring words per document to minimize noise.
  3. Select Stable Keywords: To ensure reliability, a word is only considered a valid class descriptor if it appears as a top-scoring word in at least 60% of the 100 experimental runs. This filtering process separates genuine associations from artifacts of random initialization.

Performance and Classification Results

The study utilized the Corpus of Online Registers of English (CORE), which contains nearly 50,000 web texts across eight upper-level classes. The XLM-R base model achieved a mean micro-average F1-score of 65.10%, though performance varied significantly by register.

Table 1: Predictive performance (F1) and support (Sup.) across web register classes.

As shown in the performance data, classes like "Lyrical" (82.92% F1) were highly predictable, while the "Spoken" register proved extremely challenging (26.45% F1). The high standard deviation for the Spoken class suggests that the model failed to find a consistent internal logic for this category.

Global Insights and Model Debugging

A key finding of this research is that the model identifies functional markers rather than just topical keywords. For instance, in the "Interactive Discussion" (ID) class, the most stable keywords define the structure of the interaction rather than the subject matter.

Table 3: Top stable keywords for How-to (HI), Interactive Discussion (ID), and Informational Description (IN) classes.

In the ID category, words like question, faq, forum, and answer dominate the attribution scores. Similarly, the "How-to" (HI) class is defined by procedural terms like recipe, tips, and tutorial. The method also serves as a debugging tool; for the "Spoken" class, no keywords passed the stability threshold, confirming that the model's poor performance was due to an inability to learn defining features for that register.

Conclusion and Future Work

By prioritizing stability across multiple training runs, this method provides a robust way to interpret the global logic of deep learning classifiers. The researchers found that 82% of the top 100 keywords for any given register were unique to that class, indicating high discriminative power. Future work will explore cross-lingual settings to determine if models apply the same logic to identify registers across different languages, such as English and Finnish.

Summary updated

BibTeX
@misc{ronnqvist2021explaining,
  author = {Samuel Rönnqvist and Amanda Myntti and Aki-Juhani Kyröläinen and Sampo Pyysalo and Veronika Laippala and Filip Ginter},
  title = {{Explaining Classes through Word Attribution}},
  year = {2021},
  eprint = {2108.13653},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.13653},
}
Figure