A central quest of probing is to uncover how pre-trained models encode a linguistic property within their representations. An encoding, however, might be spurious-i.e., the model might not rely on it when making predictions. In this paper, we try to find encodings that the model actually uses, introducing a usage-based probing setup. We first choose a behavioral task which cannot be solved without using the linguistic property. Then, we attempt to remove the property by intervening on the model's representations. We contend that, if an encoding is used by the model, its removal should harm the performance on the chosen behavioral task. As a case study, we focus on how BERT encodes grammatical number, and on how it uses this encoding to solve the number agreement task. Experimentally, we find that BERT relies on a linear encoding of grammatical number to produce the correct behavioral output. We also find that BERT uses a separate encoding of grammatical number for nouns and verbs. Finally, we identify in which layers information about grammatical number is transferred from a noun to its head verb.
翻译:探测任务的核心目标是揭示预训练模型在其表示中如何编码语言属性。然而,这种编码可能是伪相关的——即模型在进行预测时未必依赖该编码。本文尝试寻找模型实际使用的编码方式,提出了一种基于使用的探测框架。我们首先选择一个必须借助该语言属性才能完成的语法行为任务,随后通过干预模型表示来移除该属性。我们认为,若某编码被模型实际使用,其移除将损害所选语法行为任务的表现。以BERT模型对语法数范畴的编码及其在数一致任务中的使用机制为案例,实验发现:BERT依赖语法数范畴的线性编码生成正确的语法行为输出;同时,BERT对名词与动词的语法数编码采用独立机制。最后,我们定位了名词与其支配动词间语法数信息传递发生的具体层。