BERT能消化RuCoLA吗?用拓扑数据分析来解释
Can BERT eat RuCoLA? Topological Data Analysis to Explain
AI总结:
该研究利用拓扑数据分析从Transformer注意力图中提取弦性与匹配数等特征,解释并提升英俄语言可接受性分类,同时通过黑盒内省揭示注意力头的语法功能。
摘要:
本文研究了为可接受性分类而微调的Transformer语言模型(LM)如何捕捉语言特征。我们的方法采用了拓扑数据分析(TDA)在NLP中的最佳实践:我们从注意力矩阵构建有向注意力图,从中推导拓扑特征,并将其输入线性分类器。我们引入了两个新颖特征,即弦性和匹配数,并表明基于TDA的分类器优于微调基线。我们在CoLA和RuCoLA两个数据集上进行实验,分别对应英语和俄语这两种类型学上不同的语言。除此之外,我们提出了若干黑盒内省技术,旨在检测微调期间LM注意力模式的变化、定义LM的预测置信度,并将单个注意力头与细粒度语法现象相关联。我们的结果有助于理解单语LM在可接受性分类任务中的行为,为注意力头的功能作用提供洞见,并凸显基于TDA的方法在分析LM方面的优势。我们公开代码和实验结果,以供进一步使用。
英文摘要:
This paper investigates how Transformer language models (LMs) fine-tuned for acceptability classification capture linguistic features. Our approach uses the best practices of topological data analysis (TDA) in NLP: we construct directed attention graphs from attention matrices, derive topological features from them, and feed them to linear classifiers. We introduce two novel features, chordality, and the matching number, and show that TDA-based classifiers outperform fine-tuning baselines. We experiment with two datasets, CoLA and RuCoLA in English and Russian, typologically different languages. On top of that, we propose several black-box introspection techniques aimed at detecting changes in the attention mode of the LMs during fine-tuning, defining the LM's prediction confidences, and associating individual heads with fine-grained grammar phenomena. Our results contribute to understanding the behavior of monolingual LMs in the acceptability classification task, provide insights into the functional roles of attention heads, and highlight the advantages of TDA-based approaches for analyzing LMs. We release the code and the experimental results for further uptake.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。