[论文解读] Rethinking Positional Encoding in Language Pre-training
TUPE 提出非绑定位置编码,分离词语与位置相关性并解除对 CLS 标记的绑定,提升 GLUE 性能并实现更快的预训练。
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 exttt{[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 extbf{T}ransformer with extbf{U}ntied extbf{P}ositional extbf{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 exttt{[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.
研究动机与目标
- 促使重新审视语言预训练中的绝对/相对位置编码。
- 提出一种新的 TUPE 方法,在自注意力中解除词–位置相关性绑定。
- 将 CLS 符号与常规位置解绑,以更好地捕捉全句信息。
- 在 BERT-base 设置的 GLUE 基准上展示 TUPE 的改进。
提出的方法
- 在自注意力中使用不同的投影分别计算词语上下文相关性和位置相关性。
- 在注意力中用独立的相关项替代将词嵌入和绝对位置嵌入在输入层相加的做法。
- 通过使用可学习参数重置 CLS 的位置相关性来解除绑定。
- 给出 TUPE-A(非绑定的绝对)和 TUPE-R(非绑定的相对)变体。
- 在各层之间共享位置相关性项以提高效率。
- 在 GLUE 上以 BERT-Base 进行评估,并在附录中扩展对 BERT-Large 和 ELECTRA 的分析。
实验结果
研究问题
- RQ1非绑定的、独立的词语与位置相关性是否能相比标准的绝对/相对编码提升 Transformer 的预训练?
- RQ2将 CLS 符号与常规位置解绑是否能改善句子级表示?
- RQ3TUPE-A 与 TUPE-R 在与现有相对编码结合时是否提供互补的好处?
- RQ4TUPE 对 GLUE 基准性能与预训练效率的影响是什么?
主要发现
| Steps | MNLI-m/mm | QNLI | QQP | SST | CoLA | MRPC | RTE | STS | Avg | |
|---|---|---|---|---|---|---|---|---|---|---|
| BERT-A | 1 M | 84.93/84.91 | 91.34 | 91.04 | 92.88 | 55.19 | 88.29 | 68.61 | 89.43 | 82.96 |
| BERT-R | 1 M | 85.81/85.84 | 92.16 | 91.12 | 92.90 | 55.43 | 89.26 | 71.46 | 88.94 | 83.66 |
| TUPE-A | 1 M | 86.05/85.99 | 91.92 | 91.16 | 93.19 | 63.09 | 88.37 | 71.61 | 88.88 | 84.47 |
| TUPE-R | 1 M | 86.21/86.19 | 92.17 | 91.30 | 93.26 | 63.56 | 89.89 | 73.56 | 89.23 | 85.04 |
| TUPE-A mid | 300 k | 84.76/84.83 | 90.96 | 91.00 | 92.25 | 62.13 | 87.1 | 68.79 | 88.16 | 83.33 |
| TUPE-R mid | 300 k | 84.86/85.21 | 91.23 | 91.14 | 92.41 | 62.47 | 87.29 | 69.85 | 88.63 | 83.68 |
| TUPE-A tie-cls | 1 M | 85.91/85.73 | 91.90 | 91.05 | 93.17 | 59.46 | 88.53 | 69.54 | 88.97 | 83.81 |
| BERT-A d | 1 M | 85.26/85.28 | 91.56 | 91.02 | 92.70 | 59.73 | 88.46 | 71.31 | 87.47 | 83.64 |
- TUPE-A 与 TUPE-R 在 GLUE 任务上超越了 BERT-A 与 BERT-R 基线。
- TUPE-R 的 GLUE 平均分为 85.04,低于 83.66 的 BERT-R,增益约 1.38 点。
- TUPE-R 平均分比 TUPE-A 高出 0.57 点。
- TUPE-A 与 TUPE-R 在预训练阶段收敛更快,使用约 30% 的预训练步即可达到更好的下游性能。
- 解除 CLS 绑定在低资源任务(如 CoLA、RTE)上带来显著提升,而解绑的相关性在高资源任务(如 MNLI)上有帮助。
- TUPE 增加的参数很少(约为 BERT-Base 的 1%),额外计算开销极小;位置相关项可在各层之间复用。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。