Venue: NAACL 2019

An Empirical Investigation of Global and Local Normalization for Recurrent Neural Sequence Models Using a Continuous Relaxation to Beam Search

Kartik Goyal

School of Computer Science

Carnegie Mellon University

kartikgo@cs.cmu.edu &Chris Dyer

Deepmind

cdyer@google.com &Taylor Berg-Kirkpatrick

University of California, San Diego

tberg@ucsd.edu

###### Abstract

Globally normalized neural sequence models are considered superior to their locally normalized equivalents because they may ameliorate the effects of label bias. However, when considering high-capacity neural parametrizations that condition on the whole input sequence, both model classes are theoretically equivalent in terms of the distributions they are capable of representing. Thus, the practical advantage of global normalization in the context of modern neural methods remains unclear. In this paper, we attempt to shed light on this problem through an empirical study. We extend an approach for search-aware training via a continuous relaxation of beam search (Goyal et al., 2017) in order to enable training of _globally normalized_ recurrent sequence models through simple backpropagation. We then use this technique to conduct an empirical study of the interaction between global normalization, high-capacity encoders, and search-aware optimization. We observe that in the context of inexact search, globally normalized neural models are still more effective than their locally normalized counterparts. Further, since our training approach is sensitive to warm-starting with pre-trained models, we also propose a novel initialization strategy based on self-normalization for pretraining globally normalized models. We perform analysis of our approach on two tasks: CCG supertagging and Machine Translation, and demonstrate the importance of global normalization under different conditions while using search-aware training.

## 1 Introduction

Neural encoder-decoder models have been tremendously successful at a variety of NLP tasks, such as machine translation (Sutskever et al., 2014; Bahdanau et al., 2015), parsing (Dyer et al., 2016, 2015), summarization (Rush et al., 2015), dialog generation (Serban et al., 2015), and image captioning (Xu et al., 2015). With these models, the target sequence is generated in a left-to-right step-wise manner with the predictions at every step being conditioned on the input sequence and the whole prediction history. This long-distance memory precludes exact search for the maximally scoring sequence according to the model and therefore, approximate algorithms like greedy search or beam search are necessary in practice during decoding. In this scenario, it is natural to resort to search-aware learning techniques for these models which makes the optimization objective sensitive to any potential errors that could occur due to inexact search in these models.

This work focuses on comparison between search-aware locally normalized sequence models that involve projecting the scores of items in the vocabulary onto a probability simplex at each step and globally normalized/unnormalized sequence models that involve scoring sequences without explicit normalization at each step. When conditioned on the the full input sequence and the entire prediction history, both locally normalized and globally normalized conditional models should have same expressive power under a high-capacity neural parametrization in theory, as they can both model same set of distributions over all finite length output sequences (Smith and Johnson, 2007). However, locally normalized models are constrained in how they respond to search errors during training since the scores at each decoding step must sum to one. To let a search-aware training setup have the most flexibility, abandoning this constraint may be useful for easier optimization.

In this paper, we demonstrate that the interaction between approximate inference and non-convex parameter optimization results in more robust training and better performance for models with global normalization compared to those with 

the more common locally normalized parametrization. We posit that this difference is due to _label bias_[1] arising from the interaction of approximate search and search-aware optimization in locally normalized models. A commonly understood source of label bias in _locally normalized_ sequence models is an effect of conditioning only on partial input (for example, only the history of the input) at each step during decoding [2, 30, 45]. We discus another potential source of label bias arising from approximate search with locally normalized models that may be present even with access to the full input at each step. To this end, we train search-aware globally and locally normalized models in an end-to-end (sub)-differentiable manner using a continuous relaxation to the discontinuous beam search procedure introduced by Goyal et al. goyal2017b. This approach requires initialization with a suitable globally normalized model to work in practice. Hence, we also propose an initialization strategy based upon self-normalization for pre-training globally normalized models.

We demonstrate the effect of both sources of label bias through our experiments on two common sequence tasks: CCG supertagging and machine translation. We find that label bias can be eliminated by both, using a powerful encoder, and using a globally normalized model. We observe that global normalization yields performance gains over local normalization and is able to ameliorate label bias especially in scenarios that involve a very large hypothesis space.

## 2 Recurrent Sequence Models and Effects of Normalization

We now introduce the notation that we will use in the remainder of the paper for describing locally and globally normalized neural sequence-to-sequence models. We are interested in the probability of output sequence, \({\bf y}\), conditioned on input sequence, \({\bf x}\). Let \(s({\bf x},y_{1:i-1},y_{i})\) be a non negative score of output label \(y\) at time-step \(i\) for the input \(x\) and the prediction history \(y_{1:i-1}\), let \(V\) be the label space, and let \(\mathcal{Y}_{\mathbf{x}}\) be the space of all finite sequences for \({\bf x}\).1 A neural encoder (e.g. a bidirectional LSTM) encodes information about \({\bf x}\) and a recurrent neural decoder generates the output \({\bf y}\) (typically step-by-step from left-to-right) conditioned on the encoder.

