Explaining How Transformers Use Context to Build Predictions

05/21/2023
by   Javier Ferrando, et al.
0

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.

READ FULL TEXT

page 17

page 20

page 26

research
03/03/2022

As Little as Possible, as Much as Necessary: Detecting Over- and Undertranslations with Contrastive Conditioning

Omission and addition of content is a typical issue in neural machine tr...
research
05/23/2022

Towards Opening the Black Box of Neural Machine Translation: Source and Target Interpretations of the Transformer

In Neural Machine Translation (NMT), each token prediction is conditione...
research
01/19/2023

AtMan: Understanding Transformer Predictions Through Memory Efficient Attention Manipulation

Generative transformer models have become increasingly complex, with lar...
research
09/02/2023

Explainability for Large Language Models: A Survey

Large language models (LLMs) have demonstrated impressive capabilities i...
research
02/15/2022

XAI for Transformers: Better Explanations through Conservative Propagation

Transformers have become an important workhorse of machine learning, wit...
research
08/29/2019

Regularized Context Gates on Transformer for Machine Translation

Context gates are effective to control the contributions from the source...
research
10/09/2021

Leveraging recent advances in Pre-Trained Language Models forEye-Tracking Prediction

Cognitively inspired Natural Language Pro-cessing uses human-derived beh...

Please sign up or login with your details

Forgot password? Click here to reset