[论文解读] Position Masking for Language Models
本文提出了一种位置掩码(position masking)——一种对 BERT 类模型中掩码语言建模(MLM)的新型扩展——通过额外掩码并预测被掩码标记的位置,使用专用分类头进行预测。该方法提升了训练收敛速度与性能,在 SQuAD 上实现了 0.3% 的 F1 分数提升,并在 IPU 硬件上将收敛所需训练 token 数量减少至原始 BERT 训练的 50%,同时通过增强 dropout 层中的梯度流动,实现了更快的收敛速度。
Masked language modeling (MLM) pre-training models such as BERT corrupt the input by replacing some tokens with [MASK] and then train a model to reconstruct the original tokens. This is an effective technique which has led to good results on all NLP benchmarks. We propose to expand upon this idea by masking the positions of some tokens along with the masked input token ids. We follow the same standard approach as BERT masking a percentage of the tokens positions and then predicting their original values using an additional fully connected classifier stage. This approach has shown good performance gains (.3\% improvement) for the SQUAD additional improvement in convergence times. For the Graphcore IPU the convergence of BERT Base with position masking requires only 50\% of the tokens from the original BERT paper.
研究动机与目标
- 通过将掩码语言建模扩展至包含位置预测,提升 BERT 类模型的训练效率与性能。
- 探究在基于 Transformer 的语言模型中添加位置掩码是否能实现更快的收敛速度与更好的泛化能力。
- 评估位置掩码对 MLM 预训练与下游 SQuAD 微调任务的影响。
- 探索通过 dropout 层改进梯度流动对模型性能的影响。
- 在相同的训练设置下,比较 GPU 与 IPU 硬件平台上的训练效率与准确率。
提出的方法
- 在标准 MLM 的标记重建头之外,增加一个全连接分类头,用于预测被掩码标记的原始位置。
- 模型采用与 BERT 相同的掩码策略:90% 的标记被掩码,其中 5% 使用正确位置,5% 使用随机位置。
- 位置掩码与标记掩码并行应用,为位置编码的学习提供额外监督信号。
- 模型使用标准 BERT 预训练目标进行训练,序列长度为 128 和 384,并采用 IPU 的流水线式实现。
- 引入一种改进的 dropout 梯度技术,即在反向传播过程中不应用 dropout 掩码,从而提升微调性能。
- 实验在 GPU 与 IPU 平台上进行,以 BERT Base 为基线模型,SQuAD 为主要评估指标。
实验结果
研究问题
- RQ1在 BERT 类模型中,除了掩码标记值外,是否通过掩码其位置也能提升收敛速度与最终模型性能?
- RQ2位置掩码在多大程度上增强了 Transformer 模型中位置嵌入的学习?
- RQ3与标准 dropout 相比,改进的 dropout 梯度技术对微调性能有何影响?
- RQ4位置掩码是否能减少达到收敛所需的训练 token 数量,尤其是在 IPU 等专用硬件上?
- RQ5在 F1 分数与收敛时间方面,位置掩码在 IPU 与 GPU 平台上的相对性能提升如何?
主要发现
- 与标准 BERT 训练相比,位置掩码使 IPU 上的 SQuAD v1.1 F1 分数提升 0.3%,EM 提升 0.4%。
- 在 IPU 上,收敛时间减少至原始 BERT 论文 token 数量的 50%,且位置掩码显著加快了收敛速度。
- GPU 结果显示 SQuAD 的 F1 分数提升 0.3%,与 IPU 结果一致,但由于序列长度限制,未达到峰值性能。
- 10% 的位置掩码率取得了最佳性能,15% 的掩码率与无掩码效果相当,而 5% 的掩码率与 10% 效果相似。
- 改进的 dropout 梯度技术相比标准 dropout 提升了 SQuAD 性能 0.5%,表明可能存在潜在的正则化效应。
- 在收敛速度与稳定性能方面,IPU 均优于 GPU,使用位置掩码时收敛速度提升 10%。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。