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
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
寒冷匪发布了新的文献求助30
刚刚
1秒前
1秒前
2秒前
3秒前
3秒前
4秒前
今后应助天真的梦露采纳,获得10
4秒前
4秒前
狮子完成签到,获得积分20
4秒前
谨慎蓝天完成签到,获得积分10
5秒前
5秒前
6秒前
6秒前
zzz发布了新的文献求助10
7秒前
筱姐姐发布了新的文献求助10
7秒前
柏笙笑发布了新的文献求助20
7秒前
拓跋太英发布了新的文献求助10
8秒前
9秒前
曹苍久发布了新的文献求助10
9秒前
大个应助夜将尽采纳,获得10
9秒前
nimo完成签到,获得积分10
9秒前
123w123发布了新的文献求助10
10秒前
狮子发布了新的文献求助10
10秒前
11秒前
11秒前
12秒前
13秒前
xy完成签到,获得积分10
14秒前
XX完成签到,获得积分10
14秒前
Akim应助含糊的灵雁采纳,获得10
15秒前
lcy完成签到,获得积分10
16秒前
大模型应助狮子采纳,获得10
17秒前
Libra发布了新的文献求助10
18秒前
18秒前
18秒前
18秒前
wrl2023完成签到,获得积分10
19秒前
20秒前
酷波er应助罗彦采纳,获得10
20秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Principles of town planning: translating concepts to applications 1000
内視鏡的に摘除しえた十二指腸乳頭部腫瘍の2例 660
Management and the Arts 510
Matrix Methods in Data Mining and Pattern Recognition Second Edition 510
Interpolation and Regression Models for the Chemical Engineer: Solving Numerical Problems 400
The Neuroscience of Language 400
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 内科学 物理 复合材料 催化作用 细胞生物学 无机化学 光电子学 物理化学 电极 基因
热门帖子
关注 科研通微信公众号,转发送积分 7686181
求助须知:如何正确求助?哪些是违规求助? 9249389
关于积分的说明 19957356
捐赠科研通 7259201
什么是DOI,文献DOI怎么找? 3289356
关于科研通互助平台的介绍 2446415
邀请新用户注册赠送积分活动 2293782