[论文解读] Open Sesame: Getting Inside BERT's Linguistic Knowledge
本文通过结合诊断分类器与一种新颖的基于注意力的混淆度量指标,研究了 BERT 如何编码句法结构。研究发现,BERT 从较低层开始逐步将线性、位置性信息编码,过渡到较高层中越来越抽象、层次化的句法表征,其自注意力机制对主谓一致性和反身代词回指表现出敏感性,但尚未达到人类般的分类精确度。
How and to what extent does BERT encode syntactically-sensitive hierarchical information or positionally-sensitive linear information? Recent work has shown that contextual representations like BERT perform well on tasks that require sensitivity to linguistic structure. We present here two studies which aim to provide a better understanding of the nature of BERT's representations. The first of these focuses on the identification of structurally-defined elements using diagnostic classifiers, while the second explores BERT's representation of subject-verb agreement and anaphor-antecedent dependencies through a quantitative assessment of self-attention vectors. In both cases, we find that BERT encodes positional information about word tokens well on its lower layers, but switches to a hierarchically-oriented encoding on higher layers. We conclude then that BERT's representations do indeed model linguistically relevant aspects of hierarchical structure, though they do not appear to show the sharp sensitivity to hierarchical structure that is found in human processing of reflexive anaphora.
研究动机与目标
- 理解 BERT 表征如何编码句法结构而非线性词序。
- 探究 BERT 是否捕捉到诸如主谓一致性和反身代词回指等层次化依赖关系。
- 评估自注意力机制在编码语言结构方面的作用,超越表层词序。
- 提出一种基于注意力权重的定量度量指标,用于评估 BERT 对句法扭曲的敏感性。
- 确定 BERT 在哪一层网络中实现从位置编码到层次编码的转变。
提出的方法
- 采用‘刺激贫乏’范式训练诊断分类器,以区分 BERT 表征中线性与层次化解决方案的差异。
- 提出一种基于自注意力权重的混淆度量指标,用于量化 BERT 在一致性和回指任务中对句法干扰项的响应。
- 使用线性模型分析句法结构(如关系从句与介词短语)以及语法特征匹配对混淆度量的影响。
- 分析 BERT 的 Transformer 块中逐层注意力模式,追踪结构编码的演化过程。
- 比较不同类型干扰项(语法上可达与不可达、特征匹配与不匹配)的混淆度量,以评估注意力的选择性。
- 在受控句法扭曲条件下评估 BERT 在主谓一致性和反身代词回指任务中的表现,以隔离其结构敏感性。
实验结果
研究问题
- RQ1BERT 表征在多大程度上编码了层次化句法结构而非线性词序?
- RQ2BERT 的注意力机制在主谓一致性和反身代词回指任务中,如何响应句法干扰项?
- RQ3BERT 的表征在哪些网络层中从位置编码转变为层次编码?
- RQ4数量和性别等语法特征如何影响 BERT 在一致性和回指消解中的注意力模式?
- RQ5BERT 的注意力机制是否对结构复杂性敏感,例如嵌入在关系从句中与介词短语中?
主要发现
- BERT 的低层编码了强烈的定位与序列信息,这些信息在高层逐渐减弱。
- 高层表现出对层次化句法结构的日益增强的敏感性,表征变得更加抽象且以结构为导向。
- 混淆度量指标显示,BERT 的注意力对句法结构具有敏感性:关系从句中的干扰项比介词短语中的干扰项引起更多混淆。
- 语法上可达的干扰项比不可达的干扰项引起更大的混淆,且特征匹配的干扰项影响更强,表明对语法特征的敏感性。
- 主谓一致性和反身代词回指任务的混淆度量均随网络深度增加而下降,表明句法结构的逐步抽象化。
- 第 4 层出现明显的混淆度峰值,与线性信息的退化时间点一致,表明这是表征构成的转变点。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。