12
Unsupervised Recurrent Neural Network Grammars Yoon Kim Alexander M. Rush Lei Yu Adhiguna Kuncoro ,Chris Dyer abor Melis Harvard University University of Oxford DeepMind {yoonkim,srush}@seas.harvard.edu {leiyu,akuncoro,cdyer,melisgl}@google.com Abstract Recurrent neural network grammars (RNNG) are generative models of language which jointly model syntax and surface structure by incrementally generating a syntax tree and sentence in a top-down, left-to-right order. Supervised RNNGs achieve strong language modeling and parsing performance, but re- quire an annotated corpus of parse trees. In this work, we experiment with unsupervised learning of RNNGs. Since directly marginal- izing over the space of latent trees is in- tractable, we instead apply amortized varia- tional inference. To maximize the evidence lower bound, we develop an inference net- work parameterized as a neural CRF con- stituency parser. On language modeling, unsu- pervised RNNGs perform as well their super- vised counterparts on benchmarks in English and Chinese. On constituency grammar in- duction, they are competitive with recent neu- ral language models that induce tree structures from words through attention mechanisms. 1 Introduction Recurrent neural network grammars (RNNGs) (Dyer et al., 2016) model sentences by first gen- erating a nested, hierarchical syntactic structure which is used to construct a context representation to be conditioned upon for upcoming words. Su- pervised RNNGs have been shown to outperform standard sequential language models, achieve ex- cellent results on parsing (Dyer et al., 2016; Kun- coro et al., 2017), better encode syntactic proper- ties of language (Kuncoro et al., 2018), and cor- relate with electrophysiological responses in the human brain (Hale et al., 2018). However, these all require annotated syntactic trees for training. In this work, we explore unsupervised learning of recurrent neural network grammars for language modeling and grammar induction. Work done while the first author was an intern at DeepMind. Code available at https://github.com/harvardnlp/urnng The standard setup for unsupervised structure learning is to define a generative model p θ (x, z) over observed data x (e.g. sentence) and unob- served structure z (e.g. parse tree, part-of-speech sequence), and maximize the log marginal like- lihood log p θ (x) = log z p θ (x, z). Success- ful approaches to unsupervised parsing have made strong conditional independence assumptions (e.g. context-freeness) and employed auxiliary objec- tives (Klein and Manning, 2002) or priors (John- son et al., 2007). These strategies imbue the learn- ing process with inductive biases that guide the model to discover meaningful structures while al- lowing tractable algorithms for marginalization; however, they come at the expense of language modeling performance, particularly compared to sequential neural models that make no indepen- dence assumptions. Like RNN language models, RNNGs make no independence assumptions. Instead they encode structural bias through operations that compose linguistic constituents. The lack of independence assumptions contributes to the strong language modeling performance of RNNGs, but make unsu- pervised learning challenging. First, marginaliza- tion is intractable. Second, the biases imposed by the RNNG are relatively weak compared to those imposed by models like PCFGs. There is little pressure for non-trivial tree structure to emerge during unsupervised RNNG (URNNG) learning. In this work, we explore a technique for han- dling intractable marginalization while also inject- ing inductive bias. Specifically we employ amor- tized variational inference (Kingma and Welling, 2014; Rezende et al., 2014; Mnih and Gregor, 2014) with a structured inference network. Varia- tional inference lets us tractably optimize a lower bound on the log marginal likelihood, while em- ploying a structured inference network encour- ages non-trivial structure. In particular, a con- arXiv:1904.03746v6 [cs.CL] 5 Aug 2019

Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

Unsupervised Recurrent Neural Network Grammars

Yoon Kim† Alexander M. Rush† Lei Yu3

Adhiguna Kuncoro‡,3 Chris Dyer3 Gabor Melis3

†Harvard University ‡University of Oxford 3DeepMind{yoonkim,srush}@seas.harvard.edu {leiyu,akuncoro,cdyer,melisgl}@google.com

AbstractRecurrent neural network grammars (RNNG)are generative models of language whichjointly model syntax and surface structure byincrementally generating a syntax tree andsentence in a top-down, left-to-right order.Supervised RNNGs achieve strong languagemodeling and parsing performance, but re-quire an annotated corpus of parse trees. Inthis work, we experiment with unsupervisedlearning of RNNGs. Since directly marginal-izing over the space of latent trees is in-tractable, we instead apply amortized varia-tional inference. To maximize the evidencelower bound, we develop an inference net-work parameterized as a neural CRF con-stituency parser. On language modeling, unsu-pervised RNNGs perform as well their super-vised counterparts on benchmarks in Englishand Chinese. On constituency grammar in-duction, they are competitive with recent neu-ral language models that induce tree structuresfrom words through attention mechanisms.

1 IntroductionRecurrent neural network grammars (RNNGs)

(Dyer et al., 2016) model sentences by first gen-erating a nested, hierarchical syntactic structurewhich is used to construct a context representationto be conditioned upon for upcoming words. Su-pervised RNNGs have been shown to outperformstandard sequential language models, achieve ex-cellent results on parsing (Dyer et al., 2016; Kun-coro et al., 2017), better encode syntactic proper-ties of language (Kuncoro et al., 2018), and cor-relate with electrophysiological responses in thehuman brain (Hale et al., 2018). However, theseall require annotated syntactic trees for training.In this work, we explore unsupervised learning ofrecurrent neural network grammars for languagemodeling and grammar induction.

Work done while the first author was an intern at DeepMind.Code available at https://github.com/harvardnlp/urnng

The standard setup for unsupervised structurelearning is to define a generative model pθ(x, z)over observed data x (e.g. sentence) and unob-served structure z (e.g. parse tree, part-of-speechsequence), and maximize the log marginal like-lihood log pθ(x) = log

∑z pθ(x, z). Success-

ful approaches to unsupervised parsing have madestrong conditional independence assumptions (e.g.context-freeness) and employed auxiliary objec-tives (Klein and Manning, 2002) or priors (John-son et al., 2007). These strategies imbue the learn-ing process with inductive biases that guide themodel to discover meaningful structures while al-lowing tractable algorithms for marginalization;however, they come at the expense of languagemodeling performance, particularly compared tosequential neural models that make no indepen-dence assumptions.

Like RNN language models, RNNGs make noindependence assumptions. Instead they encodestructural bias through operations that composelinguistic constituents. The lack of independenceassumptions contributes to the strong languagemodeling performance of RNNGs, but make unsu-pervised learning challenging. First, marginaliza-tion is intractable. Second, the biases imposed bythe RNNG are relatively weak compared to thoseimposed by models like PCFGs. There is littlepressure for non-trivial tree structure to emergeduring unsupervised RNNG (URNNG) learning.

In this work, we explore a technique for han-dling intractable marginalization while also inject-ing inductive bias. Specifically we employ amor-tized variational inference (Kingma and Welling,2014; Rezende et al., 2014; Mnih and Gregor,2014) with a structured inference network. Varia-tional inference lets us tractably optimize a lowerbound on the log marginal likelihood, while em-ploying a structured inference network encour-ages non-trivial structure. In particular, a con-

arX

iv:1

904.

0374

6v6

[cs

.CL

] 5

Aug

201

9

Page 2: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

ditional random field (CRF) constituency parser(Finkel et al., 2008; Durrett and Klein, 2015),which makes significant independence assump-tions, acts as a guide on the generative modelto learn meaningful trees through regularizing theposterior (Ganchev et al., 2010).

We experiment with URNNGs on English andChinese and observe that they perform well aslanguage models compared to their supervisedcounterparts and standard neural LMs. In termsof grammar induction, they are competitive withrecently-proposed neural architectures that dis-cover tree-like structures through gated attention(Shen et al., 2018). Our results, along with otherrecent work on joint language modeling/structurelearning with deep networks (Shen et al., 2018,2019; Wiseman et al., 2018; Kawakami et al.,2018), suggest that it is possible to learn genera-tive models of language that model the underlyingdata well (i.e. assign high likelihood to held-outdata) and at the same time induce meaningful lin-guistic structure.

