论文阅读 | Adversarial Example Generation with Syntactically Controlled Paraphrase Networks

[pdf] [code]

Interpretation of syntactic control network SCPNS generate confrontation sample

We propose a syntactic paraphrase control network (SCPNs), and use them to generate examples of antagonistic. Given a sentence and a target grammatical form (for example, a constituency parsing), scpn trained, you can produce the interpretation of the sentence with the required syntax. We show create training data for this task is possible, first of all reverse translation in a very large range, and then use the tag syntax parser to convert naturally occurring in the process. Such data allows us to use additional encoder input to train a neural decoding models to target syntax. Combination of automated and manual evaluation showed that compared with baseline (uncontrolled) interpretation systems, scpn generated interpretation in line with its target specification, and will not reduce the quality of interpretation. In addition, they are more examples of the ability to generate opposition on grammar, thereby (1) to fool the model pre-trained, (2) improve the robustness of these models when used to augment the training data syntax changes.

We introduced the first learning method to solve this problem, based on a common neurological codec model to support a wide range of conversion.

We face two new challenges: (1) get a lot of interpretation pairs for training (2) to define the syntax conversion to pair these labels.

Collect enough input for a variety of phenomena - output pair. Our focus is the syntax conversion, we use a selection from the linear analysis template linearized constituency parses to define the syntax conversion. Given this parallel data, we can easily be trained to a target grammar and sentence template as input, and generates the required codec model of interpretation.

 

Our model, namely grammar control Interpretation Network (SCPN), able to underlying data sets sentiment analysis and text examples generate confrontational, these examples have a significant impact on the performance pre-training model:

 

 

Interpretation of the collected labeled 2 labeled paraphrase pairs

we use the PARANMT-50M corpus from Wieting and Gimpel (2017).

Syntactic interpretation automatic annotation conversion

Stanford parser <p1, p2> <s1, s2> p1 p2 What this particular

Interpretation Templates

The goal is to relax syntax parsing a template, we define it as linearization of the parse tree top level and top-level (root and underlying root together)

 

3 grammar explanations control network

Neural controlled paraphrase generation

Given a sentential paraphrase pair (s1, s2) and a corresponding target syntax tree p2 for s2

encode s1 using a bidirectional LSTM (Hochreiter and Schmidhuber, 1997)

our decoder is a two-layer LSTM augmented with soft attention over the encoded states (Bahdanau et al., 2014) as well as a copy mechanism (See et al., 2017).

Following existing work in NMT (Sennrich et al., 2015), we preprocess s1 and s2 into subword units using byte pair encoding, and we perform decoding using beam search. For all attention computations, we use a bilinear product with a learned parameter matrix W: given vectors u and v, we score them by uTWv.

 

decoder

 

 

 Instead, we use another model train and SCPN same architecture to generate a complete resolution from parsing template. This allows us to predict in two steps: First, predict the complete syntax tree, and then use the tree generation interpretation. Specifically, for the first step, assuming t2 template is parsed by the parsing p2 target before the two layers. The analytical generator input is parsed input p1 and t2, which is trained to generate p2. We from SCPN (ie., No joint optimization) to improve efficiency for the purpose. In the test, the user only needs to specify the input sentence and a target template; template by parsing the generator provides, and then sent to the parsing predicted target SCPN paraphrasing generated.

 

 

 

Template selection and post-processing

By switching from full syntax to the template, we have reduced but not completely eliminated the burden of generating the target grammatical form. Some templates may not apply to a particular input sentence (for example, contains a long sentence for converting multiple clauses noun phrase). However, it may be too similar to other grammatical syntax input, resulting in little change. Since the focus of this article is not to select a template, so we used a relatively simple process, choose PARANMT-50M is the most common template 20.

因为我们不能为每个模板生成一个有效的释义,所以我们进行后处理来删除无意义的输出。特别地,我们使用n-gram overlap和释义相似度对生成的释义进行过滤,后者使用来自Wieting和Gimpel(2017)的预训练词TRIAVG句子嵌入模型来计算。由于有了PARANMT-50M的数据,这些释义式的句子嵌入明显优于之前的研究。

 

4 Intrinsic Experiments

