[论文解读] Centroid Transformers: Learning to Abstract with Attention
本文提出中心点注意力(centroid attention),一种新颖的Transformer机制,通过在聚类目标函数上进行 amortized 梯度下降,将 N 个输入标记压缩为 M < N 个代表性中心点,实现高效且信息保留的抽象。由此产生的中心点Transformer在文本摘要、3D视觉和图像分类任务中均达到最先进性能,计算成本相比标准Transformer降低高达50%。
Self-attention, as the key block of transformers, is a powerful mechanism for extracting features from the inputs. In essence, what self-attention does is to infer the pairwise relations between the elements of the inputs, and modify the inputs by propagating information between input pairs. As a result, it maps inputs to N outputs and casts a quadratic $O(N^2)$ memory and time complexity. We propose centroid attention, a generalization of self-attention that maps N inputs to M outputs $(M\leq N)$, such that the key information in the inputs are summarized in the smaller number of outputs (called centroids). We design centroid attention by amortizing the gradient descent update rule of a clustering objective function on the inputs, which reveals an underlying connection between attention and clustering. By compressing the inputs to the centroids, we extract the key information useful for prediction and also reduce the computation of the attention module and the subsequent layers. We apply our method to various applications, including abstractive text summarization, 3D vision, and image processing. Empirical results demonstrate the effectiveness of our method over the standard transformers.
研究动机与目标
- 为解决标准Transformer中自注意力机制的二次方 O(N²) 内存与计算成本问题。
- 通过将 N 个输入标记抽象为 M < N 个代表性中心点,实现信息抽象。
- 建立注意力机制与聚类算法之间的可微、可训练连接。
- 在不牺牲模型性能的前提下,降低Transformer架构的计算与内存开销。
- 为跨多样化领域的Transformer模型提供一种通用、自适应的下采样模块。
提出的方法
- 中心点注意力通过在输入嵌入上对可微聚类目标函数的梯度下降更新规则进行 amortized 化推导得出。
- 该方法学习一个可训练的相似性度量,并通过基于梯度的优化将每个输入分配给最近的中心点。
- 输出是一组 M 个中心点,总结了 N 个输入的关键信息,将维度与计算成本降低至 O(NM)。
- 将中心点注意力模块插入标准自注意力层之间,构成中心点Transformer架构。
- 该方法端到端可微,且与现有Transformer组件(包括跳跃连接)兼容。
- 该方法避免存储成对的分配矩阵,相比基于路由的方法(如胶囊网络)具有更低的内存占用。
实验结果
研究问题
- RQ1能否从聚类优化中推导出一种可微的注意力机制,以实现在Transformer中高效且信息保留的抽象?
- RQ2用中心点注意力替代标准自注意力后,模型在多样化任务中的性能与计算效率如何变化?
- RQ3中心点注意力能否作为Transformer模型中一种通用、自适应的下采样机制?
- RQ4梯度驱动的聚类与注意力之间的关联是否能生成比标准注意力更具语义意义的表征?
- RQ5在准确率与推理成本方面,中心点Transformer相较于最先进高效Transformer变体表现如何?
主要发现
- 在抽象型文本摘要任务中,中心点Transformer在计算成本降低约50%的同时,性能与标准Transformer相当。
- 在3D点云分类任务中,中心点Transformer在准确率与效率方面均优于当前最先进Transformer模型。
- 在图像分类任务中,中心点Transformer在FLOPs与内存使用更低的前提下,实现了比现有Transformer网络更高的准确率。
- 当用中心点注意力替换3D胶囊网络中的动态路由模块时,其表现出更低的重建误差、更少的存储消耗,以及更具语义意义的潜在表征。
- 该方法建立了一种新颖、可训练的注意力与聚类之间的连接,实现了无需依赖人工设计的路由或池化策略的有效信息摘要。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。