2 Unsupervised Recurrent NeuralNetwork Grammars

We use x = [x1, . . . , xT ] to denote a sentence oflength T , and z ∈ ZT to denote an unlabeled bi-nary parse tree over a sequence of length T , repre-sented as a binary vector of length 2T − 1. Here0 and 1 correspond to SHIFT and REDUCE actions,explained below.1 Figure 1 presents an overviewof our approach.

2.1 Generative ModelAn RNNG defines a joint probability distribu-tion pθ(x, z) over sentences x and parse treesz. We consider a simplified version of the orig-inal RNNG (Dyer et al., 2016) by ignoring con-stituent labels and only considering binary trees.The RNNG utilizes an RNN to parameterize astack data structure (Dyer et al., 2015) of partially-completed constituents to incrementally build theparse tree while generating terminals. Using thecurrent stack representation, the model samplesan action (SHIFT or REDUCE): SHIFT generatesa terminal symbol, i.e. word, and shifts it ontothe stack,2 REDUCE pops the last two elements off

1The cardinality of ZT ⊂ {0, 1}2T−1 is given by the(T − 1)-th Catalan number, |ZT | = (2T−2)!

T !(T−1)!.

2A better name for SHIFT would be GENERATE (as inDyer et al. (2016)), but we use SHIFT to emphasize similaritywith the shift-reduce parsing.

Figure 1: Overview of our approach. The inference net-work qφ(z |x) (left) is a CRF parser which produces a dis-tribution over binary trees (shown in dotted box). Bij arerandom variables for existence of a constituent spanning i-thand j-th words, whose potentials are the output from a bidi-rectional LSTM (the global factor ensures that the distribu-tion is only over valid binary trees). The generative modelpθ(x, z) (right) is an RNNG which consists of a stack LSTM(from which actions/words are predicted) and a tree LSTM(to obtain constituent representations upon REDUCE). Train-ing involves sampling a binary tree from qφ(z |x), convertingit to a sequence of shift/reduce actions (z = [SHIFT, SHIFT,SHIFT, REDUCE, REDUCE, SHIFT, REDUCE] in the above ex-ample), and optimizing the log joint likelihood log pθ(x, z).

the stack, composes them, and shifts the composedrepresentation onto the stack.

Formally, let S = [(0,0)] be the initial stack.Each item of the stack will be a pair, where the firstelement is the hidden state of the stack LSTM, andthe second element is an input vector, describedbelow. We use top(S) to refer to the top pair inthe stack. The push and pop operations are de-fined imperatively in the usual way. At each timestep, the next action zt (SHIFT or REDUCE) is sam-pled from a Bernoulli distribution parameterizedin terms of the current stack representation. Let-ting (hprev,gprev) = top(S), we have

zt ∼ Bernoulli(pt), pt = σ(w>hprev + b).

Subsequent generation depend on zt:

• If zt = 0 (SHIFT), the model first generates aterminal symbol via sampling from a categori-cal distribution whose parameters come from anaffine transformation and a softmax,

x ∼ softmax(Whprev + b).

Then the generated terminal is shifted onto thestack using a stack LSTM,

hnext = LSTM(ex,hprev),

push(S, (hnext, ex)),

where ex is the word embedding for x.

Page 3: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

• If zt = 1 (REDUCE), we pop the last two ele-ments off the stack,

(hr,gr) = pop(S), (hl,gl) = pop(S),

and obtain a new representation that combinesthe left/right constituent representations using atree LSTM (Tai et al., 2015; Zhu et al., 2015),

gnew = TreeLSTM(gl,gr).

Note that we use gl and gr to obtain the newrepresentation instead of hl and hr.3 We thenupdate the stack using gnew,

(hprev,gprev) = top(S),

hnew = LSTM(gnew,hprev),

push(S, (hnew,gnew)).

The generation process continues until an end-of-sentence symbol is generated. The parameters θ ofthe generative model are w, b,W,b, and the pa-rameters of the stack/tree LSTMs. For a sentencex = [x1, . . . , xT ] of length T , the binary parse treeis given by the binary vector z = [z1, . . . , z2T−1].4

The joint log likelihood decomposes as a sum ofterminal/action log likelihoods,

log pθ(x, z) =T∑t=1

log pθ(xt |x<t, z<n(t))︸ ︷︷ ︸log pθ(x | z)

+

2T−1∑j=1

log pθ(zj |x<m(j), z<j)︸ ︷︷ ︸log pθ(z |x<z)

, (1)

where z<n(t) refers to all actions before generatingthe t-th word, and similarly x<m(j) refers to allwords generated before taking the j-th action. Forbrevity, from here on we will use log pθ(x | z) torefer to the first term (terminal log likelihood) andlog pθ(z |x<z) to refer to the second term (actionlog likelihood) in the above decomposition.5

3The update equations for the tree LSTM (and the stackLSTM) also involve cell states in addition to the hiddenstates. To reduce notational clutter we do not explicitly showthe cell states and instead subsume them into g. If one (orboth) of the inputs to the tree LSTM is a word embedding,the associated cell state is taken to be zero. See Tai et al.(2015) for the exact parameterization.

4As it stands, the support of z is {0, 1}2T−1, all binaryvectors of length 2T − 1. To restrict our distribution to ZT(binary vectors which describe valid trees), we constrain zt tobe valid at each time step, which amounts to deterministicallychoosing zt = 0 (SHIFT) if there are fewer than two elements(not counting the initial zero tuple) on the stack.

5The action log likelihood is the sum of log conditionalpriors, which is obviously different from the unconditionallog prior log pθ(z) = log

∑x pθ(x, z).

In the supervised case where ground-truth zis available, we can straightforwardly performgradient-based optimization to maximize the jointlog likelihood log pθ(x, z). In the unsupervisedcase, the standard approach is to maximize the logmarginal likelihood,

log pθ(x) = log∑

z′∈ZT

pθ(x, z′).

However this summation is intractable be-cause zt fully depends on all previous actions[z1, . . . , zt−1]. Even if this summation weretractable, it is not clear that meaningful latentstructures would emerge given the lack of explicitindependence assumptions in the RNNG (e.g. it isclearly not context-free). We handle these issueswith amortized variational inference.

2.2 Amortized Variational InferenceAmortized variational inference (Kingma andWelling, 2014) defines a trainable inference net-work φ that parameterizes qφ(z |x), a variationalposterior distribution, in this case over parse treesz given the sentence x. This distribution is used toform an evidence lower bound (ELBO) on the logmarginal likelihood,

ELBO(θ, φ;x) = Eqφ(z |x)[log

pθ(x, z)

qφ(z |x)

].

We maximize the ELBO with respect to bothmodel parameters θ and inference network param-eters φ. The ELBO is still intractable to calculateexactly, but this formulation will allow us to ob-tain unbiased gradient estimators based on MonteCarlo sampling.

Observe that rearranging the ELBO gives thefollowing optimization problem,

maxθ,φ

log pθ(x)−KL[qφ(z |x) ‖ pθ(z |x)].

Thus, φ is trained to match the variational poste-rior qφ(z |x) to the true posterior pθ(z |x), but θ isalso trained to match the true posterior to the vari-ational posterior. Indeed, there is some evidence tosuggest that generative models trained with amor-tized variational inference (i.e. variational autoen-coders) learn posterior distributions that are closeto the variational family (Cremer et al., 2018).

We can use this to our advantage with an in-ference network that injects inductive bias. Wepropose to do this by using a context-free modelfor the inference network, in particular, a neuralCRF parser (Durrett and Klein, 2015). This choice

Page 4: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

can seen as a form of posterior regularization thatlimits posterior flexibility of the overly powerfulRNNG generative model.6,7