在使用SCPN在下游数据集上生成对抗性示例之前,我们需要确保它的输出释义是有效的和语法的,并且它的输出遵循指定的目标语法。在本节中,我们将SCPN与神经反向翻译基线(NMT-BT)在我们的parnmt - 50m分割的开发集上进行比较,使用了人工和自动化实验。NMTBT是相同的预先训练捷克英语模型,用于创建PARANMT-50M;然而,在这里我们使用它来产生两个方向(即。,英语-捷克语和捷克英语)。

释义质量和语法性    -- 这个需要大量人工

为了衡量释义质量和语法程度,我们进行了一个众包实验,要求工人们在Kok和布罗基特(2010)的三点量表上对释义对(s, g)进行评分,其中s为源句,g为生成句。如此规模的一个0表示没有解释关系,虽然1意味着g是一个不通释义和2意味着g是一个s的语法解释。我们从发展的我们选择100个解释对PARANMT-50M分割后处理步骤详细后(3.3节)和有三个工人每一对。为了评价句法操作对英语教学质量的影响,我们进行了大量的实验研究,只选择顶级解析模板不同的句子(即, ts != tg),确保两个系统的输出在语法上与源语句不同。

结果(表1)表明,非受控NMT-BT模型s输出与SCPN输出在质量和语法上具有可比性;这两种体系都没有明显的优势。更有趣的是,当将模板提供给SCPN(通过第3.2节中描述的解析生成器)而不是完整的解析树时,我们没有发现质量下降,这表明解析生成器在生成可信的解析树方面做得很好;因此,对于接下来的所有对抗评估,我们只使用SCPN的模板变体。

 

 

释义是否符合目标规范?

接下来,我们确定SCPN s生成的释义符合目标语法的频率:如果g是生成的释义,pg是它的解析,那么pg与基本事实目标解析p2匹配的频率是多少?我们使用精确的模板匹配对我们的开发集进行评估:只有当g的解析pg的前两个级别与p2匹配时,g才被视为与s2匹配的语法。我们评估了两个SCPN配置,其中一个配置给出了完整的目标解析p2,另一个配置给出了在目标模板t2上运行解析生成器的结果。作为完整性检查,我们还使用相同的度量来评估解析生成器。

结果(表2)表明SCPN确实实现了对其大部分输入的语法控制。我们的解析生成器生成几乎总是匹配目标模板的完整解析;然而,使用这些语法生成的释义在语法上不太准确。对生成的解析进行定性检查,可以发现它们在较低层次成分的排序或存在性方面与基本事实目标解析不同(表6);我们的理论是,这些差异可能抛出SCPN s解码器。

 

 

 

 

 

 NMT-BT系统产生的释义在语法上与输入语句非常相似:28.7%的释义与输入语句s1具有相同的模板,而只有11.1%的释义与基本事实目标s2具有相同的模板。即使我们训练SCPN对于由NMT反向翻译生成的数据,我们通过将语法合并到学习过程中来避免这个问题。

 

5 对抗样本生成

内在评价表明,SCPN产生的释义质量可与不受控制的NMT-BT系统相媲美,同时也符合指定的目标规范。接下来,我们将研究控制释义在反例生成中的作用。为了将问题形式化,假设某个下游任务的预训练模型在给定测试时实例x的情况下生成预测yx。我们的研究结果表明,在情感分析和蕴涵任务上,使用适当的模板选择控制意译生成比反向翻译产生更有效的反例。

binary sentiment classification   SST

 

 

 

 

 

 我们再次转向众包实验。我们要求工人为给定的句子或句子对选择合适的标签(例如,SST是正的还是负的),然后我们将工人的判断与原始开发示例s标签进行比较。对于这两种模型,我们随机选择100个对抗性的例子,并让3名工作人员对每个例子进行注释。结果(表4)表明,在较为复杂的海温数据上,SCPN s转述的有效对抗性例证比例高于NMT-BT,这尤其令人鼓舞,因为我们的模型产生的对抗性例证也明显多于NMT-BT。

 

这篇文章里用了大量人工啊。

5.4 Increasing robustness to adversarial examples

如果我们另外增加两个任务的训练数据控制的迂回,我们可以增加一个下游模型鲁棒性对抗的例子在发展。量化这种效果,我们的训练集生成控制转述SST和生病的使用相同的模板与前面的实验。然后,我们将这些转述作为额外的培训示例,并重新培训biLSTM任务模型。如表4所示,SCPN s释义训练在不影响原始测试集准确性的前提下,显著提高了对语法对抗样本的鲁棒性。

 

 

 NMT-BT释义的增强增强了SICK的鲁棒性,但是在SST上,它降低了测试的准确性,但在鲁棒性上没有显著的提高;这可能是因为与SCPN相比,它缺乏语法变化。

