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

Fourier Transformer:通过FFT算子消除序列冗余实现快速长程建模

Fourier Transformer: Fast Long Range Modeling by Removing Sequence Redundancy with FFT Operator

Shanghai Jiao Tong University(上海交通大学);Netease BizEase(网易商业Ease)

Ziwei He, Meng Yang, Minwei Feng, Jingcheng Yin, Xinbing Wang, Jingwen Leng, Zhouhan Lin

AI总结:

针对Transformer自注意力长序列计算成本高且多数高效方案无法继承预训练权重的问题,提出Fourier Transformer,用FFT算子做DCT逐步消除隐藏序列冗余,在LRA基准取得最优性能,继承BART权重后在生成任务上超越标准BART及其他高效模型。

摘要:

众所周知,Transformer模型计算需求大,处理长序列时成本极高,因为自注意力模块的时间和空间复杂度与序列长度呈二次方关系。许多研究者专注于设计新型自注意力形式或引入新参数来突破这一限制,但其中大部分方法都无法让模型继承大型预训练模型的权重。本研究从另一个角度解决了Transformer的低效问题。我们提出Fourier Transformer,这是一种简单却有效的方法,利用现成的快速傅里叶变换(FFT)算子执行离散余弦变换(DCT),逐步消除隐藏序列中的冗余。Fourier Transformer能够显著降低计算成本,同时保留继承各类大型预训练模型的能力。实验表明,在长程建模基准LRA上,我们的模型在所有基于Transformer的模型中取得了最优性能,在速度和空间上均有显著提升。在包括CNN/DailyMail和ELI5在内的生成式序列到序列任务中,通过继承BART权重,我们的模型性能优于标准BART及其他高效模型。我们的代码已公开在https://github.com/LUMIA-Group/FourierTransformer。

英文摘要:

The transformer model is known to be computationally demanding, and prohibitively costly for long sequences, as the self-attention module uses a quadratic time and space complexity with respect to sequence length. Many researchers have focused on designing new forms of self-attention or introducing new parameters to overcome this limitation, however a large portion of them prohibits the model to inherit weights from large pretrained models. In this work, the transformer's inefficiency has been taken care of from another perspective. We propose Fourier Transformer, a simple yet effective approach by progressively removing redundancies in hidden sequence using the ready-made Fast Fourier Transform (FFT) operator to perform Discrete Cosine Transformation (DCT). Fourier Transformer is able to significantly reduce computational costs while retain the ability to inherit from various large pretrained models. Experiments show that our model achieves state-of-the-art performances among all transformer-based models on the long-range modeling benchmark LRA with significant improvement in both speed and space. For generative seq-to-seq tasks including CNN/DailyMail and ELI5, by inheriting the BART weights our model outperforms the standard BART and other efficient models. Our code is publicly available at https://github.com/LUMIA-Group/FourierTransformer

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

↑