Footnote 1: For notational convenience we suppress the dependence of the score \(s\) on model parameters \(\theta\).

### Locally normalized models

Under a locally normalized model \(\mathcal{M}_{L}\), the probability of \({\bf y}\) given \({\bf x}\) is:

\[p_{\mathcal{M}_{L}}({\bf y}~{}|~{}{\bf x})=\prod_{i=1}^{n} p(y_{i}~{}|~{}{\bf x},y_{1:i-1})=\] \[\prod_{i=1}^{n} \frac{s({\bf x},y_{1:i-1},y_{i})}{Z_{L,i}({\bf x},y_{1:i-1})}\]

where \(Z_{L,i}({\bf x},y_{1:i-1})=\sum_{y\in V}s({\bf x},y_{1:i-1},y)\), is the local normalizer at each time step and \(n\) is the number of prediction steps. Since, the local normalizer is easy to compute, likelihood maximization based training is a standard approach for training these models.

### Globally normalized models

In contrast, under a globally normalized model \(\mathcal{M}_{G}\), the probability of \({\bf y}\) given \({\bf x}\) is:

\[p_{\mathcal{M}_{G}}({\bf y}~{}|~{}{\bf x})=\frac{\prod_{i=1}^{n} s({\bf x},y_{1:i-1},y_{i})}{Z_{G}({\bf x})}\]

where \(Z_{G}({\bf x})=\sum_{{\bf y}\in{\cal Y}}\prod_{i=1}^{n}s({\bf x},y_{1:i-1},y_{ i})\), is the global log-normalizer. \(Z_{G}({\bf x})\) is intractable to estimate for most problems of interest due to the large search space therefore, an exact likelihood maximization training approach is intractable for these models.

### Label Bias with partial input

It was shown in Andor et al. amdor2016; Lafferty et al. lafferty2001, locally normalized conditional models _with access to only partial input_, \(x_{1:i-1}\), at each decoding step are biased towards labeling decisions with low-entropy transition probabilities at each decoding step and, as a result, suffer from a weakened ability to revise previous decisions based upon future input observations. This phenomenon has been referred to as _label bias_, and presents itself as an arbitrary allocation of probability mass to unlikely or undesirable label sequences despite the presence of well-formed sequences in training data. Andor et al. arndor2016 prove that this class of locally normalized models that relies on the structural assumption of access to only left-to-right partial input at each step,

\[\prod_{i=1}^{n}p(y_{i}~{}|~{}{\bf x},y_{1:i-1})=\prod_{i=1}^{n}p(y_{i}~{}|~{}x_ {1:i-1},y_{1:i-1}),\] 

is strictly less expressive than its globally normalized counterpart.

However, the standard sequence-to-sequence models used most often in practice and presented in this paper actually condition the decoder on a summary representation of the _entire input sequence_, \({\bf x}\), computed by a neural encoder. Hence, depending on the power of the encoder, it is commonly thought that such models avoid this type of label bias. For these models, both locally normalized and globally normalized conditional models are equally expressive, in principle, with a sufficiently powerful encoder.

However, as we suggest in the next section and show empirically in experiments, this does not necessarily mean that both parametrizations are equally amenable to gradient-based training in practice, particularly when the search space is large and search-aware training techniques are used. We will argue that they suffer from a related, but distinct, form of bias introduced by inexact decoding.

### Search-aware training

To improve performance with inexact decoding methods (e.g. beam search), search-aware training techniques take into account the decoding procedure that will be used at test time and adjust the parameters of the model to maximize prediction accuracy under the decoder. Because of the popularity of beam search as a decoding procedure for sequence models, in this paper we focus on beam search-aware training. While many options are available, including beam-search optimization (BSO) [20], in Section 3.1 we will describe the particular search-aware training strategy we use in experiments [7], chosen for its simplicity.

### Label Bias due to approximate search

We illustrate via example how optimization of locally normalized models may suffer from a new kind of label bias when using beam search-aware training, and point to reasons why this issue might be mitigated by the use of globally normalized models. While the scores of successors of a single candidate under a locally normalized model are constrained to sum to one, scores of successors under a globally normalized model need only be positive. Intuitively, during training, this gives the globally normalized model more freedom to downweight undesirable intermediate candidates in order avoid search errors.