The parameterization of span scores is similar torecent works (Wang and Chang, 2016; Stern et al.,2017; Kitaev and Klein, 2018): we add positionembeddings to word embeddings and run a bidi-rectional LSTM over the input representations toobtain the forward [

−→h 1, . . . ,

−→h T ] and backward

[←−h 1, . . . ,

←−h T ] hidden states. The score sij ∈ R

for a constituent spanning xi to xj is given by,

sij = MLP([−→h j+1 −

−→h i;←−h i−1 −

←−h j ]).

Letting B be the binary matrix representation of atree (Bij = 1 means there is a constituent span-ning xi and xj), the CRF parser defines a distri-bution over binary trees via the Gibbs distribution,

qφ(B |x) =1

ZT (x)exp

(∑i≤j

Bijsij

),

where ZT (x) is the partition function,

ZT (x) =∑

B′∈BT

exp(∑i≤j

B′ijsij

),

and φ denotes the parameters of the inference net-work (i.e. the bidirectional LSTM and the MLP).Calculating ZT (x) requires a summation over anexponentially-sized set BT ⊂ {0, 1}T×T , the setof all binary trees over a length T sequence. How-ever we can perform the summation in O(T 3) us-ing the inside algorithm (Baker, 1979), shown in

6While it has a similar goal, this formulation differs thefrom posterior regularization as formulated by Ganchev et al.(2010), which constrains the distributional family via linearconstraints on posterior expectations. In our case, the condi-tional independence assumptions in the CRF lead to a curvedexponential family where the vector of natural parameters hasfewer dimensions than the vector of sufficient statistics of thefull exponential family. This curved exponential family is asubset of the marginal polytope of the full exponential fam-ily, but it is an intersection of both linear and nonlinear man-ifolds, and therefore cannot be characterized through linearconstraints over posterior expectations.

7In preliminary experiments, we also attempted to learnlatent trees with a transition-based parser (which does notmake explicit independence assumptions) that looks at the en-tire sentence. However we found that under this setup, the in-ference network degenerated into a local minimum wherebyit always generated left-branching trees despite various opti-mization strategies. Williams et al. (2018) observe a similarphenomenon in the context of learning latent trees for classi-fication tasks. However Li et al. (2019) find that it is possibleuse a transition-based parser as the inference network for de-pendency grammar induction, if the inference network is con-strained via posterior regularization (Ganchev et al., 2010)based on universal syntactic rules (Naseem et al., 2010).

Algorithm 1 Inside algorithm for calculating ZT (x)

1: procedure INSIDE(s) . scores sij for i ≤ j2: for i := 1 to T do . length-1 spans3: β[i, i] = exp(sii)

