分析多头自我注意力:专门的头做繁重的工作,其余的可以修剪
Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Pruned
摘要:
多头自注意是Transformer的关键组件,它是神经机器翻译的最新架构。在这项工作中,我们评估了编码器中的各个注意头对模型整体性能的贡献,并分析了它们所扮演的角色。我们发现,最重要和最自信的头扮演一致的,往往是语言解释的角色。当使用基于随机门和L0惩罚的可微松弛的方法修剪头部时,我们观察到专门的头部最后被修剪。我们的新修剪方法删除了绝大多数的头部,而不会严重影响性能。例如,在英语-俄语WMT数据集上,修剪48个编码器头中的38个导致仅0.15 BLEU的下降。
英文摘要:
Multi-head self-attention is a key component of the Transformer, a state-of-the-art architecture for neural machine translation. In this work we evaluate the contribution made by individual attention heads in the encoder to the overall performance of the model and analyze the roles played by them. We find that the most important and confident heads play consistent and often linguistically-interpretable roles. When pruning heads using a method based on stochastic gates and a differentiable relaxation of the L0 penalty, we observe that specialized heads are last to be pruned. Our novel pruning method removes the vast majority of heads without seriously affecting performance. For example, on the English-Russian WMT dataset, pruning 38 out of 48 encoder heads results in a drop of only 0.15 BLEU.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。