16
Syntax-guided Controlled Generation of Paraphrases Ashutosh Kumar 1 Kabir Ahuja 2* Raghuram Vadapalli 3* Partha Talukdar 1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore 3 Google, London [email protected], [email protected] [email protected], [email protected] Abstract Given a sentence (e.g., "I like mangoes") and a constraint (e.g., sentiment flip), the goal of controlled text generation is to pro- duce a sentence that adapts the input sen- tence to meet the requirements of the con- straint (e.g., "I hate mangoes"). Going be- yond such simple constraints, recent works have started exploring the incorporation of complex syntactic-guidance as constraints in the task of controlled paraphrase genera- tion. In these methods, syntactic-guidance is sourced from a separate exemplar sen- tence. However, these prior works have only utilized limited syntactic information avail- able in the parse tree of the exemplar sen- tence. We address this limitation in the pa- per and propose Syntax Guided Controlled Paraphraser (SGCP), an end-to-end frame- work for syntactic paraphrase generation. We find that SGCP can generate syntax- conforming sentences while not compro- mising on relevance. We perform extensive automated and human evaluations over mul- tiple real-world English language datasets to demonstrate the efficacy of SGCP over state-of-the-art baselines. To drive future re- search, we have made SGCP’s source code available 1 . 1 Introduction Controlled text generation is the task of producing a sequence of coherent words based on given con- straints. These constraints can range from simple attributes like tense, sentiment polarity and word- reordering (Hu et al., 2017; Shen et al., 2017; Yang et al., 2018) to more complex syntactic informa- tion. For example, given a sentence "The movie is awful!" and a simple constraint like flip sentiment * This research was conducted during the author’s intern- ship at Indian Institute of Science. 1 https://github.com/malllabiisc/SGCP SOURCE how do i predict the stock market ? EXEMPLAR can a brain transplant be done ? SCPN how can the stock and start ? CGEN can the stock market actually happen ? SGCP (Ours) can i predict the stock market ? SOURCE what are some of the mobile apps you ca n’t live without and why ? EXEMPLAR which is the best resume you have come across ? SCPN what are the best ways to lose weight ? CGEN which is the best mobile app you ca n’t ? SGCP (Ours) which is the best app you ca n’t live without and why ? Table 1: Sample syntactic paraphrases generated by SCPN (Iyyer et al., 2018), CGEN (Chen et al., 2019a), SGCP (Ours). We observe that SGCP is able to generate syntax conforming paraphrases without compromising much on relevance. to positive, a controlled text generator is expected to produce the sentence "The movie is fantastic!". These constraints are important in not only pro- viding information about what to say but also how to say it. Without any constraint, the ubiquitous sequence-to-sequence neural models often tend to produce degenerate outputs and favour generic ut- terances (Vinyals and Le, 2015; Li et al., 2016). While simple attributes are helpful in addressing what to say, they provide very little information about how to say it. Syntactic control over gen- eration helps in filling this gap by providing that missing information. Incorporating complex syntactic information has shown promising results in neural machine translation (Stahlberg et al., 2016; Aharoni and Goldberg, 2017; Yang et al., 2019), data-to-text generation (Peng et al., 2019), abstractive text- summarization (Cao et al., 2018) and adversarial text generation (Iyyer et al., 2018). Additionally, recent work (Iyyer et al., 2018; Kumar et al., 2019) has shown that augmenting lexical and syntactical variations in the training set can help in building arXiv:2005.08417v1 [cs.CL] 18 May 2020

Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

Syntax-guided Controlled Generation of Paraphrases

Ashutosh Kumar1 Kabir Ahuja2∗ Raghuram Vadapalli3∗ Partha Talukdar11 Indian Institute of Science, Bangalore

2 Microsoft Research, Bangalore3 Google, London

[email protected], [email protected]

[email protected], [email protected]

Abstract

Given a sentence (e.g., "I like mangoes")and a constraint (e.g., sentiment flip), thegoal of controlled text generation is to pro-duce a sentence that adapts the input sen-tence to meet the requirements of the con-straint (e.g., "I hate mangoes"). Going be-yond such simple constraints, recent workshave started exploring the incorporation ofcomplex syntactic-guidance as constraintsin the task of controlled paraphrase genera-tion. In these methods, syntactic-guidanceis sourced from a separate exemplar sen-tence. However, these prior works have onlyutilized limited syntactic information avail-able in the parse tree of the exemplar sen-tence. We address this limitation in the pa-per and propose Syntax Guided ControlledParaphraser (SGCP), an end-to-end frame-work for syntactic paraphrase generation.We find that SGCP can generate syntax-conforming sentences while not compro-mising on relevance. We perform extensiveautomated and human evaluations over mul-tiple real-world English language datasetsto demonstrate the efficacy of SGCP overstate-of-the-art baselines. To drive future re-search, we have made SGCP’s source codeavailable1.

1 Introduction

Controlled text generation is the task of producinga sequence of coherent words based on given con-straints. These constraints can range from simpleattributes like tense, sentiment polarity and word-reordering (Hu et al., 2017; Shen et al., 2017; Yanget al., 2018) to more complex syntactic informa-tion. For example, given a sentence "The movie isawful!" and a simple constraint like flip sentiment

∗This research was conducted during the author’s intern-ship at Indian Institute of Science.

1https://github.com/malllabiisc/SGCP

SOURCE – how do i predict the stock market ?EXEMPLAR – can a brain transplant be done ?

SCPN – how can the stock and start ?CGEN – can the stock market actually happen ?SGCP(Ours) – can i predict the stock market ?

SOURCE– what are some of the mobile apps you ca n’t livewithout and why ?

EXEMPLAR – which is the best resume you have come across ?

SCPN – what are the best ways to lose weight ?CGEN – which is the best mobile app you ca n’t ?SGCP(Ours)

– which is the best app you ca n’t live without andwhy ?

Table 1: Sample syntactic paraphrases generatedby SCPN (Iyyer et al., 2018), CGEN (Chen et al.,2019a), SGCP (Ours). We observe that SGCP isable to generate syntax conforming paraphraseswithout compromising much on relevance.

to positive, a controlled text generator is expectedto produce the sentence "The movie is fantastic!".

These constraints are important in not only pro-viding information about what to say but also howto say it. Without any constraint, the ubiquitoussequence-to-sequence neural models often tend toproduce degenerate outputs and favour generic ut-terances (Vinyals and Le, 2015; Li et al., 2016).While simple attributes are helpful in addressingwhat to say, they provide very little informationabout how to say it. Syntactic control over gen-eration helps in filling this gap by providing thatmissing information.

Incorporating complex syntactic informationhas shown promising results in neural machinetranslation (Stahlberg et al., 2016; Aharoni andGoldberg, 2017; Yang et al., 2019), data-to-textgeneration (Peng et al., 2019), abstractive text-summarization (Cao et al., 2018) and adversarialtext generation (Iyyer et al., 2018). Additionally,recent work (Iyyer et al., 2018; Kumar et al., 2019)has shown that augmenting lexical and syntacticalvariations in the training set can help in building

arX

iv:2

005.

0841

7v1

[cs

.CL

] 1

8 M

ay 2

020

Page 2: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

(1) SENTENCE ENCODER

is it safe to access the deep web ?

is it possible to make a real iron

SBARQ

SQ

VBZ NP ADJP

PRP ADJP S

how

close

are

we

to

a

real

iron

man

suit

?

EXEMPLAR SENTENCE (2) SYNTACTIC ENCODER

(3) SYNTACTIC PARAPHRASE DECODER

…..

<SOS> is it possible to make a real iron

CONSTITUENCY

PARSER

CONSTITUENCYPARSER

Similar Syntax

SBARQ

SQ

VBZ NP

PRP

ADJP

S

PARSE TREE OF GENERATED PARAPHRASE

H = 4

ADJP

<DOT> <DOT>

𝑐"

𝑠"

PARSE TREE OFEXEMPLAR SENTENCE

