RoFormer: Enhanced transformer with Rotary Position Embedding

嵌入 计算机科学 变压器 绳子 杠杆(统计) 安全性令牌 人工智能 算法 工程类 电气工程 计算机安全 电压
作者
Jianlin Su,Murtadha Ahmed,Yu Lu,Shengfeng Pan,Bo Wen,Yunfeng Liu
出处
期刊:Neurocomputing [Elsevier BV]
卷期号:568: 127063-127063 被引量:1284
标识
DOI:10.1016/j.neucom.2023.127063
摘要

Position encoding has recently been shown to be effective in transformer architecture. It enables valuable supervision for dependency modeling between elements at different positions of the sequence. In this paper, we first investigate various methods to integrate positional information into the learning process of transformer-based language models. Then, we propose a novel method named Rotary Position Embedding (RoPE) to effectively leverage the positional information. Specifically, the proposed RoPE encodes the absolute position with a rotation matrix and meanwhile incorporates the explicit relative position dependency in the self-attention formulation. Notably, RoPE enables valuable properties, including the flexibility of sequence length, decaying inter-token dependency with increasing relative distances, and the capability of equipping linear self-attention with relative position encoding. Finally, we evaluate the enhanced transformer with rotary position embedding, also called RoFormer, on various long text classification benchmark datasets. Our experiments show that it consistently overcomes its alternatives. Furthermore, we provide a theoretical analysis to explain some experimental results. RoFormer is already integrated into Huggingface: https://huggingface.co/docs/transformers/model_doc/roformer.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
你好发布了新的文献求助10
刚刚
刚刚
刚刚
喜悦方盒发布了新的文献求助10
刚刚
ymy的应助被曾经的问兰采纳,获得10
刚刚
刚刚
刚刚
陈全刚完成签到,获得积分10
1秒前
知性的雁梅完成签到,获得积分10
1秒前
1秒前
科研完成签到,获得积分10
1秒前
lk发布了新的文献求助10
2秒前
2秒前
2秒前
2秒前
LeonPan完成签到,获得积分10
2秒前
2秒前
凶狠的冷松发布了新的文献求助150
2秒前
2秒前
2秒前
2秒前
My_magnum_opus的应助被犹豫难摧采纳,获得60
2秒前
3秒前
万能图书馆的应助被li5498693采纳,获得10
3秒前
4秒前
4秒前
昀清发布了新的文献求助10
4秒前
顾矜的应助被wang采纳,获得10
4秒前
4秒前
4秒前
4秒前
4秒前
4秒前
4秒前
5秒前
5秒前
5秒前
5秒前
lwt发布了新的文献求助10
5秒前
5秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Les Mantodea De Guyane 2000
内視鏡下経鼻経蝶形骨洞手術術後SIADHに対する予防的水制限の安全性と有効性の検討 1000
Problems and Solutions for Integer and Combinatorial Optimization: Building Skills in Discrete Optimization 600
Organizational Behavior 510
桑白皮エキスの実験的, 臨床的育毛効果について 500
Nonlinear vehicle active suspension system control method based on the extended high gain observer 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 计算机科学 工程类 有机化学 化学工程 生物化学 物理 复合材料 内科学 催化作用 光电子学 人工智能 细胞生物学 无机化学 物理化学 数学
热门帖子
关注 科研通微信公众号,转发送积分 8000981
求助须知:如何正确求助?哪些是违规求助? 9453895
关于积分的说明 21146729
捐赠科研通 7573841
什么是DOI,文献DOI怎么找? 3381268
关于科研通互助平台的介绍 2513941
邀请新用户注册赠送积分活动 2415347