从几何视角解析BERT注意力机制,揭示其分类原理
The geometry of BERT
- 用子空间方向性分析BERT自注意力模式
- 提出锥度指数衡量语义信息分布,准确识别新冠变异株
- 为Transformer模型改进提供可解释的理论依据
Transformer神经网络,尤其是双向编码器表示模型BERT,在分类、文本摘要和问答等任务中表现出色,但其内部机制仍缺乏数学解释,亟需提升可解释性。本文从理论角度探究BERT的内部机制,提出一种新的注意力机制分析视角。研究涵盖局部与全局网络行为:在局部层面,引入子空间选择的方向性概念,并系统分析自注意力矩阵中的模式;在全局层面,通过数据分布分析与新型锥度指数等统计量,探索信息流的语义内容。以基于RNA序列对SARS-CoV-2变异株分类的案例研究为例,获得极高准确率。这些洞察深化了对BERT分类过程的理解,为未来Transformer架构优化及训练过程分析提供新路径。
原文摘要 · Abstract (English)
Transformer neural networks, particularly Bidirectional Encoder Representations from Transformers (BERT), have shown remarkable performance across various tasks such as classification, text summarization, and question answering. However, their internal mechanisms remain mathematically obscure, highlighting the need for greater explainability and interpretability. In this direction, this paper investigates the internal mechanisms of BERT proposing a novel perspective on the attention mechanism of BERT from a theoretical perspective. The analysis encompasses both local and global network behavior. At the local level, the concept of directionality of subspace selection as well as a comprehensive study of the patterns emerging from the self-attention matrix are presented. Additionally, this work explores the semantic content of the information stream through data distribution analysis and global statistical measures including the novel concept of cone index. A case study on the classification of SARS-CoV-2 variants using RNA which resulted in a very high accuracy has been selected in order to observe these concepts in an application. The insights gained from this analysis contribute to a deeper understanding of BERT's classification process, offering potential avenues for future architectural improvements in Transformer models and further analysis in the training process.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。