H = 4

VBZ PRP ADJP S

ℎ"%

𝑠"

Figure 1: Architecture of SGCP (proposed method). SGCP aims to paraphrase an input sentence, whileconforming to the syntax of an exemplar sentence (provided along with the input). The input sentence isencoded using the Sentence Encoder (Section 3.2) to obtain a semantic signal ct. The Syntactic Encoder(Section 3.3) takes a constituency parse tree (pruned at height H) of the exemplar sentence as an input,and produces representations for all the nodes in the pruned tree. Once both of these are encoded, theSyntactic Paraphrase Decoder (Section 3.4) uses pointer-generator network, and at each time step takesthe semantic signal ct, the decoder recurrent state st, embedding of the previous token and syntacticsignal hYt to generate a new token. Note that the syntactic signal remains the same for each token in aspan (shown in figure above curly braces; please see Figure 2 for more details). The gray shaded region(not part of the model) illustrates a qualitative comparison of the exemplar syntax tree and the syntaxtree obtained from the generated paraphrase. Please refer Section 3 for details.

better performing and more robust models.In this paper, we focus on the task of syntacti-

cally controlled paraphrase generation, i.e., givenan input sentence and a syntactic exemplar, pro-duce a sentence which conforms to the syntax ofthe exemplar while retaining the meaning of theoriginal input sentence. While syntactically con-trolled generation of paraphrases finds applica-tions in multiple domains like data-augmentationand text passivization, we highlight its importancein the particular task of Text simplification. Aspointed out in Siddharthan (2014), depending onthe literacy skill of an individual, certain syntacti-cal forms of English sentences are easier to com-prehend than others. As an example consider thefollowing two sentences:

S1 Because it is raining today, you should carryan umbrella.

S2 You should carry an umbrella today, becauseit is raining.

Connectives that permit pre-posed adverbialclauses have been found to be difficult for third tofifth grade readers, even when the order of men-tion coincides with the causal (and temporal) or-der (Anderson and Davison, 1986; Levy, 2003).Hence, they prefer sentence S2. However, vari-ous other studies (Clark and Clark, 1968; Katz andBrent, 1968; Irwin, 1980) have suggested that forolder school children, college students and adults,comprehension is better for the cause-effect pre-sentation, hence sentence S1. Thus, modifying asentence, syntactically, would help in better com-prehension based on literacy skills.

Prior work in syntactically controlled para-phrase generation addressed this task by condi-tioning the semantic input on either the featureslearnt from a linearized constituency-based parsetree (Iyyer et al., 2018), or the latent syntactic in-formation (Chen et al., 2019a) learnt from exem-plars through variational auto-encoders. Lineariz-ing parse trees, typically, result in loss of essen-

Page 3: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

tial dependency information. On the other hand,as noted in (Shi et al., 2016), an auto-encoderbased approach might not offer rich enough syn-tactic information as guaranteed by actual con-stituency parse trees. Moreover, as noted in Chenet al. (2019a), SCPN (Iyyer et al., 2018) and CGEN

(Chen et al., 2019a) tend to generate sentencesof the same length as the exemplar. This is anundesirable characteristic because it often resultsin producing sentences that end abruptly, therebycompromising on grammaticality and semantics.Please see Table 1 for sample generations usingeach of the models.

To address these gaps, we propose SyntaxGuided Controlled Paraphraser (SGCP) whichuses full exemplar syntactic tree information. Ad-ditionally, our model provides an easy mechanismto incorporate different levels of syntactic control(granularity) based on the height of the tree beingconsidered. The decoder in our framework is aug-mented with rich enough syntactical informationto be able to produce syntax conforming sentenceswhile not losing out on semantics and grammati-cality.

The main contributions of this work are as fol-lows:

1. We propose Syntax Guided ControlledParaphraser (SGCP), an end-to-end model togenerate syntactically controlled paraphrasesat different levels of granularity using aparsed exemplar.

2. We provide a new decoding mechanism to in-corporate syntactic information from the ex-emplar sentence’s syntactic parse.

3. We provide a dataset formed from QuoraQuestion Pairs 2 for evaluating the models.We also perform extensive experiments todemonstrate the efficacy of our model usingmultiple automated metrics as well as humanevaluations.

2 Related Work

Controllable Text Generation is an importantproblem in NLP which has received significant at-tention in recent times. Prior works include gener-ating text using models conditioned on attributeslike formality, sentiment or tense (Hu et al., 2017;Shen et al., 2017; Yang et al., 2018) as well ason syntactical templates (Iyyer et al., 2018; Chen

2https://www.kaggle.com/c/quora-question-pairs

et al., 2019a). These systems find applications inadversarial sample generation (Iyyer et al., 2018),text summarization and table-to-text generation(Peng et al., 2019). While achieving state-of-the-art in their respective domains, these systemstypically rely on a known finite set of attributesthereby making them quite restrictive in terms ofthe styles they can offer.

Paraphrase generation. While generation ofparaphrases has been addressed in the past us-ing traditional methods (McKeown, 1983; Barzi-lay and Lee, 2003; Quirk et al., 2004; Hassanet al., 2007; Zhao et al., 2008; Madnani andDorr, 2010; Wubben et al., 2010), they have re-cently been superseded by deep learning-based ap-proaches (Prakash et al., 2016; Gupta et al., 2018;Li et al., 2019, 2018; Kumar et al., 2019). Theprimary task of all these methods (Prakash et al.,2016; Gupta et al., 2018; Li et al., 2018) is to gen-erate the most semantically similar sentence andthey typically rely on beam search to obtain anykind of lexical diversity. Kumar et al. (2019) try totackle the problem of achieving lexical, and lim-ited syntactical diversity using submodular opti-mization but do not provide any syntactic controlover the type of utterance that might be desired.These methods are therefore restrictive in terms ofthe syntactical diversity that they can offer.

Controlled Paraphrase Generation. Our task issimilar in spirit to Iyyer et al. (2018); Chen et al.(2019a), which also deals with the task of syntac-tic paraphrase generation. However, the approachtaken by them is different from ours in at least twoaspects. Firstly, SCPN (Iyyer et al., 2018) usesattention (Bahdanau et al., 2014) based pointer-generator network (See et al., 2017) to encode in-put sentences and a linearised constituency treeto produce paraphrases. Due to the linearizationof syntactic tree, a lot of dependency-based infor-mation is generally lost. Our model, instead, di-rectly encodes the tree structure to produce a para-phrase. Secondly, the inference (or generation)process in SCPN is computationally very expen-sive, since it involves a two-stage generation pro-cess. In the first stage, they generate full parsetrees from incomplete templates, and then fromfull parse trees to final generations. In contrast,the inference in our method involves a single-stageprocess, wherein our model takes as input a se-mantic source, a syntactic tree and the level of syn-tactic style that needs to be transferred, to obtain

Page 4: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

the generations. Additionally, we also observedthat the model does not perform well in low re-source settings. This, again, can be attributed tothe compounding implicit noise in the training dueto linearised trees and generation of full linearisedtrees before obtaining the final paraphrases.

Chen et al. (2019a) propose a syntacticexemplar-based method for controlled paraphrasegeneration using an approach based on latent vari-able probabilistic modeling, neural variational in-ference, and multi-task learning. This, in princi-ple, is very similar to Chen et al. (2019b). Asopposed to our model which provides differentlevels of syntactic control of the exemplar-basedgeneration, this approach is restrictive in termsof the flexibility it can offer. Also, as noted inShi et al. (2016), an auto-encoder based approachmight not offer rich enough syntactic informationas offered by actual constituency parse trees. Ad-ditionally, VAEs (Kingma and Welling, 2014) aregenerally unstable and harder to train (Bowmanet al., 2016; Gupta et al., 2018) than seq2seq basedapproaches.

3 SGCP: Proposed Method

