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 被引量:435
标识
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
更新
PDF的下载单位、IP信息已删除 (2025-6-4)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
含糊的画板完成签到,获得积分10
2秒前
2秒前
三个地方户籍卡完成签到,获得积分10
4秒前
SamuelLiu完成签到,获得积分10
7秒前
小秋发布了新的文献求助10
8秒前
王磊完成签到,获得积分10
12秒前
123完成签到,获得积分10
13秒前
灵巧的导师完成签到,获得积分10
14秒前
Bressanone完成签到,获得积分10
15秒前
jimmy完成签到 ,获得积分10
16秒前
Yuan完成签到 ,获得积分10
17秒前
BUHUIWAN完成签到,获得积分20
17秒前
快乐的奕涵完成签到,获得积分10
18秒前
19秒前
无相完成签到 ,获得积分10
19秒前
痕丶歆完成签到 ,获得积分10
21秒前
自由的姿完成签到,获得积分10
21秒前
温柔梦易完成签到,获得积分10
21秒前
沙克几十块完成签到,获得积分10
21秒前
22秒前
ppc524完成签到,获得积分10
23秒前
潇湘夜雨完成签到,获得积分10
23秒前
小李叭叭完成签到,获得积分10
24秒前
wsr完成签到,获得积分10
24秒前
复杂的板凳完成签到,获得积分10
25秒前
失眠夏山完成签到,获得积分10
26秒前
Mingtiaoxiyue完成签到,获得积分10
27秒前
子不语发布了新的文献求助10
27秒前
超级小熊猫完成签到 ,获得积分10
28秒前
学渣一枚完成签到 ,获得积分10
28秒前
莴苣完成签到,获得积分10
28秒前
像猫的狗完成签到 ,获得积分10
30秒前
30秒前
阿超发布了新的文献求助10
30秒前
赵乂完成签到,获得积分20
31秒前
winifred完成签到 ,获得积分10
32秒前
丫丫完成签到 ,获得积分10
32秒前
zhenya完成签到,获得积分10
33秒前
huang完成签到,获得积分20
33秒前
仄兀完成签到,获得积分10
34秒前
高分求助中
A new approach to the extrapolation of accelerated life test data 1000
Cognitive Neuroscience: The Biology of the Mind 1000
Technical Brochure TB 814: LPIT applications in HV gas insulated switchgear 1000
Immigrant Incorporation in East Asian Democracies 500
Nucleophilic substitution in azasydnone-modified dinitroanisoles 500
不知道标题是什么 500
A Preliminary Study on Correlation Between Independent Components of Facial Thermal Images and Subjective Assessment of Chronic Stress 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 工程类 有机化学 生物化学 物理 内科学 纳米技术 计算机科学 化学工程 复合材料 遗传学 基因 物理化学 催化作用 冶金 细胞生物学 免疫学
热门帖子
关注 科研通微信公众号,转发送积分 3965813
求助须知:如何正确求助?哪些是违规求助? 3511146
关于积分的说明 11156382
捐赠科研通 3245736
什么是DOI,文献DOI怎么找? 1793118
邀请新用户注册赠送积分活动 874230
科研通“疑难数据库(出版商)”最低求助积分说明 804268