6 定性分析

在上一节中,我们定量地评估了SCPN产生有效释义和反例的能力。在这里,我们来看一下模型生成的实际句子。除了分析SCPN相对于NMT-BT的优缺点之外,我们还研究了模型的各种配置所产生的释义之间的差异,以确定每个主要设计决策的影响(例如,模板而不是完整的解析)。

语法操作:表3演示了SCPN执行语法操作的能力,显示了使用不同模板生成的两个句子的释义。许多示例显示了复杂的转换,同时保留了输入语义和语法性,即使目标语法与源语法非常不同(例如,将声明性转换为疑问句时)。然而,失败案例表明,并非每个模板都能产生有效的释义,因为当试图将输入语义压缩到不合适的目标形式时,有时会生成无意义的输出。

作为未来的工作,将这一下游信号提供给NMT-BT和SCPN将是有趣的;对于后者,也许这个信号可以指导模板选择过程,而模板选择过程目前固定在一个小的有限集上。

具体来说,不受控制的SCPN有38.6%的时间产生与输入模板相同的释义,而NMT-BT有28.7%(第4.2节).

 

相关工作

 

Madnani和Dorr(2010)回顾了用于释义生成的数据驱动方法,指出了两大类:基于模板的和基于翻译的。第一家庭包括使用手工规则的方法(McKeown, 1983)、基于辞典的替代方法(Bolshakov和Gelbukh, 2004;Zhang和LeCun, 2015),晶格匹配(Barzilay和Lee, 2003),以及基于模板的shake &贝克转述(卡尔等人,2005)。这些方法通常产生语法输出,但它们在多样性上可能受到限制。

第二类包括使用基于并行文本的方法重写输入的方法(Bannard和Callison-Burch, 2005)、机器翻译(Quirk et al., 2004;Napoles等,2016;铃木等,2017),或相关统计技术(赵等,2009)。与我们的工作特别相关的方法是,结合语法来提高意译输出的流畅性。Callison-Burch(2008)将释义限制为与输入相同的语法类型,尽管他关注的是短语级的释义,而不是句子级的释义。Pang等人(2003)从生成句法释义的翻译对中学习有限状态自动机,尽管这需要将多个翻译成同一种语言,并且不能用于在此数据集之外生成释义。沈等人(2006)将此扩展到更深层次的句法分析。所有这些方法都使用语法改善语法,这是由我们的解码器语言模型处理。最近的研究涉及到神经方法。Iyyer等人(2014)通过在测试时随机选择解析树,使用依赖树递归自动编码器生成释义。Li等(2017)使用深度强化学习生成释义。Gupta等人(2017)使用变分自动编码器生成多个释义。这些方法与我们的方法的不同之处在于,它们都没有提供对释义语法形式的细粒度控制

与我们的方法相关最多的是基于句法转换的方法,如Woodsend和Lapata(2011)基于准同步语法的树对树的句子简化方法(Smith and Eisner, 2006)。我们的方法更一般,因为我们不需要语法,只有软约束。也许与该方法最接近的是Ficler and Goldberg(2017)的条件递归语言模型,该模型生成的语言具有用户选择的属性,如句子长度和形式,但无法生成释义。

对于对话,Li等人(2016a)利用说话者身份影响输出,Wang等人(2017)建立模型来影响输出的主题和风格。Shen等(2017)对非平行文本进行风格转移,Guu等(2017)从原型生成新颖的句子;同样,这些方法并不一定要生成保留意义的释义,而只是转换了具有不同风格的句子。

 

8 结论

提出了一种用于句法控制释义生成的编译码器模型SCPN,并证明了该模型是一种有效的反例生成方法。使用解析器,我们标记了大型反向翻译数据中的语法变化,这为SCPN提供了训练数据。与现有的不受控制的释义生成系统相比,该模型显示的词汇变化要小得多,而更喜欢纯粹的语法修改。它能够生成对抗的例子来愚弄预先训练好的NLP模型。此外,通过对这些例子的训练,我们提高了这些模型对句法变化的鲁棒性

 

Guess you like

Origin www.cnblogs.com/shona/p/11579244.html