Macformer:基于随机麦克劳林特征注意力的Transformer
Macformer: Transformer with Random Maclaurin Feature Attention
AI总结:
提出Macformer架构,利用随机麦克劳林特征(RMF)近似点积核以加速长序列注意力计算,结合RMFA与ppSBN机制,在LRA基准上验证了其加速效果与准确性。
摘要:
随机特征注意力(RFA)采用随机傅里叶特征(RFF)方法来近似softmax函数,形成了一种线性时间与空间复杂度的注意力机制,从而能够构建高效的Transformer。受RFA启发,我们提出了Macformer,这是一种采用随机麦克劳林特征(RMF)来近似各种点积核的Transformer架构,从而加速长序列的注意力计算。Macformer由随机麦克劳林特征注意力(RMFA)和前后缩放批归一化(ppSBN)组成,前者是对点积核化注意力的无偏近似,后者是保证RMFA误差的两阶段正则化机制。我们进行了初步实验以证明RMFA和ppSBN的效率,并在长程竞技场(LRA)基准上进行实验,验证了Macformer在不同点积核下的加速效果和准确性。Macformer的实验结果与我们的理论分析一致。
英文摘要:
Random feature attention (RFA) adopts random fourier feature (RFF) methods to approximate the softmax function, resulting in a linear time and space attention mechanism that enables the construction of an efficient Transformer. Inspired by RFA, we propose Macformer, a Transformer architecture that employs random Maclaurin features (RMF) to approximate various dot-product kernels, thereby accelerating attention computations for long sequence. Macformer consists of Random Maclaurin Feature Attention (RMFA) and pre-post Scaling Batch Normalization (ppSBN), the former is an unbiased approximation for dot-product kernelized attention and the later is a two-stage regularization mechanism guaranteeing the error of RMFA. We conducted toy experiments to demonstrate the efficiency of RMFA and ppSBN, and experiments on long range arena (LRA) benchmark to validate the acceleration and accuracy of Macformer with different dot-product kernels. Experiment results of Macformer are consistent with our theoretical analysis.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。