In this section, we describe the inputs and vari-ous architectural components, essential for build-ing SGCP, an end-to-end trainable model. Ourmodel, as shown in Figure 1, comprises a sentenceencoder (3.2), syntactic tree encoder (3.3), and asyntactic-paraphrase-decoder (3.4).

3.1 Inputs

Given an input sentence X and a syntactic exem-plar Y , our goal is to generate a sentence Z thatconforms to the syntax of Y while retaining themeaning of X .

While the semantic encoder (Section 3.2) workson sequence of input tokens, the syntactic encoder(Section 3.3) operates on constituency-based parsetrees. We parse the syntactic exemplar Y 3 to ob-tain its constituency-based parse tree. The leafnodes of the constituency-based parse tree con-sists of token for the sentence Y. These tokens, insome sense, carry the semantic information of sen-tence Y, which we do not need for generating para-phrases. In order to prevent any meaning propa-gation from exemplar sentence Y into the gener-ation, we remove these leaf/terminal nodes from

3Obtained using the Stanford CoreNLP toolkit (Manninget al., 2014)

its constituency parse. The tree thus obtained isdenoted as CY .

The syntactic encoder, additionally, takes as in-putH , which governs the level of syntactic controlneeded to be induced. The utility of H will be de-scribed in Section 3.3.

3.2 Semantic EncoderThe semantic encoder, a multi-layered Gated Re-current Unit (GRU), receives tokenized sentenceX = {x1, . . . , xTX

} as input and computes thecontextualized hidden state representation hXt foreach token using:

hXt = GRU(hXt−1, e(xt)), (1)

where e(xt) represents the learnable embedding ofthe token xt and t ∈ {1, . . . , TX} . Note that weuse byte-pair encoding (Sennrich et al., 2016) forword/token segmentation.

3.3 Syntactic EncoderThis encoder provides the necessary syntacticguidance for the generation of paraphrases. For-mally, let constituency tree CY = {V, E ,Y},where V is the set of nodes, E the set of edges andY the labels associated with each node.

We calculate the hidden-state representation hYvof each node v ∈ V using the hidden-state repre-sentation of its parent node pa(v) and the embed-ding associated with its label yv as follows:

hYv = GeLU(WpahYpa(v) +Wve(yv) + bv), (2)

where e(yv) is the embedding of the node label yv,and Wpa,Wv, bv are learnable parameters. Thisapproach can be considered similar to TreeLSTM(Tai et al., 2015). We use GeLU activation func-tion (Hendrycks and Gimpel, 2016) rather than thestandard tanh or relu, because of superior em-pirical performance.

As indicated in Section 3.1, syntactic encodertakes as input the height H , which governs thelevel of syntactic control. We randomly prunethe tree CY to height H ∈ {3, . . . ,Hmax}, whereHmax is the height of the full constituency treeCY . As an example, in Figure 2b, we prune theconstituency-based parse tree of the exemplar sen-tence, to height H = 3. The leaf nodes for thistree have the labels WP, VBZ, NP and <DOT>.While we calculate the hidden-state representationof all the nodes, only the terminal nodes are re-sponsible for providing the syntactic signal to thedecoder (Section 3.4).

Page 5: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

SBARQ

WHNP SQ

WP VBZ NP

NP

DT JJS NN

PP

IN NP

NN NN

What is the best language for web development ?

ROOT

H = 3 ; 𝑎 = (1,1,1,0,0,0,0,0,1)

H = 4 ; 𝑎 = (1,1,1,0,0,1,0,0,1)

H = 5 ; 𝑎 = (1,1,1,1,1,1,1,0,1)

H = 2 ; 𝑎 = (1,1,0,0,0,0,0,0,1)

<DOT>

(a) Full Constituency Parse Tree

SBARQ

WHNP SQ

WP VBZ NP

ROOT

H = 3 ; 𝑎 = (1,1,1,0,0,0,0,0,1)

<DOT>

(b) Pruned tree at height H = 3

Figure 2: The constituency parse tree serves as an input to the syntactic encoder (Section 3.3). The firststep is to remove the leaf nodes which contain meaning representative tokens (Here: What is the bestlanguage ...). H denotes the height to which the tree can be pruned and is an input to the model. Figure(a) shows the full constituency parse tree annotated with vector a for different heights. Figure (b) showsthe same tree pruned at height H = 3 with its corresponding a vector. The vector a serves as an signallingvector (Section 3.4.2) which helps in deciding the syntactic signal to be passed on to the decoder. Pleaserefer Section 3 for details.

We maintain a queue LYH of such terminal node

representations where elements are inserted fromleft to right for a given H. Specifically, for the par-ticular example given in Figure 2b,

LYH = [hYWP, h

YVBZ, h

YNP, h

Y<DOT>]

We emphasize the fact that the length of the queue|LY

H | is a function of height H .

3.4 Syntactic Paraphrase Decoder

Having obtained the semantic and syntactic repre-sentations, the decoder is tasked with the genera-tion of syntactic paraphrases. This can be mod-eled as finding the best Z = Z∗ that maximizesthe probability P(Z|X,Y ), which can further befactorized as:

Z∗ = argmaxz

TZ∏t=1

(zt|z1, . . . , zt−1, X, Y ), (3)

where TZ is the maximum length up to which de-coding is required.

In the subsequent sections, we use t to denotethe decoder time step.

3.4.1 Using Semantic InformationAt each decoder time step t, the attention distribu-tion αt is calculated over the encoder hidden states

hXi , obtained using Equation 1, as:

eti = vᵀtanh(WhhXi +Wsst + battn)

αt = softmax(et),(4)

where st is the decoder cell-state andv,Wh,Ws, battn are learnable parameters.

The attention distribution provides a way tojointly-align and train sequence to sequence mod-els by producing a weighted sum of the semanticencoder hidden states, known as context-vector ctgiven by:

ct =∑i

αtih

Xi (5)

ct serves as the semantic signal which is essentialfor generating meaning preserving sentences.

3.4.2 Using Syntactic InformationDuring training, each terminal node in the tree CY ,pruned at H, is equipped with information aboutthe span of words it needs to generate. At eachtime step t, only one terminal node representationhYv ∈ LY

H is responsible for providing the syntac-tic signal which we call hYt . This hidden-state rep-resentation to be used is governed through an sig-nalling vector a = (a1, . . . , aTz), where each ai ∈{0, 1}. 0 indicates that the decoder should keep onusing the same hidden-representation hYv ∈ LY

H

that is currently being used, and 1 indicates that

Page 6: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

the next element (hidden-representation) in thequeue LY

H should be used for decoding.The utility of a can be best understood through

Figure 2b. Consider the syntactic tree pruned atheight H = 3. For this example,

LYH = [hYWP, h

YVBZ, h

YNP, h

Y<DOT>]

anda = (1, 1, 1, 0, 0, 0, 0, 0, 1)

ai = 1 provides a signal to pop an element fromthe queue LY

H while ai = 0 provides a signal tokeep on using the last popped element. This el-ement is then used to guide the decoder syntacti-cally by providing a signal in the form of hidden-state representation (Equation 8).

Specifically, in this example, the a1 = 1 signalsLYH to pop hYWP to provide syntactic guidance to the

decoder for generating the first token. a2 = 1 sig-nals LY

H to pop hYVBZ to provide syntactic guidanceto the decoder for generating the second token.a3 = 1 helps in obtaining hYNP from LY

H to provideguidance to generate the third token. As describedearlier, a4, . . . , a8 = 0 indicate that the same rep-resentation hYNP should be used for syntacticallyguiding tokens z4, . . . , z8. Finally a9 = 1 helpsin retrieving hY<DOT> for guiding decoder to gener-ate token z9. Note that |LY

H | =∑Tz

i=1 aiWhile a is provided to the model during train-

ing, this information might not be available duringinference. Providing a during generation makesthe model restrictive and might result in producingungrammatical sentences. SGCP is tasked to learna proxy for the signalling vector a, using transi-tion probability vector p.