In the example beam search decoding problem in Figure 1, we compare the behavior of locally and globally normalized models at a single time step for a beam size of two. In this example, we assume that the score for beams in both the models is exactly the same until the step shown in Figure 1. Suppose that the lower item on the beam(X2) is correct, and thus, for more effective search, we would prefer the models scores to be such that only successors of the lower beam item are present on the beam at the next step. However, since, the scores at each step for a locally normalized model are constrained to sum to one, the upper beam item(X1) generates successors with scores comparable to those of the lower beam item. As we see in the example, due to the normalization constraint, search-aware training of the locally normalized model might find it difficult to set the parameters to prevent extension of the poorer candidate. In contrast, because the scores of a _globally normalized_ model are not constrained to sum to one, the parameters of the neural model can be set such that _all_ the successors of the bad candidate have a very low score and thus do not compete for space on the beam. This illustrates a mechanism by which search-aware training of globally normalized models in a large search spaces might

Figure 1: Illustrative example of bias arising in locally normalized models due to beam search. Red indicates the candidate that optimization should learn to discard and green indicates the candidate that should be propagated. Locally normalized models are constrained to return normalized scores for the successors of each candidate, while globally normalized models are unconstrained and can more easily learn to drop successors of the red candidate.

 

be more effective. However as discussed earlier, if we can perform _exact search_ then this _label bias_ ceases to exist because both the models have the same expressive power with a search-agnostic optimization scheme. In experiments, we will explore this trade-off empirically.

## 3 Search-aware Training for Globally Normalized Models

In order to conduct an empirical study with meaningful comparisons, we devise an extension of the relaxed beam-search based optimization proposed by Goyal et al. (2017b) that allows us to train both the search-aware globally and locally normalized models in a similar manner with the same underlying architecture.

### Continuous Relaxation to Beam Search

Following Goyal et al. (2017b), we train a beam-search aware model by optimizing a continuous surrogate approximation to a _direct loss_ objective, \(J\), defined as a function of the output of beam search and the ground truth sequence \({\bf y}^{*}\):

\[\min_{\theta}J({\bf x},\theta,{\bf y}^{*})=\min_{\theta}\ell(\textit{Beam}({ \bf x},{\cal M}(\theta)),{\bf y}^{*})\]

Here \(\ell\) is a function that computes the loss of the model's prediction produced by beam search , and \({\cal M}\) refers to the model parametrized by \(\theta\). While this objective is search-aware, it is discontinuous and difficult to optimize because beam search involves discrete _k-argmax_ operations. Therefore, Goyal et al. (2017b) propose a continuous surrogate, \(\tilde{J}\), by defining a continuous approximation (_soft-k-argmax_) of the discrete _k-argmax_ and using this to compute an approximation to a composition of the loss function and the beam search function.

The _soft-k-argmax_ procedure involves computing distances between the scores of the successors and the \(k^{th}\)-max score and using the temperature based argmax operation (Maddison et al., 2017; Jang et al., 2016; Goyal et al., 2017a) to get an output peaked on the \(k^{th}\)-max value as shown in the right panel of Figure 2. The temperature is a hyperparameter which is typically annealed toward producing low entropy distributions during optimization. As shown in the left panel of Figure 2, the _soft candidate vectors_ and the _soft backpointers_ are computed at every decoding step using this _soft-k-argmax_ operation in order to generate the embeddings and recurrent hidden states of the LSTM at each step of the _soft beam search_ procedure. With a locally decomposable loss like Hamming loss, both _soft loss_ and _soft scores_ for the relaxed procedure are iteratively computed so that the end-to-end objective computation can be described by a computation graph that is amenable to backpropagation.

Using this relaxation, point-wise convergence of the surrogate objective to the original objective can be established (\(\alpha\) is the inverse temperature):

\[\tilde{J}_{\alpha}({\bf x},\theta,{\bf y}^{*})\xrightarrow[p]{\alpha\rightarrow \infty}J({\bf x},\theta,{\bf y}^{*})\]

Goyal et al. (2017b) demonstrated empirically that optimizing the surrogate objective, \(\tilde{J}\) - which can be accomplished via simple backpropagation for decomposable losses like Hamming distance - leads to improved performance at test time.

Figure 2: **Left:** Computing LSTM hidden states at a subsequent step using continuous relaxation to beam search for beam size of 2. **Right:** Illustration of top-k-argmax. \(m_{1}\) and \(m_{2}\) are the maximum and second maximum candidate scores.

 

In experiments, for training locally normalized models, we use _log-normalized_ successor scores. However, for training globally normalized models, we will directly use _unnormalized scores_, which are \(\in{\rm R}_{+}\).

### Initialization for training globally normalized models

Goyal et al. (2017b) reported that _initialization_ with a locally normalized model pre-trained with teacher-forcing was important for their continuous beam search based approach to be stable and hence they used the locally normalized log-scores for their search-aware training model. In this work, we experimented with the unnormalized candidate successor scores and found that initializing the optimization for a globally normalized objective with a cross-entropy trained locally normalized model resulted in unstable training. This is expected because the locally normalized models are parametrized in a way such that using the scores before the softmax normalization results in a very different outcome than using scores after local normalization. For example, the locally normalized Machine Translation model in Table 1, that gives a BLEU score of \(27.62\) when decoded with beam search using locally normalized scores, results in BLEU of \(4.30\) when beam search decoding is performed with unnormalized scores. Pre-training a truly globally normalized model for initialization is not straightforward because no exact likelihood maximization techniques exist for globally normalized models as the global normalizer is intractable to compute.

