arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2305.12535cs.CLcs.AIcs.LG
收藏

解释 Transformer 如何使用上下文来构建预测

Explaining How Transformers Use Context to Build Predictions

TALP Research Center(TALP研究中心);Universitat Politècnica de Catalunya(加泰罗尼亚理工大学);Meta AI

Javier Ferrando, Gerard I. Gállego, Ioannis Tsiamas, Marta R. Costa-jussà

AI总结:

本文提出一种基于Transformer可解释性进展的语言生成模型分析方法,通过对比示例验证其解释对齐效果优于基线,并揭示了MLP在语法预测及神经机器翻译对齐中的作用。

摘要:

语言生成模型基于先前的上下文生成单词。尽管现有方法提供输入归因作为对模型预测的解释,但目前仍不清楚先前的单词如何在整个层中影响模型的决策。在这项工作中,我们利用 Transformer 可解释性的最新进展,提出了一种分析语言生成模型的方法。使用对比示例,我们将我们的解释与语言学现象的证据进行对齐比较,并表明我们的方法始终比基于梯度和基于扰动的基线对齐得更好。然后,我们研究了 Transformer 内部 MLP 的作用,并表明它们学习到的特征有助于模型预测语法上可接受的单词。最后,我们将我们的方法应用于神经机器翻译模型,并证明它们生成类似人类的源-目标对齐以构建预测。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