When classifying grammatical role, BERT doesn’t care about word order…except when it matters
Isabel Papadimitriou Stanford University、Richard Futrell University of California, Irvine \ANDKyle Mahowald The University of Texas at Austin
Abstract
Because meaning can often be inferred from lexical semantics alone, word order is often a redundant cue in natural language. For example, the words chopped, chef, and onion are more likely used to convey “The chef chopped the onion,” not “The onion chopped the chef.” Recent work has shown large language models to be surprisingly word order invariant, but crucially has largely considered natural prototypical inputs, where compositional meaning mostly matches lexical expectations. To overcome this confound, we probe grammatical role representation in English BERT and GPT-2, on instances where lexical expectations are not sufficient, and word order knowledge is necessary for correct classification. Such non-prototypical instances are naturally occurring English sentences with inanimate subjects or animate objects, or sentences where we systematically swap the arguments to make sentences like “The onion chopped the chef”. We find that, while early layer embeddings are largely lexical, word order is in fact crucial in defining the later-layer representations of words in semantically non-prototypical positions. Our experiments isolate the effect of word order on the contextualization pro
中文速览
大型语言模型(如BERT和GPT-2)在语法理解上是否真的懂得词序,还是只靠词汇本身的语义在"走捷径"?研究者通过专门挑选"非原型句"(non-prototypical sentences)来回答这个问题——这类句子的词汇语义与句法角色相矛盾,比如"洋葱切了厨师",此时若要正确判断谁是主语、谁是宾语,模型必须依赖词序而非词义。实验发现,模型早期层的表示主要受词汇语义主导,但在更深的层中,词序信息会逐渐"覆盖"词汇的先验期望,使模型正确表征语法角色;而一旦将词序打乱(即便只是局部乱序),这种语法表征能力就会崩溃。这项研究揭示了一个重要警示:过去那些用常规句子做的探测实验(probing)之所以显示模型在浅层就"懂语法",很可能只是词汇语义在帮忙"凑答案",真正由词序驱动的句法理解只在少数关键情况下才得以体现,但正是这些边缘情况暴露了模型真实的语言理解机制。
原文 arXiv:2203.06204;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2203.06204v1