论文地址:
https://arxiv.org/abs/1901.02860arrow-up-right
传统的Attention计算,Q,K\mathbf Q,\mathbf KQ,K可以拆成context和pos部分,所以Attention Score的计算可以拆成4项:
Transformer-XL的思路是将(b), (c), (d)项修改:
Attention Matrix的时间复杂度由n2dn^2dn2d增加为4n2d4n^2d4n2d,其余部分不变。
不变。
https://github.com/kimiyoung/transformer-xlarrow-up-right
作者主要测试了LM,不清楚在Encoder中是否有效果。
暂无。
应该是第一篇引入相对位置编码的工作,将Attention Score拆成4项的思路还是挺巧妙的。
Last updated 3 years ago