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
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
yy发布了新的文献求助10
刚刚
aaa完成签到,获得积分10
刚刚
Jin发布了新的文献求助10
1秒前
1秒前
1秒前
liyuqi61148完成签到,获得积分10
1秒前
星辰大海应助Nil采纳,获得10
2秒前
无极微光应助李林柯采纳,获得20
2秒前
潇洒的棒棒糖完成签到 ,获得积分10
2秒前
2秒前
JamesPei应助zhq采纳,获得10
2秒前
2秒前
脑洞疼应助邓佩雨采纳,获得10
2秒前
叮叮叮铛完成签到,获得积分0
2秒前
3秒前
3秒前
3秒前
4秒前
无敌小飞虫完成签到,获得积分20
4秒前
爆米花应助bujiachong采纳,获得10
4秒前
壮壮完成签到,获得积分10
5秒前
5秒前
研友_VZG7GZ应助追寻素阴采纳,获得10
5秒前
qwzh完成签到,获得积分10
7秒前
小马甲应助饼饼采纳,获得10
7秒前
prrrratt发布了新的文献求助10
7秒前
P2512148发布了新的文献求助10
7秒前
高贵的不凡完成签到,获得积分10
8秒前
犹豫耳机完成签到,获得积分10
8秒前
8秒前
研友_VZG7GZ应助顺顺采纳,获得10
8秒前
8秒前
桃真心完成签到,获得积分10
8秒前
坦率又菡发布了新的文献求助10
9秒前
情怀应助chnningji采纳,获得10
9秒前
yy完成签到,获得积分10
9秒前
21发布了新的文献求助10
10秒前
辞旧完成签到,获得积分10
10秒前
河马发布了新的文献求助10
10秒前
狮子卷卷完成签到,获得积分0
11秒前
高分求助中
Signals, Systems, and Signal Processing 610
Fundamentals of Pharmaceutical and Biologics Regulations: A Global Perspective, Second Edition 600
久松真一著作集〈第5巻〉禅と芸術 500
Fundamentals of Modern Mathematics: A Practical Review (Dover Books on Mathematics) 500
Cold War Transcended: Australia's China Policy, 1949-1990 470
Cybercrime: The Transformation of Crime in the Information Age, 2nd Edition 400
Moore's Clinically Oriented Anatomy 10th Edition 400
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 物理 内科学 复合材料 催化作用 物理化学 光电子学 电极 细胞生物学 基因 无机化学
热门帖子
关注 科研通微信公众号,转发送积分 6617977
求助须知:如何正确求助?哪些是违规求助? 8382232
关于积分的说明 17932713
捐赠科研通 5787646
什么是DOI,文献DOI怎么找? 2960022
邀请新用户注册赠送积分活动 1935276
关于科研通互助平台的介绍 1840081