统一的CNN与Transformer底层学习机制揭示多头注意力共存方式
Unified CNNs and transformers underlying learning mechanism reveals multi-head attention modus vivendi
AI总结:
本文提出CNNs与ViT共享统一的底层学习机制,通过单节点性能定量分析实现高效ANDC剪枝,并揭示多头注意力中自发对称性破缺使各头成为标签识别专家。
摘要:
卷积神经网络(CNNs)评估输入图像中沿层递进的短程相关性,而视觉Transformer(ViT)架构则利用由全连接层组成的重复Transformer编码器评估长程相关性。两者都旨在解决复杂的分类任务,但视角不同。本研究表明,CNNs和ViT架构源于统一的底层学习机制,该机制定量衡量前馈(FF)子块和多头注意力(MHA)子块中每个节点的单节点性能(SNP)。每个节点识别可能输出标签的小簇,附加噪声表示为这些簇之外的标签。这些特征沿Transformer编码器逐步锐化,从而提高信噪比。这一统一的底层学习机制带来了两个主要发现。第一,它实现了一种高效的应用节点对角连接(ANDC)剪枝技术,且不影响准确率。第二,基于SNP,MHA头之间发生自发对称性破缺,使得每个头通过其SNP之间的协作将注意力集中于标签子集。因此,每个头成为识别其指定标签的专家,代表了一种定量的MHA共存方式机制。这种受统计力学启发的视角能够从每个节点的微观性能揭示整个网络的宏观行为。这些结果基于在CIFAR-100和Flowers-102数据集上训练的紧凑卷积Transformer架构,并呼吁将其扩展到其他架构和应用,如自然语言处理。
英文摘要:
Convolutional neural networks (CNNs) evaluate short-range correlations in input images which progress along the layers, whereas vision transformer (ViT) architectures evaluate long-range correlations, using repeated transformer encoders composed of fully connected layers. Both are designed to solve complex classification tasks but from different perspectives. This study demonstrates that CNNs and ViT architectures stem from a unified underlying learning mechanism, which quantitatively measures the single-nodal performance (SNP) of each node in feedforward (FF) and multi-head attention (MHA) sub-blocks. Each node identifies small clusters of possible output labels, with additional noise represented as labels outside these clusters. These features are progressively sharpened along the transformer encoders, enhancing the signal-to-noise ratio. This unified underlying learning mechanism leads to two main findings. First, it enables an efficient applied nodal diagonal connection (ANDC) pruning technique without affecting the accuracy. Second, based on the SNP, spontaneous symmetry breaking occurs among the MHA heads, such that each head focuses its attention on a subset of labels through cooperation among its SNPs. Consequently, each head becomes an expert in recognizing its designated labels, representing a quantitative MHA modus vivendi mechanism. This statistical mechanics inspired viewpoint enables to reveal macroscopic behavior of the entire network from the microscopic performance of each node. These results are based on a compact convolutional transformer architecture trained on the CIFAR-100 and Flowers-102 datasets and call for their extension to other architectures and applications, such as natural language processing.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。