arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1909.04925cs.CLcs.IR
收藏

BERT如何回答问题?Transformer表示的逐层分析

How Does BERT Answer Questions? A Layer-Wise Analysis of Transformer Representations

Beuth University of Applied Sciences Berlin(柏林贝思应用科学大学)

Betty van Aken, Benjamin Winter, Alexander Löser, Felix A. Gers

摘要:

来自Transformers的双向编码器表示(BERT)在各种自然语言处理任务中达到最先进的结果。然而,对它们的内部运作的了解仍然不够充分和不能令人满意。为了更好地理解BERT和其他基于transformer的模型,我们提出了一个逐层分析的BERT的隐藏状态。与以往的研究,主要集中在解释Transformer模型的注意力权重,我们认为,隐藏状态包含同样有价值的信息。具体来说,我们的分析集中在模型微调的任务问答(QA)作为一个例子,一个复杂的下游任务。我们检查QA模型如何转换令牌向量,以找到正确的答案。为此,我们应用一组通用和QA特定的探测任务,揭示存储在每个表示层的信息。我们对隐藏状态可视化的定性分析为BERT的推理过程提供了额外的见解。我们的研究结果表明,BERT中的转换经历了与传统管道任务相关的阶段。因此,系统可以隐式地将特定于任务的信息合并到其令牌表示中。此外,我们的分析表明,微调对模型的语义能力几乎没有影响,甚至在早期层的向量表示中也可以识别预测错误。

英文摘要:

Bidirectional Encoder Representations from Transformers (BERT) reach state-of-the-art results in a variety of Natural Language Processing tasks. However, understanding of their internal functioning is still insufficient and unsatisfactory. In order to better understand BERT and other Transformer-based models, we present a layer-wise analysis of BERT's hidden states. Unlike previous research, which mainly focuses on explaining Transformer models by their attention weights, we argue that hidden states contain equally valuable information. Specifically, our analysis focuses on models fine-tuned on the task of Question Answering (QA) as an example of a complex downstream task. We inspect how QA models transform token vectors in order to find the correct answer. To this end, we apply a set of general and QA-specific probing tasks that reveal the information stored in each representation layer. Our qualitative analysis of hidden state visualizations provides additional insights into BERT's reasoning process. Our results show that the transformations within BERT go through phases that are related to traditional pipeline tasks. The system can therefore implicitly incorporate task-specific information into its token representations. Furthermore, our analysis reveals that fine-tuning has little impact on the models' semantic abilities and that prediction errors can be recognized in the vector representations of even early layers.

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

↑