Therefore, we propose a new approach to initialization for search-aware training of globally normalized models: we pre-train a locally normalized model that is parametrized like a globally normalized model. More specifically, we train a locally normalized model with its distribution over the output sequences denoted by \(p_{L}(\mathcal{Y})\) such that we can easily find a globally normalized model with a distribution \(p_{G}(\mathcal{Y})\) that matches \(p_{L}(\mathcal{Y})\). Following the notation in Section 2, for a locally normalized model, the log-probability of a sequence is:

\[\sum_{i=1}^{n}\left[\log s(\mathbf{x},y_{1:i-1},y_{i})-\log Z_{L, i}(\mathbf{x},y_{1:i-1})\right]\]

and for a globally normalized model it is:

\[\left[\sum_{i=1}^{n}\log s(\mathbf{x},y_{1:i-1},y_{i})\right]- \log Z_{G}(\mathbf{x})\]

#### 3.2.1 Self Normalization

One way to find a locally normalized model that is parametrized like a globally normalized model is to ensure that the local normalizer at each step, \(\log~{}Z_{L,i}(\mathbf{x},y_{1:i-1})\), is \(0\). With the local normalizer being zero it is straightforward to see that the log probability of a sequence under a locally normalized model can easily be interpreted as log probability of the sequence under a globally normalized model with the global log-normalizer, \(\log~{}Z_{G}(\mathbf{x})=0\). This training technique is called _self-normalization_Andreas and Klein (2015) because the resulting models' unnormalized score at each step lies on a probability simplex. A common technique for training self-normalized models is L2-regularization of local log normalizer which encourages learning a model with \(\log~{}Z=0\) and was found to be effective for learning a language model by Devlin et al. (2014)2. The L2-regularized cross entropy objective is given by:

Footnote 2: Noise Contrastive Estimation Mnih and Teh (2012); Gutmann and Hyvärinen (2010) is also an alternative to train unnormalized models but our experiments with NCE were unstable and resulted in worse models.

\[\min_{\theta}\sum_{\mathbf{x},\mathbf{y}^{*}\in\mathcal{D}}-\sum _{i=1}^{n}\log~{}p(y_{i}^{*}~{}|~{}\mathbf{x},y_{1:i-1})\] \[+\lambda\cdot(\log~{}Z_{L,i}(\mathbf{x},y_{1:i-1}))^{2}\]

In Table 1, we report the mean and variance of the local log normalizer on the two different tasks using L2-regularization (_L2_) based self normalization and no self normalization (_CE_). We observe that _L2_ models are competitive performancewise to the cross-entropy trained locally normalized models while resulting in a much smaller local log-normalizer on average. Although, we couldn't minimize \(\log~{}Z\) exactly to 0, we observe in Section 4 that this is sufficient to train a reasonable initializer for the search-aware optimization of globally normalized models. It is important to note that these approaches yield a _globally normalized_ model that is equivalent to a locally normalized model trained via teacher-forcing and hence these are only used to _warm-start_ the search-aware optimization of globally normalized models. Our search-a 

free to adjust the parameters of the models such that the final globally normalized model has a non-zero log-normalizer \(Z_{G}\) over the data.

Other possible approaches to project locally normalized models onto globally normalized models include distribution matching via knowledge distillation Hinton et al. (2015). We leave exploration of warm-starting of search aware optimization with this approach to future work.

## 4 Experiments and Empirical Analysis

To empirically analyze the interaction between label bias arising from different sources, search-aware training, and global normalization, we conducted experiments on two tasks with vastly different sizes of output space: CCG supertagging and Machine Translation. As described in the next section, the task of tagging allows us to perform controlled experiments which explicitly study the effect of amount of input information available to the decoder at each step, we analyze the scenarios in which search aware training and global normalization are expected to improve the model performance.

In all our experiments, we report results on training with standard teacher forcing optimization and self-normalization as our baselines. We report results with both search-aware locally and globally normalized models (Section 3.1) after warm starting with both cross entropy trained models and self-normalized models to study the effects of search-aware optimization and global normalization. We follow Goyal et al. (2017b) and use the decomposable Hamming loss approximation with search-aware optimization for both the tasks and decode via _soft beam search decoding_ method which involves continuous beam search with soft backpointers for the LSTM Beam search dynamics as described in Section 3, but using identifiable backpointers and labels (using MAP estimates of soft backpointers and labels) to decode.

We tune hyperparameters like learning rate and annealing schedule by observing performance on development sets for both the tasks. We performed at least three random restarts for each class and report results based on best development performance.