4: for ` := 1 to T − 1 do . span length5: for i := 1 to T − ` do . span start6: j = i+ ` . span end7: β[i, j] =

∑j−1k=i exp(sij) · β[i, k] · β[k + 1, j]

8: return β[1, T ] . return partition function ZT (x)

Algorithm 1. This computation is itself differen-tiable and amenable to gradient-based optimiza-tion. Finally, letting f : BT → ZT be the bijec-tion between the binary tree matrix representationand a sequence of SHIFT/REDUCE actions, the in-ference network defines a distribution over ZT viaqφ(z |x) , qφ(f

−1(z) |x).2.3 OptimizationFor optimization, we use the following variant ofthe ELBO,

Eqφ(z |x)[log pθ(x, z)] +H[qφ(z |x)],

where H[qφ(z |x)] = Eqφ(z |x)[− log qφ(z |x)] isthe entropy of the variational posterior. A MonteCarlo estimate for the gradient with respect to θ is

∇θ ELBO(θ, φ;x) ≈ 1

K

K∑k=1

∇θ log pθ(x, z(k)),

with samples z(1), . . . , z(K) from qφ(z |x). Sam-pling uses the intermediate values calculated dur-ing the inside algorithm to sample split points re-cursively (Goodman, 1998; Finkel et al., 2006),as shown in Algorithm 2. The gradient with re-spect to φ involves two parts. The entropy termH[qφ(z |x)] can be calculated exactly in O(T 3),again using the intermediate values from the in-side algorithm (see Algorithm 3).8 Since eachstep of this dynamic program is differentiable, wecan obtain the gradient ∇φH[qφ(z |x)] using au-tomatic differentation.9 An estimator for the gra-dient with respect to Eqφ(z |x)[log pθ(x, z)] is ob-tained via the score function gradient estimator(Glynn, 1987; Williams, 1992),∇φEqφ(z |x)[log pθ(x, z)]

= Eqφ(z |x)[log pθ(x, z)∇φ log qφ(z |x)]

≈ 1

K

K∑k=1

log pθ(x, z(k))∇φ log qφ(z(k) |x).

8We adapt the algorithm for calculating tree entropy inPCFGs from Hwa (2000) to the CRF case.

9∇φH[qφ(z |x)] can also be computed using the inside-outside algorithm and a second-order expectation semir-ing (Li and Eisner, 2009), which has the same asymptoticruntime complexity but generally better constants.

Page 5: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

Algorithm 2 Top-down sampling a tree from qφ(z |x)1: procedure SAMPLE(β) . β from running INSIDE(s)2: B = 0 . binary matrix representation of tree3: Q = [(1, T )] . queue of constituents4: while Q is not empty do5: (i, j) = pop(Q)

6: τ =∑j−1k=i β[i, k] · β[k + 1, j]

7: for k := i to j − 1 do . get distribution over splits8: wk = (β[i, k] · β[k + 1, j])/τ

9: k ∼ Cat([wi, . . . , wj−1]) . sample a split point10: Bi,k = 1, Bk+1,j = 1 . update B11: if k > i then . if left child has width > 112: push(Q, (i, k)) . add to queue13: if k + 1 < j then . if right child has width > 114: push(Q, (k + 1, j)) . add to queue15: z = f(B) . f : BT → ZT maps matrix represen-

tation of tree to sequence of actions.16: return z

The above estimator is unbiased but typically suf-fers from high variance. To reduce variance, weuse a control variate derived from an average ofthe other samples’ joint likelihoods (Mnih andRezende, 2016), yielding the following estimator,

1

K

K∑k=1

(log pθ(x, z(k))− r(k))∇φ log qφ(z(k) |x),

where r(k) = 1K−1

∑j 6=k log pθ(x, z

(j)). Thiscontrol variate worked better than alternativessuch as estimates of baselines from an auxiliarynetwork (Mnih and Gregor, 2014; Deng et al.,2018) or a language model (Yin et al., 2018).

3 Experimental Setup3.1 DataFor English we use the Penn Treebank (Marcuset al., 1993, PTB) with splits and preprocessingfrom Dyer et al. (2016) which retains punctu-ation and replaces singleton words with Berke-ley parser’s mapping rules, resulting in a vocab-ulary of 23,815 word types.10 Notably this ismuch larger than the standard PTB LM setup fromMikolov et al. (2010) which uses 10K types.11

Also different from the LM setup, we model eachsentence separately instead of carrying informa-tion across sentence boundaries, as the RNNG isa generative model of sentences. Hence our per-plexity numbers are not comparable to the PTBLM results (Melis et al., 2018; Merity et al., 2018;Yang et al., 2018).

Since the PTB is rather small, and since theURNNG does not require annotation, we also testour approach on a subset of the one billion word

10https://github.com/clab/rnng11Both versions of the PTB data can be obtained from http:

//demo.clab.cs.cmu.edu/cdyer/ptb-lm.tar.gz.

Algorithm 3 Calculating the tree entropy H[qφ(z |x)]1: procedure ENTROPY(β) . β from running INSIDE(s)2: for i := 1 to T do . initialize entropy table3: H[i, i] = 0

4: for l := 1 to T − 1 do . span length5: for i := 1 to T − l do . span start6: j = i+ l . span end7: τ =

∑j−1u=i β[i, u] · β[u+ 1, j]

8: for u := i to j − 1 do9: wu = (β[i, u] · β[u+ 1, j])/τ

10: H[i, j] =∑j−1u=i(H[i, u] +H[u+ 1, j]

11: − logwu) · wu12: return H[1, T ] . return tree entropy H[qφ(z |x)]

corpus (Chelba et al., 2013). We randomly sam-ple 1M sentences for training and 2K sentencesfor validation/test, and limit the vocabulary to 30Kword types. While still a subset of the full corpus(which has 30M sentences), this dataset is two or-ders of magnitude larger than PTB. Experimentson Chinese utilize version 5.1 of the Chinese PennTreebank (CTB) (Xue et al., 2005), with the samesplits as in Chen and Manning (2014). Singletonwords are replaced with a single 〈UNK〉 token, re-sulting in a vocabulary of 17,489 word types.

3.2 Training and HyperparametersThe stack LSTM has two layers with input/hiddensize equal to 650 and dropout of 0.5. The treeLSTM also has 650 units. The inference networkuses a one-layer bidirectional LSTM with 256 hid-den units, and the MLP (to produce span scoressij for i ≤ j) has a single hidden layer with aReLU nonlinearity followed by layer normaliza-tion (Ba et al., 2016) and dropout of 0.5. We shareword embeddings between the generative modeland the inference network, and also tie weightsbetween the input/output word embeddings (Pressand Wolf, 2016).

Optimization of the model itself required stan-dard techniques for avoiding posterior collapse inVAEs.12 We warm-up the ELBO objective bylinearly annealing (per batch) the weight on theconditional prior log pθ(z |x<z) and the entropyH[qφ(z |x)] from 0 to 1 over the first two epochs(see equation (1) for definition of log pθ(z |x<z)).This is analogous to KL-annealing in VAEs withcontinuous latent variables (Bowman et al., 2016;Sønderby et al., 2016). We train for 18 epochs(enough for convergence for all models) with abatch size of 16 and K = 8 samples for the MonteCarlo gradient estimators. The generative model isoptimized with SGD with learning rate equal to 1,

12Posterior collapse in our context means that qφ(z |x) al-ways produced trivial (always left or right branching) trees.

Page 6: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

except for the affine layer that produces a distribu-tion over the actions, which has learning rate 0.1.Gradients of the generative model are clipped at5. The inference network is optimized with Adam(Kingma and Ba, 2015) with learning rate 0.0001,β1 = 0.9, β2 = 0.999, and gradient clipping at1. As Adam converges significantly faster thanSGD (even with a much lower learning rate), westop training the inference network after the firsttwo epochs. Initial model parameters are sampledfrom U [−0.1, 0.1]. The learning rate starts decay-ing by a factor of 2 each epoch after the first epochat which validation performance does not improve,but this learning rate decay is not triggered forthe first eight epochs to ensure adequate training.We use the same hyperparameters/training setupfor both PTB and CTB. For experiments on (thesubset of) the one billion word corpus, we use asmaller dropout rate of 0.1. The baseline RNNLMalso uses the smaller dropout rate.

All models are trained with an end-of-sentencetoken, but for perplexity calculation these tokensare not counted to be comparable to prior work(Dyer et al., 2016; Kuncoro et al., 2017; Buys andBlunsom, 2018). To be more precise, the inferencenetwork does not make use of the end-of-sentencetoken to produce parse trees, but the generativemodel is trained to generate the end-of-sentencetoken after the final REDUCE operation.

3.3 BaselinesWe compare the unsupervised RNNG (URNNG)against several baselines: (1) RNNLM, a standardRNN language model whose size is the same asURNNG’s stack LSTM; (2) Parsing Reading Pre-dict Network (PRPN) (Shen et al., 2018), a neu-ral language model that uses gated attention lay-ers to embed soft tree-like structures into a neu-ral network (and among the current state-of-the-artin grammar induction from words on the full cor-pus); (3) RNNG with trivial trees (left branching,right branching, random); (4) supervised RNNGtrained on unlabeled, binarized gold trees.13 Notethat the supervised RNNG also trains a discrim-inative parser qφ(z |x) (alongside the generativemodel pθ(x, z)) in order to sample parse forestsfor perplexity evaluation (i.e. importance sam-pling). This discriminative parser has the same ar-

13We use right branching binarization—Matsuzaki et al.(2005) find that differences between various binarizationschemes have marginal impact. Our supervised RNNGtherefore differs the original RNNG, which trains on non-binarized trees and does not ignore constituent labels.

PTB CTBModel PPL F1 PPL F1

RNNLM 93.2 – 201.3 –PRPN (default) 126.2 32.9 290.9 32.9PRPN (tuned) 96.7 41.2 216.0 36.1Left Branching Trees 100.9 10.3 223.6 12.4Right Branching Trees 93.3 34.8 203.5 20.6Random Trees 113.2 17.0 209.1 17.4URNNG 90.6 40.7 195.7 29.1

RNNG 88.7 68.1 193.1 52.3RNNG→ URNNG 85.9 67.7 181.1 51.9

Oracle Binary Trees – 82.5 – 88.6

Table 1: Language modeling perplexity (PPL) and grammarinduction F1 scores on English (PTB) and Chinese (CTB) forthe different models. We separate results for those that makedo not make use of annotated data (top) versus those thatdo (mid). Note that our PTB setup from Dyer et al. (2016)differs considerably from the usual language modeling setup(Mikolov et al., 2010) since we model each sentence inde-pendently and use a much larger vocabulary (see §3.1).

chitecture as URNNG’s inference network. For allmodels, we perform early stopping based on vali-dation perplexity.

4 Results and Discussion4.1 Language ModelingTable 1 shows perplexity for the different modelson PTB/CTB. As a language model URNNG out-performs an RNNLM and is competitive with thesupervised RNNG.14 The left branching baselineperforms poorly, implying that the strong perfor-mance of URNNG/RNNG is not simply due tothe additional depth afforded by the tree LSTMcomposition function (a left branching tree, whichalways performs REDUCE when possible, is the“deepest” model). The right branching baselineis essentially equivalent to an RNNLM and henceperforms similarly. We found PRPN with de-fault hyperparameters (which obtains a perplex-ity of 62.0 in the PTB setup from Mikolov et al.(2010)) to not perform well, but tuning hyperpa-rameters improves performance.15 The supervisedRNNG performs well as a language model, despitebeing trained on the joint (rather than marginal)likelihood objective.16 This indicates that explicit

14For RNNG and URNNG we estimate the logmarginal likelihood (and hence, perplexity) withK = 1000 importance-weighted samples, log pθ(x) ≈log(

1K

∑Kk=1

log p(x,z(k))

qφ(z(k) |x)

). During evaluation only, we

also flatten qφ(z |x) by dividing span scores sij by atemperature term 2.0 before feeding it to the CRF.

15Using the code from https://github.com/yikangshen/PRPN, we tuned model size, initialization, dropout, learningrate, and use of batch normalization.

16RNNG is trained to maximize log pθ(x, z) whileURNNG is trained to maximize (a lower bound on) the lan-guage modeling objective log pθ(x).

Page 7: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

Figure 2: Perplexity of the different models grouped by sen-tence length on PTB.

modeling of syntax helps generalization even withrichly-parameterized neural models. Encouragedby these observations, we also experiment witha hybrid approach where we train a supervisedRNNG first and continue fine-tuning the model(including the inference network) on the URNNGobjective (RNNG→ URNNG in Table 1).17 Thisapproach results in nontrivial perplexity improve-ments, and suggests that it is potentially possi-ble to improve language models with supervisionon parsed data. In Figure 2 we show perplexityby sentence length. We find that a standard lan-guage model (RNNLM) is better at modeling shortsentences, but underperforms models that explic-itly take into account structure (RNNG/URNNG)when the sentence length is greater than 10. Ta-ble 2 (top) compares our results against prior workon this version of the PTB, and Table 2 (bot-tom) shows the results on a 1M sentence sub-set of the one billion word corpus, which is twoorders of magnitude larger than PTB. On thislarger dataset URNNG still improves upon theRNNLM. We also trained an RNNG (and RNNG→URNNG) on this dataset by parsing the trainingset with the self-attentive parser from Kitaev andKlein (2018).18 These models improve upon theRNNLM but not the URNNG, potentially high-lighting the limitations of using predicted trees forsupervising RNNGs.

4.2 Grammar InductionTable 1 also shows the F1 scores for grammarinduction. Note that we induce latent trees di-rectly from words on the full dataset.19 For

17We fine-tune for 10 epochs and use a smaller learningrate of 0.1 for the generative model.

18To parse the training set we use the benepar en2model from https://github.com/nikitakit/self-attentive-parser,which obtains an F1 score of 95.17 on the PTB test set.

19Past work on grammar induction usually train/evaluateon short sentences and also assume access to gold POS tags(Klein and Manning, 2002; Smith and Eisner, 2004; Bod,2006). However more recent works train directly on words(Jin et al., 2018; Shen et al., 2018; Drozdov et al., 2019).

PTB PPL

KN 5-gram (Dyer et al., 2016) 169.3RNNLM (Dyer et al., 2016) 113.4Original RNNG (Dyer et al., 2016) 102.4Stack-only RNNG (Kuncoro et al., 2017) 101.2Gated-Attention RNNG (Kuncoro et al., 2017) 100.9Generative Dep. Parser (Buys and Blunsom, 2015) 138.6RNNLM (Buys and Blunsom, 2018) 100.7Sup. Syntactic NLM (Buys and Blunsom, 2018) 107.6Unsup. Syntactic NLM (Buys and Blunsom, 2018) 125.2PRPN† (Shen et al., 2018) 96.7This work:

RNNLM 93.2URNNG 90.6RNNG 88.7RNNG→ URNNG 85.9

1M Sentences PPL

PRPN† (Shen et al., 2018) 77.7RNNLM 77.4URNNG 71.8RNNG‡ 72.9RNNG‡→ URNNG 72.0

Table 2: (Top) Comparison of this work as a language modelagainst prior works on sentence-level PTB with preprocess-ing from Dyer et al. (2016). Note that previous versionsof RNNG differ from ours in terms of parameterization andmodel size. (Bottom) Results on a subset (1M sentences)of the one billion word corpus. PRPN† is the model fromShen et al. (2018), whose hyperparameters were tuned byus. RNNG‡ is trained on predicted parse trees from the self-attentive parser from Kitaev and Klein (2018).

RNNG/URNNG we obtain the highest scoringtree from qφ(z |x) through the Viterbi inside(i.e. CKY) algorithm.20 We calculate unla-beled F1 using evalb, which ignores punctua-tion and discards trivial spans (width-one and sen-tence spans).21 Since we compare F1 against theoriginal, non-binarized trees (per convention), F1

scores of models using oracle binarized trees con-stitute the upper bounds.

We confirm the replication study of Htut et al.(2018) and find that PRPN is a strong model forgrammar induction. URNNG performs on parwith PRPN on English but PRPN does better onChinese; both outperform right branching base-

20Alternatively, we could estimate argmaxz pθ(z |x) bysampling parse trees from qφ(z |x) and using pθ(x, z) torerank the output, as in Dyer et al. (2016).

21Available at https://nlp.cs.nyu.edu/evalb/. We evaluatewith COLLINS.prm parameter file and LABELED optionequal to 0. We observe that the setup for grammar inductionvaries widely across different papers: lexicalized vs. unlex-icalized; use of punctuation vs. not; separation of train/testsets; counting sentence-level spans for evaluation vs. ig-noring them; use of additional data; length cutoff for train-ing/evaluation; corpus-level F1 vs. sentence-level F1; and,more. In our survey of twenty or so papers, almost no twopapers were identical in their setup. Such variation makesit difficult to meaningfully compare models across papers.Hence, we report grammar induction results mainly for themodels and baselines considered in the present work.

Page 8: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

Tree PTB CTB

Gold 40.7 29.1Left 9.2 8.4Right 68.3 51.2Self 92.3 87.3RNNG 55.4 47.1PRPN 41.0 47.2

Label URNNG PRPN

SBAR 74.8% 28.9%NP 39.5% 63.9%VP 76.6% 27.3%PP 55.8% 55.1%ADJP 33.9% 42.5%ADVP 50.4% 45.1%

Table 3: (Left) F1 scores of URNNG against other trees.“Self” refers to another URNNG trained with a different ran-dom seed. (Right) Recall of constituents by label for URNNGand PRPN. Recall for a particular label is the fraction ofground truth constituents of that label that were identified bythe model (as in Htut et al. (2018)).

F1 +PP

PRPN-UP‡ 39.8 45.4PRPN-LM‡ 42.8 42.4ON-LSTM‡ (Shen et al., 2019) 49.4 −DIORA‡ (Drozdov et al., 2019) 49.6 56.2PRPN (tuned) 49.0 49.9URNNG 52.4 52.4

Table 4: PTB F1 scores using the same evaluation setupas Drozdov et al. (2019), which evaluates against binarizedtrees, counts punctuation and trivial spans, and uses sentence-level F1. +PP indicates a post-processing heuristic which di-rectly attaches trailing punctuation to the root. This does notchange URNNG results since it learns to do so anyway. Re-sults with ‡ are copied from Table 1 of Drozdov et al. (2019).

lines. Table 3 further analyzes the learned treesand shows the F1 score of URNNG trees againstother trees (left), and the recall of URNNG/PRPNtrees against ground truth constituents (right). Wefind that trees induced by URNNG and PRPNare quite different; URNNG is more sensitive toSBAR and VP, while PRPN is better at identifyingNP. While left as future work, this naturally sug-gests a hybrid approach wherein the intersectionof constituents from URNNG and PRPN is used tocreate a corpus of partially annotated trees, whichcan be used to guide another model, e.g. via poste-rior regularization (Ganchev et al., 2010) or semi-supervision (Hwa, 1999). Finally, Table 4 com-pares our results using the same evaluation setupas in Drozdov et al. (2019), which differs consid-erably from our setup.

4.3 Distributional MetricsTable 5 shows some standard metrics relatedto the learned generative model/inference net-work. The “reconstruction” perplexity based onEqφ(z |x)[log pθ(x | z)] is much lower than regularperplexity, and further, the Kullback-Leibler diver-gence between the conditional prior and the varia-tional posterior, given by

Eqφ(z |x)[log

qφ(z |x)pθ(z |x<z)

],

PTB CTBRNNG URNNG RNNG URNNG

PPL 88.7 90.6 193.1 195.7Recon. PPL 74.6 73.4 183.4 151.9KL 7.10 6.13 11.11 8.91Prior Entropy 7.65 9.61 9.48 15.13Post. Entropy 1.56 2.28 6.23 5.75Unif. Entropy 26.07 26.07 30.17 30.17

Table 5: Metrics related to the generative model/inferencenetwork for RNNG/URNNG. For the supervised RNNGwe take the “inference network” to be the discriminativeparser trained alongside the generative model (see §3.3).Recon. PPL is the reconstruction perplexity based onEqφ(z |x)[log pθ(x | z)], and KL is the Kullback-Leibler di-vergence. Prior entropy is the entropy of the conditional priorpθ(z |x<z), and uniform entropy is the entropy of the uni-form distribution over all binary trees. The KL/entropy met-rics are averaged across sentences.

is highly nonzero. (See equation (1) for definitionsof log pθ(x | z) and log pθ(z |x<z)). This indi-cates that the latent space is being used in a mean-ingful way and that there is no posterior collapse(Bowman et al., 2016). As expected, the entropyof the variational posterior is much lower than theentropy of the conditional prior, but there is stillsome uncertainty in the posterior.

4.4 Syntactic EvaluationWe perform a syntactic evaluation of the differ-ent models based on the setup from Marvin andLinzen (2018): the model is given two mini-mally different sentences, one grammatical andone ungrammatical, and must identify the gram-matical sentence by assigning it higher probabil-ity.22 Table 6 shows the accuracy results. Overallthe supervised RNNG significantly outperformsthe other models, indicating opportunities for fur-ther work in unsupervised modeling. While theURNNG does slightly outperform an RNNLM,the distribution of errors made from both modelsare similar, and thus it is not clear whether the out-performance is simply due to better perplexity orlearning different structural biases.

4.5 LimitationsThere are several limitations to our approach.For one, the URNNG takes considerably moretime/memory to train than a standard languagemodel due to the O(T 3) dynamic program inthe inference network, multiple samples to obtainlow-variance gradient estimators, and dynamic

22We modify the publicly available dataset from https://github.com/BeckyMarvin/LM syneval to only keep sentencepairs that did not have any unknown words with respect to ourvocabulary, resulting in 80K sentence pairs for evaluation.Further, we train on a much smaller corpus, and hence ourresults are not directly comparable.

Page 9: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

RNNLM PRPN RNNG URNNG

PPL 93.2 96.7 88.7 90.6

Overall 62.5% 61.9% 69.3% 64.6%Subj. 63.5% 63.7% 89.4% 67.2%Obj. Rel. 62.6% 61.0% 67.6% 65.7%Refl. 60.7% 68.8% 57.3% 60.5%NPI 58.7% 39.5% 46.8% 55.0%

Table 6: Syntactic evaluation based on the setup fromMarvin and Linzen (2018). Subj. is subject-verbagreement in sentential complement, across prepositionalphrase/subjective relative clause, and VP coordination; Obj.Rel. refers to subject-verb agreement in/across an objectiverelative clause; Refl. refers to reflexive pronoun agreementwith antecedent; NPI is negative polarity items.

computation graphs that make efficient batchingnontrivial.23 The model is sensitive to hyperpa-rameters and required various optimization strate-gies (e.g. separate optimizers for the inference net-work and the generative model) to avoid posteriorcollapse. Finally, the URNNG also seemed to relyheavily on punctuation to identify constituents andwe were unable to improve upon a right-branchingbaseline when training the URNNG on a versionof PTB where punctuation is removed.24

5 Related WorkThere has been much work on incorporating treestructures into deep models for syntax-aware lan-guage modeling, both for unconditional (Emamiand Jelinek, 2005; Buys and Blunsom, 2015; Dyeret al., 2016) and conditional (Yin and Neubig,2017; Alvarez-Melis and Jaakkola, 2017; Rabi-novich et al., 2017; Aharoni and Goldberg, 2017;Eriguchi et al., 2017; Wang et al., 2018; Gu et al.,2018) cases. These approaches generally rely onannotated parse trees during training and maxi-mizes the joint likelihood of sentence-tree pairs.Prior work on combining language modeling andunsupervised tree learning typically embed soft,tree-like structures as hidden layers of a deep net-

23The main time bottleneck is the dynamic computiongraph, since the dynamic programming algorithm can bebatched (however the latter is a significant memory bottle-neck). We manually batch the SHIFT and REDUCE operationas much as possible, though recent work on auto-batching(Neubig et al., 2017) could potentially make this easier/faster.

24Many prior works that induce trees directly from wordsoften employ additional heuristics based on punctuation(Seginer, 2007; Ponvert et al., 2011; Spitkovsky et al., 2013;Parikh et al., 2014), as punctuation (e.g. comma) is usu-ally a reliable signal for start/end of constituent spans. TheURNNG still has to learn to rely on punctuation, similar torecent works such as depth-bounded PCFGs (Jin et al., 2018)and DIORA (Drozdov et al., 2019). In contrast, PRPN (Shenet al., 2018) and Ordered Neurons (Shen et al., 2019) inducetrees by directly training on corpus without punctuation. Wealso reiterate that punctuation is used during training but ig-nored during evaluation (except in Table 4).

work (Cho et al., 2014; Chung et al., 2017; Shenet al., 2018, 2019). In contrast, Buys and Blun-som (2018) make Markov assumptions and per-form exact marginalization over latent dependencytrees. Our work is also related to the recent lineof work on learning latent trees as part of a deepmodel through supervision on other tasks, typ-ically via differentiable structured hidden layers(Kim et al., 2017; Bradbury and Socher, 2017; Liuand Lapata, 2018; Tran and Bisk, 2018; Peng et al.,2018; Niculae et al., 2018; Liu et al., 2018), policygradient-based approaches (Yogatama et al., 2017;Williams et al., 2018; Havrylov et al., 2019), ordifferentiable relaxations (Choi et al., 2018; Mail-lard and Clark, 2018).

The variational approximation uses amortizedinference (Kingma and Welling, 2014; Mnih andGregor, 2014; Rezende et al., 2014), in which aninference network is used to obtain the variationalposterior for each observed x. Since our inferencenetwork is structured (i.e., a CRF), it is also re-lated to CRF autoencoders (Ammar et al., 2014)and structured VAEs (Johnson et al., 2016; Krish-nan et al., 2017), which have been used previouslyfor unsupervised (Cai et al., 2017; Drozdov et al.,2019; Li et al., 2019) and semi-supervised (Yinet al., 2018; Corro and Titov, 2019) parsing.

6 ConclusionIt is an open question as to whether explicit mod-eling of syntax significantly helps neural mod-els. Strubell et al. (2018) find that supervisingintermediate attention layers with syntactic headsimproves semantic role labeling, while Shi et al.(2018) observe that for text classification, syntac-tic trees only have marginal impact. Our work sug-gests that at least for language modeling, incorpo-rating syntax either via explicit supervision or aslatent variables does provide useful inductive bi-ases and improves performance.

Finally, in modeling child language acquisition,the complex interaction of the parser and the gram-matical knowledge being acquired is the objectof much investigation (Trueswell and Gleitman,2007); our work shows that apparently grammati-cal constraints can emerge from the interaction ofa constrained parser and a more general grammarlearner, which is an intriguing but underexploredhypothesis for explaining human linguistic biases.

AcknowledgmentsWe thank the members of the DeepMind language team forhelpful feedback. YK is supported by a Google Fellowship.AR is supported by NSF Career 1845664.

Page 10: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

ReferencesRoee Aharoni and Yoav Goldberg. 2017. Towards String-to-

Tree Neural Machine Translation. In Proceedings of ACL.

David Alvarez-Melis and Tommi S. Jaakkola. 2017. Tree-structured Decoding with Doubly-Recurrent Neural Net-works. In Proceedings of ICLR.

Waleed Ammar, Chris Dyer, and Noah A. Smith. 2014. Con-ditional Random Field Autoencoders for UnsupervisedStructured Prediction. In Proceedings of NIPS.

Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton.2016. Layer Normalization. In Proceedings of NIPS.

James K. Baker. 1979. Trainable Grammars for SpeechRecognition. In Proceedings of the Spring Conference ofthe Acoustical Society of America.

Rens Bod. 2006. An All-Subtrees Approach to UnsupervisedParsing. In Proceedings of ACL.

Samuel R. Bowman, Luke Vilnis, Oriol Vinyal, Andrew M.Dai, Rafal Jozefowicz, and Samy Bengio. 2016. Generat-ing Sentences from a Continuous Space. In Proceedingsof CoNLL.

James Bradbury and Richard Socher. 2017. Towards NeuralMachine Translation with Latent Tree Attention. In Pro-ceedings of the 2nd Workshop on Structured Prediction forNatural Language Processing.

Jan Buys and Phil Blunsom. 2015. Generative IncrementalDependency Parsing with Neural Networks. In Proceed-ings of ACL.

Jan Buys and Phil Blunsom. 2018. Neural Syntactic Gener-ative Models with Exact Marginalization. In Proceedingsof NAACL.

Jiong Cai, Yong Jiang, and Kewei Tu. 2017. CRF Autoen-coder for Unsupervised Dependency Parsing. In Proceed-ings of EMNLP.

Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge,Thorsten Brants, Phillipp Koehn, and Tony Robin-son. 2013. One Billion Word Benchmark forMeasuring Progress in Statistical Language Modeling.arXiv:1312.3005.

Danqi Chen and Christopher D. Manning. 2014. A Fast andAccurate Dependency Parser using Neural Networks. InProceedings of EMNLP.

Kyunghyun Cho, Bart van Merrienboer, Dzmitry Bahdanau,and Yoshua Bengio. 2014. On the Properties of Neu-ral Machine Translation: Encoder-Decoder Approaches.In Proceedings of Eighth Workshop on Syntax, Semanticsand Structure in Statistical Translation.

Jihun Choi, Kang Min Yoo, and Sang goo Lee. 2018. Learn-ing to Compose Task-Specific Tree Structures. In Pro-ceedings of AAAI.

Junyoung Chung, Sungjin Ahn, and Yoshua Bengio. 2017.Hierarchical Multiscale Recurrent Neural Networks. InProceedings of ICLR.

Caio Corro and Ivan Titov. 2019. Differentiable Perturb-and-Parse: Semi-Supervised Parsing with a Structured Varia-tional Autoencoder. In Proceedings of ICLR.

Chris Cremer, Xuechen Li, and David Duvenaud. 2018. In-ference Suboptimality in Variational Autoencoders. InProceedings of ICML.

Yuntian Deng, Yoon Kim, Justin Chiu, Demi Guo, andAlexander M. Rush. 2018. Latent Alignment and Varia-tional Attention. In Proceedings of NIPS.

Andrew Drozdov, Patrick Verga, Mohit Yadev, Mohit Iyyer,and Andrew McCallum. 2019. Unsupervised LatentTree Induction with Deep Inside-Outside Recursive Auto-Encoders. In Proceedings of NAACL.

Greg Durrett and Dan Klein. 2015. Neural CRF Parsing. InProceedings of ACL.

Chris Dyer, Miguel Ballesteros, Wang Ling, AustinMatthews, and Noah A. Smith. 2015. Transition-BasedDependency Parsing with Stack Long Short-Term Mem-ory. In Proceedings of ACL.

Chris Dyer, Adhiguna Kuncoro, Miguel Ballesteros, andNoah A. Smith. 2016. Recurrent Neural Network Gram-mars. In Proceedings of NAACL.

Ahmad Emami and Frederick Jelinek. 2005. A Neural Syn-tactic Language Model. Machine Learning, 60:195–227.

Akiko Eriguchi, Yoshimasa Tsuruoka, and Kyunghyun Cho.2017. Learning to Parse and Translate Improves NeuralMachine Translation. In Proceedings of ACL.

Jenny Rose Finkel, Alex Kleeman, and Christopher D. Man-ning. 2008. Efficient, Feature-based, Conditional RandomField Parsing. In Proceedings of ACL.

Jenny Rose Finkel, Christopher D. Manning, and Andrew Y.Ng. 2006. Solving the Problem of Cascading Errors: Ap-proximate Bayesian Inference for Linguistic AnnotationPipelines. In Proceedings of EMNLP.

Kuzman Ganchev, Joao Graca, Jennifer Gillenwater, and BenTaskar. 2010. Posterior Regularization for Structured La-tent Variable Models. Journal of Machine Learning Re-search, 11:2001–2049.

Peter Glynn. 1987. Likelihood Ratio Gradient Estimation:An Overview. In Proceedings of Winter Simulation Con-ference.

Joshua Goodman. 1998. Parsing Inside-Out. PhD thesis,Harvard University.

Jetic Gu, Hassan S. Shavarani, and Anoop Sarkar. 2018. Top-down Tree Structured Decoding with Syntactic Connec-tions for Neural Machine Translation and Parsing. In Pro-ceedings of EMNLP.

John Hale, Chris Dyer, Adhiguna Kuncoro, and Jonathan R.Brennan. 2018. Finding Syntax in Human Encephalogra-phy with Beam Search. In Proceedings of ACL.

Serhii Havrylov, German Kruszewski, and Armand Joulin.2019. Cooperative Learning of Disjoint Syntax and Se-mantics. In Proceedings of NAACL.

Phu Mon Htut, Kyunghyun Cho, and Samuel R. Bowman.2018. Grammar Induction with Neural Language Models:An Unusual Replication. In Proceedings of EMNLP.

Rebecca Hwa. 1999. Supervised Grammar Induction UsingTraining Data with Limited Constituent Information. InProceedings of ACL.

Page 11: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

Rebecca Hwa. 2000. Sample Selection for Statistical Gram-mar Induction. In Proceedings of EMNLP.

Lifeng Jin, Finale Doshi-Velez, Timothy Miller, WilliamSchuler, and Lane Schwartz. 2018. Unsupervised Gram-mar Induction with Depth-bounded PCFG. In Proceed-ings of TACL.

Mark Johnson, Thomas L. Griffiths, and Sharon Goldwater.2007. Bayesian Inference for PCFGs via Markov chainMonte Carlo. In Proceedings of NAACL.

Matthew Johnson, David K. Duvenaud, Alex Wiltschko,Ryan P. Adams, and Sandeep R. Datta. 2016. Compos-ing Graphical Models with Neural Networks for Struc-tured Representations and Fast Inference. In Proceedingsof NIPS.

Kazuya Kawakami, Chris Dyer, and Phil Blunsom. 2018.Unsupervised Word Discovery with Segmental NeuralLanguage Models. arXiv:1811.09353.

Yoon Kim, Carl Denton, Luong Hoang, and Alexander M.Rush. 2017. Structured Attention Networks. In Proceed-ings of ICLR.

Diederik P. Kingma and Jimmy Ba. 2015. Adam: A Methodfor Stochastic Optimization. In Proceedings of ICLR.

Diederik P. Kingma and Max Welling. 2014. Auto-EncodingVariational Bayes. In Proceedings of ICLR.

Nikita Kitaev and Dan Klein. 2018. Constituency Parsingwith a Self-Attentive Encoder. In Proceedings of ACL.

Dan Klein and Christopher Manning. 2002. A GenerativeConstituent-Context Model for Improved Grammar Induc-tion. In Proceedings of ACL.

Rahul G. Krishnan, Uri Shalit, and David Sontag. 2017.Structured Inference Networks for Nonlinear State SpaceModels. In Proceedings of AAAI.

Adhiguna Kuncoro, Miguel Ballesteros, Lingpeng Kong,Chris Dyer, Graham Neubig, and Noah A. Smith. 2017.What Do Recurrent Neural Network Grammars LearnAbout Syntax? In Proceedings of EACL.

Adhiguna Kuncoro, Chris Dyer, John Hale, Dani Yogatama,Stephen Clark, and Phil Blunsom. 2018. LSTMs CanLearn Syntax-Sensitive Dependencies Well, But Model-ing Structure Makes Them Better. In Proceedings of ACL.

Bowen Li, Jianpeng Cheng, Yang Liu, and Frank Keller.2019. Dependency Grammar Induction with a NeuralVariational Transition-based Parser. In Proceedings ofAAAI.

Zhifei Li and Jason Eisner. 2009. First- and Second-OrderExpectation Semirings with Applications to Minimum-Risk Training on Translation Forests. In Proceedings ofEMNLP.

Yang Liu, Matt Gardner, and Mirella Lapata. 2018. Struc-tured Alignment Networks for Matching Sentences. InProceedings of EMNLP.

Yang Liu and Mirella Lapata. 2018. Learning StructuredText Representations. In Proceedings of TACL.

Jean Maillard and Stephen Clark. 2018. Latent Tree Learn-ing with Differentiable Parsers: Shift-Reduce Parsing andChart Parsing. In Proceedings of the Workshop on the Rel-evance of Linguistic Structure in Neural Architectures forNLP.

Mitchell P. Marcus, Mary Ann Marcinkiewicz, and BeatriceSantorini. 1993. Building a Large Annotated Corpus ofEnglish: The Penn Treebank. Computational Linguistics,19:313–330.

Rebecca Marvin and Tal Linzen. 2018. Targeted Syntac-tic Evaluation of Language Models. In Proceedings ofEMNLP.

Takuya Matsuzaki, Yusuke Miyao, and Junichi Tsujii. 2005.Probabilistic CFG with Latent Annotations. In Proceed-ings of ACL.

Gabor Melis, Chris Dyer, and Phil Blunsom. 2018. On theState of the Art of Evaluation in Neural Language Models.In Proceedings of ICLR.

Stephen Merity, Nitish Shirish Keskar, and Richard Socher.2018. Regularizing and Optimizing LSTM LanguageModels. In Proceedings of ICLR.

Tomas Mikolov, Martin Karafiat, Lukas Burget, Jan Cer-nocky, and Sanjeev Khudanpur. 2010. Recurrent NeuralNetwork Based Language Model. In Proceedings of IN-TERSPEECH.

Andriy Mnih and Karol Gregor. 2014. Neural variational in-ference and learning in belief networks. In Proceedings ofICML.

Andriy Mnih and Danilo J. Rezende. 2016. Variational In-ference for Monte Carlo Objectives. In Proceedings ofICML.

Tahira Naseem, Harr Chen, Regina Barzilay, and Mark John-son. 2010. Using Universal Linguistic Knowledge toGuide Grammar Induction. In Proceedings of EMNLP.

Graham Neubig, Yoav Goldberg, and Chris Dyer. 2017.On-the-fly Operation Batching in Dynamic ComputationGraphs. arXiv:1705.07860.

Vlad Niculae, Andre F. T. Martins, and Claire Cardie. 2018.Towards Dynamic Computation Graphs via Sparse LatentStructure. In Proceedings of EMNLP.

Ankur P. Parikh, Shay B. Cohen, and Eric P. Xing. 2014.Spectral Unsupervised Parsing with Additive Tree Met-rics. In Proceedings of ACL.

Hao Peng, Sam Thomson, and Noah A. Smith. 2018. Back-propagating through Structured Argmax using a SPIGOT.In Proceedings of ACL.

Elis Ponvert, Jason Baldridge, and Katrin Erk. 2011. Sim-pled Unsupervised Grammar Induction from Raw Textwith Cascaded Finite State Methods. In Proceedings ofACL.

Ofir Press and Lior Wolf. 2016. Using the Output Embeddingto Improve Language Models. In Proceedings of EACL.

Maxim Rabinovich, Mitchell Stern, and Dan Klein. 2017.Abstract Syntax Networks for Code Generation and Se-mantic Parsing. In Proceedings of ACL.

Page 12: Unsupervised Recurrent Neural Network Grammars · Yoon Kim yAlexander M. Rush Lei Yu3 Adhiguna Kuncoroz; 3Chris Dyer Gabor Melis´ 3 yHarvard University zUniversity of Oxford 3DeepMind

Danilo J. Rezende, Shakir Mohamed, and Daan Wierstra.2014. Stochastic Backpropagation and Approximate In-ference in Deep Generative Models. In Proceedings ofICML.

Yoav Seginer. 2007. Fast Unsupervised Incremental Parsing.In Proceedings of ACL.

Yikang Shen, Zhouhan Lin, Chin-Wei Huang, and AaronCourville. 2018. Neural Language Modeling by JointlyLearning Syntax and Lexicon. In Proceedings of ICLR.

Yikang Shen, Shawn Tan, Alessandro Sordoni, and AaronCourville. 2019. Ordered Neurons: Integrating TreeStructures into Recurrent Neural Networks. In Proceed-ings of ICLR.

Haoyue Shi, Hao Zhou, Jiaze Chen, and Lei Li. 2018. OnTree-based Neural Sentence Modeling. In Proceedings ofEMNLP.

Noah A. Smith and Jason Eisner. 2004. Annealing Tech-niques for Unsupervised Statistical Language Learning.In Proceedings of ACL.

Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe,Søren Kaae Sønderby, and Ole Winther. 2016. LadderVariational Autoencoders. In Proceedings of NIPS.

Valentin I. Spitkovsky, Hiyan Alshawi, and Daniel Jurafsky.2013. Breaking Out of Local Optima with Count Trans-forms and Model Recombination: A Study in GrammarInduction. In Proceedings of EMNLP.

Mitchell Stern, Jacob Andreas, and Dan Klein. 2017. A Min-imal Span-Based Neural Constituency Parser. In Proceed-ings of ACL.

Emma Strubell, Patrick Verga, Daniel Andor, David Weiss,and Andrew McCallum. 2018. Linguistically-InformedSelf-Attention for Semantic Role Labeling. In Proceed-ings of EMNLP.

Kai Sheng Tai, Richard Socher, and Christopher D. Manning.2015. Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks. In Pro-ceedings of ACL.

Ke Tran and Yonatan Bisk. 2018. Inducing Grammars withand for Neural Machine Translation. In Proceedings of the2nd Workshop on Neural Machine Translation and Gener-ation.

John C. Trueswell and Lila R. Gleitman. 2007. Learning toParse and its Implications for Language Acquisition. TheOxford Handbook of Psycholinguistics.

Wenhui Wang and Baobao Chang. 2016. Graph-based De-pendency Parsing with Bidirectional LSTM. In Proceed-ings of ACL.

Xinyi Wang, Hieu Pham, Pengcheng Yin, and Graham Neu-big. 2018. A Tree-based Decoder for Neural MachineTranslation. In Proceedings of EMNLP.

Adina Williams, Andrew Drozdov, and Samuel R. Bowman.2018. Do Latent Tree Learning Models Identify Meaning-ful Structure in Sentences? In Proceedings of TACL.

Ronald J. Williams. 1992. Simple Statistical Gradient-following Algorithms for Connectionist ReinforcementLearning. Machine Learning, 8.

Sam Wiseman, Stuart M. Shieber, and Alexander M. Rush.2018. Learning Neural Templates for Text Generation. InProceedings of EMNLP.

Naiwen Xue, Fei Xia, Fu dong Chiou, and Marta Palmer.2005. The Penn Chinese Treebank: Phrase Structure An-notation of a Large Corpus. Natural Language Engineer-ing, 11:207–238.

Zhilin Yang, Zihang Dai, Ruslan Salakhutdinov, andWilliam W. Cohen. 2018. Breaking the Softmax Bottle-neck: A High-Rank RNN Language Model. In Proceed-ings of ICLR.

Pengcheng Yin and Graham Neubig. 2017. A Syntactic Neu-ral Model for General-Purpose Code Generation. In Pro-ceedings of ACL.

Pengcheng Yin, Chunting Zhou, Junxian He, and GrahamNeubig. 2018. StructVAE: Tree-structured Latent Vari-able Models for Semi-supervised Semantic Parsing. InProceedings of ACL.

Dani Yogatama, Phil Blunsom, Chris Dyer, Edward Grefen-stette, and Wang Ling. 2017. Learning to Compose Wordsinto Sentences with Reinforcement Learning. In Proceed-ings of ICLR.

Xiaodan Zhu, Parinaz Sobhani, and Hongyu Guo. 2015.Long Short-Term Memory Over Tree Structures. In Pro-ceedings of ICML.