Pre-trained language models have been shown to encode linguistic structures, e.g. dependency and constituency parse trees, in their embeddings while being trained on unsupervised loss functions like masked language modeling. Some doubts have been raised whether the models actually are doing parsing or only some computation weakly correlated with it. We study questions: (a) Is it possible to explicitly describe transformers with realistic embedding dimension, number of heads, etc. that are capable of doing parsing -- or even approximate parsing? (b) Why do pre-trained models capture parsing structure? This paper takes a step toward answering these questions in the context of generative modeling with PCFGs. We show that masked language models like BERT or RoBERTa of moderate sizes can approximately execute the Inside-Outside algorithm for the English PCFG [Marcus et al, 1993]. We also show that the Inside-Outside algorithm is optimal for masked language modeling loss on the PCFG-generated data. We also give a construction of transformers with $50$ layers, $15$ attention heads, and $1275$ dimensional embeddings in average such that using its embeddings it is possible to do constituency parsing with $>70\%$ F1 score on PTB dataset. We conduct probing experiments on models pre-trained on PCFG-generated data to show that this not only allows recovery of approximate parse tree, but also recovers marginal span probabilities computed by the Inside-Outside algorithm, which suggests an implicit bias of masked language modeling towards this algorithm.
On the Inductive Bias of Masked Language Modeling: From Statistical to Syntactic Dependencies
Stanford University(斯坦福大学)
我们研究了如何以无监督的方式掩蔽和预测令牌可以产生语言结构和下游性能增益。最近的理论表明,预训练的语言模型通过隐含地充当下游任务的完形填空缩减的掩码来获得有用的归纳偏差。虽然有吸引力,我们表明,在实践中使用的随机掩蔽策略的成功,不能解释这样的完形填空式的面具。我们使用三个不同分类数据集的特定任务词典构建了类似完形填空的掩码,并表明大多数预训练的性能增益来自与词典无关的通用掩码。为了解释这些通用面具的经验成功,我们证明了掩蔽语言模型(MLM)的目标和现有的方法之间的对应关系,学习统计依赖的图形模型。使用此,我们推导出一种方法,用于提取这些学习的统计依赖MLMs,并表明这些依赖编码有用的归纳偏见的形式的句法结构。在无监督解析评估中,简单地在隐含的统计依赖结构上形成最小生成树优于无监督解析的经典方法(58.74 vs. 55.91 UUAS)。
Birds have four legs?! NumerSense: Probing Numerical Commonsense Knowledge of Pre-trained Language Models
University of Southern California(南加州大学)
最近的工作表明,预训练语言模型(PTLM),如BERT,拥有一定的常识和事实知识。他们认为,通过预测屏蔽词,将PTLM用作“神经知识库”是有希望的。令人惊讶的是,我们发现这可能不适用于数字常识知识(例如,鸟通常有两条腿。在本文中,我们调查是否以及在何种程度上,我们可以从PTLM以及这个过程的鲁棒性的数值常识知识。为了研究这一点,我们引入了一个新的探测任务,诊断数据集NumerSense包含13.6k个屏蔽词预测探测器(10.5k用于微调,3.1k用于测试)。我们的分析表明:(1)在任何微调之前,BERT及其更强的变体RoBERTa在诊断数据集上表现不佳;(2)远程监督的微调带来了一些改进;(3)与人类表现相比,最好的监督模型仍然表现不佳(准确率为54.06% vs 96.3%)。
Research Training Group AIPHES(AIPHES研究培训小组);Leibniz ScienceCampus “Empirical Linguistics and Computational Language Modeling”(莱布尼茨科学园区“实证语言学与计算语言建模”);Department for Computational Linguistics(计算语言学系)
Variable Name Recovery in Decompiled Binary Code using Constrained Masked Language Modeling
Arizona State University(亚利桑那州立大学)
反编译是将二进制程序转换为高级表示(如源代码)以供人类分析人员检查的过程。虽然现代反编译器可以重建和恢复在编译过程中丢弃的许多信息,但推断变量名仍然非常困难。受自然语言处理最新进展的启发,我们提出了一种新的解决方案来推断反编译代码中的变量名称,基于掩码语言建模,字节对编码和神经架构,如Transformers和BERT。我们的解决方案需要\textit{raw}反编译器的输出,语义意义不大的代码,作为输入,并丰富它使用我们提出的\textit{finetuning}技术,约束屏蔽语言建模。使用受约束的掩码语言建模引入了预测原始变量名的掩码标记数量的挑战。我们解决这个\textit{count of token prediction}的挑战与我们的后处理算法。与最先进的方法相比,我们训练的VarBERT模型更简单,性能更好。我们在一个包含164,632个二进制文件的现有大规模数据集上评估了我们的模型,并表明它可以预测与原始源代码中相同的变量名称,高达84.15%。
Exploring prompts to elicit memorization in masked language model-based named entity recognition
University of Vienna(维也纳大学);Faculty of Computer Science, University of Vienna(维也纳大学计算机科学学院);UniVie Doctoral School Computer Science(维也纳大学计算机科学博士学院);Faculty of Philological and Cultural Studies, University of Vienna(维也纳大学语言与文化研究学院)
"Mask and Infill" : Applying Masked Language Model to Sentiment Transfer
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络空间安全学院);Baidu Inc.(百度公司)
Gender Bias in Masked Language Models for Multiple Languages
Tokyo Institute of Technology(东京工业大学);CogSmart Co., Ltd.(CogSmart有限公司);University of Liverpool(利物浦大学);Amazon(亚马逊)
通过预测大型语料库上的掩蔽标记来预训练的掩蔽语言模型(Masked Language Models,MLMs)已经成功地用于各种语言的自然语言处理任务。不幸的是,据报告,多层膜也学习有关性别和种族等属性的歧视性偏见。由于大多数研究都集中在英语中的多语言标记语,很少有人研究其他语言中的多语言标记语的偏见。由于费用和征聘注释员的困难,英文以外其他语文的评价数据的人工注释一直具有挑战性。此外,现有的偏见评估方法需要由相同的上下文与属性词(例如,他/她是一名护士)组成的刻板句子对。我们提出了多语言偏差评估(MBE)分数,以评估偏见,在各种语言中使用只有英语属性词表和平行语料库之间的目标语言和英语,而不需要手动注释的数据。我们使用MBE评估了八种语言的MLMs,并确认所有这些语言的MLMs中都编码了与性别相关的偏见。我们手动创建了日语和俄语的性别偏见数据集,以评估MBE的有效性。结果表明,MBE报告的偏见分数显着相关,从上述手动创建的数据集和现有的英语数据集的性别偏见计算。
Instituto de Telecomunicações(电信研究所);Instituto Superior Técnico(高等技术学院);LUMLIS (Lisbon ELLIS Unit)(LUMLIS(里斯本ELLIS单元));Mila, Université de Montréal(蒙特利尔大学米拉研究所);Language Technologies Institute, Carnegie Mellon University(卡内基梅隆大学语言技术研究所);Unbabel(Unbabel公司);Kaufland e-commerce(考夫兰电子商务)