CLAILGMay 21, 2023

Explaining How Transformers Use Context to Build Predictions

arXiv:2305.12535v1238 citations
Originality Incremental advance
AI Analysis

This work provides incremental improvements in explainability for language generation models, benefiting researchers and practitioners in NLP by offering clearer insights into model decisions.

The paper tackled the problem of explaining how prior context influences predictions in Transformer-based language generation models, and showed that their method aligns better with linguistic evidence than gradient-based and perturbation-based baselines. It also demonstrated that MLPs in Transformers learn features for grammatical acceptability and that Neural Machine Translation models generate human-like alignments.

Language Generation Models produce words based on the previous context. Although existing methods offer input attributions as explanations for a model's prediction, it is still unclear how prior words affect the model's decision throughout the layers. In this work, we leverage recent advances in explainability of the Transformer and present a procedure to analyze models for language generation. Using contrastive examples, we compare the alignment of our explanations with evidence of the linguistic phenomena, and show that our method consistently aligns better than gradient-based and perturbation-based baselines. Then, we investigate the role of MLPs inside the Transformer and show that they learn features that help the model predict words that are grammatically acceptable. Lastly, we apply our method to Neural Machine Translation models, and demonstrate that they generate human-like source-target alignments for building predictions.

Code Implementations1 repo
Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes