Agent Attention: On the Integration of Softmax and Linear Attention

Softmax函数 计算机科学 变压器 骨料(复合) 人工智能 背景(考古学) 人工神经网络 量子力学 生物 物理 古生物学 复合材料 电压 材料科学
作者
Dongchen Han,Tianzhu Ye,Yizeng Han,Zhuofan Xia,Shiji Song,Gao Huang
出处
期刊:Cornell University - arXiv 被引量:5
标识
DOI:10.48550/arxiv.2312.08874
摘要

The attention module is the key component in Transformers. While the global attention mechanism offers high expressiveness, its excessive computational cost restricts its applicability in various scenarios. In this paper, we propose a novel attention paradigm, Agent Attention, to strike a favorable balance between computational efficiency and representation power. Specifically, the Agent Attention, denoted as a quadruple $(Q, A, K, V)$, introduces an additional set of agent tokens $A$ into the conventional attention module. The agent tokens first act as the agent for the query tokens $Q$ to aggregate information from $K$ and $V$, and then broadcast the information back to $Q$. Given the number of agent tokens can be designed to be much smaller than the number of query tokens, the agent attention is significantly more efficient than the widely adopted Softmax attention, while preserving global context modelling capability. Interestingly, we show that the proposed agent attention is equivalent to a generalized form of linear attention. Therefore, agent attention seamlessly integrates the powerful Softmax attention and the highly efficient linear attention. Extensive experiments demonstrate the effectiveness of agent attention with various vision Transformers and across diverse vision tasks, including image classification, object detection, semantic segmentation and image generation. Notably, agent attention has shown remarkable performance in high-resolution scenarios, owning to its linear attention nature. For instance, when applied to Stable Diffusion, our agent attention accelerates generation and substantially enhances image generation quality without any additional training. Code is available at https://github.com/LeapLabTHU/Agent-Attention.
最长约 10秒,即可获得该文献文件

科研通智能强力驱动
Strongly Powered by AbleSci AI
更新
PDF的下载单位、IP信息已删除 (2025-6-4)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
刚刚
高大的易蓉发布了新的文献求助100
1秒前
2秒前
情怀应助博士采纳,获得10
2秒前
小火苗发布了新的文献求助10
2秒前
7秒前
8秒前
HMethod完成签到 ,获得积分10
8秒前
8秒前
量子星尘发布了新的文献求助10
9秒前
9秒前
9秒前
山东及时雨完成签到,获得积分20
9秒前
11秒前
W查查完成签到,获得积分10
11秒前
yuk发布了新的文献求助30
12秒前
yyp发布了新的文献求助30
12秒前
12秒前
fyj发布了新的文献求助30
12秒前
端庄乐松完成签到,获得积分10
14秒前
星辰大海应助以筱采纳,获得10
15秒前
博士发布了新的文献求助10
15秒前
16秒前
16秒前
汉堡包应助科研通管家采纳,获得10
16秒前
共享精神应助科研通管家采纳,获得20
16秒前
Jasper应助小火苗采纳,获得50
16秒前
李健应助科研通管家采纳,获得10
16秒前
16秒前
斯文败类应助科研通管家采纳,获得10
16秒前
17秒前
知更鸟完成签到,获得积分10
17秒前
尤静柏完成签到,获得积分10
17秒前
隐形曼青应助Erika采纳,获得10
18秒前
18秒前
qu完成签到,获得积分10
18秒前
甜甜亦巧发布了新的文献求助10
18秒前
所所应助wangxiaoli0991采纳,获得10
18秒前
臧梓任完成签到,获得积分10
18秒前
郭九九呢发布了新的文献求助10
19秒前
高分求助中
A new approach to the extrapolation of accelerated life test data 1000
Picture Books with Same-sex Parented Families: Unintentional Censorship 700
ACSM’s Guidelines for Exercise Testing and Prescription, 12th edition 500
Nucleophilic substitution in azasydnone-modified dinitroanisoles 500
不知道标题是什么 500
Indomethacinのヒトにおける経皮吸収 400
Effective Learning and Mental Wellbeing 400
热门求助领域 (近24小时)
化学 材料科学 医学 生物 工程类 有机化学 生物化学 物理 内科学 纳米技术 计算机科学 化学工程 复合材料 遗传学 基因 物理化学 催化作用 冶金 细胞生物学 免疫学
热门帖子
关注 科研通微信公众号,转发送积分 3976107
求助须知:如何正确求助?哪些是违规求助? 3520330
关于积分的说明 11202435
捐赠科研通 3256819
什么是DOI,文献DOI怎么找? 1798504
邀请新用户注册赠送积分活动 877642
科研通“疑难数据库(出版商)”最低求助积分说明 806496