相对位置编码两篇简要笔记

该文探讨了Transformer模型中位置编码的作用,指出现有方法未能充分利用位置信息。绝对位置编码用于模拟不同位置间token的关注,但在某些任务(如NSP)中可能不适用,作者主张使用相对位置编码以提高模型的鲁棒性和训练效率。实验结果显示,相对位置编码在翻译质量上未表现出明显优势,但其方法更具优势。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. Shaw P, Uszkoreit J, Vaswani A. Self-attention with relative position representations[J]. arXiv preprint arXiv:1803.02155, 2018.
  1. 结合相对位置和绝对位置表征,翻译质量没有进一步提高。
  2. 英德互译实验结果
    在这里插入图片描述
  3. In our experiments we did not observe any benefit from including sinusoidal position encodings in addition to relative position representations.
  1. Huang Z, Liang D, Xu P, et al. Improve transformer models with better relative position embeddings[J]. arXiv preprint
    arXiv:2009.13658, 2020.

1. 提出观点: VanillaTransformer现有位置编码方式未能完全利用位置信息。
(…that existing work does not fully utilize position information.)
2. 绝对位置编码用于模拟一个位置的token如何关注另一个位置的token。
(The absolute position embedding is used to model how a token at one position attends to another token at a different position. )
3. 作者认为在NSP任务中绝对位置不合理,应该使用相对位置。

  1. 该论文提出的方法,鲁棒性强,易于训练。在这里插入图片描述
    在这里插入图片描述

  2. 作者对方法4更有信心。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值