Prior work has explored directly regularizing the output distributions of probabilistic models to alleviate peaky (i.e. over-confident) predictions, a common sign of overfitting. This class of techniques, of which label smoothing is one, has a connection to entropy regularization. Despite the consistent success of label smoothing across architectures and datasets in language generation tasks, two problems remain open: (1) there is little understanding of the underlying effects entropy regularizers have on models, and (2) the full space of entropy regularization techniques is largely unexplored. We introduce a parametric family of entropy regularizers, which includes label smoothing as a special case, and use it to gain a better understanding of the relationship between the entropy of a trained model and its performance on language generation tasks. We also find that variance in model performance can be explained largely by the resulting entropy of the model. Lastly, we find that label smoothing provably does not allow for sparse distributions, an undesirable property for language generation models, and therefore advise the use of other entropy regularization methods in its place. Our code is available online at https://github.com/ rycolab/entropyRegularization . When training large neural networks with millions of parameters, regularization of some form is needed to prevent overfitting, even when large amounts of data are used; models for language generation are no exception. In probabilistic modeling, e.g. when the final layer of the neural network is a softmax, overfitting often manifests itself in overconfident placement of most of the probability mass on a few candidates, resulting in peaky (low-entropy) probability distributions over the vocabulary. Specifically for language generation tasks, this behavior leads to the output of repetitive or frequently occurring but unrelated text, which is detrimental to the generalization abilities of the model (Chorowski and Jaitly, 2017; Holtz-man et al., 2020). A natural regularizer to consider is, therefore, one that penalizes overconfidence, encouraging higher entropy in the learned distribution. Indeed, the literature has ascribed gains of  1 BLEU point in machine translation to label smoothing, one such technique (Chen et al., 2018). Despite the clear relationship between low entropy and overfitting, only a handful of distinct entropy regularizers have been explored. To fill this gap, we introduce generalized entropy regularization (GER), a unified framework for understanding and exploring a broad range of entropy-inducing regularizers. GER is based on the skew-Jensen family of divergences J ,G (Nielsen and Boltz, 2011) and thus may be generalized to any Bregman divergence through the choice of generator function G . For the negative entropy generator function, GER recovers label smoothing (Szegedy et al., 2015) as   1 , and the confidence penalty (Pereyra et al., 2017) as   0 . We provide formal properties of GER in 3, proving these special-case equivalences among other characteristics of GER. We then use GER to examine the relationship between entropy and the evaluation metrics in two language generation tasks: neural machine translation (NMT) and abstractive summarization. GER encompasses a large family of regularizers, which allows us to directly compare label smoothing to other forms of entropy regularization. By studying the relationship between different regularizers on the performance of natural language generation (NLG) systems, we can better understand not just when but also why label smoothing aids language generation tasks. Through our analysis, we gain the following insights: (i) With tuning of the regularizer's coefficient, any choice of  can yield similar performance, i.e. there is nothing special about label smoothing. In fact, our results suggest that label smoothing (   1 ) makes it more difficult to tune the regularizer's coefficient. (ii) Label smoothing assigns infinite cost to sparse output distributions, which may be an undesirable behavior for language generation tasks. (iii) There is a strong (quadratic) relationship between a model's performance on the evaluation metric and its (average) entropy, offering a hint as to why these regularizers are so effective for NLG. In summary, entropy-inducing regularizers are a boon to probabilistic NLG systems, which bene-fit from higher entropy output distributions. Label smoothing works because it forces the model towards a higher-entropy solution, but we recommend the confidence penalty and other entropy regularizers (  < 1 ) for reasons (i) and (ii) above. In this work, we consider conditional probability models p  ( y | x ) for natural language generation; such models assign probability to a target sequence y  Y given a source sequence x . Specifically, our target sequence y = (cid:104) y 1 , . . . , y n (cid:105) of arbitrary length n is a sequence of target words 1 y i from our vocabulary Y . The set of all complete target sequences, which are padded with distinguished beginningand end-of-sentence symbols, BOS and EOS , is then defined as Y := { BOS  y  EOS | y  Y  } . For language generation tasks, p  ( y | x ) is typically a neural network with parameters  ; this network is often trained to approximate  p ( y | x ) , the empirical distribution (i.e. the distribution of the data). Here, we focus on locally normalized models; in such models p  ( y | x ) is factored as: p  ( y | x ) = p  ( y 1 | x )    p  ( y n | x , y <n ) (1) where p  ( y i | x , y <i ) is defined by a softmax over the output of the final fully connected layer of the network. Generation is performed using greedy search, beam search or a sampling scheme. Of the candidate sequences generated, the one with the highest probability under the model p  is returned as the model's prediction. One way of selecting the parameters  is to minimize the KL-divergence between the empirical 1 Targets y i may also be characters or subwords; our experiments use byte-pair encoding (Sennrich et al., 2016) distribution and the model. However, fitting a model that perfectly approximates the empirical distribution is, in general, fraught with problems (Hastie et al., 2001). The goal of learning is to generalize beyond the observed data. Exactly fitting the empirical distribution, often termed overfitting, is therefore not an ideal goal and for language generation models specifically, does not go hand-in-hand with the ability of a model to generate desirable text (Bengio et al., 2015). Consequently, it is advisable to minimize a regularized objective to prevent overfitting: L (  ) +  R (  ) (4) where R (  ) is a regularizer defined over the model with strength coefficient  > 0 . Overfitting can manifest itself as peakiness in p  (Williams and Peng, 1991; Mnih et al., 2016; Pereyra et al., 2017). In other words, p  overcon-fidently places most of the probability mass on very few candidates. While this overconfidence improves training loss, it hurts generalization. Entropy regularization is one technique that directly combats such overconfidence by encouraging more entropic (less peaky) distributions. where we remove dependence on x for notational simplicity. However, the sum in eq. (5) over Y generally renders its computation intractable. 3 Instead, regularization is performed on the conditional distribution over Y  { EOS } at each time step, which can be interpreted as an approximation of the true model entropy. For ease of notation, we define a higher-order function D f over our training corpus C consisting of (cid:104) x , y (cid:105) pairs that maps a function f 2 H( p, q ) :=  (cid:80) z Z p ( z ) log q ( z ) is cross-entropy and H( p ) := H( p, p ) =  (cid:80) z Z p ( z ) log p ( z ) is the Shannon entropy, for which log = log 2 and Z = supp( p ) . 3 The notation used by Pereyra et al. (2017) is imprecise. over distributions p, q as follows below: D f ( p || q ) = (6) (cid:88) (cid:104) x , y (cid:105)C | y | (cid:88) t =1 f ( p (  | x , y <t ) || q (  | x , y <t )) The function D f allows us to describe in notation how entropy regularization is typically employed in the training of language generation systems. 4 Label Smoothing. Label smoothing, first introduced as a regularizer for neural networks by Szegedy et al. (2015), is so named because the technique smooths hard target distributions. One such distribution, the empirical distribution, is encoded as a set of one-hot vectors (hard targets) where for each data point, the correct label (e.g., vocabulary index of a word) has value 1 and all other labels have value 0 . Label smoothing with strength coefficient  is an add smoothing scheme on the distribution over labels at every time step. Interestingly, minimizing the cross entropy between this modified distribution and the model p  is equivalent to adding the weighted KL divergence between the uniform distribution and the model p  in our original objective function with the same strength coefficient: L (  ) LS  := (1   ) L (  ) +  DKL ( u || p  ) (7) While the loss function is often scaled as above, it is nonetheless equivalent to L (  ) LS  = L (  ) +  DKL ( u || p  ) ; 5 we use this form for consistency. Confidence Penalty. The confidence penalty, empirically explored in the supervised learning setting by Pereyra et al. (2017), aims to penalize a low-entropy model. This is done by subtracting a weighted term for the entropy of the model's pre-4 Note that the standard loss function in eq. diction p  (  ) from the loss function, thereby encouraging a more entropic model. This is equivalent to adding the KL divergence between the model p  and the uniform distribution: L (  ) CP := L (  ) +  DKL ( p  || u ) (8) While Pereyra et al. (2017) found that label smoothing performed better than the confidence penalty for NMT, they only searched coarsely over a small range of  's for both regularizers. Our findings in 4 suggest an alternate conclusion. The positive effect of both label smoothing and the confidence penalty on model performance in language generation tasks motivates further exploration of entropy-promoting regularizers. To this end, we construct a parameterized family of regularizers with label smoothing and the confidence penalty as special cases. We discuss the formal properties of a subset of this family, providing upper and lower bounds for it. We show divergence only occurs in one case for this subset (   1 ), which directly implies that no sparse solution exists when label smoothing is used as a regularizer. We derive a family of regularizers from the skew-Jensen divergence J ,G (Nielsen and Boltz, 2011), which is defined below as: for a strictly convex generator function G :   R and   (0 , 1) where  is a closed convex set. In this paper, we restrict  to be the ( | Y | +1) -simplex. Note that J ,G ( q || p  ) (cid:54) = J ,G ( p  || q ) in general, although this is true for some choices of G and  . We define the generalized entropy regularizer as R (  ) = DJ ,G ( u || p  ) where u is the uniform Figure 1: Different divergence measures between u , the uniform distribution and p , a probability distribution over a Bernoulli random variable X . distribution. 6 These regularizers promote entropy because they push the model p  towards u , which is the maximum-entropy distribution with an entropy of log( | Y | +1) . Throughout the rest of this paper, we primarily use the generator function 7 G ( p ) =  H( p ) . We use J  as shorthand for J ,  H . We note J  is equivalent to quadruple the Jensen Shannon (JS) divergence and asymptotically approaches the KullbackLeibler (KL) divergence for certain values of  . Specifically, we have: lim   0 J  ( q || p  ) = KL( p  || q ) (10) lim   1 J  ( q || p  ) = KL( q || p  ) (11) J 1 / 2 ( q || p  ) = 4  JS( q || p  ) (12) We prove these relationships in App. A and App. B. For ease, we define J 1 := lim   1 J  and J 0 := lim   0 J  . We note the following two equivalences for these special cases. Proposition 1.   J 1 ( u || p  ) =   H( q, p  ) . In words, the gradient of the loss with GER as   1 is equivalent to the gradient of the loss augmented with label smoothing . Proposition 2.   J 0 ( u || p  ) =   H( p  ) . In words, the gradient of the loss with GER as   0 is equivalent to the gradient of the loss augmented with the confidence penalty . See App. C and App. D for proofs. When fitting a model p  , we generally optimize the inclusive KL , i.e. KL( p || p  ) , so that, among other reasons, p  has support everywhere that  p has support. However, it is unclear what relationships we want to encourage between the model p  and the uniform distribution u during regularization as complete support of u implies no word can ever have non-zero probability. Here we explore formal properties of J  as a regularizer to gain insight into how, as a function of  , these regularizers affect the learned distribution. Magnitude. Figure 1 shows the different divergence measures between u and p  . We see that J 1 = KL( u || p  ) (label smoothing) is much larger than J 0 = KL( p  || u ) (confidence penalty) at values of p  farther from u . This indicates that J 1 would be a stronger regularizer than J < 1 , i.e. penalize values of p  far from u more heavily, given the same strength coefficient  . Note that it is not always the case that J < 1 ( u || p )  J 1 ( u || p ) for fixed p . We can, however, bound J  from above and below by other quantities. Sparsity. Sparsity is generally a desirable trait in probabilistic models; specifically for structured prediction, it leads to improvements in performance and interpretability (Martins et al., 2011; Niculae WMT'14 De-En IWSLT'14 De-En MTTT Fr-En   H BLEU   H BLEU   H BLEU No Regularization  0 0.11 31.1  0 0.1 35.7  0 0.15 35.2 Label Smoothing DJ 1 (  =0 . 1 ) 1 0.11 0.23 31.3 +0.2 1 0.11 0.18 36.9 +1.2 1 0.11 0.18 36.5 +0.8 Label Smoothing DJ 1 1 0.35 0.38 31.7 +0.6 1 0.50 0.40 37.2 +1.5 1 0.693 0.47 37.5 +2.3 Confidence Penalty DJ 0 0 0.28 0.55 31.6 +0.5 0 0.76 0.81 37.5 +1.8 0 0.95 0.86 37.4 +2.2 GER DJ  0.7 0.65 0.47 32.0 +0.9 0.5 1.00 0.56 37.5 +1.8 0.85 0.52 0.37 37.6 +2.4 Table 2: BLEU scores and normalized entropy H( p  ) on the test sets for WMT'14 De-En, WMT'14 De-En, and MTTT Fr-En. For example, Martins and Astudillo (2016) showed the benefits of using sparsemax, which induces sparsity in an output distribution or attention layer, for natural language inference tasks. There are also intuitive reasons for allowing p  to be sparse. Part of modeling language generations tasks is learning when particular sequences cannot , or at least should not, occur (e.g. are grammatically or syntactically incorrect). In these cases, a model should be able to assign 0 probability mass to that sequence. However, there is no sparse optimal solution p  when using label smoothing as the label smoothing loss function becomes divergent if p  does not assign probability mass  y  supp ( u ) . Proposition 5. J  ( u || p ) is finite for any p   and any  < 1 . As   1 , J  ( u || p ) diverges iff  y  supp( u ) for which p ( y ) = 0 . See App. F for a proof. We evaluate our family of entropy regularizers on two language generation tasks: machine translation and abstractive summarization. We then analyze trends in model performance as a function of  and model entropy 9 and explore how this entropy affects other properties of language generation models. In the following experiments, each model is trained using eq. (4) where R (  ) = DJ  ( p || p  ) . We conduct searches over  and  using Bayesian optimization (Snoek et al., 2012) to find the combination of regularizer DJ  and strength coefficient  8 We have   1 as an exception; the standard deviation is slightly higher for larger values of  . 9 Model entropy is estimated as an average of the entropies of distributions at each time step during decoding, i.e. H( p  ) = DH ( p  ) . Entropy is normalized by the maximum possible entropy for the given vocabulary size ( log | Y | ) in all figures and tables to control for the fact that languages have vocabularies of different sizes. that lead to the lowest loss on the development set for the respective task. 10 We additionally do a more fine-grained grid search over  for J 0 (confidence penalty) and J 1 (label smoothing) for completeness. All other model hyperparameters are held constant. We run experiments on multiple architectures and across several data sets to ensure trends are general. We explore performance of the regularizer DJ  on NMT systems using three language pairs and corpora of two different sizes on the following tasks: WMT'14 German-to-English (De-En) (Bojar et al., 2014), IWSLT'14 German-to-English (De-En) (Cettolo et al., 2012), and Multitarget TED Talks Task (MTTT) French-to-English (FrEn) and Japanese-to-English (Ja-En) tasks (Duh, 2018). For the larger WMT data set, we train fewer models using coarser-grained  and  ranges. We perform experiments for both Transformers (Vaswani et al., 2017) and convolutional sequence-to-sequence models (Gehring et al., 2017). For reproducibility and comparability, we use the data pre-processing scripts provided by fairseq (Ott et al., 2019) and follow recommended hyperparameter settings from previous work (Vaswani et al., 2017; Gehring et al., 2017) for baseline models. We use SacreBLEU (Post, 2018) to calculate BLEU scores (Papineni et al., 2002). Specific data pre-processing steps and model hyperparameter details are provided in App. G. Decoding is performed with length-normalized beam search with a beam size of 5 unless otherwise stated. Early stopping was used during training; model parame-10 We only report results with generator function G =  H as results using G ( z ) = || z || 22 were consistently worse and often did not improve on the baseline; these results may be seen in App. H. Figure 3: Model entropy H( p  ) vs. BLEU on IWSLT'14 German to English (De-En) and Multitarget TED Talks Task French to English (Fr-En) using a Transformer architecture; each point is a fully trained model, regularized with DJ  for varying  and  . ters were taken from the checkpoint with the best validation set BLEU . Results of our experiments are shown in Table 2 and Figure 3. We see the same relation between model entropy and BLEU with both Transformer and convolutional architectures and between different language pairs. We show results for the Transformer architectures inline as they are the current standard for many NLP tasks; results for convolutional architectures are in App. H. Our results show better performance is achieved with values of  and  other than those that correspond to label smoothing with  = 0 . 1 , which is the commonly used value for the strength coefficient (Vaswani et al., 2017; Edunov et al., 2018). Moreover, the relationship between model entropy and evaluation performance is strong, following the same trend for all values of  , which suggests tuning a model for a specific entropy rather than ,  may be a better method in practice. We discuss trends in 4.3. We fine-tune BART (Lewis et al., 2019) on the CNN/DailyMail abstractive summarization task (Hermann et al., 2015) with regularizer DJ  . Data pre-processing and other hyperparameter settings follow Lewis et al. (2019). Results in Table 3 show that optimal values of ROUGE-L (Lin, 2004), the evaluation metric, can be achieved by regularizing with DJ  for different values of  . Notably, the entropy is virtually the same for the models that achieve top performance, demonstrating the closer relationship of performance with model entropy than with  , discussed further in 4.3. We look at the strength of the relationship between the evaluation metrics and both  and the model's entropy. Figure 3 shows a quadratic relationship between model entropy and BLEU . On the other hand, the relationship between  (coloring of points) and BLEU is not an obvious one; the best performing models are regularized with various values of  . As correlation only tells us about linear relationships, we report mutual information to measure the strength of the relationship between  , model entropy, and BLEU . Mutual information shows the proportion of entropy of a variable that is ex-plained by another and is often used as a generalized correlation measure i.e. for nonlinear relationships (Song et al., 2012). We see in Figure 4 that model entropy has a much stronger relationship with BLEU than  . Indeed, the normalized mutual information (NMI) between  and BLEU is  0 . 05 compared to  0 . 25 between model entropy and BLEU implying that any flavor of entropy regularization can lead to similar performance. While the relationship between  and BLEU is Figure 4: Entropy H(  ) , Conditional Entropy H(  |  ) and Mutual Information I(  ;  ) for BLEU with alpha (  ) and model entropy, respectively. weak, it is still statistically significant. Some evidence for this exists in Figure 3 where a closer examination reveals that each level of  has a similar quadratic trend, albeit with a different offset. Specifically, the performance of models trained with DJ  for   [0 . 75 , 1] (which includes label smoothing) starts to degrade at lower levels of entropy than models trained with DJ  for   [0 , 0 . 25] (confidence penalty). As quantitative validation of this observation, we (i) run a conditional independence test to see whether BLEU and  are conditionally independent given model entropy and (ii) look at the range of  for which DJ  leads to good performance for different  . Conditional Independence. If  and BLEU are conditionally independent it implies that the value of  does not supply any additional information about the value BLEU given model entropy, i.e.  does not matter when using the regularizer DJ  . We use a Monte Carlo permutation test where the null hypothesis is that no relationship between  and BLEU exists. 11 However, this test rejects the null hypothesis with p -value < 0 . 05 , supporting the alternate hypothesis that  and BLEU are not conditionally independent. Tuning  . On the tasks for which we trained > 60 models, we take the subset of models for which performance is within  1% ( < 0 . 4 BLEU ) of the best overall model. We then look at the range of  used with the regularizer DJ  for these models. The range of  that meets the above criterion is 11 The underlying distributions of random variables are assumed to be Gaussian. much larger for  close to 0 than for for  close to 1 (see Figure 5). We contend this implies that DJ  is easier to tune (i.e. it is more robust) for   0 while for   1 , DJ  is relatively sensitive to  . We take a subset of models trained with regularizers DJ 0 and DJ 1 and examine the sparsity of p  . Results in Table 4 support our formal analysis regarding the sparsity of DJ 0 and DJ 1 in 3.2; DJ 1 steeply penalizes sparsity while DJ  for  < 1 allows words to be assigned probability  0 . We look at how the probability (under p  ) of the reference sequence on the test set changes with model entropy. While higher entropy in models trends positively with downstream evaluation metrics (Figure 3), experiments show they often lead to lower log-likelihood of the reference sequence. Both of these observations have been made for models trained with label smoothing in previous works (Ott et al., 2018; Muller et al., 2019). However, log-likelihood alone does not tell a complete story. During decoding, we search for the Figure 6: Average ranking in p  of words in the reference sequence on the test set for IWSLT '14 (De-En) plotted against model entropy.
abstain abstain abstain method result result other abstain abstain abstain abstain abstain abstain objective abstain abstain method method method method method objective result objective objective abstain method abstain abstain method abstain abstain abstain method abstain abstain method abstain abstain abstain abstain abstain abstain abstain abstain method abstain abstain abstain method abstain method abstain abstain abstain abstain other abstain abstain abstain abstain abstain abstain abstain method method abstain method abstain abstain abstain method abstain abstain method method abstain abstain abstain method method abstain abstain abstain abstain abstain abstain abstain method method abstain abstain abstain abstain abstain abstain abstain abstain other abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain other abstain abstain abstain abstain abstain abstain result abstain abstain result result result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain abstain result abstain abstain abstain abstain abstain