Multilingual multi-aspect explainability analyses on machine reading comprehension models

Yiming Cui, Weinan Zhang, Wanxiang Che, Ting Liu, Zhigang Chen, Shijin Wang

TL;DR

This paper delves into the "black box" of machine reading comprehension (MRC) models, specifically investigating how multi-head self-attention mechanisms contribute to their performance. By analyzing attention patterns across different languages, model types, and question complexities, they reveal that "passage-to-question" and "passage understanding" attentions are crucial for accurate answers, offering a more nuanced view of model explainability.

What Problem Does This Paper Address?

While pre-trained language models (PLMs) have achieved human-level performance on many machine reading comprehension (MRC) tasks, their internal workings remain largely opaque. This lack of transparency hinders our ability to trust, debug, and improve these models. Specifically, the role of the attention mechanism, a core component of PLMs, in MRC performance is not fully understood. Existing research often treats attention maps holistically or focuses on specific tasks, leaving a gap in understanding its multi-faceted contribution to MRC, especially across different languages and model architectures.

Methods

The authors propose a novel approach to dissecting the attention mechanism in MRC models by dividing the attention map into four distinct "attention zones":

  • Q2 (Question-to-Question): Represents the model attending to the question itself, akin to question understanding.
  • Q2P (Question-to-Passage): Models how specific question words attend to passage words, crucial for finding relevant clues.
  • P2Q (Passage-to-Question): The reverse of Q2P, where passage words attend to question words, potentially for answer verification.
  • P2 (Passage-to-Passage): Represents the model attending to the passage itself, for passage understanding.

They employ a quantitative approach by systematically masking these attention zones (or parts of them) and observing the impact on model performance (measured by EM and F1 scores). This allows them to assess the relative importance of each zone. Additionally, they use visualizations (like attention heatmaps) to provide qualitative insights into how these zones function in practice. Their experiments are conducted in a multilingual setting (English and Chinese) and across different PLMs (BERT, ELECTRA, ALBERT) and model sizes.

Datasets

The study utilizes two prominent span-extraction MRC datasets:

  • SQuAD (Stanford Question Answering Dataset): A large-scale English dataset with over 100,000 samples, widely used as a benchmark.
  • CMRC 2018 (Chinese Machine Reading Comprehension 2018): A Chinese dataset constructed from Wikipedia, featuring traditional train/dev/test splits and a challenging set of harder questions.

Key Insights and Ideas

  • Attention Zones Matter: The paper moves beyond treating attention maps as monolithic entities, demonstrating that specific zones (Q2, Q2P, P2Q, P2) have distinct roles and varying importance in MRC.
  • Passage-to-Question and Passage Understanding are Key: The "P2Q" (passage-to-question) and "P2" (passage understanding) attention zones show the strongest correlation with model performance, suggesting that how the model relates passage information to the question and understands the passage context itself are paramount.
  • Multilingual and Multi-Aspect Generalizability: The findings regarding the importance of P2Q and P2 hold across both English and Chinese datasets, and to a significant extent, across different PLM architectures and sizes, indicating a degree of generalizability.
  • Harder Questions Require Deeper Understanding: For more complex questions (like "why" questions or those in the CMRC 2018 challenge set), the model shows increased emphasis on the Q2 (question understanding) and P2 (passage understanding) zones, mirroring human problem-solving strategies.
  • Attention is Conditional Explanation: The study suggests that attention scores are not direct explanations but rather conditional indicators of importance, and their impact on performance varies depending on the specific zone and context.

Key Results

  • Masking the P2Q attention zone resulted in the most severe performance degradation across both SQuAD and CMRC 2018 datasets, highlighting its critical role in answer prediction.
  • Masking the Q2P zone had the least impact on performance, suggesting it's less critical than other zones for overall accuracy.
  • The P2 (passage understanding) attention starts influencing performance from the very first layer and shows a strong reaction when masked.
  • Larger PLMs (e.g., ALBERT-large) showed less performance degradation when attention zones were masked compared to their base-level counterparts, suggesting that larger models have more distributed knowledge and are less reliant on specific attention patterns.
  • For harder questions, the emphasis shifts towards Q2 and P2 attention zones, indicating a deeper engagement with question and passage comprehension.

Limitations and Future Work

  • Language Diversity: While the study includes English and Chinese, it acknowledges that conclusions might not generalize to other language genres. Future work could explore explainability in languages like Arabic.
  • Model Diversity: The analysis focused on BERT, ELECTRA, and ALBERT. Investigating other PLM architectures could reveal further insights into how different model designs influence attention patterns.
  • Attention Mechanism Examination: The paper proposes a novel way to analyze attention by masking zones and observing performance impact. Future work could explore more efficient methods for identifying and discarding less important attention heads or zones automatically.
  • Many-to-Many Mappings: The authors suggest exploring many-to-many attention mappings for questions requiring complex reasoning.
  • Automated Head Pruning: Developing methods to automatically discard less important attention heads could lead to more efficient and interpretable models.

Summary updated

BibTeX
@inproceedings{cui2022multilingual,
  author = {Yiming Cui and Weinan Zhang and Wanxiang Che and Ting Liu and Zhigang Chen and Shijin Wang},
  title = {{Multilingual multi-aspect explainability analyses on machine reading comprehension models}},
  booktitle = {iScience},
  year = {2022},
  doi = {10.1016/j.isci.2022.104176},
}
Figure