At each time step t, we calculate pt ∈ (0, 1)which determines the probability of changing thesyntactic signal using:

pt = σ(Wbop([ct;hYt ; st; e(z

′t)]) + bbop), (6)

hYt+1 =

{hYt pt < 0.5

pop(LYH) otherwise

(7)

where pop removes and returns the next elementin the queue, st is the decoder state, and e(z′t) isthe embedding of the input token at time t duringdecoding.

3.4.3 OverallThe semantic signal ct, together with decoder statest, embedding of the input token e(z′t) and the syn-tactic signal hYt is fed through a GRU followed by

softmax of the output to produce a vocabulary dis-tribution as:

Pvocab = softmax(W ([ct;hYt ; st; e(z

′t)])+b), (8)

where [; ] represents concatenation of constituentelements, and W, b are trainable parameters.

We augment this with the copying mechanism(Vinyals et al., 2015) as in the pointer-generatornetwork (See et al., 2017). Usage of such a mech-anism offers a probability distribution over the ex-tended vocabulary (the union of vocabulary wordsand words present in the source sentence) as fol-lows:

P(z) = pgenPvocab(z) + (1− pgen)∑i:zi=z

αti

pgen = σ(wᵀc ct + wᵀ

sst + wᵀxe(z

′t) + bgen)

(9)

where wc, ws, wx and bgen are learnable parame-ters, e(z′t) is the input token embedding to the de-coder at time step t and αt

i is the element corre-sponding to the ith co-ordinate in the attention dis-tribution as defined in Equation 4

The overall objective can be obtained by tak-ing negative log-likelihood of the distributions ob-tained in Equation 6 and Equation 9.

L =− 1

T

T∑t=0

[logP(z∗t )

+ at log(pt)

+ (1− at) log(1− pt)]

(10)

where at is the tth element of the vector a.

4 Experiments

Our experiments are geared towards answering thefollowing questions:

Q1. Is SGCP able to generate syntax conform-ing sentences without losing out on meaning?(Section 5.1, 5.4)

Q2. What level of syntactic control does SGCP of-fer? (Section 5.2, 5.3, 5.2)

Q3. How does SGCP compare against prior mod-els, qualitatively? (Section 5.4)

Q4. Are the improvements achieved by SGCP sta-tistically significant? (Section 5.1)

Based on these questions, we outline the methodscompared (Section 4.1), along with the datasets(Section 4.2) used, evaluation criteria (Section4.3) and the experimental setup (Section 4.4).

Page 7: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

4.1 Methods ComparedAs in Chen et al. (2019a), we first highlight theresults of the two direct return-input baselines.

1. Source-as-Output: Baseline where the out-put is the semantic input.

2. Exemplar-as-Output: Baseline where theoutput is the syntactic exemplar.

We compare the following competitive methods:

3. SCPN (Iyyer et al., 2018) is a sequence-to-sequence based model comprising two en-coders built with LSTM (Hochreiter andSchmidhuber, 1997) to encode semantics andsyntax respectively. Once the encoding isobtained, it serves as an input to the LSTMbased decoder which is augmented with soft-attention (Bahdanau et al., 2014) over en-coded states as well as a copying mecha-nism (See et al., 2017) to deal with out-of-vocabulary tokens. 4

4. CGEN (Chen et al., 2019a) is a VAE (Kingmaand Welling, 2014) model with two encodersto project semantic input and syntactic in-put to a latent space. They obtain a syn-tactic embedding from one encoder, using astandard Gaussian prior. To obtain the se-mantic representation, they use von Mises-Fisher prior, which can be thought of as aGaussian distribution on a hypersphere. Theytrain the model using a multi-task paradigm,incorporating paraphrase generation loss andword position loss. We considered their bestmodel, VGVAE + LC + WN + WPL, whichincorporates the above objectives.

5. SGCP (Section 3) is a sequence-and-tree-to-sequence based model which encodes seman-tics and tree-level syntax to produce para-phrases. It uses a GRU (Chung et al., 2014)based decoder with soft-attention on seman-tic encodings and a begin of phrase (bop) gateto select a leaf node in the exemplar syntaxtree. We compare the following two variantsof SGCP:(a) SGCP-F : Uses full constituency parsetree information of the exemplar for generat-ing paraphrases.

4Note that the results for SCPN differ from the ones shownin (Iyyer et al., 2018). This is because the dataset used in(Iyyer et al., 2018) is atleast 50 times larger than the largestdataset (ParaNMT-small) in this work.

(a) SGCP-R : SGCP can produce multi-ple paraphrases by pruning the exemplar treeat various heights. This variant first gener-ates 5 candidate generations, correspondingto 5 different heights of the exemplar treenamely {Hmax, Hmax− 1, Hmax− 2, Hmax−3, Hmax − 4}, for each (source, exemplar)pair. From these candidates, the one the high-est ROUGE-1 score with the source sentence,is selected as the final generation.

Note that, except for the return-input baselines,all methods use beam search during inference.

4.2 Datasets

We train the models and evaluate them on the fol-lowing datasets:(1) ParaNMT-small (Chen et al., 2019a) con-tains 500K sentence-paraphrase pairs for training,and 1300 manually labeled sentence-exemplar-reference which is further split into 800 test datapoints and 500 dev. data points respectively.As in Chen et al. (2019a), our model uses only(sentence, paraphrase) during training. The para-phrase itself serves as the exemplar input duringtraining.

This dataset is a subset of the originalParaNMT-50M dataset (Wieting and Gimpel,2018). ParaNMT-50M is a data set generatedautomatically through backtranslation of originalEnglish sentences. It is inherently noisy due toimperfect neural machine translation quality withmany sentences being non-grammatical and someeven being non-English sentences. Because ofsuch noisy data points, it is optimistic to assumethat the corresponding constituency parse treewould be well aligned. To that end, we propose touse the following additional dataset which is morewell-formed and has more human interventionthan the ParaNMT-50M dataset.

(2) QQP-Pos: The original Quora Question Pairs(QQP) dataset contains about 400K sentence pairslabeled positive if they are duplicates of each otherand negative otherwise. The dataset is composedof about 150K positive and 250K negative pairs.We select those positive pairs which contain bothsentences with a maximum token length of 30,leaving us with ~146K pairs. We call this datasetas QQP-Pos.

Similar to ParaNMT-small, we use only thesentence-paraphrase pairs as training set and

Page 8: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

sentence-exemplar-reference triples for testingand validation. We randomly choose 140Ksentence-paraphrase pairs as the training setTtrain, and the remaining 6K pairs Teval are usedto form the evaluation set E. Additionally, letTeset =

⋃{{X,Z} : (X,Z) ∈ Teval}. Note that

Teset is a set of sentences while Teval is a set ofsentence-paraphrase pairs.Let E = φ be the initial evaluation set. For select-ing exemplar for each each sentence-paraphrasepair (X,Z) ∈ Teval, we adopt the following pro-cedure:

Step 1: For a given (X,Z) ∈ Teval, construct anexemplar candidate set C = Teset − {X,Z}.|C| ≈ 12, 000.

Step 2: Retain only those sentencesC ∈ C whosesentence length (= number of tokens) differby at most 2 when compared to the para-phrase Z. This is done since sentences withsimilar constituency-based parse tree struc-tures tend to have similar token lengths.

Step 3: Remove those candidates C ∈ C, whichare very similar to the source sentence X , i.e.BLEU(X,C) > 0.6.

Step 4: From the remaining instances in C,choose that sentence C as the exemplar Ywhich has the least Tree-Edit distance withthe paraphrase Z of the selected pair i.e. Y =argminC∈C

TED(Z,C). This ensures that the

constituency-based parse tree of the exemplarY is quite similar to that of Z, in terms ofTree-Edit distance.

Step 5: E := E ∪ (X,Y, Z)

Step 6: Repeat procedure for all other pairs inTeval.

From the obtained evaluation set E, we ran-domly choose 3K triplets for the test set Ttest, andremaining 3K for the validation set V.

4.3 EvaluationIt should be noted that there is no single fully-reliable metric for evaluating syntactic paraphrasegeneration. Therefore, we evaluate on the follow-ing metrics to showcase the efficacy of syntacticparaphrasing models.

1. Automated Evaluation.(i) Alignment based metrics: We com-pute BLEU (Papineni et al., 2002), ME-

TEOR (Banerjee and Lavie, 2005), ROUGE-1, ROUGE-2, ROUGE-L (Lin, 2004) scoresbetween the generated and the referenceparaphrases in the test set.

(ii) Syntactic Transfer: We evaluate thesyntactic transfer using Tree-edit distance(Zhang and Shasha, 1989) between the parsetrees of:

(a) the generated and the syntactic exemplarin the test set - TED-E

(b) the generated and the reference para-phrase in the test set - TED-R

(iii) Model-based evaluation: Since ourgoal is to generate paraphrases of the inputsentences, we need some measure to deter-mine if the generations indeed convey thesame meaning as the original text. To achievethis, we adopt a model-based evaluation met-ric as used by Shen et al. (2017) for Text StyleTransfer and Isola et al. (2017) for ImageTransfer. Specifically, classifiers are trainedon the task of Paraphrase Detection and thenused as Oracles to evaluate the generations ofour model and the baselines. We fine-tunetwo RoBERTa (Liu et al., 2019) based sen-tence pair classifiers, one on Quora QuestionPairs (Classifier-1) and other on ParaNMT +PAWS5 datasets (Classifier-2) which achieveaccuracies of 90.2% and 94.0% on their re-spective test sets6.

Once trained, we use Classifier-1 to evaluategenerations on QQP-Pos and Classifier-2 onParaNMT-small.

We first generate syntactic paraphrases us-ing all the models (Section 4.1) on thetest splits of QQP-Pos and ParaNMT-smalldatasets. We then pair the source sentencewith their corresponding generated para-phrases and send them as input to the clas-sifiers. The Paraphrase Detection score, de-noted as PDS in Table 2, is defined as, theratio of the number of generations predictedas paraphrases of their corresponding source

5Since the ParaNMT dataset only contains paraphrasepairs, we augment it with PAWS (Zhang et al., 2019) datasetto acquire negative samples.

6Since the test set of QQP is not public, the 90.2% numberwas computed on the available dev set (not used for modelselection)

Page 9: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

QQP-Pos

Model BLEU↑ METEOR↑ ROUGE-1↑ ROUGE-2↑ ROUGE-L↑ TED-R↓ TED-E↓ PDS↑

Source-as-Output 17.2 31.1 51.9 26.2 52.9 16.2 16.6 99.8Exemplar-as-Output 16.8 17.6 38.2 20.5 43.2 4.8 0.0 10.7

SCPN (Iyyer et al., 2018) 15.6 19.6 40.6 20.5 44.6 9.1 8.0 27.0CGEN (Chen et al., 2019a) 34.9 37.4 62.6 42.7 65.4 6.7 6.0 65.4

SGCP-F 36.7 39.8 66.9 45.0 69.6 4.8 1.8 75.0SGCP-R 38.0 41.3 68.1 45.7 70.2 6.8 5.9 87.7

ParaNMT-small

Source-as-Output 18.5 28.8 50.6 23.1 47.7 12.0 13.0 99.0Exemplar-as-Output 3.3 12.1 24.4 7.5 29.1 5.9 0.0 14.0

SCPN (Iyyer et al., 2018) 6.4 14.6 30.3 11.2 34.6 6.2 1.4 15.4CGEN (Chen et al., 2019a) 13.6 24.8 44.8 21.0 48.3 6.7 3.3 70.2

SGCP-F 15.3 25.9 46.6 21.8 49.7 6.1 1.4 76.6SGCP-R 16.4 27.2 49.6 22.9 50.5 8.7 7.0 83.5

Table 2: Results on QQP and ParaNMT-small dataset. Higher↑ BLEU, METEOR, ROUGE and PDS isbetter whereas lower↓ TED score is better. SGCP-R selects the best candidate out of many, resulting inperformance boost for semantic preservation (shown in box). We bold the statistically significant resultsof SGCP-F, only, for a fair comparison with the baselines. Note that Source-as-Output, and Exemplar-as-Output are only dataset quality indicators and not the competitive baselines. Please see Section 5 fordetails.

sentences by the classifier to the total numberof generations.

2. Human Evaluation.While TED is sufficient to highlight syn-tactic transfer, there has been some scepti-cism regarding automated metrics for para-phrase quality (Reiter, 2018). To addressthis issue, we perform human evaluation on100 randomly selected data points from thetest set. In the evaluation, 3 judges (non-researchers proficient in the English lan-guage) were asked to assign scores to gener-ated sentences based on the semantic similar-ity with the given source sentence. The anno-tators were shown a source sentence and thecorresponding outputs of the systems in ran-dom order. The scores ranged from 1 (doesn’tcapture meaning at all) to 4 (perfectly cap-tures the meaning of the source sentence).

4.4 Setup(a) Pre-processing. Since our model needs ac-cess to constituency parse trees, we tokenize andparse all our data points using the fully paralleliz-able Stanford CoreNLP Parser (Manning et al.,2014) to obtain their respective parse trees. Thisis done prior to training in order to prevent anyadditional computational costs that might be in-curred because of repeated parsing of the same

data points during different epochs.(b) Implementation details. We train both ourmodels using the Adam Optimizer (Kingma andBa, 2014) with an initial learning rate of 7e-5.We use a bidirectional 3-layered GRU for encod-ing the tokenized semantic input and a standardpointer-generator network with GRU for decod-ing. The token embedding is learnable with di-mension 300. To reduce the training complexity ofthe model, the maximum sequence length is keptat 60. The vocabulary size is kept at 24K for QQPand 50K for ParaNMT-small.

SGCP needs access to the level of syntacticgranularity for decoding, depicted as H in Fig-ure 2. During training, we keep on varying it ran-domly from 3 toHmax, changing it with each train-ing epoch. This ensures that our model is able togeneralize because of an implicit regularization at-tained using this procedure. At each time-step ofthe decoding process, we keep a teacher forcingratio of 0.9.

5 Results

5.1 Semantic Preservation and Syntactictransfer

1. Automated Metrics: As can be observed inTable 2, our method(s) (SGCP-F/R (Section 4.1))are able to outperform the existing baselines on

Page 10: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

Source what should be done to get rid of laziness ?Template Exemplar how can i manage my anger ?

SCPN (Iyyer et al., 2018) how can i get rid ?CGEN (Chen et al., 2019a) how can i get rid of ?SGCP-F (Ours) how can i stop my laziness ?SGCP-R (Ours) how do i get rid of laziness ?

Source what books should entrepreneurs read on entrepreneurship ?Template Exemplar what is the best programming language for beginners to learn ?

SCPN (Iyyer et al., 2018) what are the best books books to read to read ?CGEN (Chen et al., 2019a) what ’s the best book for entrepreneurs read to entrepreneurs ?SGCP-F (Ours) what is a best book idea that entrepreneurs to read ?SGCP-R (Ours) what is a good book that entrepreneurs should read ?

Source how do i get on the board of directors of a non profit or a for profit organisation ?Template Exemplar what is the best way to travel around the world for free ?

SCPN (Iyyer et al., 2018) what is the best way to prepare for a girl of a ?CGEN (Chen et al., 2019a) what is the best way to get a non profit on directors ?SGCP-F (Ours) what is the best way to get on the board of directors ?SGCP-R (Ours) what is the best way to get on the board of directors of a non profit or a for profit organisation ?

Table 3: Sample generations of the competitive models. Please refer to Section 5.5 for details

both the datasets. Source-as-Output is indepen-dent of the exemplar sentence being used and sincea sentence is a paraphrase of itself, the paraphras-tic scores are generally high while the syntacticscores are below par. An opposite is true forExemplar-as-Output. These baselines also serveas dataset quality indicators. It can be seen thatsource is semantically similar while being syntac-tically different from target sentence whereas theopposite is true when exemplar is compared to tar-get sentences. Additionally, source sentences aresyntactically and semantically different from ex-emplar sentences as can be observed from TED-Eand PDS scores. This helps in showing that thedataset has rich enough syntactic diversity to learnfrom.

Through TED-E scores it can be seen thatSGCP-F is able to adhere to the syntax of theexemplar template to a much larger degree thanthe baseline models. This verifies that our modelis able to generate meaning preserving sentenceswhile conforming to the syntax of the exemplarswhen measured using standard metrics.

It can also be seen that SGCP-R tends to per-form better than SGCP-F in terms of paraphrasticscores while taking a hit on the syntactic scores.This makes sense, intuitively, because in somecases SGCP-R tends to select lower H values forsyntactic granularity. This can also be observedfrom the example given in Table 6 where H = 6is more favourable than H = 7, because of bettermeaning retention.

Although CGEN performs close to our model

in terms of BLEU, ROUGE and METEOR scoreson ParaNMT-small dataset, its PDS is still muchlower than that of our model, suggesting thatour model is better at capturing the originalmeaning of the source sentence. In order to showthat the results are not coincidental, we test thestatistical significance of our model. We followthe non-parametric Pitman’s permutation test(Dror et al., 2018) and observe that our modelis statistically significant when the significancelevel (α) is taken to be 0.05. Note that this holdstrue for all metric on both the datasets exceptROUGE-2 on ParaNMT-small.

SCPN CGEN SGCP-F SGCP-R

QQP-Pos 1.63 2.47 2.70 2.99

ParaNMT-small 1.24 1.89 2.07 2.26

Table 4: A comparison of human evaluation scoresfor comparing quality of paraphrases generatedusing all models. Higher score is better. Pleaserefer to Section 5.1 for details.

2. Human Evaluation: Table 4 shows the resultsof human assessment. It can be seen that anno-tators, generally tend to rate SGCP-F and SGCP-R (Section 4.1) higher than the baseline models,thereby highlighting the efficacy of our models.This evaluation additionally shows that automatedmetrics are somewhat consistent with the humanevaluation scores.

Page 11: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

SOURCE : how do i develop my career in software ?

SYNTACTIC EXEMPLAR SGCP GENERATIONS

how can i get a domain for free ? how can i develop a career in software ?

what is the best way to register a company ? what is the best way to develop career in software ?

what are good places to visit in new york ? what are good ways to develop my career in software ?

can i make 800,000 a month betting on horses ? can i develop my career in software ?

what is chromosomal mutation ? what are some examples ? what is good career ? what are some of the ways to develop my career insoftware ?

is delivery free on quikr ? is career useful in software ?

is it possible to mute a question on quora ? is it possible to develop my career in software ?

Table 5: Sample SGCP-R generations with a single source sentence and multiple syntactic exemplars.Please refer to Section 5.4 for details.

5.2 Syntactic Control1. Syntactical Granularity : Our model can workwith different levels of granularity for the exem-plar syntax, i.e., different tree heights of the exem-plar tree can be used for decoding the output.

S what are pure substances ? what are some examples ?E what are the characteristics of the elizabethan theater ?

H = 4 what are pure substances ?H = 5 what are some of pure substances ?H = 6 what are some examples of pure substances ?H = 7 what are some examples of a pure substance ?

Table 6: Sample generations with different levelsof syntactic control. S and E stand for source andexemplar, respectively. Please refer to Section 5.2for details.

As can been seen in Table 6, at height 4 thesyntax tree provided to the model is not enoughto generate the full sentence that captures themeaning of the original sentence. As we increasethe height to 5, it is able to capture the semanticsbetter by predicting some of in the sentence. Wesee that at heights 6 and 7 SGCP is able to captureboth semantics and syntax of the source andexemplar respectively. However, as we providethe complete height of the tree i.e., 7, it furthertries to follow the syntactic input more closelyleading to sacrifice in the overall relevance sincethe original sentence is about pure substancesand not a pure substance. It can be inferred fromthis example that since a source sentence andexemplar’s syntax might not be fully compatiblewith each other, using the complete syntax treecan potentially lead to loss of relevance andgrammaticality. Hence by choosing differentlevels of syntactic granularity, one can address the

issue of compatibility to a certain extent.

2. Syntactic Variety : Table 5 shows samplegenerations of our model on multiple exemplarsfor a given source sentence. It can be observedthat SGCP can generate high-quality outputs fora variety of different template exemplars even theones which differ a lot from the original sentencein terms of their syntax. A particularly interest-ing exemplar is what is chromosomal mutation ?what are some examples ?. Here, SGCP is ableto generate a sentence with two question markswhile preserving the essence of the source sen-tence. It should also be noted that the exemplarsused in Table 5, were selected manually from thetest sets, considering only their qualitative com-patibility with the source sentence. Unlike the pro-cedure used for the creation of QQP-Pos dataset,the final paraphrases were not kept in hand whileselecting the exemplars. In real-world settings,where a gold paraphrase won’t be present, theseresults are indicative of the qualitative efficacy ofour method.

5.3 SGCP-R AnalysisROUGE based selection from the candidatesfavour paraphrases which have higher n-gramoverlap with their respective source sentences,hence may capture source’s meaning better. Thishypothesis can be directly observed from the re-sults in Table 2 and Table 4 where we see highervalues on automated semantic and human evalu-ation scores. While this helps in getting bettersemantic generations, it tends to result in higherTED values. One possible reason is that, whenprovided with the complete tree, fine-grained in-formation is available to the model for decoding

Page 12: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

and it forces the generations to adhere to the syn-tactic structure. In contrast, at lower heights, themodel is provided with lesser syntactic informa-tion but equivalent semantic information.

5.4 Qualitative Analysis

Single-Pass Syntactic Signal Granularity

SCPN 7 Linearized Tree 3

CGEN 3 POS Tags (Duringtraining)

7

SGCP 3 Constituency ParseTree

3

Table 7: Comparison of different syntacticallycontrolled paraphrasing methods. Please refer toSection 5.4 for details.

As can be seen from Table 7, SGCP not only in-corporates the best aspects of both the prior mod-els, namely SCPN and CGEN, but also utilizes thecomplete syntactic information obtained using theconstituency-based parse trees of the exemplar.

From the generations in Table 3, it can be ob-served that our model is able to capture both, thesemantics of the source text as well as the syntaxof template. SCPN, evidently, can produce out-puts with the template syntax, but it does so atthe cost of semantics of the source sentence. Thiscan also be verified from the results in Table 2where SCPN performs poorly on PDS as comparedto other models. In contrast CGEN and SGCP re-tain much better semantic information, as is de-sirable. While generating sentences, CGEN oftenabruptly ends the sentence as in example 1 in Table3, truncating the penultimate token with of. Theproblem of abrupt ending due to insufficient syn-tactic input length was highlighted in Chen et al.(2019a) and we observe similar trends. SGCP onthe other hand generates more relevant and gram-matical sentences.

Based on empirical evidence, SGCP alleviatesthis shortcoming, possibly due to dynamic syntac-tic control and decoding. This can be seen in e.g.,3 in Table 3 where CGEN truncates the sentenceabruptly (penultimate token = directors) but SGCP

is able to generate relevant sentence without com-promising on grammaticality.

5.5 Limitations and Future directions

All natural language English sentences cannotnecessarily be converted to any desirable syntax.

We note that SGCP does not take into account thecompatibility of source sentence and template ex-emplars and can freely generate syntax conform-ing paraphrases. This at times, leads to imperfectparaphrase conversion and nonsensical sentenceslike example 6 in Table 5 (is career useful in soft-ware ?). Identifying compatible exemplars is animportant but separate task in itself, which we de-fer to future work.

Another important aspect is that the task ofparaphrase generation is inherently domain agnos-tic. It is easy for humans to adapt to new do-mains for paraphrasing. However, due to the na-ture of the formulation of the problem in NLP, allthe baselines as well as our model(s), suffer fromdataset bias and are not directly applicable to newdomains. A prospective future direction can be toexplore it from the lens of domain independence.

Analyzing the utility of controlled paraphrasegenerations for the task of data augmentation isanother interesting possible direction.

6 Conclusion

In this paper, we proposed SGCP, an end-to-end framework for the task of syntactically con-trolled paraphrase generation. SGCP generatesparaphrase of an input sentence while conform-ing to the syntax of an exemplar sentence providedalong with the input. SGCP comprises a GRU-based sentence encoder, a modified RNN basedtree encoder, and a pointer-generator based noveldecoder. In contrast to previous works that fo-cus on a limited amount of syntactic control, ourmodel can generate paraphrases at different levelsof granularity of syntactic control without com-promising on relevance. Through extensive eval-uations on real-world datasets, we demonstrateSGCP’s efficacy over state-of-the-art baselines.We believe that the above approach can be usefulfor a variety of text generation tasks including syn-tactic exemplar-based abstractive summarization,text simplification and data-to-text generation.

Acknowledgement

This research is supported in part by the Ministryof Human Resource Development (Government ofIndia). We thank the action editor Asli Celikyil-maz, and the three anonymous reviewers for theirhelpful suggestions in preparing the manuscript.We also thank Chandrahas for his indispensablecomments on drafts of this paper.

Page 13: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

References

Roee Aharoni and Yoav Goldberg. 2017. To-wards string-to-tree neural machine translation.In Proceedings of the 55th Annual Meeting ofthe Association for Computational Linguistics(Volume 2: Short Papers), pages 132–140, Van-couver, Canada. Association for ComputationalLinguistics.

Richard Chase Anderson and Alice Davison.1986. Conceptual and empirical bases of read-ability formulas. Center for the Study of Read-ing Technical Report; no. 392.

Dzmitry Bahdanau, Kyunghyun Cho, and YoshuaBengio. 2014. Neural machine translation byjointly learning to align and translate. arXivpreprint arXiv:1409.0473.

Satanjeev Banerjee and Alon Lavie. 2005. Me-teor: An automatic metric for mt evaluationwith improved correlation with human judg-ments. In Proceedings of the acl workshopon intrinsic and extrinsic evaluation measuresfor machine translation and/or summarization,pages 65–72.

Regina Barzilay and Lillian Lee. 2003. Learningto paraphrase: an unsupervised approach usingmultiple-sequence alignment. In Proceedingsof the 2003 Conference of the North AmericanChapter of the Association for ComputationalLinguistics on Human Language Technology-Volume 1, pages 16–23. Association for Com-putational Linguistics.

Samuel R. Bowman, Luke Vilnis, Oriol Vinyals,Andrew Dai, Rafal Jozefowicz, and Samy Ben-gio. 2016. Generating sentences from a con-tinuous space. In Proceedings of The 20thSIGNLL Conference on Computational NaturalLanguage Learning, pages 10–21, Berlin, Ger-many. Association for Computational Linguis-tics.

Ziqiang Cao, Wenjie Li, Sujian Li, and Furu Wei.2018. Retrieve, rerank and rewrite: Soft tem-plate based neural summarization. In Proceed-ings of the 56th Annual Meeting of the Associ-ation for Computational Linguistics (Volume 1:Long Papers), pages 152–161.

Mingda Chen, Qingming Tang, Sam Wiseman,and Kevin Gimpel. 2019a. Controllable para-

phrase generation with a syntactic exemplar.In Proceedings of the 57th Annual Meeting ofthe Association for Computational Linguistics,pages 5972–5984, Florence, Italy. Associationfor Computational Linguistics.

Mingda Chen, Qingming Tang, Sam Wiseman,and Kevin Gimpel. 2019b. A multi-task ap-proach for disentangling syntax and semanticsin sentence representations. In Proceedingsof the 2019 Conference of the North Ameri-can Chapter of the Association for Computa-tional Linguistics: Human Language Technolo-gies, Volume 1 (Long and Short Papers), pages2453–2464, Minneapolis, Minnesota. Associa-tion for Computational Linguistics.

Junyoung Chung, Caglar Gulcehre, KyunghyunCho, and Yoshua Bengio. 2014. Empirical eval-uation of gated recurrent neural networks on se-quence modeling. In NIPS 2014 Workshop onDeep Learning, December 2014.

Herbert H Clark and Eve V Clark. 1968. Seman-tic distinctions and memory for complex sen-tences. Quarterly journal of experimental psy-chology, 20(2):129–138.

Rotem Dror, Gili Baumer, Segev Shlomov, andRoi Reichart. 2018. The hitchhiker’s guideto testing statistical significance in natural lan-guage processing. In Proceedings of the 56thAnnual Meeting of the Association for Compu-tational Linguistics (Volume 1: Long Papers),pages 1383–1392, Melbourne, Australia. Asso-ciation for Computational Linguistics.

Ankush Gupta, Arvind Agarwal, Prawaan Singh,and Piyush Rai. 2018. A deep generative frame-work for paraphrase generation. In Thirty-Second AAAI Conference on Artificial Intelli-gence.

Samer Hassan, Andras Csomai, Carmen Banea,Ravi Sinha, and Rada Mihalcea. 2007. Unt:Subfinder: Combining knowledge sources forautomatic lexical substitution. In Proceedingsof the 4th International Workshop on Seman-tic Evaluations, pages 410–413. Association forComputational Linguistics.

Dan Hendrycks and Kevin Gimpel. 2016. Gaus-sian error linear units (gelus). arXiv preprintarXiv:1606.08415.

Page 14: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

Sepp Hochreiter and Jürgen Schmidhuber. 1997.Long short-term memory. Neural computation,9(8):1735–1780.

Zhiting Hu, Zichao Yang, Xiaodan Liang, RuslanSalakhutdinov, and Eric P Xing. 2017. Towardcontrolled generation of text. In Proceedings ofthe 34th International Conference on MachineLearning-Volume 70, pages 1587–1596. JMLR.org.

Judith W Irwin. 1980. The effects of explicitnessand clause order on the comprehension of re-versible causal relationships. Reading ResearchQuarterly, pages 477–488.

Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, andAlexei A Efros. 2017. Image-to-image transla-tion with conditional adversarial networks. InProceedings of the IEEE conference on com-puter vision and pattern recognition, pages1125–1134.

Mohit Iyyer, John Wieting, Kevin Gimpel, andLuke Zettlemoyer. 2018. Adversarial examplegeneration with syntactically controlled para-phrase networks. In Proceedings of the 2018Conference of the North American Chapterof the Association for Computational Linguis-tics: Human Language Technologies, Volume 1(Long Papers), pages 1875–1885, New Orleans,Louisiana. Association for Computational Lin-guistics.

Evelyn Walker Katz and Sandor B Brent. 1968.Understanding connectives. Journal of Memoryand Language, 7(2):501.

Diederik P Kingma and Jimmy Ba. 2014. Adam:A method for stochastic optimization. arXivpreprint arXiv:1412.6980.

Diederik P Kingma and Max Welling. 2014.Auto-encoding variational bayes. In Proceed-ings of ICLR.

Ashutosh Kumar, Satwik Bhattamishra, ManikBhandari, and Partha Talukdar. 2019. Sub-modular optimization-based diverse paraphras-ing and its effectiveness in data augmentation.In Proceedings of the 2019 Conference of theNorth American Chapter of the Association forComputational Linguistics: Human Language

Technologies, Volume 1 (Long and Short Pa-pers), pages 3609–3619, Minneapolis, Min-nesota. Association for Computational Linguis-tics.

Elena T Levy. 2003. The roots of coherence in dis-course. Human Development, 46(4):169–188.

Jiwei Li, Michel Galley, Chris Brockett, Jian-feng Gao, and Bill Dolan. 2016. A diversity-promoting objective function for neural conver-sation models. In Proceedings of the 2016 Con-ference of the North American Chapter of theAssociation for Computational Linguistics: Hu-man Language Technologies, pages 110–119.

Zichao Li, Xin Jiang, Lifeng Shang, and Hang Li.2018. Paraphrase generation with deep rein-forcement learning. In Proceedings of the 2018Conference on Empirical Methods in NaturalLanguage Processing, pages 3865–3878, Brus-sels, Belgium. Association for ComputationalLinguistics.

Zichao Li, Xin Jiang, Lifeng Shang, and Qun Liu.2019. Decomposable neural paraphrase gener-ation. In Proceedings of the 57th Annual Meet-ing of the Association for Computational Lin-guistics, pages 3403–3414, Florence, Italy. As-sociation for Computational Linguistics.

Chin-Yew Lin. 2004. Rouge: A package for auto-matic evaluation of summaries. In Text summa-rization branches out, pages 74–81.

Yinhan Liu, Myle Ott, Naman Goyal, JingfeiDu, Mandar Joshi, Danqi Chen, Omer Levy,Mike Lewis, Luke Zettlemoyer, and VeselinStoyanov. 2019. Roberta: A robustly opti-mized bert pretraining approach. arXiv preprintarXiv:1907.11692.

Nitin Madnani and Bonnie J Dorr. 2010. Gen-erating phrasal and sentential paraphrases: Asurvey of data-driven methods. ComputationalLinguistics, 36(3):341–387.

Christopher D. Manning, Mihai Surdeanu, JohnBauer, Jenny Finkel, Steven J. Bethard, andDavid McClosky. 2014. The Stanford CoreNLPnatural language processing toolkit. In Associ-ation for Computational Linguistics (ACL) Sys-tem Demonstrations, pages 55–60.

Page 15: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

Kathleen R McKeown. 1983. Paraphrasing ques-tions using given and new information. Compu-tational Linguistics, 9(1):1–10.

Kishore Papineni, Salim Roukos, Todd Ward,and Wei-Jing Zhu. 2002. Bleu: a methodfor automatic evaluation of machine transla-tion. In Proceedings of the 40th Annual Meet-ing of the Association for Computational Lin-guistics, pages 311–318, Philadelphia, Penn-sylvania, USA. Association for ComputationalLinguistics.

Hao Peng, Ankur Parikh, Manaal Faruqui,Bhuwan Dhingra, and Dipanjan Das. 2019.Text generation with exemplar-based adaptivedecoding. In Proceedings of the 2019 Confer-ence of the North American Chapter of the As-sociation for Computational Linguistics: Hu-man Language Technologies, Volume 1 (Longand Short Papers), pages 2555–2565, Min-neapolis, Minnesota. Association for Computa-tional Linguistics.

Aaditya Prakash, Sadid A. Hasan, Kathy Lee,Vivek Datla, Ashequl Qadir, Joey Liu, andOladimeji Farri. 2016. Neural paraphrase gen-eration with stacked residual LSTM networks.In Proceedings of COLING 2016, the 26th In-ternational Conference on Computational Lin-guistics: Technical Papers, pages 2923–2934,Osaka, Japan. The COLING 2016 OrganizingCommittee.

Chris Quirk, Chris Brockett, and William Dolan.2004. Monolingual machine translation forparaphrase generation. In Proceedings of the2004 conference on empirical methods in natu-ral language processing, pages 142–149.

Ehud Reiter. 2018. A structured review of thevalidity of bleu. Computational Linguistics,44(3):393–401.

Abigail See, Peter J. Liu, and Christopher D. Man-ning. 2017. Get to the point: Summarizationwith pointer-generator networks. In Proceed-ings of the 55th Annual Meeting of the As-sociation for Computational Linguistics (Vol-ume 1: Long Papers), pages 1073–1083, Van-couver, Canada. Association for ComputationalLinguistics.

Rico Sennrich, Barry Haddow, and AlexandraBirch. 2016. Neural machine translation of rare

words with subword units. In Proceedings ofthe 54th Annual Meeting of the Association forComputational Linguistics (Volume 1: Long Pa-pers), pages 1715–1725, Berlin, Germany. As-sociation for Computational Linguistics.

Tianxiao Shen, Tao Lei, Regina Barzilay, andTommi Jaakkola. 2017. Style transfer fromnon-parallel text by cross-alignment. In Ad-vances in neural information processing sys-tems, pages 6830–6841.

Xing Shi, Inkit Padhi, and Kevin Knight. 2016.Does string-based neural MT learn source syn-tax? In Proceedings of the 2016 Conference onEmpirical Methods in Natural Language Pro-cessing, pages 1526–1534, Austin, Texas. As-sociation for Computational Linguistics.

Advaith Siddharthan. 2014. A survey of researchon text simplification. ITL-International Jour-nal of Applied Linguistics, 165(2):259–298.

Felix Stahlberg, Eva Hasler, Aurelien Waite, andBill Byrne. 2016. Syntactically guided neuralmachine translation. In Proceedings of the 54thAnnual Meeting of the Association for Compu-tational Linguistics (Volume 2: Short Papers),pages 299–305.

Kai Sheng Tai, Richard Socher, and Christopher DManning. 2015. Improved semantic representa-tions from tree-structured long short-term mem-ory networks. In Proceedings of the 53rd An-nual Meeting of the Association for Compu-tational Linguistics and the 7th InternationalJoint Conference on Natural Language Pro-cessing (Volume 1: Long Papers), pages 1556–1566.

Oriol Vinyals, Meire Fortunato, and NavdeepJaitly. 2015. Pointer networks. In Advances inNeural Information Processing Systems, pages2692–2700.

Oriol Vinyals and Quoc Le. 2015. A neu-ral conversational model. arXiv preprintarXiv:1506.05869.

John Wieting and Kevin Gimpel. 2018. Paranmt-50m: Pushing the limits of paraphrastic sen-tence embeddings with millions of machinetranslations. In Proceedings of the 56th An-nual Meeting of the Association for Compu-

Page 16: Syntax-guided Controlled Generation of ParaphrasesAshutosh Kumar1 Kabir Ahuja2 Raghuram Vadapalli3 Partha Talukdar1 1 Indian Institute of Science, Bangalore 2 Microsoft Research, Bangalore

tational Linguistics (Volume 1: Long Papers),pages 451–462.

Sander Wubben, Antal Van Den Bosch, andEmiel Krahmer. 2010. Paraphrase generation asmonolingual translation: Data and evaluation.In Proceedings of the 6th International Nat-ural Language Generation Conference, pages203–207. Association for Computational Lin-guistics.

Xuewen Yang, Yingru Liu, Dongliang Xie, XinWang, and Niranjan Balasubramanian. 2019.Latent part-of-speech sequences for neural ma-chine translation.

Zichao Yang, Zhiting Hu, Chris Dyer, Eric P Xing,and Taylor Berg-Kirkpatrick. 2018. Unsuper-vised text style transfer using language modelsas discriminators. In Advances in Neural Infor-mation Processing Systems, pages 7287–7298.

Kaizhong Zhang and Dennis Shasha. 1989. Sim-ple fast algorithms for the editing distance be-tween trees and related problems. SIAM journalon computing, 18(6):1245–1262.

Yuan Zhang, Jason Baldridge, and Luheng He.2019. Paws: Paraphrase adversaries from wordscrambling. In Proceedings of the 2019 Con-ference of the North American Chapter of theAssociation for Computational Linguistics: Hu-man Language Technologies, Volume 1 (Longand Short Papers), pages 1298–1308.

Shiqi Zhao, Cheng Niu, Ming Zhou, Ting Liu, andSheng Li. 2008. Combining multiple resourcesto improve smt-based paraphrasing model. Pro-ceedings of ACL-08: HLT, pages 1021–1029.