arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2108.09084cs.CL
收藏

Fastformer:附加注意力可以满足您的所有需求

Fastformer: Additive Attention Can Be All You Need

Tsinghua University(清华大学);Microsoft Research Asia(微软亚洲研究院)

Chuhan Wu, Fangzhao Wu, Tao Qi, Yongfeng Huang, Xing Xie

摘要:

Transformer是一个强大的文本理解模型。然而,由于其输入序列长度的二次复杂度,它是低效的。虽然有很多方法可以加速Transformer,但它们要么在长序列上效率低下,要么不够有效。在本文中,我们提出了Fastformer,这是一个有效的Transformer模型的基础上加性注意。在Fastformer中,我们首先使用加性注意力机制来建模全局上下文,而不是对令牌之间的成对交互进行建模,然后根据每个令牌表示与全局上下文表示的交互进一步转换每个令牌表示。通过这种方式,Fastformer可以实现线性复杂度的有效上下文建模。在五个数据集上的大量实验表明,Fastformer比许多现有的Transformer模型更有效,同时可以实现相当甚至更好的长文本建模性能。

英文摘要:

Transformer is a powerful model for text understanding. However, it is inefficient due to its quadratic complexity to input sequence length. Although there are many methods on Transformer acceleration, they are still either inefficient on long sequences or not effective enough. In this paper, we propose Fastformer, which is an efficient Transformer model based on additive attention. In Fastformer, instead of modeling the pair-wise interactions between tokens, we first use additive attention mechanism to model global contexts, and then further transform each token representation based on its interaction with global context representations. In this way, Fastformer can achieve effective context modeling with linear complexity. Extensive experiments on five datasets show that Fastformer is much more efficient than many existing Transformer models and can meanwhile achieve comparable or even better long text modeling performance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