PADRe:一种用于高效视觉Transformer的统一多项式注意力即插即用替代方案
PADRe: A Unifying Polynomial Attention Drop-in Replacement for Efficient Vision Transformer
AI总结:
PADRe提出一种统一的多项式注意力替代框架,兼容多种现有注意力机制,通过硬件友好的Hadamard积实现线性复杂度,在视觉任务上速度提升11-43倍且精度相当。
摘要:
我们提出了多项式注意力即插即用替代方案(PADRe),这是一个新颖且统一的框架,旨在替代Transformer模型中的传统自注意力机制。值得注意的是,最近的几种替代注意力机制,包括Hyena、Mamba、SimA、Conv2Former和Castling-ViT,都可以被视为我们PADRe框架的特定实例。PADRe利用多项式函数,并借鉴逼近理论的既有成果,在不牺牲精度的情况下提高计算效率。PADRe的关键组件包括乘法非线性,我们使用简单的、硬件友好的操作(如Hadamard积)来实现,仅产生线性的计算和内存成本。PADRe进一步避免了使用Softmax等复杂函数的需要,同时与传统自注意力相比保持了相当或更优的精度。我们评估了PADRe作为自注意力即插即用替代方案在多种计算机视觉任务中的有效性。这些任务包括图像分类、基于图像的2D目标检测和3D点云目标检测。实验结果表明,在替换Transformer模型中的自注意力时,PADRe的运行速度显著快于传统自注意力(在服务器GPU和移动NPU上快11倍至43倍),同时保持了相似的精度。
英文摘要:
We present Polynomial Attention Drop-in Replacement (PADRe), a novel and unifying framework designed to replace the conventional self-attention mechanism in transformer models. Notably, several recent alternative attention mechanisms, including Hyena, Mamba, SimA, Conv2Former, and Castling-ViT, can be viewed as specific instances of our PADRe framework. PADRe leverages polynomial functions and draws upon established results from approximation theory, enhancing computational efficiency without compromising accuracy. PADRe's key components include multiplicative nonlinearities, which we implement using straightforward, hardware-friendly operations such as Hadamard products, incurring only linear computational and memory costs. PADRe further avoids the need for using complex functions such as Softmax, yet it maintains comparable or superior accuracy compared to traditional self-attention. We assess the effectiveness of PADRe as a drop-in replacement for self-attention across diverse computer vision tasks. These tasks include image classification, image-based 2D object detection, and 3D point cloud object detection. Empirical results demonstrate that PADRe runs significantly faster than the conventional self-attention (11x ~ 43x faster on server GPU and mobile NPU) while maintaining similar accuracy when substituting self-attention in the transformer models.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。