Understanding the inner workings of neural network models is a crucial step for rationalizing their output and refining their architecture. Transformer-based models are the core of recent natural language processing and have been analyzed typically with attention patterns as their epoch-making feature is contextualizing surrounding input words via attention mechanisms. In this study, we analyze their inner contextualization by considering all the components, including the feed-forward block (i.e., a feed-forward layer and its surrounding residual and normalization layers) as well as the attention. Our experiments with masked language models show that each of the previously overlooked components did modify the degree of the contextualization in case of processing special word-word pairs (e.g., consisting of named entities). Furthermore, we find that some components cancel each other's effects. Our results could update the typical view about each component's roles (e.g., attention performs contextualization, and the other components serve different roles) in the Transformer layer.
翻译:理解神经网络模型的内部功能是使其输出合理化和完善其结构的关键步骤。 以变换器为基础的模型是最近自然语言处理的核心,并且通常以关注模式进行分析,因为其划时代特征正在通过注意机制将输入文字背景化。 在这项研究中,我们通过考虑所有组成部分,包括进料向前方块(即进料向上层及其周围的剩余和正常化层)以及注意力来分析其内在背景化。我们用蒙面语言模型进行的实验表明,在处理特殊词对配时,先前忽略的每个组成部分都改变了背景化的程度(例如由指定实体组成)。此外,我们发现,有些组成部分抵消了对方的效应。我们的结果可以更新关于每个组成部分在变换器层的作用的典型观点(例如,关注表现背景化,而其他组成部分则起到不同的作用 )。