### CCG supertagging

We used the standard splits of CCG bank Hockenmaier and Steedman (2002) for training, development, and testing. The label space of supertags is 1,284 and the labels are correlated with each other based on their syntactic relations. The distribution of supertag labels in the training data exhibits a long tail distribution. This task is sensitive to the long range sequential decisions because it encodes rich syntactic information about the sentence. Hence, this task is ideal to analyze the effects of label bias and search effects. We perform minor preprocessing on the data similar to the pre-processing in Vaswani et al. (2016). For experiments related to search aware optimization, we report results with beam size of 5.3

Footnote 3: We observed similar results with beam size 10

#### 4.1.1 Tagging model for ablation study

We changed the standard sequence-to-sequence model to be more suitable for the tagging task. This change also lets us perform controlled experiments pertaining to the amount of input sequence information available to the decoder at each time step.

In a standard encoder-decoder model with attention, the initial hidden state of the decoder is often some function of the final encoder state so that the decoder's predictions can be conditioned on the full input. For our tagging experiments, instead of influencing the initial decoder state with the encoder, we set it to a vector of zeros. Thus the information about input for prediction is _only_ available via the attention mechanism. In addition to the change above, we also forced the model to attend to only the \(i^{th}\) input representation while predicting the \(i^{th}\) label. This is enforceable because the output length is equal to the input length and it is also a more suitable structure for a tagging model. With these changes in the decoder, we can precisely control the amount of information about the input available to the decoder at each prediction step. For example, with a unidirectional LSTM encoder, the decoder at \(i^{th}\) step

\begin{table}
\begin{tabular}{|c|l|l|l|l|l|l|} \hline  & \multicolumn{3}{c|}{Train logZ} & \multicolumn{2}{c|}{Dev logZ} & Acc/ \\ \hline \multirow{3}{*}{CCG} & \multicolumn{2}{c|}{Mean} & Var & Mean & Var & BLEU \\ \cline{2-9}  & CE & 21.08 & 9.57 & 21.96 & 9.18 & 93.3 \\ \cline{2-9}  & L2 & 0.6 & 0.29 & 0.26 & 0.08 & 91.9 \\ \cline{2-9}  & CE & 24.7 & 115.4 & 25.8 & 129.1 & 27.62 \\ \cline{2-9}  & L2 & 0.65 & 0.18 & 0.7 & 0.29 & 26.63 \\ \hline \end{tabular}
\end{table}
Table 1: Comparison of logZ between cross entropy trained models (CE) and self normalized models (L2) for CCG supertagging and Machine Translation tasks.

 

only has access to input till the \(i^{th}\) token and the prediction history:

\[p(y_{i}\mid\mathbf{x},y_{1:i-1})=p(y_{i}\mid x_{1:i},y_{1:i-1})\]

This setting lets us clearly explore the classical notion of _label bias_ arising out of access to partial input at each prediction step (Section 2.3). A bidirectional LSTM encoder, however provides access to all of the input information to the decoder at all the prediction steps.

### Machine Translation

We use the same dataset (the German-English portion of the IWSLT 2014 machine translation evaluation campaign Cetto et al. (2014)), preprocessing and data splits as Ranzato et al. (2016) for our Machine Translation experiments. The output label/vocabulary size is 32000 and unlike tagging, the length of output sequences cannot be deterministically determined from the length of the input sequence. Moreover, the output sequence does not necessarily align monotonically with the input sequence. Hence the output sequence space for MT is much larger than that for tagging and the effects of inexact search on optimization are expected to be even more apparent for MT. We use a standard LSTM-based encoder/decoder model with a standard attention mechanism Bahdanau et al. (2016) for our MT experiments. For search-aware optimization experiments, we report results with beam size 3.4

Footnote 4: We observed similar results beam size of 5.

### Results and Analysis

The results reported in Tables 2, 3 and 4 allow us to analyze the effect of interaction of label bias, inexact search and global normalization in detail.

#### 4.3.1 Label bias with partial input

First, we analyze the effect of label bias that arises from conditioning on partial input (Section 2.3) during decoding on optimization of the models. The unidirectional encoder based tagging experiments suggest that conditioning on partial input during decoding results in poor models when trained with cross entropy based methods. Interestingly, all techniques improve upon this: (i) search-aware locally and globally normalized models are able to train for accuracy directly and eliminate exposure bias that arises out of the mismatch between train-time and test-time prediction methods, and, (ii) the bidirectional tagging model which provides access to all of the input is powerful enough to learn a complex relationship between the decoder and the input representations for the search space of the CCG supertagging task and results in a much better performance.

#### 4.3.2 Initialization of search-aware training

Next, we analyze the importance of appropriate initialization of search-aware optimization with pretrained models. Across all the results in Tables 2, 3 and 4, we observe that search-aware optimization for locally normalized models always improves upon the pre-trained locally

