Your Transformer May Not be as Powerful as You Expect

Softmax函数 变压器 计算机科学 人工神经网络 算法 理论计算机科学 人工智能 电气工程 电压 工程类
作者
Shengjie Luo,Shanda Li,Shuxin Zheng,Tie-Yan Liu,Liwei Wang,Dawei He
出处
期刊:Cornell University - arXiv
标识
DOI:10.48550/arxiv.2205.13401
摘要

Relative Positional Encoding (RPE), which encodes the relative distance between any pair of tokens, is one of the most successful modifications to the original Transformer. As far as we know, theoretical understanding of the RPE-based Transformers is largely unexplored. In this work, we mathematically analyze the power of RPE-based Transformers regarding whether the model is capable of approximating any continuous sequence-to-sequence functions. One may naturally assume the answer is in the affirmative -- RPE-based Transformers are universal function approximators. However, we present a negative result by showing there exist continuous sequence-to-sequence functions that RPE-based Transformers cannot approximate no matter how deep and wide the neural network is. One key reason lies in that most RPEs are placed in the softmax attention that always generates a right stochastic matrix. This restricts the network from capturing positional information in the RPEs and limits its capacity. To overcome the problem and make the model more powerful, we first present sufficient conditions for RPE-based Transformers to achieve universal function approximation. With the theoretical guidance, we develop a novel attention module, called Universal RPE-based (URPE) Attention, which satisfies the conditions. Therefore, the corresponding URPE-based Transformers become universal function approximators. Extensive experiments covering typical architectures and tasks demonstrate that our model is parameter-efficient and can achieve superior performance to strong baselines in a wide range of applications. The code will be made publicly available at https://github.com/lsj2408/URPE.

科研通智能强力驱动
Strongly Powered by AbleSci AI
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
蜡笔小天完成签到,获得积分10
刚刚
lip发布了新的文献求助10
1秒前
1秒前
叔易发布了新的文献求助10
2秒前
summer夏完成签到,获得积分10
2秒前
2秒前
hf发布了新的文献求助10
2秒前
汉堡包应助就是觉得无聊采纳,获得10
3秒前
SY发布了新的文献求助10
3秒前
WYP完成签到,获得积分10
3秒前
3秒前
tlh发布了新的文献求助10
3秒前
芙蓉影破应助李知恩采纳,获得10
4秒前
4秒前
4秒前
执着新蕾完成签到,获得积分10
4秒前
华仔应助111采纳,获得10
6秒前
弥谷完成签到,获得积分10
7秒前
cedricleonard发布了新的文献求助10
8秒前
好事发生666完成签到,获得积分10
8秒前
chang完成签到,获得积分20
8秒前
8秒前
Ava应助某某采纳,获得10
9秒前
9秒前
充电宝应助xishanju采纳,获得10
9秒前
9秒前
南瓜气气完成签到,获得积分10
9秒前
10秒前
YG123发布了新的文献求助10
10秒前
lip完成签到,获得积分10
10秒前
我是老大应助科研通管家采纳,获得10
10秒前
10秒前
邓佳鑫Alan应助科研通管家采纳,获得10
10秒前
彭于晏应助科研通管家采纳,获得10
11秒前
11秒前
科研狗应助科研通管家采纳,获得30
11秒前
乐乐应助科研通管家采纳,获得10
11秒前
11秒前
英俊的铭应助科研通管家采纳,获得30
11秒前
丘比特应助科研通管家采纳,获得10
11秒前
高分求助中
(应助此贴封号)【重要!!请各用户(尤其是新用户)详细阅读】【科研通的精品贴汇总】 10000
Les Mantodea de Guyane Insecta, Polyneoptera 2000
Quality by Design - An Indispensable Approach to Accelerate Biopharmaceutical Product Development 800
Pulse width control of a 3-phase inverter with non sinusoidal phase voltages 777
Signals, Systems, and Signal Processing 610
Research Methods for Applied Linguistics: A Practical Guide 600
Research Methods for Applied Linguistics 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 纳米技术 工程类 有机化学 化学工程 生物化学 计算机科学 物理 内科学 复合材料 催化作用 物理化学 光电子学 电极 细胞生物学 基因 无机化学
热门帖子
关注 科研通微信公众号,转发送积分 6406289
求助须知:如何正确求助?哪些是违规求助? 8225572
关于积分的说明 17441853
捐赠科研通 5458961
什么是DOI,文献DOI怎么找? 2884512
邀请新用户注册赠送积分活动 1860862
关于科研通互助平台的介绍 1701701