Word Order Does Matter (And Shuffled Language Models Know It)
Vinit Ravishankar Mostafa Abdou Artur Kulmizev Anders Søgaard Language Technology Group, Department of Informatics, University of Oslo Department of Computer Science, University of Copenhagen Department of Linguistics and Philology, Uppsala University Equal contribution. Order was decided by a coin toss.
Abstract
Recent studies have shown that language models pretrained and/or fine-tuned on randomly permuted sentences exhibit competitive performance on GLUE, putting into question the importance of word order information. Somewhat counter-intuitively, some of these studies also report that position embeddings appear to be crucial for models’ good performance with shuffled text. We probe these language models for word order information and investigate what position embeddings learned from shuffled text encode, showing that these models retain information pertaining to the original, naturalistic word order. We show this is in part due to a subtlety in how shuffling is implemented in previous work – before rather than after subword segmentation. Surprisingly, we find even Language models trained on text shuffled after subword segmentation retain some semblance of information about word order because of the statistical dependencies between sentence length and unigram probabilities. Finally, we show that beyond GLUE, a variety of language understanding tasks do require word order information, often to an extent that cannot be learned through fine-tuning.
中文速览
用乱序文本预训练的语言模型(如把句子中的词随机打乱后训练 RoBERTa)在 GLUE 基准上表现与正常模型相近,但这究竟是因为词序不重要,还是另有隐情?研究者通过探针实验发现,这些乱序模型其实仍然保留了大量原始词序信息——关键原因在于:之前的研究在做乱序时是先打乱词再做子词切分(BPE segmentation),导致同一个词的子词片段始终相邻,无意间给模型提供了局部词序线索;此外,句子长度与词频分布之间的统计关联也让模型能隐式感知词序。即便在子词级别打乱后,这些信号依然部分残留,而注意力机制分析也印证了这一点:乱序模型的注意力头依然倾向于关注相邻位置,而无位置编码的模型则完全没有这种偏好。更重要的是,当把评估范围从 GLUE 扩展到 SuperGLUE、WinoGrande 等更严格的任务时,乱序预训练模型的表现出现了显著下滑,且仅靠微调无法弥补,说明真正需要词序理解的任务对词序信息的要求远超 GLUE 所能揭示的程度。
原文 arXiv:2203.10995;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2203.10995v1