\begin{table}
\begin{tabular}{|l|c|l|} \hline Init-scheme \(\rightarrow\) & Regular & Self-normalized \\ \hline pretrain-greedy & 26.24 & 25.42 \\ \hline pretrain-beam & 27.62 & 26.63 \\ \hline locally-normalized & **29.28** & 27.71 \\ \hline globally-normalized & 26.24 & **29.27** \\ \hline \end{tabular}
\end{table}
Table 4: **BLEU results on de-en Machine Translation.**_Regular_ and _Self-normalized_ refer to the initiation scheme for soft beam search training. _pretrain-greedy_ and _pretrain-beam_ refer to the output of decoding the initializer model. _locally normalized_ and _globally normalized_ refer to search-aware soft-beam models

\begin{table}
\begin{tabular}{|l|l|l|} \hline  & Unidirectional & Bidirectional \\ \hline pretrain-greedy & 73.12 & 91.23 \\ \hline pretrain-beam & 73.83 & 91.94 \\ \hline locally normalized & 83.35 & **92.78** \\ \hline globally normalized & **85.50** & 92.63 \\ \hline \end{tabular}
\end{table}
Table 3: **Accuracy results on CCG supertagging when initialized with a self normalized model**.

 

normalized models used for initialization. But when the search-aware optimization for globally normalized models is initialized with locally normalized CE models, the improvement is not as pronounced and in the case of MT, the performance is actually _hurt_ by the improper initialization for training globally normalized models - probably a consequence of large search space associated with MT and incompatibility between unnormalized scores for search-aware optimization and locally normalized scores of the _CE_ model used for pre-training. When the _self-normalized_ models are used for initialization, optimization for globally normalized models always improves upon the pre-trained self-normalized model. It is interesting to note that we see improvements for the globally normalized models even when \(logZ\) is not exactly reduced to \(0\) indicating that the scores used for search-aware training initially are comparable to the scores of the pre-trained self-normalized model. We also observe that self-normalized models perform slightly worse than CE-trained models but search aware training for globally normalized models improves the performance significantly.

#### 4.3.3 Search-aware training

Next, we analyze the effect of search-aware optimization on the performance of the models. Search-aware training with locally normalized models improves the performance significantly in _all_ our experiments which indicates that accounting for exposure bias and optimizing for predictive performance directly is important. We also observe that the bidirectional model for tagging is quite powerful and seems to account for both _exposure bias_ and _label bias_ to a large extent. We reckon that this may be because the greedy decoding itself is very close to _exact search_ for this well-trained tagging model over a search space that is much simpler than that associated with MT. Therefore, the impact of search-aware optimization on the bidirectional tagger is marginal. However, it is much more pronounced on the task of MT.

#### 4.3.4 Global normalization and label bias

We analyze the importance of training globally normalized models. In the specific setup for tagging with the unidirectional encoder, globally normalized models are actually _more expressive_ than the locally normalized models [1] as described in Section 2.3 and this is reflected in our experiments (table 3) with tagging. The globally normalized model (warm started with a self-normalized model) performs the best among all the models in the unidirectional tagger case which indicates that it is ameliorating something beyond exposure bias which is fixed by the search-aware locally normalized model. For MT (table 4), both globally normalized and locally normalized models are equally expressive in theory because the decoder is conditioned on the full input information at each step, but we still observe that the globally normalized model improves significantly over the self-normalized pre-trained model and the search-aware locally normalized model. This indicates that it might be ameliorating the label bias associated with inexact search (discussed in Section 2.5). As discussed in Section 3.2, the globally normalized model, when initialized with a CE trained model, performs worse because of improper initialization of the search aware training. The self-normalized model starts off 1 BLEU point worse than the CE model point but global normalization, initialized with the self-normalized model improves the performance and is competitive with the best model for MT. This suggests that a better technique for initializing the optimization for globally normalized models should be helpful in improving the performance.

#### 4.3.5 Global normalization and sentence length

In tables 5 and 6, we analyze the source of improvement from global normalization for MT. In table 5, we report the ngram overlap scores and ratio of length of the predictions to length of hypothesis for the case when the search-aware training is initialized with a self-normalized model. We observe that the globally normalized model produces longer predictions than the locally normalized model. More interestingly, it seems to have better 3 and 4-gram overlap and slightly worse unigram and bigram overlap score than the locally normalized model. These observations suggest that globally normalized models are better able to take longer range effects into account and are also cautious about predicting the _end-of-sentence_ symbol too soon. Moreover, in table 6, we observe 

that globally normalized models perform better on all the length ranges but especially so on long sentences.

## 5 Related Work

