Transformer has shown great successes in natural language processing, computer vision, and audio processing. As one of its core components, the softmax attention helps to capture long-range dependencies yet prohibits its scale-up due to the quadratic space and time complexity to the sequence length. Kernel methods are often adopted to reduce the complexity by approximating the softmax operator. Nevertheless, due to the approximation errors, their performances vary in different tasks/corpus and suffer crucial performance drops when compared with the vanilla softmax attention. In this paper, we propose a linear transformer called cosFormer that can achieve comparable or better accuracy to the vanilla transformer in both casual and cross attentions. cosFormer is based on two key properties of softmax attention: i). non-negativeness of the attention matrix; ii). a non-linear re-weighting scheme that can concentrate the distribution of the attention matrix. As its linear substitute, cosFormer fulfills these properties with a linear operator and a cosine-based distance re-weighting mechanism. Extensive experiments on language modeling and text understanding tasks demonstrate the effectiveness of our method. We further examine our method on long sequences and achieve state-of-the-art performance on the Long-Range Arena benchmark. The source code is available at https://github.com/OpenNLPLab/cosFormer.


翻译:变压器在自然语言处理、计算机视觉和音频处理方面取得了巨大成功。 软性关注是其核心组成部分之一, 有助于捕捉长距离依赖性, 但由于音序长度的四边空间和时间复杂性, 也禁止其扩大。 内核方法通常被采用, 通过接近软体操作器来降低复杂性。 然而, 由于近似错误, 其性能因任务/ 体体而异, 与香草软体关注度相比, 其性能会发生重大下降。 在本文中, 我们提议使用一个叫做cos Former 的线性变压器, 它可以在临时和交叉关注中实现与香草变压器的可比或更准确性。 COs Former基于软体注意的两种关键特性: i. 注意矩阵的无偏重度矩阵;ii. 一种非线性重力重力重力计划, 可以集中分配注意矩阵。 作为线性替代品, cosFormer将这些特性与线性操作器的远程再加权调整机制。 在长期性变压法中进行广泛的实验, 我们的模型/ 的 Rormainal rodeal rode roal rode rodu rodustral la la la la la la la la la la la lax la la lax lax lax lax lax lax lax lax

0
下载
关闭预览

相关内容

专知会员服务
52+阅读 · 2020年12月14日
专知会员服务
124+阅读 · 2020年9月8日
专知会员服务
61+阅读 · 2020年3月19日
100+篇《自监督学习(Self-Supervised Learning)》论文最新合集
专知会员服务
167+阅读 · 2020年3月18日
注意力机制介绍,Attention Mechanism
专知会员服务
172+阅读 · 2019年10月13日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
164+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
105+阅读 · 2019年10月9日
AIART 2022 Call for Papers
CCF多媒体专委会
1+阅读 · 2022年2月13日
【ICIG2021】Check out the hot new trailer of ICIG2021 Symposium6
中国图象图形学学会CSIG
2+阅读 · 2021年11月12日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
跨越注意力:Cross-Attention
我爱读PAMI
172+阅读 · 2018年6月2日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
18+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
4+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Arxiv
31+阅读 · 2021年6月30日
Arxiv
17+阅读 · 2021年3月29日
Arxiv
13+阅读 · 2019年11月14日
Arxiv
11+阅读 · 2018年1月18日
VIP会员
最新内容
人工智能赋能无人机:俄乌战争(万字长文)
专知会员服务
3+阅读 · 今天6:56
国外海军作战管理系统与作战训练系统
专知会员服务
2+阅读 · 今天4:16
美军条令《海军陆战队规划流程(2026版)》
专知会员服务
7+阅读 · 今天3:36
《压缩式分布式交互仿真标准》120页
专知会员服务
4+阅读 · 今天3:21
《电子战数据交换模型研究报告》
专知会员服务
6+阅读 · 今天3:13
《基于Transformer的异常舰船导航识别与跟踪》80页
《低数据领域军事目标检测模型研究》
专知会员服务
6+阅读 · 今天2:37
【CMU博士论文】物理世界的视觉感知与深度理解
伊朗战争停火期间美军关键弹药状况分析
专知会员服务
8+阅读 · 4月22日
电子战革命:塑造战场的十年突破(2015–2025)
相关VIP内容
专知会员服务
52+阅读 · 2020年12月14日
专知会员服务
124+阅读 · 2020年9月8日
专知会员服务
61+阅读 · 2020年3月19日
100+篇《自监督学习(Self-Supervised Learning)》论文最新合集
专知会员服务
167+阅读 · 2020年3月18日
注意力机制介绍,Attention Mechanism
专知会员服务
172+阅读 · 2019年10月13日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
164+阅读 · 2019年10月12日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
105+阅读 · 2019年10月9日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
18+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
4+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员