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)

科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
小唐完成签到,获得积分20
刚刚
笨脑腐发布了新的文献求助10
1秒前
小妤丸子完成签到,获得积分10
1秒前
1秒前
qqzhang发布了新的文献求助10
2秒前
2秒前
saaa完成签到,获得积分10
2秒前
猪猪hero发布了新的文献求助10
2秒前
Giinjju发布了新的文献求助10
3秒前
HML完成签到,获得积分10
3秒前
5秒前
5秒前
桐桐应助无奈尔曼采纳,获得10
5秒前
飞天意面发布了新的文献求助10
5秒前
SciGPT应助guozizi采纳,获得10
5秒前
zzz完成签到 ,获得积分10
5秒前
YANG完成签到,获得积分10
6秒前
6秒前
6秒前
dou发布了新的文献求助10
6秒前
8秒前
回应吧五月天完成签到,获得积分10
8秒前
9秒前
9秒前
情怀应助galaxy采纳,获得10
9秒前
CipherSage应助咳咳咳采纳,获得10
9秒前
kyt发布了新的文献求助10
9秒前
10秒前
不入流舞女完成签到,获得积分10
10秒前
反方向的水豚给趣乐多的求助进行了留言
10秒前
10秒前
李爱国应助ZS0901采纳,获得10
11秒前
11秒前
11秒前
KAKAPOO完成签到,获得积分10
12秒前
12秒前
12秒前
13秒前
不会搞科研完成签到,获得积分0
13秒前
JamesPei应助zhl采纳,获得10
13秒前
高分求助中
A new approach to the extrapolation of accelerated life test data 1000
Technical Brochure TB 814: LPIT applications in HV gas insulated switchgear 1000
ACSM’s Guidelines for Exercise Testing and Prescription, 12th edition 500
Picture Books with Same-sex Parented Families: Unintentional Censorship 500
Nucleophilic substitution in azasydnone-modified dinitroanisoles 500
不知道标题是什么 500
A Preliminary Study on Correlation Between Independent Components of Facial Thermal Images and Subjective Assessment of Chronic Stress 500
热门求助领域 (近24小时)
化学 材料科学 医学 生物 工程类 有机化学 生物化学 物理 内科学 纳米技术 计算机科学 化学工程 复合材料 遗传学 基因 物理化学 催化作用 冶金 细胞生物学 免疫学
热门帖子
关注 科研通微信公众号,转发送积分 3970394
求助须知:如何正确求助?哪些是违规求助? 3515139
关于积分的说明 11177107
捐赠科研通 3250335
什么是DOI,文献DOI怎么找? 1795254
邀请新用户注册赠送积分活动 875732
科研通“疑难数据库(出版商)”最低求助积分说明 805054