Much of the existing work on search-aware training of globally normalized neural sequence models uses some mechanism like early updates Collins and Roark (2004) that relies on explicitly tracking if the gold sequence falls off the beam and is not end-to-end continuous. Andor et al. (2016) describe a method for training globally normalized neural feedforward models, which involves optimizing a CRF-based likelihood where the normalizer is approximated by the sum of the scores of the final beam elements. They describe label bias arising out of conditioning on partial input and hence focused on the scenario in which locally normalized models can be less expressive than globally normalized models, whereas we also consider another source of label bias which might be affecting the optimization of equally expressive locally and globally normalized conditional models. Wiseman and Rush (2016) also propose a beam search based training procedure that uses unnormalized scores similar to our approach. Their models achieve good performance over CE baselines - a pattern that we observe in our results as well. In this work, we attempt to empirically analyze the factors affecting this boost in performance with end-to-end continuous search-aware training Goyal et al. (2017b) for globally normalized models.

Smith and Johnson (2007) proved that locally normalized conditional PCFGs and unnormalized conditional WCFGs are equally expressive for finite length sequences and posit that Maximum Entropy Markov Models (MEMMs) are weaker than CRFs because of the structural assumptions involved with MEMMs that result in label bias.

Recently, energy based neural structured prediction models Amos et al. (2016); Belanger and McCallum (2016); Belanger et al. (2017) were proposed that define an energy function over candidate structured output space and use gradient based optimization to form predictions making the overall optimization search aware. These models are designed to model global interactions between the output random variables without specifying strong structural assumptions.

## 6 Conclusion

We performed empirical analysis to analyze the interaction between label bias, search-aware optimization and global normalization in various scenarios. We proposed an extension to the continuous relaxation to beam search proposed by Goyal et al. (2017b) to train search-aware globally normalized models and comparable locally normalized models. We find that in the context of inexact search over large output spaces, globally normalized models are more effective than the locally normalized models in spite of them being equivalent in terms of their expressive power.

## Acknowledgement

This project is funded in part by the NSF under grant 1618044. We thank the three anonymous reviewers for their helpful feedback.

## References

* Amos et al. (2016) Brandon Amos, Lei Xu, and J Zico Kolter. 2016. Input convex neural networks. _arXiv preprint arXiv:1609.07152_.
* Andor et al. (2016) Daniel Andor, Chris Alberti, David Weiss, Aliaksei Severyn, Alessandro Presta, Kuzman Ganchev, Slav Petrov, and Michael Collins. 2016. Globally normalized transition-based neural networks. In _Association for Computational Linguistics_.
* Andreas and Klein (2015) Jacob Andreas and Dan Klein. 2015. When and why are log-linear models self-normalizing? In _Proceedings of the 2015 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies_, pages 244-249.
* Barthelemy et al. (2013)

\begin{table}
\begin{tabular}{|l|c|c|c|c|} \hline Src sent-length \(\rightarrow\) & **0-20** & **20-30** & **30-40** & **40+** \\ \hline pretrain-beam & 29.36 & 25.73 & 24.71 & 24.50 \\ \hline locally-normalized & 32.35 & 26.95 & 25.39 & 25.2 \\ \hline globally-normalized & 33.21 & 28.08 & 26.75 & 26.41 \\ \hline \end{tabular}
\end{table}
Table 6: **BLEU scores with different length inputs on dev set** Reported on Self-normalized initialization. The header specifies the range of length of the input sentences

