Fibottention: Inceptive Visual Representation Learning with Diverse Attention Across Heads
作者: Ali Khaleghi Rahimian, Manish Kumar Govind, Subhajit Maity, Dominick Reilly, Christian Kümmerle, Srijan Das, Aritra Dutta
分类: cs.CV
发布日期: 2024-06-27 (更新: 2024-12-20)
备注: The complete implementation, including source code and evaluation scripts, is publicly available at: https://github.com/Charlotte-CharMLab/Fibottention
💡 一句话要点
Fibottention:利用多样化注意力头的Inception式视觉表征学习,提升Transformer在有限数据下的性能。
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: 视觉Transformer 稀疏注意力 Fibonacci序列 多头注意力 数据效率 机器人学习 图像分类
📋 核心要点
- Transformer在视觉任务中表现出色,但自注意力的平方复杂度限制了可处理的tokens数量,且需要大量数据。
- Fibottention通过基于Fibonacci序列的稀疏注意力,降低计算复杂度至O(N log N),并提升数据利用率。
- 实验表明,Fibottention在图像分类、视频理解和机器人学习等任务上,在数据有限的情况下显著提升了性能。
📝 摘要(中文)
本文提出了一种新的多头自注意力(MHSA)变体,名为Fibottention,它可以替代Transformer架构中的MHSA。相比于标准MHSA,Fibottention在处理大量tokens时具有更高的数据效率和计算适用性。它采用基于扩张Fibonacci序列的结构化稀疏注意力,独特之处在于不同注意力头之间存在差异,从而产生类似Inception的多样化特征。Fibonacci序列的间距遵循Wythoff阵列,最大限度地减少了不同注意力头聚合的token交互的冗余,同时仍然通过token对交互捕获足够的互补信息。这些稀疏注意力模式在现有的稀疏注意力中是独一无二的,并实现了O(N log N)的复杂度,其中N是token的数量。Fibottention仅利用自注意力头中2-6%的元素,嵌入到流行的、最先进的Transformer架构中,可以在图像分类、视频理解和机器人学习等数据有限的领域中显著提高预测性能,并降低计算复杂度。我们进一步验证了不同自注意力头产生的特征表示的多样性,并将我们的模型设计与其他稀疏注意力机制进行了比较。
🔬 方法详解
问题定义:Transformer在视觉任务中面临两个主要问题:一是自注意力机制的计算复杂度为平方级别,限制了输入tokens的数量;二是需要大量的训练数据才能达到最佳性能。现有方法难以兼顾计算效率和数据效率,尤其是在数据受限的场景下表现不佳。
核心思路:本文的核心思路是设计一种新的多头自注意力机制Fibottention,它采用结构化的稀疏注意力模式,基于扩张的Fibonacci序列。这种稀疏模式降低了计算复杂度,同时通过在不同注意力头之间引入多样性,提升了模型在数据有限情况下的泛化能力。
技术框架:Fibottention可以作为标准MHSA的替代品,嵌入到现有的Transformer架构中。其主要流程包括:首先,将输入tokens通过线性层映射到query、key和value;然后,利用Fibonacci序列定义的稀疏模式计算注意力权重;最后,将注意力权重应用于value,得到最终的输出。不同注意力头使用不同的Fibonacci序列,从而实现特征的多样性。
关键创新:Fibottention的关键创新在于其独特的稀疏注意力模式,该模式基于扩张的Fibonacci序列,并且在不同的注意力头之间是不同的。这种设计在降低计算复杂度的同时,保证了模型能够捕捉到足够的信息,并且通过多样性提升了泛化能力。此外,Fibonacci序列的间距遵循Wythoff阵列,进一步减少了冗余的token交互。
关键设计:Fibottention的关键设计包括:1) 使用Fibonacci序列定义稀疏注意力模式,仅保留2-6%的注意力权重;2) 不同注意力头使用不同的Fibonacci序列,以实现特征的多样性;3) Fibonacci序列的间距遵循Wythoff阵列,以减少冗余的token交互。没有特别提到损失函数或网络结构的修改,重点在于注意力机制的改进。
🖼️ 关键图片
📊 实验亮点
实验结果表明,Fibottention在图像分类、视频理解和机器人学习等任务上,在数据有限的情况下显著提高了性能。例如,在某些数据集上,Fibottention能够以更少的计算资源达到与标准Transformer相当甚至更好的性能。此外,论文还验证了Fibottention能够产生更多样化的特征表示,从而提升模型的泛化能力。
🎯 应用场景
Fibottention具有广泛的应用前景,尤其是在数据受限的视觉任务中,例如医学图像分析、机器人学习和视频监控等领域。通过降低计算复杂度和提高数据效率,Fibottention可以帮助研究人员在资源有限的环境下训练出高性能的视觉模型,加速相关领域的发展。
📄 摘要(原文)
Transformer architectures such as Vision Transformers (ViT) have proven effective for solving visual perception tasks. However, they suffer from two major limitations; first, the quadratic complexity of self-attention limits the number of tokens that can be processed, and second, Transformers often require large amounts of training data to attain state-of-the-art performance. In this paper, we propose a new multi-head self-attention (MHSA) variant named Fibottention, which can replace MHSA in Transformer architectures. Fibottention is data-efficient and computationally more suitable for processing large numbers of tokens than the standard MHSA. It employs structured sparse attention based on dilated Fibonacci sequences, which, uniquely, differ across attention heads, resulting in inception-like diverse features across heads. The spacing of the Fibonacci sequences follows the Wythoff array, which minimizes the redundancy of token interactions aggregated across different attention heads, while still capturing sufficient complementary information through token pair interactions. These sparse attention patterns are unique among the existing sparse attention and lead to an $O(N \log N)$ complexity, where $N$ is the number of tokens. Leveraging only 2-6% of the elements in the self-attention heads, Fibottention embedded into popular, state-of-the-art Transformer architectures can achieve significantly improved predictive performance for domains with limited data such as image classification, video understanding, and robot learning tasks, and render reduced computational complexity. We further validated the improved diversity of feature representations resulting from different self-attention heads, and our model design against other sparse attention mechanisms.