通过多头注意力的协同机制,实现低延迟视觉Transformer,精度不降反而提升。
Low-latency vision transformers via large-scale multi-head attention
- 利用单头性能矩阵揭示注意力头的协同聚焦机制。
- 在CIFAR-100上保持精度的同时,延迟显著降低。
- 适合追求高效率视觉模型的开发者与研究者。
近期通过量化单节点性能(SNP)发现,在分类任务中,变换器块间少数注意力头出现自发对称性破缺。这表明每个头通过其SNP协作,将注意力集中于部分标签。该学习机制被推广至大规模多头注意力(LS-MHA),采用单头性能(SHP)矩阵表示,类比卷积神经网络中的单滤波器性能。结果表明,每个SHP矩阵包含多个单位簇,使少数头能清晰识别各标签且噪声极小,从而提升沿变换器块的信噪比,改善分类准确率。由此衍生出多种结构不同的视觉变换器(ViT),在相同精度下表现各异。其软集成策略带来更高准确率,这是传统依赖数百滤波器的CNN难以实现的。此外,通过用卷积层替换初始变换器块,可在不损失精度的前提下显著降低延迟,加速前期学习并由后续变换器层优化。该机制扩展至自然语言处理任务,有望为深度学习提供新洞见。实验基于在CIFAR-100上训练的紧凑型卷积-变换器架构验证。
原文摘要 · Abstract (English)
The emergence of spontaneous symmetry breaking among a few heads of multi-head attention (MHA) across transformer blocks in classification tasks was recently demonstrated through the quantification of single-nodal performance (SNP). This finding indicates that each head focuses its attention on a subset of labels through cooperation among its SNPs. This underlying learning mechanism is generalized to large-scale MHA (LS-MHA) using a single matrix value representing single-head performance (SHP), analogous to single-filter performance in convolutional neural networks (CNNs). The results indicate that each SHP matrix comprises multiple unit clusters such that each label being explicitly recognized by a few heads with negligible noise. This leads to an increased signal-to-noise ratio (SNR) along the transformer blocks, thereby improving classification accuracy. These features give rise to several distinct vision transformer (ViT) architectures that achieve the same accuracy but differ in their LS-MHA structures. As a result, their soft committee yields superior accuracy, an outcome not typically observed in CNNs which rely on hundreds of filters. In addition, a significant reduction in latency is achieved without affecting the accuracy by replacing the initial transformer blocks with convolutional layers. This substitution accelerates early-stage learning, which is then improved by subsequent transformer layers. The extension of this learning mechanism to natural language processing tasks, based on quantitative differences between CNNs and ViT architectures, has the potential to yield new insights in deep learning. The findings are demonstrated using compact convolutional transformer architectures trained on the CIFAR-100 dataset.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。