\begin{table}
\begin{tabular}{|p{113.8pt}|p{113.8pt}|p{113.8pt}|} \hline  & N-gram overlap & Length ratio \\ \hline pretrain-beam & 63.5/35.7/21.8/13.7 & 0.931 \\ \hline locally-normalized & 66.9/39.4/22.7/14.0 & 0.918 \\ \hline globally-normalized & 65.0/39.1/23.2/14.7 & 0.959 \\ \hline \end{tabular}
\end{table}
Table 5: **Breakdown of BLEU results on de-en Machine Translation dev set.** Reported on Self-normalized initialization 

Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. 2015. Neural machine translation by jointly learning to align and translate. In _International Conference on Learning Representations_.
* Bahdanau et al. (2016) Dzmitry Bahdanau, Dmiriy Serdyuk, Philemon Brakel, Nan Rosemary Ke, Jan Chorowski, Aaron Courville, and Yoshua Bengio. 2016. Task loss estimation for structured prediction.
* Belanger and McCallum (2016) David Belanger and Andrew McCallum. 2016. Structured prediction energy networks. In _International Conference on Machine Learning_, pages 983-992.
* Belanger et al. (2017) David Belanger, Bishan Yang, and Andrew McCallum. 2017. End-to-end learning for structured prediction energy networks. _arXiv preprint arXiv:1703.05667_.
* Bottou (1991) Leon Bottou. 1991. _Une Approche theorique de l'Apprentissage Connexionniste: Applications a la Reconnaissance de la Parole_. Ph.D. thesis, Universite de Paris XI, Orsay, France.
* Cettolo et al. (2014) Mauro Cettolo, Jan Niehues, Sebastian Stuker, Luisa Bentivogli, and Marcello Federico. 2014. Report on the 11th iwslt evaluation campaign, iswl 2014. In _Proceedings of the International Workshop on Spoken Language Translation, Hanoi, Vietnam_.
* Collins and Roark (2004) Michael Collins and Brian Roark. 2004. Incremental parsing with the perceptron algorithm. In _Proceedings of the 42nd Annual Meeting on Association for Computational Linguistics_, page 111. Association for Computational Linguistics.
* Devlin et al. (2014) Jacob Devlin, Rabih Zbib, Zhongqiang Huang, Thomas Lamar, Richard Schwartz, and John Makhoul. 2014. Fast and robust neural network joint models for statistical machine translation. In _Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)_, volume 1, pages 1370-1380.
* Dyer et al. (2015) Chris Dyer, Miguel Ballesteros, Wang Ling, Austin Matthews, and Noah A Smith. 2015. Transition-based dependency parsing with stack long short-term memory. _arXiv preprint arXiv:1505.08075_.
* Dyer et al. (2016) Chris Dyer, Adhiguna Kuncoro, Miguel Ballesteros, and Noah A Smith. 2016. Recurrent neural network grammars. _arXiv preprint arXiv:1602.07776_.
* Goyal et al. (2017a) Kartik Goyal, Chris Dyer, and Taylor Berg-Kirkpatrick. 2017a. Differentiable scheduled sampling for credit assignment. _arXiv preprint arXiv:1704.06970_.
* Goyal et al. (2017b) Kartik Goyal, Graham Neubig, Chris Dyer, and Taylor Berg-Kirkpatrick. 2017b. A continuous relaxation of beam search for end-to-end training of neural sequence models. _arXiv preprint arXiv:1708.00111_.
* Gutmann and Hyvarinen (2010) Michael Gutmann and Aapo Hyvarinen. 2010. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In _Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics_, pages 297-304.
* Hinton et al. (2015) Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. 2015. Distilling the knowledge in a neural network. _arXiv preprint arXiv:1503.02531_.
* Hockenmaier and Steedman (2002) Julia Hockenmaier and Mark Steedman. 2002. Acquiring compact lexicalized grammars from a cleaner treebank. In _LREC_.
* Jang et al. (2016) Eric Jang, Shixiang Gu, and Ben Poole. 2016. Categorical reparameterization with gumbel-softmax. In _International Conference on Learning Representations_.
* Lafferty et al. (2001) John Lafferty, Andrew McCallum, and Fernando CN Pereira. 2001. Conditional random fields: Probabilistic models for segmenting and labeling sequence data.
* Maddison et al. (2017) Chris J Maddison, Andriy Mnih, and Yee Whye Teh. 2017. The concrete distribution: A continuous relaxation of discrete random variables. In _International Conference on Learning Representations_.
* Mnih and Teh (2012) Andriy Mnih and Yee Whye Teh. 2012. A fast and simple algorithm for training neural probabilistic language models. _arXiv preprint arXiv:1206.6426_.
* Ranzato et al. (2016) Marc'Aurelio Ranzato, Sumit Chopra, Michael Auli, and Wojciech Zaremba. 2016. Sequence level training with recurrent neural networks. In _International Conference on Learning Representations_.
* Rush et al. (2015) Alexander M Rush, Sumit Chopra, and Jason Weston. 2015. A neural attention model for abstractive sentence summarization. In _Empirical Methods in Natural Language Processing_.
* Serban et al. (2015) Iulian V Serban, Alessandro Sordoni, Yoshua Bengio, Aaron Courville, and Joelle Pineau. 2015. Building end-to-end dialogue systems using generative hierarchical neural network models. In _AAAI'16 Proceedings of the Thirtieth AAAI Conference on Artificial Intelligence_.
* Smith and Johnson (2007) Noah A Smith and Mark Johnson. 2007. Weighted and probabilistic context-free grammars are equally expressive. _Computational Linguistics_, 33(4):477-491.
* Sutskever et al. (2014) Ilya Sutskever, Oriol Vinyals, and Quoc V Le. 2014. Sequence to sequence learning with neural networks. In _Advances in neural information processing systems_, pages 3104-3112.
* Vaswani et al. (2016) Ashish Vaswani, Yonatan Bisk, Kenji Sagae, and Ryan Musa. 2016. Supertagging with lstms. In _Proceedings of NAACL-HLT_, pages 232-237.
* Wiseman and Rush (2016) Sam Wiseman and Alexander M Rush. 2016. Sequence-to-sequence learning as beam-search optimization. In _Empirical Methods in Natural Language Processing_.
* Xu et al. (2015) Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron C Courville, Ruslan Salakhutdinov, Richard S Zemel, and Yoshua Bengio. 2015. Show, attend and tell: Neural image caption generation with visual attention. In _ICML_, volume 14, pages 77-81