arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2006.15595cs.CLcs.LG
收藏

对语言预训练中位置编码的再认识

Rethinking Positional Encoding in Language Pre-training

Microsoft Research(微软研究院)

Guolin Ke, Di He, Tie-Yan Liu

摘要:

在这项工作中,我们研究了用于语言预训练的位置编码方法(例如,BERT)并识别现有公式中的几个问题。首先,我们证明了在绝对位置编码中,位置嵌入和词嵌入上的加法运算带来了两个异构信息资源之间的混合相关性。它可能会在注意力上带来不必要的随机性,并进一步限制模型的表达能力。第二,我们质疑,考虑到符号\texttt{[CLS]}在下游任务中的特殊作用(代表整个句子),将符号的位置与其他单词相同是否是一个合理的设计。基于上述分析,我们提出了一种新的位置编码方法--\textbf{T} transformer with \textbf{U} ntied \textbf{P} ositional \textbf{E} ncoding(TUPE).在自注意模块中,TUPE分别计算了词的上下文相关度和位置相关度,并将它们相加。这种设计消除了异构嵌入上的混合和噪声相关性,并通过使用不同的投影矩阵提供了更多的表现力。此外,TUPE将\texttt{[CLS]}符号与其他位置分开,从而更容易从所有位置捕获信息。大量的实验和GLUE基准上的烧蚀研究证明了该方法的有效性。代码和模型在https://github.com/guolinke/TUPE上发布。

英文摘要:

In this work, we investigate the positional encoding methods used in language pre-training (e.g., BERT) and identify several problems in the existing formulations. First, we show that in the absolute positional encoding, the addition operation applied on positional embeddings and word embeddings brings mixed correlations between the two heterogeneous information resources. It may bring unnecessary randomness in the attention and further limit the expressiveness of the model. Second, we question whether treating the position of the symbol \texttt{[CLS]} the same as other words is a reasonable design, considering its special role (the representation of the entire sentence) in the downstream tasks. Motivated from above analysis, we propose a new positional encoding method called \textbf{T}ransformer with \textbf{U}ntied \textbf{P}ositional \textbf{E}ncoding (TUPE). In the self-attention module, TUPE computes the word contextual correlation and positional correlation separately with different parameterizations and then adds them together. This design removes the mixed and noisy correlations over heterogeneous embeddings and offers more expressiveness by using different projection matrices. Furthermore, TUPE unties the \texttt{[CLS]} symbol from other positions, making it easier to capture information from all positions. Extensive experiments and ablation studies on GLUE benchmark demonstrate the effectiveness of the proposed method. Codes and models are released at https://github.com/guolinke/TUPE.

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

↑