Datasets:
Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- parse/train/B1g5sA4twr/B1g5sA4twr_model.json +0 -0
- parse/train/BJlahxHYDS/BJlahxHYDS.md +567 -0
- parse/train/BJlahxHYDS/BJlahxHYDS_content_list.json +0 -0
- parse/train/BJlahxHYDS/BJlahxHYDS_middle.json +0 -0
- parse/train/BJlahxHYDS/BJlahxHYDS_model.json +0 -0
- parse/train/BygFVAEKDH/BygFVAEKDH.md +376 -0
- parse/train/BygFVAEKDH/BygFVAEKDH_content_list.json +1980 -0
- parse/train/BygFVAEKDH/BygFVAEKDH_middle.json +0 -0
- parse/train/BygFVAEKDH/BygFVAEKDH_model.json +0 -0
- parse/train/ByxkijC5FQ/ByxkijC5FQ.md +379 -0
- parse/train/ByxkijC5FQ/ByxkijC5FQ_content_list.json +0 -0
- parse/train/ByxkijC5FQ/ByxkijC5FQ_middle.json +0 -0
- parse/train/ByxkijC5FQ/ByxkijC5FQ_model.json +0 -0
- parse/train/EsA9Nr9JHvy/EsA9Nr9JHvy.md +0 -0
- parse/train/EsA9Nr9JHvy/EsA9Nr9JHvy_content_list.json +0 -0
- parse/train/EsA9Nr9JHvy/EsA9Nr9JHvy_middle.json +0 -0
- parse/train/EsA9Nr9JHvy/EsA9Nr9JHvy_model.json +0 -0
- parse/train/Hk5elxbRW/Hk5elxbRW.md +878 -0
- parse/train/Hk5elxbRW/Hk5elxbRW_content_list.json +0 -0
- parse/train/Hk5elxbRW/Hk5elxbRW_middle.json +0 -0
- parse/train/Hk5elxbRW/Hk5elxbRW_model.json +0 -0
- parse/train/OItvP2-i9j/OItvP2-i9j_content_list.json +0 -0
- parse/train/OItvP2-i9j/OItvP2-i9j_middle.json +0 -0
- parse/train/SJzSgnRcKX/SJzSgnRcKX.md +348 -0
- parse/train/SJzSgnRcKX/SJzSgnRcKX_content_list.json +1925 -0
- parse/train/SJzSgnRcKX/SJzSgnRcKX_middle.json +0 -0
- parse/train/SJzSgnRcKX/SJzSgnRcKX_model.json +0 -0
- parse/train/cnWSyJNmeCE/cnWSyJNmeCE.md +289 -0
- parse/train/cnWSyJNmeCE/cnWSyJNmeCE_content_list.json +1414 -0
- parse/train/cnWSyJNmeCE/cnWSyJNmeCE_middle.json +0 -0
- parse/train/cnWSyJNmeCE/cnWSyJNmeCE_model.json +0 -0
- parse/train/r16Vyf-0-/r16Vyf-0-.md +218 -0
- parse/train/r16Vyf-0-/r16Vyf-0-_content_list.json +1202 -0
- parse/train/r16Vyf-0-/r16Vyf-0-_middle.json +0 -0
- parse/train/r16Vyf-0-/r16Vyf-0-_model.json +0 -0
- parse/train/rJ8uNptgl/rJ8uNptgl.md +391 -0
- parse/train/rJ8uNptgl/rJ8uNptgl_content_list.json +2023 -0
- parse/train/rJ8uNptgl/rJ8uNptgl_middle.json +0 -0
- parse/train/rJ8uNptgl/rJ8uNptgl_model.json +0 -0
- vlm/train/4fLr7H5D_eT/0.png +3 -0
- vlm/train/4fLr7H5D_eT/1.png +3 -0
- vlm/train/4fLr7H5D_eT/10.png +3 -0
- vlm/train/4fLr7H5D_eT/11.png +3 -0
- vlm/train/4fLr7H5D_eT/12.png +3 -0
- vlm/train/4fLr7H5D_eT/13.png +3 -0
- vlm/train/4fLr7H5D_eT/2.png +3 -0
- vlm/train/4fLr7H5D_eT/3.png +3 -0
- vlm/train/4fLr7H5D_eT/4.png +3 -0
- vlm/train/4fLr7H5D_eT/5.png +3 -0
- vlm/train/4fLr7H5D_eT/6.png +3 -0
parse/train/B1g5sA4twr/B1g5sA4twr_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/BJlahxHYDS/BJlahxHYDS.md
ADDED
|
@@ -0,0 +1,567 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONSERVATIVE UNCERTAINTY ESTIMATION BY FITTING PRIOR NETWORKS
|
| 2 |
+
|
| 3 |
+
Kamil Ciosek1, Vincent Fortuin1,2, Ryota Tomioka1, Katja Hofmann1, Richard Turner1,3
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Obtaining high-quality uncertainty estimates is essential for many applications of deep neural networks. In this paper, we theoretically justify a scheme for estimating uncertainties, based on sampling from a prior distribution. Crucially, the uncertainty estimates are shown to be conservative in the sense that they never underestimate a posterior uncertainty obtained by a hypothetical Bayesian algorithm. We also show concentration, implying that the uncertainty estimates converge to zero as we get more data. Uncertainty estimates obtained from random priors can be adapted to any deep network architecture and trained using standard supervised learning pipelines. We provide experimental evaluation of random priors on calibration and out-of-distribution detection on typical computer vision tasks, demonstrating that they outperform deep ensembles in practice.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep learning has achieved huge success in many applications. In particular, increasingly often, it is used as a component in decision-making systems. In order to have confidence in decisions made by such systems, it is necessary to obtain good uncertainty estimates, which quantify how certain the network is about a given output. In particular, if the cost of failure is large, for example where the automated system has the capability to accidentally hurt humans, the availability and quality of uncertainty estimates can determine whether the system is safe to deploy at all (Carvalho, 2016; Leibig et al., 2017; Michelmore et al., 2018). Moreover, when decisions are made sequentially, good uncertainty estimates are crucial for achieving good performance quickly (Bellemare et al., 2016; Houthooft et al., 2016; Ostrovski et al., 2017; Burda et al., 2018).
|
| 12 |
+
|
| 13 |
+
Because any non-Bayesian inference process is potentially sub-optimal (De Finetti, 1937), these uncertainty estimates should ideally be relatable to Bayesian inference with a useful prior. Deep ensembles (Lakshminarayanan et al., 2017), one of the most popular methods available for uncertainty estimation in deep networks today, struggle with this requirement. While deep ensembles can be related (Rubin, 1981) to Bayesian inference in settings where the individual models are trained on subsets of the data, this is not how they are used in practice. In order to improve data efficiency, all ensembles are typically trained using the same data (Lakshminarayanan et al., 2017), resulting in a method which does not have a theoretical justification. Moreover, deep ensembles can give overconfident uncertainty estimates in practice. On the other hand, Monte-Carlo dropout can be viewed (Gal & Ghahramani, 2016) as a certain form of Bayesian inference. However, doing so requires requires either a limit to be taken or a generalization of variational inference to a quasi-KL divergence (Hron et al., 2018). In practice, MC dropout can give arbitrarily overconfident estimates (Foong et al., 2019). More broadly, a category of approaches, known as Bayesian Neural Networks (Blundell et al., 2015; Welling & Teh, 2011; Neal, 1996), maintains a distribution over the weights of the neural network. These methods have a sound Bayesian justification, but training them is both difficult and carries an accuracy penalty, particularly for networks with convolutional architectures (Osawa et al., 2019). Moreover, tuning BNNs is hard and achieving a good approximation to the posterior is difficult (Brosse et al., 2018).
|
| 14 |
+
|
| 15 |
+
We use another way of obtaining uncertainties for deep networks, based on fitting random priors (Osband et al., 2018; 2019). Random priors are easy to train and were found to work very well in practice (Burda et al., 2018). To obtain the uncertainty estimates, Affiliations: 1. Microsoft Research Cambridge; 2. ETH Zurich; 3. University of Cambridge. The second author was an intern at Microsoft when contributing to this work.
|
| 16 |
+
|
| 17 |
+
we first train a predictor network to fit a prior. Two examples of prior-predictor pairs are shown in the top two plots of Figure 1.Faced with a novel input point, we obtain an uncertainty (Figure 1, bottom plot) by measuring the error of the predictor network against this pattern. Intuitively, these errors will be small close to the training points, but large far from them. The patterns themselves are drawn from randomly initialized (and therefore untrained) neural networks. While this way of estimating uncertainties was known before (Osband et al., 2019), it did not have a theoretical justification beyond Bayesian linear regression, which is too limiting for modern applications.
|
| 18 |
+
|
| 19 |
+
Contributions We provide a sound theoretical framework for obtaining uncertainty estimates by fitting random priors, a method previously lacking a principled justification. Specifically, we justify estimates in the uncertainty of the output of neural networks with any architecture. In particular, we show in Lemma 1 and Proposition 1 that these uncertainty estimates are conservative, meaning they are never more certain than a Bayesian algorithm would be. Moreover, in Proposition 2 we show concentration, i.e. that the uncertainties become zero with infinite data. Empirically, we evaluate the calibration and out-of-distribution performance of our uncertainty estimates on typical computer vision tasks, showing a practical benefit over deep ensembles and MC dropout.
|
| 20 |
+
|
| 21 |
+
# 2 PRELIMINARIES
|
| 22 |
+
|
| 23 |
+
We are going to reason about uncertainty within the formal framework of stochastic processes. We now introduce the required notations.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: On top, two predictors (green) were trained to fit two randomlygenerated priors (red). On the bottom, we obtain uncertainties from the difference between predictors and priors. Dots correspond to training points $x _ { i }$ .
|
| 27 |
+
|
| 28 |
+
A stochastic process is a collection of random variables $\{ f ( x ) \}$ . We consider processes where $\boldsymbol { x } \in \mathbb { R } ^ { K }$ and the random-variable $f ( x )$ takes values in $\mathbb { R } ^ { M }$ . A stochastic process has exchangeable outputs if the distribution does not change when permuting the $M$ entries in the output vector. Allowing a slight abuse of notation, we denote the finite-dimensional distribution of the process $\{ f ( x ) \}$ for the set $X =$ $\{ x _ { i } \} _ { i = 1 , \ldots , N }$ as $f ( x _ { 1 } , \dots , x _ { N } ) = f ( X )$ . In practice, the finite-dimensional distribution reflects the idea of restricting the process to points $x _ { 1 } , \ldots , x _ { N }$ and marginalizing over all the other points. Inference can be performed on stochastic processes similarly to probability distributions. In particular, we can start with some prior process $\{ f ( x ) \}$ , observe a set of $N$ training points $X = \{ x _ { i } \} _ { i = 1 , \dots , N }$ and labels $y = \{ y _ { i } \} _ { i = 1 , \dots , N }$ and then consider the posterior process $\{ f _ { X y } ( x ) \}$ , whose finite-dimensional distributions are given by $f _ { X y } ( x _ { 1 } ^ { \star } \ldots x _ { N ^ { \prime } } ^ { \star } ) = f ( x _ { 1 } ^ { \star } \ldots x _ { N ^ { \prime } } ^ { \star } | x _ { 1 } , \ldots , x _ { N } , y _ { 1 } , \ldots , y _ { N } )$ for any set of testing points $x _ { 1 } ^ { \star } \ldots x _ { N ^ { \prime } } ^ { \star }$ . We use subscripts to denote conditioning on the dataset throughout the paper. We denote the variance of $f _ { X y } ( x _ { \star } )$ with $\sigma _ { X f } ^ { 2 } ( x _ { \star } )$ . A stochastic process is called Gaussian if if all its finite-dimensional distributions are Gaussian. Given a test point $x _ { \star }$ , we denote the posterior GP mean with $\mu _ { X y } ( x _ { \star } )$ and posterior GP variance with $\sigma _ { X } ^ { 2 } ( x _ { \star } )$ . We provide more background on GPs in Appendix D.
|
| 29 |
+
|
| 30 |
+
# 3 ESTIMATING UNCERTAINTY FROM RANDOM PRIORS
|
| 31 |
+
|
| 32 |
+
Intuition Uncertainties obtained from random priors have an appealing intuitive justification. Consider the networks in the top part of Figure 1. We start with a randomly initialized prior network, shown in red. Whenever we see a datapoint, we train the predictor network (green) to match this prior. Uncertainties can then be obtained by considering the squared error between the prior and the predictor at a given point. An example uncertainty estimate is shown as the shaded blue area in the bottom of Figure 1. While it may at first seem that the squared error is a poor measure of uncertainty because it can become very small by random chance, we formally show in Section 4.1 that this is very improbable. In Section 4.2, we show that this error goes down to zero as we observe more data. Similarly to GP inference, uncertainty estimation in our framework does not depend on the regression label. The prediction mean (blue curve in the bottom part of Figure 1) is obtained by fitting a completely separate neural network. In section 6, we discuss how this framework avoids the overconfidence characteristic of deep ensembles (Lakshminarayanan et al., 2017).
|
| 33 |
+
|
| 34 |
+
Prior The process of obtaining network uncertainties involves randomly initialized prior networks, which are never trained. While this may at first appear very different from they way deep learning is normally done, these random networks are a crucial component of our method. We show in Section 4.1 that the random process that corresponds to initializing these networks can be interpreted as a prior of a Bayesian inference procedure. A prior conveys the information about how the individual data points are related. The fact that we are using random networks has both practical and theoretical benefits. Practically, since the prior does not depend on the data, there is no way that it can overfit. The use of random priors also has strong empirical support – randomly initialized networks have been recently used as priors to obtain state-of-the-art performance on computer vision tasks (Ulyanov et al., 2018; Cheng et al., 2019). Theoretically, using random priors satisfies the likelihood principle (Robert, 2007). Moreover, random priors can be viewed as a safe choice since they make the minimum reasonable assumption that the network architecture is appropriate for the task. In fact, whenever deep learning is used, with or without uncertainty estimates, practitioners are already implicitly making that assumption.
|
| 35 |
+
|
| 36 |
+
Algorithm The process of training the predictor networks is shown in Algorithm 1. The function TRAIN-UNCERTAINTIES first generates random priors, i.e. neural networks with random weights. In our notation, it corresponds to sampling functions from the prior process $\{ f ( x ) \}$ . These priors, evaluated at points from the dataset $X = \{ x _ { i } \} _ { i = 1 , \dots , N }$ are then used as labels for supervised learning, performed by the function FIT. After training, when we want to obtain an uncertainty estimate $\phi$ at a given test point $x _ { \star }$ , we use the formula
|
| 37 |
+
|
| 38 |
+
<table><tr><td>Algorithm 1 Training the predictors.</td></tr><tr><td>function TRAIN-UNCERTAINTIES(X) fori=1...Bdo fi~{f(x)} > random prior hxfi ←FIT(X,fi(X)) end for</td></tr><tr><td>return fi,hx fi end function</td></tr><tr><td>function FIT(X, fi(X))</td></tr><tr><td>L(h)=∑x∈x If²(x)-h(x)ll² h xfi← OPTIMIZE(L)>SGD or similar return h x fi >return trained predictor</td></tr></table>
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\hat { \sigma } ^ { 2 } ( x _ { \star } ) = \operatorname* { m a x } ( 0 , \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) + \beta \hat { v } _ { \sigma } ( x _ { \star } ) - \sigma _ { A } ^ { 2 } ) .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
Here, the quantity $\hat { \sigma } _ { \mu } ^ { 2 }$ is the sample mean of the squared error. We will show in Section 4 that it is an unbiased estimator of a variable that models the uncertainty. On the other hand, $\hat { v } _ { \sigma }$ is the samplebased estimate of the standard deviation of squared error across bootstraps, needed to quantify our uncertainty about what the uncertainty is. The hyper-parameter $\beta$ controls the degree to which this uncertainty is taken into account. Formally, the quantities are defined as
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r l } & { \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \triangleq \sum _ { i = 1 } ^ { B } \frac { 1 } { M B } \| f ( x _ { \star } ) - h _ { X f _ { i } } ( x _ { \star } ) \| ^ { 2 } , } \\ & { \hat { v } _ { \sigma } ( x _ { \star } ) \triangleq \sqrt { \sum _ { i = 1 } ^ { B } \frac { 1 } { B } ( \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) - \frac { 1 } { M } \| f ( x _ { \star } ) - h _ { X f _ { i } } ( x _ { \star } ) \| ^ { 2 } ) ^ { 2 } } . } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
In the above equations, $B$ is the number of prior functions and each prior and predictor network has $M$ outputs. Because the predictors are trained independently, uncertainty estimates obtained from each of the $B$ predictor-prior pairs are independent. We defer the discussion of details of network architecture to Section 5. Our experiments (Section 7) show that it is often sufficient to use $B = 1$ in practice.
|
| 51 |
+
|
| 52 |
+
# 4 THEORETICAL RESULTS
|
| 53 |
+
|
| 54 |
+
In Section 3, we introduced a process for obtaining uncertainties in deep learning. We now seek to provide a formal justification. We define the expected uncertainties as
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r } { \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \triangleq \operatorname { E } _ { f } \left[ \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \right] = \operatorname { E } _ { f } \left[ \frac { 1 } { M } \lVert f ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \rVert ^ { 2 } \right] . } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
In other words, $\tilde { \sigma } _ { \mu } ^ { 2 }$ is the expected version of the sample-based uncertainties $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ introduced in equation 2. Since Bayesian inference is known to be optimal (De Finetti, 1937; Jaynes, 2003; Robert, 2007), the most appealing way of justifying uncertainty estimates ${ \tilde { \sigma } } _ { \mu } ^ { 2 }$ and $\hat { \sigma } _ { \mu } ^ { 2 }$ is to relate them to a Bayesian posterior $\sigma _ { X f } ^ { 2 } ( x _ { \star } )$ . We do this in two stages. First, in Section 4.1, we prove that the obtained uncertainties are larger than ones arrived at by Bayesian inference. This means that our uncertainties are conservative, ensuring that our algorithm is never more certain than it should be. Next, in Section 4.2, we show that uncertainties concentrate, i.e., they become small as we get more and more data. These two properties are sufficient to justify the use of our uncertainties in many applications.
|
| 61 |
+
|
| 62 |
+
# 4.1 UNCERTAINTIES FROM RANDOM PRIORS ARE CONSERVATIVE
|
| 63 |
+
|
| 64 |
+
From the point of view of safety, it is preferable to overestimate the ground truth uncertainty than to underestimate it. We now show that this property holds for uncertainties obtained from random priors. We first justify conservatism for the expected uncertainty ${ \tilde { \sigma } } _ { \mu } ^ { 2 }$ defined in equation 4 and then for the sampled uncertainty $\hat { \sigma } _ { \mu } ^ { 2 }$ defined in equation 2.
|
| 65 |
+
|
| 66 |
+
Amortized Conservatism We first consider a weak form of this conservatism, which we call amortized. It guarantees that ${ \tilde { \sigma } } _ { \mu } ^ { 2 }$ is never smaller than the average posterior uncertainty across labels sampled from the prior. Formally, amortized conservatism holds if for any test point $x _ { \star }$ we have
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \geq \mathrm { E } _ { f ( X ) } \left[ \sigma _ { X f } ^ { 2 } ( x _ { \star } ) \right] .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
Here $\sigma _ { X f } ^ { 2 }$ corresponds to the second moment of the posterior process $\{ f _ { X f } ( x ) \}$ . We will introduce a stronger version of conservatism, which does not have an expectation on the right-hand side, later in this section (eq. 8). For now, we concentrate on amortized conservatism. In Lemma 1 (proof in appendix), we show that it holds under very general conditions.
|
| 73 |
+
|
| 74 |
+
Lemma 1. For any function $h : \mathbb { R } ^ { N \times ( K + 1 ) } \mathbb { R } ^ { M }$ , for any test point $\boldsymbol { x } _ { \star } ~ \in ~ \mathbb { R } ^ { K }$ and for any stochastic process $\{ f ( x ) \} _ { x \in \mathbb { R } ^ { K } }$ with all second moments finite and exchangeable outputs
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r } { \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) = \mathrm { E } _ { f ( X ) } \left[ \sigma _ { X f } ^ { 2 } ( x _ { \star } ) + \frac { 1 } { M } \| \mu _ { X f } ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } \right] . } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Relation to a GP Lemma 1 holds for any prior process $\{ f ( x ) \}$ . However, the prior process used by Algorithm 1 is not completely arbitrary. The fact that prior samples are obtained by initializing neural networks with independently sampled weights gives us additional structure. In fact, it can be shown that randomly initialized neural networks become close to GPs as the width of the layers increases. While the original result due to Neal (1996) held for a simple network with one hidden layer, it has been extended to a wide class of popular architectures, including to CNNs and RNNs of arbitrary depth (Matthews et al., 2018; Lee et al., 2018; Novak et al., 2019; Williams, 1997; Le Roux & Bengio, 2007; Hazan & Jaakkola, 2015; Daniely et al., 2016; Garriga-Alonso et al., 2019). Recently, it has been shown to hold for a broad class of functions trainable by gradient descent (Yang, 2019). While the precise statement of these results involves technicalities which fall beyond the scope of this paper, we recall the key insight. For a family of neural networks $\{ f ^ { W } ( x ) \}$ , where the weights are sampled independently and $W$ is the width of the hidden layers, there exists a limiting kernel function $k _ { \infty }$ such that
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\operatorname* { l i m } _ { W \infty } [ \{ f ^ { W } ( x ) \} ] = \mathcal { G P } ( 0 , k _ { \infty } ) .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
In other words, as the size of the hidden layers increases, the stochastic process obtained by initializing networks randomly converges in distribution to a GP. In the context of our uncertainty estimates, this makes it reasonable for $W$ large enough to consider the prior to be a GP. We stress that the GP assumption has to hold only for the prior network, which is never trained. We do not make any assumptions about connections between the predictor training process and GPs.
|
| 87 |
+
|
| 88 |
+
Strict Conservatism Denoting the posterior GP variance with $\sigma _ { X } ^ { 2 } ( x _ { \star } )$ , we define uncertainty estimates to be strictly conservative when
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \geq \sigma _ { X } ^ { 2 } ( x _ { \star } ) .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
This statement is stronger than the amortized conservatism in equation 5. Intuitively, equation 8 can be interpreted as saying that our uncertainty estimates are never too small. This confirms the intuition expressed by Burda et al. (2018) that random priors do not overfit. Below, in Proposition 1, we outline how to guarantee strict conservatism formally. It is proved in Appendix F.1.
|
| 95 |
+
|
| 96 |
+
Proposition 1 (Strict Conservatism in Expectation). Assume that $f$ is a GP. Then for any function $h : \bar { \mathbb { R } } ^ { N \times K } \to \bar { \mathbb { R } } ^ { M }$ , we have
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) = \sigma _ { X } ^ { 2 } ( x _ { \star } ) + \underbrace { { \mathrm E } _ { f ( X ) } \left[ \frac { 1 } { M } \| \mu _ { X f } ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } \right] } _ { \geq 0 } .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
Moreover, equality holds if and only if $h _ { X f } ( x _ { \star } ) = \mu _ { X f } ( x _ { \star } )$ .
|
| 103 |
+
|
| 104 |
+
Conservatism with Finite Bootstraps Lemma 1 above shows conservatism for expected uncertainties, i.e. ${ \tilde { \sigma } } _ { \mu } ^ { 2 }$ introduced in equation 5. However, in practice we have to estimate this expectation using a finite number of bootstraps, and use the sampled uncertainties $\hat { \sigma } _ { \mu } ^ { 2 }$ defined in equation 2. We now state a conservatism guarantee that holds even in the case of just one bootstrap $B = 1$ ). The proof is deferred to Appendix F.1.
|
| 105 |
+
|
| 106 |
+
Corollary 1 (Strict Conservatism for Finite Bootstraps). Assume that $f$ is a GP. Assume that the random variable $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ has finite variance upper bounded by vUB. Then with probability $1 - \delta$ , for any function $h : \mathbb { R } ^ { N \times K } \to \mathbb { R } ^ { M }$ , we have
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r } { \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) + \frac { 1 } { \sqrt { \delta } } v _ { U B } \geq \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \geq \sigma _ { X } ^ { 2 } ( x _ { \star } ) . } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
However, applying Corollary 1 requires the knowledge of $v _ { \mathrm { U B } }$ . We now provide an upper bound.
|
| 113 |
+
|
| 114 |
+
Lemma 2. Assume that the GP $\{ f ( x ) \}$ is zero mean with exchangeable outputs and the function $h _ { X f }$ takes values in $[ - U , U ] ^ { M }$ . Assume that permuting the outputs of $f$ produces the same permutation in the outputs of $h _ { X f }$ . With probability $1 - \delta$ , we have
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\operatorname { V a r } _ { f _ { 1 } , \dots , f _ { B } } \left[ \widehat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \right] \leq v _ { U B } ,
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
where vUB is expressible in terms of observable quantities.
|
| 121 |
+
|
| 122 |
+
The proof and the explicit formula for $v _ { \mathrm { U B } }$ is deferred to Appendix F.1. In cases where conservatism is desired, but not absolutely essential, we can avoid the torturous calculation of Lemma 2 and replace $v _ { \mathrm { U B } }$ with the sample-based estimate $\hat { v } _ { \sigma } ( x _ { \star } )$ , defined in equation 2. In this case, the conservatism guarantee is only approximate. This is how we obtained equation 1, used by the algorithm in practice.
|
| 123 |
+
|
| 124 |
+
# 4.2 UNCERTAINTIES FROM RANDOM PRIORS CONCENTRATE
|
| 125 |
+
|
| 126 |
+
While the conservatism property in Proposition 1 is appealing, it is not sufficient on its own for the uncertainty estimates to be useful. We also need concentration, i.e. a guarantee that the uncertainties $\hat { \sigma } ^ { 2 }$ become small with more data. We can gurantee this formally by assuming that the class of neural networks being fitted is Lipschitz-continuous and bounded. Intuitively, by assumption of Lipschitz continuity, the predictors $h _ { X f }$ cannot behave very differently on points from the training and test sets, since both come from the same data distribution. We can then show concentration by using standard Rademacher tools to obtain a bound on the expected uncertainty in terms of the squared error on the training set. This process is formalized in Proposition 2.
|
| 127 |
+
|
| 128 |
+
Proposition 2. If the training converges, i.e. the training loss $\begin{array} { r } { \frac { 1 } { M N } \sum _ { i = 1 } ^ { N } \| f ( x _ { i } ) - h _ { X f } ( x _ { i } ) \| ^ { 2 } = \sigma _ { A } ^ { 2 } } \end{array}$ for arbitrarily large training sets, then assuming the predictors $h _ { X f }$ are bounded and Lipschitz continuous with constant $L _ { i }$ , then under technical conditions the uncertainties concentrate, i.e. $\hat { \sigma } ^ { 2 } ( x _ { \star } ) 0$ as $N \to \infty$ and $B \infty$ with probability $^ { l }$ .
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 2: Architecture of the random prior networks $f$ and predictor networks $h _ { X f }$ . The predictor networks $h _ { X f }$ typically share the same architectural core, but have additional layers relative to the prior networks. Both the green and red parts of the predictor networks are trained.
|
| 132 |
+
|
| 133 |
+
The proof and the technical conditions are given in Appendix F. Proposition 2 assumes that the training error is zero for arbitrarily large training sets, which might at first seem unrealistic. We argue that this assumption is in fact reasonable. The architecture of our predictor networks (Figure 2, right diagram) is a superset of the prior architecture (Figure 2, left diagram), guaranteeing the existence of weight settings for the predictor that make the training loss zero. Recent results on deep learning optimization (Du et al., 2019; Allen-Zhu et al., 2019) have shown that stochastic gradient descent can in general be expected to find representable functions.
|
| 134 |
+
|
| 135 |
+
# 5 PRACTICAL CONCLUSIONS FROM THE THEORY
|
| 136 |
+
|
| 137 |
+
We now re-visit the algorithm we defined in Section 3, with the aim of using the theory above to obtain practical improvements in the quality of the uncertainty estimates.
|
| 138 |
+
|
| 139 |
+
Architecture and Choosing the Number of Bootstraps Our conservatism guarantee in Proposition 1 holds for any architecture for the predictor $h _ { X f }$ . In theory, the predictor could be completely arbitrary and does not even have to be a deep network. In particular, there is no formal requirement for the predictor architecture to be the same as the prior. On the other hand, to show concentration in Proposition 2, we had to ensure that the prior networks are representable by the predictor. In practice, we use the architecture shown in Figure 2, where the predictor mirrors the prior, but has additional layers, giving it more representational power. Moreover, the architecture requires choosing the number of bootstraps $B$ . Our experiments in Section 7 show that even using $B = 1$ , i.e. one bootstrap, produces uncertainty estimates of high quality in practice.
|
| 140 |
+
|
| 141 |
+
Modeling Epistemic and Aleatoric Uncertainty Proposition 1 and Proposition 2 hold for any Gaussian Process prior. By choosing the process appropriately, we can model both epistemic and aleatoric uncertainty. Denote by $\{ n ( x ) \}$ a stochastic process obtained by randomly initializing neural networks and denote by $\bar { \{ \epsilon ( x ) \sigma _ { A } ^ { 2 } \} }$ the noise term, modeling the aleatoric (observation) noise, where samples are obtained from $\mathsf { \bar { \epsilon } } ( x ) \sim \mathcal { N } ( 0 , 1 )$ at each $x$ independently (see Appendix D for more background on aleatoric noise). We can now choose the prior process as a sum $\dot { \{ f ( x ) \} } = \{ n ( x ) + \epsilon ( \bar { x ) } \sigma _ { A } ^ { 2 } \}$ of epistemic component $\{ n ( x ) \}$ and the noise term. The amount of aleatoric uncertainty can be adjusted by choosing $\sigma _ { A } ^ { 2 }$ .
|
| 142 |
+
|
| 143 |
+
Prior Choice, Weight Copying and Conservatism One question that can be asked about our architecture (Figure 2) is whether it is possible for the predictor to exactly copy the prior weights, giving zero uncertainty everywhere. A useful edge case to consider here is when we are solving a one-dimensional regression problem, $\sigma _ { A } ^ { 2 } = 0$ and the both the priors and predictors are linear functions. In this case, after training on two points, the predictors will agree with the priors everywhere and uncertainty estimates will be zero. However, this is still consistent with our conservatism guarantee The reason for this is once we assume such a linear prior, we are comparing to a GP with a linear kernel. But a GP with that kernel will also have zero uncertainty after seeing two samples.
|
| 144 |
+
|
| 145 |
+
In practice, this means that we have to choose the architecture of the prior networks be expressive enough, which is no different from choosing a reasonable prior for Bayesian inference. Empirically, the tested network architecture did not show weight copying.
|
| 146 |
+
|
| 147 |
+
# 6 PRIOR WORK
|
| 148 |
+
|
| 149 |
+
Randomized Prior Functions (RPFs) Our work was inspired by, and builds on, Randomised Prior Functions (Osband et al., 2019; 2018), but it is different in two important respects. First, the existing theoretical justification for RPFs only holds for Bayesian linear regression (Osband et al., 2018, equation 3) with non-zero noise1 added to the priors. In contrast, our results are much more general and hold for any deep network with or without added aleatoric noise. Second, we are targeting a different setting. While RPFs were designed as a way of sampling functions from the posterior, we provide estimates of posterior uncertainty at a given test point. Our algorithm is based on the work by Burda et al. (2018), who applied RPFs to exploration in MDPs, obtaining state-of-the art results, but without justifying their uncertainty estimates formally. Our paper provides this missing justification, while also introducing a way of quantifying the error in estimating the uncertainty itself. Moreover, since Burda et al. (2018) focused on the application of RPFs to Reinforcement Learning, they only performed out-of-distribution evaluation on the relatively easy MNIST dataset (LeCun, 1998). In contrast, in Section 7 we evaluate the uncertainties on more complex vision tasks. The term prior networks has also been used (Malinin & Gales, 2018) to denote deep networks that output the parameters of a prior distribution, an approach fundamentally different from our work.
|
| 150 |
+
|
| 151 |
+
Deep Ensembles The main alternative approach for obtaining uncertainties in deep learning are deep ensembles (Lakshminarayanan et al., 2017). Building on the bootstrap (Efron & Tibshirani, 1994), deep ensembles maintain several models and quantify epistemic uncertainty by measuring how their outputs vary. Crucially, deep ensembles use representations trained on regression labels, and tend to learn similar representations for different inputs with similar labels, which can lead to over-fitting the uncertainty estimates. A useful edge case to consider is if the each of the models in the ensemble is convex in the weights. In this case, models in a deep ensemble will all converge to the same weights and produce zero uncertainty. While deep learning models used in practice aren’t normally convex, we show empirically in section 7 that deep ensembles can give overconfident uncertainty estimates in practical vision tasks, particularly on points that have the same label as points in the training set. Since our method avoids overconfidence, it can be understood as complementary to deep ensembles, to be used in situations where obtaining conservative estimates is more important than the representational benefit of using labels. In practice, deep ensembles also require using more bootstraps to achieve the same OOD performance. Moreover, they do not have theoretical support in the case when all the members of the ensemble are trained on the same data, which is how they are used in practice (Lakshminarayanan et al., 2017).
|
| 152 |
+
|
| 153 |
+
Dropout In cases where it is not economical to train more than one network, uncertainties can be obtained with dropout (Srivastava et al., 2014; Gal & Ghahramani, 2016). Monte-Carlo dropout can be viewed (Gal & Ghahramani, 2016) as a form of approximate Bayesian inference. However, to do so requires a rather unnatural approximating family from the perspective of approximate inference. Also, one has then either to take a limit or generalize variational inference to a quasi-KL (Hron et al., 2018) divergence. In addition, dropout can be interpreted in terms of MAP inference (Nalisnick et al., 2019). Another alternative view of MC dropout is as an ensemble method in which the ensemble members have shared parameters (which means they are trained together) and where the ensembling is applied at test time too. This latter view is arguably as natural as the Bayesian interpretation. For this reason we discuss MC dropout separately from BNNs. Since dropout implicitly approximates non-Gaussian weight distribution with Gaussians, it exhibits spurious patterns in the obtained uncertainties, which can lead to arbitrarily overconfident estimates (Foong et al., 2019). In contrast, due to the conservatism property, random priors avoid such overconfidence.
|
| 154 |
+
|
| 155 |
+
Bayesian Neural Networks (BNNs) Bayesian Neural Networks (Blundell et al., 2015; Kingma & Welling, 2014; Rezende et al., 2014; Welling & Teh, 2011; Brosse et al., 2018) explicitly model the distribution over weights of a neural network. While BNNs provide a link between deep learning and Bayesian inference, they are very slow to train. Even recent tuned implementations of BNNs (Osawa et al., 2019) are several times slower than supervised learning. This happens despite using a battery of technical optimizations, including distributed training and batch normalization. Moreover, modern convolutional BNNs still carry a significant accuracy penalty when deployed with realistic settings of prior variance.2
|
| 156 |
+
|
| 157 |
+
# 7 EXPERIMENTS
|
| 158 |
+
|
| 159 |
+
Encouraged by the huge empirical success of random priors in Reinforcement Learning (Burda et al., 2018), we wanted to provide an evaluation in a more typical supervised learning setting. We tested the uncertainties in two ways. First, we investigated calibration, i.e. whether we can expect a higher accuracy for more confident estimates. Next, we checked whether the uncertainties can be used for out-of-distribution detection. We compared to two competing approaches for uncertainty detection: deep ensembles (Lakshminarayanan et al., 2017) and spatial concrete dropout (Gal et al., 2017). The same ResNet architecture served as a basis for all methods. Details of the implementation are provided in Appendix A.
|
| 160 |
+
|
| 161 |
+
Out-Of-Distribution Detection We evaluated the uncertainty estimates on out-ofdistribution detection. To quantify the results, we evaluated the area under the ROC curve (AUROC) for the task of deciding whether a given image comes from the same distribution or not. All methods were trained on four classes from the CIFAR-10 (Krizhevsky et al., 2009) dataset (training details are provided in Appendix A). We then tested the resulting networks on images from withheld classes and on the SVHN dataset (Netzer et al., 2011), which contains completely different images. Results are shown in Table 1. Considering the statistical errors (see Appendix B), random priors performed slightly better than deep ensembles with adversarial training for $B = 1$ and about the same for $B ~ = ~ 1 0$ . For dropout, $B$ refers to the number of dropout samples. Dropout per
|
| 162 |
+
|
| 163 |
+
Table 1: Out-of-distribution AUROC for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ and spatial concrete dropout (DR). Estimated confidence intervals are provided in Appendix B.
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>RP</td><td rowspan=1 colspan=1>DE</td><td rowspan=1 colspan=1>DE+AT</td><td rowspan=1 colspan=1>DR</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>B=1</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>Train v. cat/deerTrain v. vehiclesTrain v. excludedTrain v. SVHN</td><td rowspan=2 colspan=1>0.991.001.000.95</td><td rowspan=1 colspan=1>0.83</td><td rowspan=2 colspan=1>0.960.960.960.96</td><td rowspan=2 colspan=1>0.810.760.770.86</td></tr><tr><td rowspan=1 colspan=1>0.820.820.88</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>B=10</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>Train v.cat/deerTrain v. vehiclesTrain v. excludedTrain v. SVHN</td><td rowspan=1 colspan=1>1.00</td><td rowspan=1 colspan=1>0.95</td><td rowspan=2 colspan=1>0.990.980.980.99</td><td rowspan=2 colspan=1>0.820.780.790.87</td></tr><tr><td rowspan=1 colspan=1>1.001.000.97</td><td rowspan=1 colspan=1>0.920.930.94</td></tr></table>
|
| 166 |
+
|
| 167 |
+
formed worse, but was cheaper to train. In order to gain a more finely-grained insight into the quality of the uncertainties, we also show uncertainty histograms in Figure 3. The figure shows the distribution of uncertainty estimates for seen data (top row) vs. unseen data (bottom row) for bootstrap sizes $B = \{ 1 , 5 , 1 0 \}$ . The main conclusion is that uncertainties obtained from random priors are already well-separated with $B = 1$ , while deep ensembles need more bootstraps to achieve the full separation between test and train examples. We provide additional experimental results, showing OOD accuracy and an evaluation on CIFAR 100 in Appendix B.
|
| 168 |
+
|
| 169 |
+
Calibration Good uncertainty estimates have the property that accuracy increases as we become more certain, a property known as calibration. We measured it by evaluating average accuracy on the subset of images with uncertainty smaller than a given value. We trained on four classes from the CIFAR-10 (Krizhevsky et al., 2009) dataset. We then tested the resulting networks on the whole dataset, which included both the seen and unseen classes. Results are shown in Figure 4. Ideally, in a calibrated method, these curves should be increasing, indicating that a method always becomes more accurate as it becomes more confident. In coarse terms, Figure 4 confirms that all methods except a degenerate deep ensemble with only one bootstrap are roughly monotonic. However, uncertainty estimates from random priors are more stable, showing monotonicity on a finer scale as well as on a large scale. Interestingly, calibration improved only slightly when increasing the number of bootstraps $B$ .
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 3: Distribution of uncertainty estimates for various algorithms. Top row shows seen data, bottom row shows unseen data from CIFAR-10. For random priors (RP), uncertainties are $\hat { \sigma } ^ { 2 }$ . For other algorithms, they are $1 - \operatorname* { m a x } ( p _ { \mu } )$ , where $p _ { \mu }$ is the averaged output of models in ensemble (Lakshminarayanan et al., 2017).
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 4: Calibration curves showing the relationship between uncertainty (horizontal axis) and accuracy (vertical axis) for $B = 1 , 5 , 1 0$ on CIFAR-10.
|
| 176 |
+
|
| 177 |
+
Subsampling Ablation In the previous experiment, we kept the architectural and optimization choices fixed across algorithms. This ensured a level playing field, but meant that we were not able to obtain zero training error on the predictor networks used by random priors. However, we also wanted to evaluate random priors in the setting of near-zero training error. To do this, we used a smaller set of training images, while still keeping the network architecture the same. This allowed us to obtain nearcomplete convergence (details in Appendix A).
|
| 178 |
+
|
| 179 |
+
Table 2: Out-of-distribution AUROC for the same models as above (see Tab. 1) on subsampled data. Numbers are accurate up to $\pm 0 . 0 1$ .
|
| 180 |
+
|
| 181 |
+
<table><tr><td></td><td>RP</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td colspan="5">B=1</td></tr><tr><td>Train v.excluded</td><td>1.00</td><td>0.90</td><td>0.89</td><td>0.91</td></tr><tr><td>Train v. SVHN</td><td>1.00</td><td>0.95</td><td>0.94</td><td>0.97</td></tr><tr><td colspan="5">B=10</td></tr><tr><td>Train v.excluded</td><td>1.00</td><td>0.94</td><td>0.90</td><td>0.92</td></tr><tr><td>Train v. SVHN</td><td>1.00</td><td>0.97</td><td>0.95</td><td>0.97</td></tr></table>
|
| 182 |
+
|
| 183 |
+
Results of this ablation are shown in Figures 5 and 6, as well as Table 2, analogous to our results on the full dataset presented above. In this sub-sampled regime, the random prior method easily outperformed competing approaches, showing better calibration (Fig. 5). The histograms in Figure 6 also demonstrate good separation between seen and unseen data. In the out-of-distribution benchmarks reported in Table 2, the random prior method has comfortably outperformed the baselines. While this training regime is not practical for real-life tasks, it demonstrates the potential performance of random priors when trained to full convergence.
|
| 184 |
+
|
| 185 |
+
Sensitivity to Initialization Scale We performed an ablation to test the robustness of our algorithm to the scaling of the weight initialization in the prior. Results are shown in Figure 7, where we plot the relationship between initialization scale (taken from the set $\{ 0 . 0 1 , 0 . 1 , 1 . 0 , 2 . 0 , 5 . 0 , 1 0 . 0 \} )$ and AUROC performance on the CIFAR-10 task. OOD performance is relatively robust with respect to the weight initialization within one order of magnitude.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 5: The relationship between uncertainty (horizontal axis) and accuracy (vertical axis) for $B =$ 1, 5, 10 on a subset of 75 samples from CIFAR-10. In well-calibrated models, accuracy increases as uncertainty declines.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 6: Distribution of uncertainty estimates for various algorithms. Top row shows seen data, bottom row shows unseen data from CIFAR-10, where we trained on a sample of 75 images from the training set. For random priors (RP), uncertainties are $\hat { \sigma } ^ { 2 }$ . For other algorithms, they are $1 -$ $\operatorname* { m a x } ( p _ { \mu } )$ , where $p _ { \mu }$ is the averaged output of models in ensemble (Lakshminarayanan et al., 2017).
|
| 192 |
+
|
| 193 |
+
Summary of experiments We have shown that uncertainties obtained from random priors achieve competitive performance with fewer bootstraps in a regime where the network architecture is typical for standard supervised learning workloads. Random priors showed superior performance in a regime where the predictors can be trained to near-zero loss.
|
| 194 |
+
|
| 195 |
+
# 8 CONCLUSIONS
|
| 196 |
+
|
| 197 |
+
We provided a theoretical justification for the use of random priors for obtaining uncertainty estimates in the context of deep learning. We have shown that the obtained uncertainties are conservative and that they concentrate for any neural network architecture. We performed an extensive empirical comparison, showing that random priors perform similarly to deep ensembles in a typical supervised training setting, while outperforming them in a regime where we are able to accomplish near-zero training loss for the predictors.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 7: Robustness of OOD perfromance to initialization scale. Conf. bars present, but small, denoting high confidence. Horizontal axis is logarithmic.
|
| 201 |
+
|
| 202 |
+
# REFERENCES
|
| 203 |
+
|
| 204 |
+
Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 242–252, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings. mlr.press/v97/allen-zhu19a.html.
|
| 205 |
+
|
| 206 |
+
Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, pp. 1471–1479, 2016.
|
| 207 |
+
|
| 208 |
+
Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. arXiv preprint arXiv:1505.05424, 2015.
|
| 209 |
+
|
| 210 |
+
Nicolas Brosse, Alain Durmus, and Eric Moulines. The promises and pitfalls of stochastic gradient langevin dynamics. In Advances in Neural Information Processing Systems, pp. 8268–8278, 2018.
|
| 211 |
+
|
| 212 |
+
Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018.
|
| 213 |
+
|
| 214 |
+
Ashwin Mark Carvalho. Predictive Control under Uncertainty for Safe Autonomous Driving: Integrating DataDriven Forecasts with Control Design. PhD thesis, UC Berkeley, 2016.
|
| 215 |
+
|
| 216 |
+
Zezhou Cheng, Matheus Gadelha, Subhransu Maji, and Daniel Sheldon. A bayesian perspective on the deep image prior. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5443–5451, 2019.
|
| 217 |
+
|
| 218 |
+
Amit Daniely, Roy Frostig, and Yoram Singer. Toward deeper understanding of neural networks: The power of initialization and a dual view on expressivity. In Advances In Neural Information Processing Systems, pp. 2253–2261, 2016.
|
| 219 |
+
|
| 220 |
+
Bruno De Finetti. La prevision: ses lois logiques, ses sources subjectives. In ´ Annales de l’institut Henri Poincare´, pp. 1–68, 1937.
|
| 221 |
+
|
| 222 |
+
Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning, pp. 1675–1685, 2019.
|
| 223 |
+
|
| 224 |
+
John Duchi. Probability bounds, 2009.
|
| 225 |
+
|
| 226 |
+
Bradley Efron and Robert J. Tibshirani. An Introduction to the Bootstrap. SIAM Review, 36(4):677–678, 1994. doi: 10.1137/1036171.
|
| 227 |
+
|
| 228 |
+
Andrew YK Foong, David R Burt, Yingzhen Li, and Richard E Turner. Pathologies of factorised gaussian and mc dropout posteriors in bayesian neural networks. arXiv preprint arXiv:1909.00719, 2019.
|
| 229 |
+
|
| 230 |
+
Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pp. 1050–1059, 2016. URL http://proceedings.mlr. press/v48/gal16.html.
|
| 231 |
+
|
| 232 |
+
Yarin Gal, Jiri Hron, and Alex Kendall. Concrete dropout. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pp. 3581–3590, 2017.
|
| 233 |
+
|
| 234 |
+
Adri Garriga-Alonso, Carl Edward Rasmussen, and Laurence Aitchison. Deep convolutional networks as shallow gaussian processes. In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id $\equiv$ Bklfsi0cKm.
|
| 235 |
+
|
| 236 |
+
Tamir Hazan and Tommi Jaakkola. Steps toward deep kernel methods from infinite neural networks. arXiv preprint arXiv:1508.05133, 2015.
|
| 237 |
+
|
| 238 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems, pp. 1109– 1117, 2016.
|
| 239 |
+
|
| 240 |
+
Jiri Hron, Alexander G. de G. Matthews, and Zoubin Ghahramani. Variational bayesian dropout: pitfalls and fixes. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018 ¨ , pp. 2024–2033, 2018. URL http: //proceedings.mlr.press/v80/hron18a.html.
|
| 241 |
+
|
| 242 |
+
Edwin T Jaynes. Probability theory: The logic of science. Cambridge university press, 2003.
|
| 243 |
+
|
| 244 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 245 |
+
|
| 246 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In 2nd International Conference on Learning Representations, ICLR 2014, Banff, AB, Canada, April 14-16, 2014, Conference Track Proceedings, 2014. URL http://arxiv.org/abs/1312.6114.
|
| 247 |
+
|
| 248 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 249 |
+
|
| 250 |
+
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In Advances in Neural Information Processing Systems, pp. 6402–6413, 2017.
|
| 251 |
+
|
| 252 |
+
Nicolas Le Roux and Yoshua Bengio. Continuous neural networks. In Artificial Intelligence and Statistics, pp. 404–411, 2007.
|
| 253 |
+
|
| 254 |
+
Yann LeCun. The mnist database of handwritten digits. http://yann. lecun. com/exdb/mnist/, 1998.
|
| 255 |
+
|
| 256 |
+
Jaehoon Lee, Jascha Sohl-dickstein, Jeffrey Pennington, Roman Novak, Sam Schoenholz, and Yasaman Bahri. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\equiv$ B1EA-M-0Z.
|
| 257 |
+
|
| 258 |
+
Christian Leibig, Vaneeda Allken, Murat Sec¸kin Ayhan, Philipp Berens, and Siegfried Wahl. Leveraging uncertainty information from deep neural networks for disease detection. Scientific reports, 7(1):17816, 2017.
|
| 259 |
+
|
| 260 |
+
Ulrike von Luxburg and Olivier Bousquet. Distance-based classification with lipschitz functions. Journal of Machine Learning Research, 5(Jun):669–695, 2004.
|
| 261 |
+
|
| 262 |
+
Andrey Malinin and Mark Gales. Predictive uncertainty estimation via prior networks. In Advances in Neural Information Processing Systems, pp. 7047–7058, 2018.
|
| 263 |
+
|
| 264 |
+
AGDG Matthews, M Rowland, J Hron, RE Turner, and Z Ghahramani. Gaussian process behaviour in wide deep neural networks. In Proceedings of the 6th International Conference on Learning Representations., 2018.
|
| 265 |
+
|
| 266 |
+
Rhiannon Michelmore, Marta Kwiatkowska, and Yarin Gal. Evaluating uncertainty quantification in end-to-end autonomous driving control. arXiv preprint arXiv:1811.06817, 2018.
|
| 267 |
+
|
| 268 |
+
Mehryar Mohri, Afshin Rostamizadeh, and Ameet Talwalkar. Foundations of machine learning. MIT press, 2018.
|
| 269 |
+
|
| 270 |
+
Kevin P Murphy. Machine learning: a probabilistic perspective. MIT press, 2012.
|
| 271 |
+
|
| 272 |
+
Eric Nalisnick, Jose Miguel Hernandez-Lobato, and Padhraic Smyth. Dropout as a structured shrinkage prior. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 4712–4722, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/v97/ nalisnick19a.html.
|
| 273 |
+
|
| 274 |
+
Radford M Neal. Bayesian learning for neural networks. Phd Thesis, 1996.
|
| 275 |
+
|
| 276 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011, 2011.
|
| 277 |
+
|
| 278 |
+
Roman Novak, Lechao Xiao, Yasaman Bahri, Jaehoon Lee, Greg Yang, Daniel A. Abolafia, Jeffrey Pennington, and Jascha Sohl-dickstein. Bayesian deep convolutional networks with many channels are gaussian processes. In International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id=B1g30j0qF7.
|
| 279 |
+
|
| 280 |
+
K. Osawa, S. Swaroop, A. Jain, R. Eschenhagen, R. E. Turner, R. Yokota, and M. E. Khan. Practical deep learning with bayesian principles. In The 33rd Conference on Neural Information Processing Systems (NeurIPS 2019), Vancouver, Canada, Dec. 8-14 2019.
|
| 281 |
+
|
| 282 |
+
Ian Osband, John Aslanides, and Albin Cassirer. Randomized prior functions for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 8617–8629, 2018.
|
| 283 |
+
|
| 284 |
+
Ian Osband, Benjamin Van Roy, Daniel J. Russo, and Zheng Wen. Deep exploration via randomized value functions. Journal of Machine Learning Research, 20(124):1–62, 2019. URL http://jmlr.org/papers/ v20/18-339.html.
|
| 285 |
+
|
| 286 |
+
Georg Ostrovski, Marc G Bellemare, Aaron van den Oord, and R ¨ emi Munos. Count-based exploration with ´ neural density models. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2721–2730. JMLR. org, 2017.
|
| 287 |
+
|
| 288 |
+
F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
|
| 289 |
+
|
| 290 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Eric P. Xing and Tony Jebara (eds.), Proceedings of the 31st International Conference on Machine Learning, volume 32 of Proceedings of Machine Learning Research, pp. 1278–1286, Bejing, China, 22–24 Jun 2014. PMLR. URL http://proceedings.mlr.press/v32/ rezende14.html.
|
| 291 |
+
|
| 292 |
+
Christian Robert. The Bayesian choice: from decision-theoretic foundations to computational implementation. Springer Science & Business Media, 2007.
|
| 293 |
+
|
| 294 |
+
Donald B Rubin. The bayesian bootstrap. The annals of statistics, pp. 130–134, 1981.
|
| 295 |
+
|
| 296 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. The journal of machine learning research, 15(1): 1929–1958, 2014.
|
| 297 |
+
|
| 298 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9446–9454, 2018.
|
| 299 |
+
|
| 300 |
+
Max Welling and Yee W Teh. Bayesian learning via stochastic gradient langevin dynamics. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 681–688, 2011.
|
| 301 |
+
|
| 302 |
+
Christopher KI Williams. Computing with infinite networks. In Advances in neural information processing systems, pp. 295–301, 1997.
|
| 303 |
+
|
| 304 |
+
Christopher KI Williams and Carl Edward Rasmussen. Gaussian processes for machine learning. MIT press Cambridge, MA, 2006.
|
| 305 |
+
|
| 306 |
+
Greg Yang. Wide feedforward or recurrent neural networks of any architecture are gaussian processes. In Neural Information Processing Systems (NeurIPS), 2019.
|
| 307 |
+
|
| 308 |
+
# APPENDICES
|
| 309 |
+
|
| 310 |
+
APPENDIX A REPRODUCIBILITY AND DETAILS OF EXPERIMENTAL SETUP
|
| 311 |
+
|
| 312 |
+
APPENDIX A.1 SYNTHETIC DATA
|
| 313 |
+
|
| 314 |
+
For the 1D regression experiment on synthetic data (Fig 1), we used feed-forward neural networks with 2 layers of 128 units each and a 1-dimensional output layer. We used an ensemble size of 5. The network was trained on 20 points sampled from the negative domain of a sigmoid function and tested on 20 points sampled from the positive domain.
|
| 315 |
+
|
| 316 |
+
APPENDIX A.2 EXPERIMENTAL SETUP
|
| 317 |
+
|
| 318 |
+
Model architecture For the CIFAR-10 experiments, we adapted the setup from the cifar10-fast model.3 For the network predicting the mean, we used the exact same architecture as in this model. For the prior networks in our uncertainty estimators, the architecture for the prior network was the same as the mean network, but using a final linear layer instead of the softmax layer. We used squared error on that last layer to get the uncertainties. For the predictor networks in the uncertainty estimators, we added two additional layers at the end to make sure the prior functions are learnable (see Fig. 2).
|
| 319 |
+
|
| 320 |
+
We followed Burda et al. (2018) in choosing the output size to be $M = 5 1 2$ and using the Adam optimizer (Kingma & Ba, 2014) with a learning rate of 0.0001. We optimized the initialization scale of our networks as a hyperparameter on the grid $\{ 0 . 0 1 , 0 . 1 , 1 . 0 , 2 . 0 , 1 0 . 0 \}$ and chose 2.0. We chose a scaling factor of $\beta = 1 . 0$ for the uncertainty bonus of the random priors and fixed it for all experiments.
|
| 321 |
+
|
| 322 |
+
Data For the CIFAR-10 experiment, we trained on the classes {bird, dog, frog, horse} and excluded {cat, deer, airplane, automobile, ship, truck}. For the small CIFAR-10 ablation experiment, we trained on 75 images sampled from the classes $\{ { \mathrm { s h i p } } , { \mathrm { t r u c k } } \}$ and excluded the remaining classes.
|
| 323 |
+
|
| 324 |
+
Training Error The training error was $0 . 5 7 \pm 0 . 2 0$ on the CIFAR experiment and $0 . 0 3 \pm 0 . 0 2$ on the sub-sampled ablation (the symbol $\pm$ denotes $90 \%$ confidence intervals).
|
| 325 |
+
|
| 326 |
+
Out-of-distribution classification For computing the areas under the receiver-operator characteristic curves (AUROC) in the OOD classification tables, we used the roc auc score function from the Python package sklearn (Pedregosa et al., 2011), using the predicted uncertainties as predicted label scores and binary labels for whether or not the samples were from the training set.
|
| 327 |
+
|
| 328 |
+
APPENDIX B ADDITIONAL RESULTS
|
| 329 |
+
|
| 330 |
+
# APPENDIX B.1 CONFIDENCE INTERVALS FOR AUROCS
|
| 331 |
+
|
| 332 |
+
We provide confidence intervals for AUROC measurements in Table 3.
|
| 333 |
+
|
| 334 |
+
<table><tr><td></td><td>RP</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td colspan="5">B=1</td></tr><tr><td>Train v. cat/deer</td><td>0.99 ± 0.002</td><td>0.83± 0.065</td><td>0.96± 0.008</td><td>0.81 ± 0.001</td></tr><tr><td>Train v. vehicles</td><td>1.00 ± 0.000</td><td>0.82 ± 0.070</td><td>0.96 ± 0.007</td><td>0.76 ± 0.001</td></tr><tr><td>Train v. excluded</td><td>1.00 ± 0.001</td><td>0.82 ± 0.069</td><td>0.96 ± 0.007</td><td>0.77 ± 0.002</td></tr><tr><td>Train v. SVHN</td><td>0.95 ± 0.013</td><td>0.88 ± 0.101</td><td>0.96 ± 0.009</td><td>0.86 ± 0.002</td></tr></table>
|
| 335 |
+
|
| 336 |
+
Table 3: Out-of-distribution AUROC for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ and spatial concrete dropout (DR). The errors are computed from ten samples each in the $B = 1$ case. The $\pm$ symbol denotes one standard error.
|
| 337 |
+
|
| 338 |
+
# APPENDIX B.2 OOD CLASSIFICATION ACCURACIES
|
| 339 |
+
|
| 340 |
+
In addition to AUROC results, we also provide accuracy figures on the same OOD tasks. The thresholding for classification was obtained by cross-validation.
|
| 341 |
+
|
| 342 |
+
They are in Table 4 and 5.
|
| 343 |
+
|
| 344 |
+
<table><tr><td></td><td>RP</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td colspan="5">B=1</td></tr><tr><td>Train v.cat/deer</td><td>0.97 ± 0.001</td><td>0.83 ±0.008</td><td>0.97 ± 0.006</td><td>0.82±0.000</td></tr><tr><td>Train v.vehicles</td><td>0.99 ± 0.001</td><td>0.81 ± 0.008</td><td>0.96 ± 0.004</td><td>0.86 ± 0.000</td></tr><tr><td>Train v. excluded</td><td>0.98 ± 0.001</td><td>0.87 ± 0.022</td><td>0.97 ± 0.007</td><td>0.70 ± 0.002</td></tr><tr><td>Train v. SVHN</td><td>0.91 ± 0.006</td><td>0.91 ± 0.025</td><td>0.96 ± 0.008</td><td>0.78 ± 0.001</td></tr><tr><td colspan="5">B=10</td></tr><tr><td>Trainv.cat/deer</td><td>0.98</td><td>0.88</td><td>0.96</td><td>0.82</td></tr><tr><td>Train v.vehicles</td><td>0.99</td><td>0.87</td><td>0.95</td><td>0.86</td></tr><tr><td>Train v. excluded</td><td>0.99</td><td>0.89</td><td>0.96</td><td>0.71</td></tr><tr><td>Train v. SVHN</td><td>0.92</td><td>0.88</td><td>0.96</td><td>0.78</td></tr></table>
|
| 345 |
+
|
| 346 |
+
Table 4: Out-of-distribution classification accuracy for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ and spatial concrete dropout (DR). These values augment the AUROC values reported in Table 1. The $\pm$ symbol denotes one standard error.
|
| 347 |
+
|
| 348 |
+
<table><tr><td></td><td>RP</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td colspan="5">B=1</td></tr><tr><td>Train v.excluded</td><td>1.00</td><td>0.90</td><td>0.88</td><td>0.91</td></tr><tr><td>Train v. SVHN</td><td>1.00</td><td>0.95</td><td>0.90</td><td>0.97</td></tr><tr><td colspan="5">B=10</td></tr><tr><td>Trainv. excluded</td><td>1.00</td><td>0.95</td><td>0.89</td><td>0.91</td></tr><tr><td>Train v. SVHN</td><td>1.00</td><td>0.97</td><td>0.95</td><td>0.96</td></tr></table>
|
| 349 |
+
|
| 350 |
+
Table 5: Out-of-distribution accuracy for the same models as above (see Tab. 4) on subsampled data.
|
| 351 |
+
These values augment the AUROC values reported in Table 2.
|
| 352 |
+
|
| 353 |
+
APPENDIX B.3 SUPERVISED IN-DISTRIBUTION CLASSIFICATION ACCURACIES
|
| 354 |
+
|
| 355 |
+
<table><tr><td></td><td>RP*</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td>CIFAR-10</td><td>0.86</td><td>0.88</td><td>0.86</td><td>0.86</td></tr><tr><td>Subsampled CIFAR-10</td><td>0.82</td><td>0.81</td><td>0.82</td><td>0.75</td></tr><tr><td>CIFAR-100</td><td>0.90</td><td>0.91</td><td>0.90</td><td>0.89</td></tr></table>
|
| 356 |
+
|
| 357 |
+
Table 6: In-distribution supervised classification accuracies on the respective test sets of the different data sets for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ ) and spatial concrete dropout (DR).
|
| 358 |
+
|
| 359 |
+
\*Since random priors do not have an intrinsic supervised prediction model, we used the predictions from the $\mathrm { D E + A T }$ model in all our experiments instead, setting $B = 1$ .
|
| 360 |
+
|
| 361 |
+
# APPENDIX B.4 CIFAR100 EXPERIMENT
|
| 362 |
+
|
| 363 |
+
As additional empirical support for our method, we ran experiments on another data set, namely CIFAR-100 (Krizhevsky et al., 2009). Again, we include 5 classes in the training set and exclude the remaining classes. The results are reported in the following (Figs. 8, 9; Tabs. 7, 8). They qualitatively and quantitatively support the same conclusions as our previous experiments.
|
| 364 |
+
|
| 365 |
+
# APPENDIX C BACKGROUND ON BAYES RISK
|
| 366 |
+
|
| 367 |
+
For completeness, we recall the definition of Bayes Risk. We are often interested in minimizing the Mean Squared Error $\mathrm { E } _ { f } \left[ ( f ( x _ { \star } ) - w ) ^ { 2 } \right]$ , where $x _ { \star }$ is a given test point and $w$ is a variable we are
|
| 368 |
+
|
| 369 |
+

|
| 370 |
+
Figure 8: Distribution of uncertainty estimates for various algorithms. Top row shows seen data, bottom row shows unseen data from CIFAR-100. For random priors (RP), uncertainties are $\hat { \sigma } ^ { 2 }$ . For other algorithms, they are $1 - \operatorname* { m a x } ( p _ { \mu } )$ , where $p _ { \mu }$ is the averaged output of models in ensemble (Lakshminarayanan et al., 2017).
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 9: The relationship between uncertainty (horizontal axis) and accuracy (vertical axis) for $B =$ 1, 5, 10 on samples from CIFAR-100. In well-calibrated models, accuracy increases as uncertainty declines.
|
| 374 |
+
|
| 375 |
+
allowed to adjust. A known result of Bayesian decision theory (Robert, 2007; Murphy, 2012) is that the minimizer of the MSE is given by the expected value of $f$ , i.e.
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\underset { w } { \arg \operatorname* { m i n } } \mathrm { E } _ { f } \left[ ( f ( x _ { \star } ) - w ) ^ { 2 } \right] = \mathrm { E } _ { f } \left[ f ( x _ { \star } ) \right] .
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
Equation 12 holds for any stochastic process $f$ , including when $f$ is a posterior process obtained by conditioning on some dataset. A consequence of equation 12 is that it is impossible to obtain a MSE lower than the one obtained by computing the posterior mean of $f$ .
|
| 382 |
+
|
| 383 |
+
# APPENDIX D GAUSSIAN PROCESSES
|
| 384 |
+
|
| 385 |
+
A stochastic process is Gaussian (Williams & Rasmussen, 2006), if all its finite-dimensional distributions are Gaussian. The main advantage of GPs is that the posterior process can be expressed in a tractable way. GPs are often used for regression, where we are learning an unknown function4 $\phi : \mathbb { R } ^ { K } \mathbb { R }$ from noisy observations. Since a Gaussian distribution is completely identified by its first two moments, a GP can be defined by a mean function and a covariance function. Formally, the notation $\mathcal { G P } ( \mu , k )$ refers to a GP with with mean function $\mu : \mathbb { R } ^ { K } \mathbb { R }$ , a positive-definite kernel function $\boldsymbol { k } : \dot { \mathbb { R } ^ { K } } \times \mathbb { R } ^ { K } \mathbb { R }$ . GPs can be used to model two kinds of uncertainty: epistemic uncertainty, which reflects lack of knowledge about unobserved values of $\phi$ and aleatoric uncertainty, which reflects measurement noise. When performing regression, we start with a zero-mean prior $\mathcal { G P } ( 0 , k )$ and then observe $N$ training points $X = \{ x _ { i } \} _ { i = 1 , \dots , N }$ and labels $y = \{ y _ { i } \} _ { i = 1 , \dots , N }$ where $y _ { i } = \phi ( x _ { i } ) + \epsilon _ { i }$ . Here, the i.i.d. random variables $\epsilon _ { i } \sim \mathcal { N } ( 0 , \sigma _ { A } ^ { 2 } )$ model the aleatoric noise. We obtain the posterior process on $\mathcal { G P } ( \mu _ { X y } , k _ { X } )$ . For GPs, the mean and covariance of the posterior GP on $y$ evaluated at $x _ { \star }$ can be expressed as
|
| 386 |
+
|
| 387 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>RP</td><td rowspan=1 colspan=1>DE</td><td rowspan=1 colspan=1>DE+AT</td><td rowspan=1 colspan=1>DR</td></tr><tr><td rowspan=1 colspan=5>B=1</td></tr><tr><td rowspan=1 colspan=1>Train v. excludedTrain v. SVHN</td><td rowspan=1 colspan=1>1.00± 0.0001.00 ± 0.000</td><td rowspan=1 colspan=1>0.93± 0.0030.96 ± 0.004</td><td rowspan=1 colspan=1>0.98 ± 0.0010.99 ± 0.001</td><td rowspan=1 colspan=1>0.88±0.0020.82 ±0.002</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>B=10</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Trainv.excludedTrain v. SVHN</td><td rowspan=1 colspan=1>1.001.00</td><td rowspan=1 colspan=1>0.960.99</td><td rowspan=1 colspan=1>0.991.00</td><td rowspan=1 colspan=1>0.900.82</td></tr></table>
|
| 388 |
+
|
| 389 |
+
Table 7: Out-of-distribution classification AUROCs on CIFAR-100 for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ and spatial concrete dropout (DR). The $\pm$ symbol denotes one standard error.
|
| 390 |
+
Table 8: Out-of-distribution classification accuracy on CIFAR-100 for random priors (RP), deep ensembles (DE), deep ensembles with adversarial training $( \mathrm { D E + A T } )$ and spatial concrete dropout (DR). The $\pm$ symbol denotes one standard error. These values augment the AUROC values reported in Table 7.
|
| 391 |
+
|
| 392 |
+
<table><tr><td></td><td>RP</td><td>DE</td><td>DE +AT</td><td>DR</td></tr><tr><td colspan="5">B=1</td></tr><tr><td>Train v.excluded Train v. SVHN</td><td>1.00 ± 0.001 0.97 ± 0.003</td><td>0.91 ±0.002 0.95 ± 0.003</td><td>0.97 ± 0.001 0.99 ± 0.001</td><td>0.82±0.003 0.74 ± 0.003</td></tr><tr><td colspan="5">B=10</td></tr><tr><td>Trainv.excluded</td><td>1.00</td><td>0.94</td><td>0.98</td><td>0.83</td></tr><tr><td>Train v. SVHN</td><td>0.98</td><td>0.98</td><td>0.99</td><td>0.74</td></tr></table>
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\begin{array} { r } { \mu _ { X y } ( x _ { \star } ) = k _ { \star } ^ { \top } ( K + \sigma _ { A } ^ { 2 } I ) ^ { - 1 } y \quad \mathrm { a n d } \qquad } \\ { \sigma _ { X } ^ { 2 } ( x _ { \star } ) \triangleq k _ { X } ( x _ { \star } , x _ { \star } ) + \sigma _ { A } ^ { 2 } = k _ { \star \star } - k _ { \star } ^ { \top } ( K + \sigma _ { A } ^ { 2 } I ) ^ { - 1 } k _ { \star } + \sigma _ { A } ^ { 2 } . } \end{array}
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
In particular, the posterior covariance does not depend on $y$ . In the formula above, we use the kernel matrix $K \in \mathbb { R } ^ { N } \times \mathbb { R } ^ { N }$ defined as $K _ { i j } = k ( x _ { i } , x _ { j } )$ , where $x _ { i }$ and $x _ { j }$ are in the training set. We also use the notation $\boldsymbol { k } _ { \star } \in \mathbb { R } ^ { N }$ for the vector of train-test correlations $\{ k _ { \star } \} _ { i } = k ( x _ { i } , x ^ { \star } )$ , where $x _ { i }$ is in the training set and $k ( x ^ { \star } , x ^ { \star } )$ is similarly defined. The shorthand $\sigma _ { X } ^ { 2 } ( x _ { \star } )$ introduced in equation 14 denotes the posterior variance at a single point.
|
| 399 |
+
|
| 400 |
+
# APPENDIX E LIST OF SYMBOLS DENOTING VARIANCE
|
| 401 |
+
|
| 402 |
+
Below, we give a list of symbols used for variance of various random variables.
|
| 403 |
+
|
| 404 |
+
<table><tr><td>0 .2 O X 8</td><td>posterior variance of stochastic process posterior variance of Gaussian process prior variance of stochastic process sample-based estimate of prior GP variance combined uncertainty estimate (see equation 1) sample-based mean part of uncertainty estimate (see equation 2) Ef[o2]</td></tr></table>
|
| 405 |
+
|
| 406 |
+
# APPENDIX F PROOFS
|
| 407 |
+
|
| 408 |
+
We now give formal proofs for the results in the paper.
|
| 409 |
+
|
| 410 |
+
# APPENDIX F.1 PROOFS RELATING TO CONSERVATISM
|
| 411 |
+
|
| 412 |
+
Lemma 1. For any function $h : \mathbb { R } ^ { N \times ( K + 1 ) } \mathbb { R } ^ { M }$ , for any test point $\boldsymbol { x } _ { \star } ~ \in ~ \mathbb { R } ^ { K }$ and for any stochastic process $\{ f ( x ) \} _ { x \in \mathbb { R } ^ { K } }$ with all second moments finite and exchangeable outputs
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\begin{array} { r } { \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) = \mathrm { E } _ { f ( X ) } \left[ \sigma _ { X f } ^ { 2 } ( x _ { \star } ) + \frac { 1 } { M } \| \mu _ { X f } ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } \right] . } \end{array}
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
Proof. We prove the statement by re-writing the expression on the left.
|
| 419 |
+
|
| 420 |
+
$$
|
| 421 |
+
\begin{array} { r l r } { \bar { \sigma } _ { \mu } ^ { 2 } ( { \boldsymbol x } _ { \star } ) = \frac { 1 } { M } { \mathrm { ~ E } } _ { f } ( { \boldsymbol x } ) , f ( | | f ( { \boldsymbol x } _ { \star } ) - h _ { X } f ( { \boldsymbol x } _ { \star } ) | | ^ { 2 } ] } & { \mathrm { ( I 5 ) } } \\ { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \end{array}
|
| 422 |
+
$$
|
| 423 |
+
|
| 424 |
+
Here, the equality in (16) holds by definition of conditional probability. The equality in (19) holds by definition of posterior mean and the equality 21 follows by assumption that the process has exchangeable outputs. While this argument follows a similar pattern to a standard result about Bayesian Risk (see Appendix Appendix C), it is not identical because the function $h _ { X f }$ depends on $f$ . □
|
| 425 |
+
|
| 426 |
+
Proposition 1 (Strict Conservatism in Expectation). Assume that $f$ is a GP. Then for any function $h : \bar { \mathbb { R } } ^ { N \times K } \to \bar { \mathbb { R } } ^ { M }$ , we have
|
| 427 |
+
|
| 428 |
+
$$
|
| 429 |
+
\tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) = \sigma _ { X } ^ { 2 } ( x _ { \star } ) + \underbrace { { \mathrm E } _ { f ( X ) } \left[ \frac { 1 } { M } \| \mu _ { X f } ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } \right] } _ { \geq 0 } .
|
| 430 |
+
$$
|
| 431 |
+
|
| 432 |
+
Moreover, equality holds if and only if $h _ { X f } ( x _ { \star } ) = \mu _ { X f } ( x _ { \star } )$ .
|
| 433 |
+
|
| 434 |
+
Proof. We instantiate Lemma 1 by setting $f$ to be a GP. By equation 14, the posterior covariance of a GP does not depend on the target values, i.e. $\sigma _ { X f } ^ { 2 } ( x _ { \star } ) \dot { } = \dot { \sigma } _ { X } ^ { 2 } ( x _ { \star } )$ . The first part of the result can be shown by pulling $\sigma _ { X } ^ { 2 } ( x _ { \star } )$ out of the expectation. Moreover, since $\| \cdot \|$ is a norm and hence positive semi-definite, equality holds if and only if $h _ { X f } ( x _ { \star } ) = \mu _ { X f } ( x _ { \star } )$ . □
|
| 435 |
+
|
| 436 |
+
Lemma 3. Assume that the random variable $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ has finite variance upper bounded by vUB.
|
| 437 |
+
With probability $1 - \delta$ , we have $\begin{array} { r } { \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) + \frac { 1 } { \sqrt { \delta } } v _ { U B } \ge \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) } \end{array}$ .
|
| 438 |
+
|
| 439 |
+
Proof. The proof is standard, but we state it in our notation for completeness. Applying Chebyshev’s inequality to the random variable $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ , we have that $\begin{array} { r } { \mathrm { P r o b } \left( | \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) - \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) | \ge \frac { 1 } { \sqrt { \delta } } v _ { \mathrm { U B } } \right) \le \delta , } \end{array}$ , implying the statement. □
|
| 440 |
+
|
| 441 |
+
Corollary 1 (Strict Conservatism for Finite Bootstraps). Assume that $f$ is a GP. Assume that the random variable $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ has finite variance upper bounded by vUB. Then with probability $1 - \delta$ , for any function $h : \mathbb { R } ^ { \dot { N } \times K } \to \mathbb { R } ^ { M }$ , we have
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\begin{array} { r } { \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) + \frac { 1 } { \sqrt { \delta } } v _ { U B } \geq \tilde { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \geq \sigma _ { X } ^ { 2 } ( x _ { \star } ) . } \end{array}
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
Proof. Combine Lemma 3 and Proposition 1.
|
| 448 |
+
|
| 449 |
+
Lemma 2. Assume that the GP $\{ f ( x ) \}$ is zero mean with exchangeable outputs and the function $h _ { X f }$ takes values in $[ - U , U ] ^ { M }$ . Assume that permuting the outputs of $f$ produces the same permutation in the outputs of $h _ { X f }$ . With probability $1 - \delta$ , we have
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\operatorname { V a r } _ { f _ { 1 } , \dots , f _ { B } } \left[ \widehat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) \right] \leq v _ { U B } ,
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
where vUB is expressible in terms of observable quantities.
|
| 456 |
+
|
| 457 |
+
Proof. We seek to decompose the variance of $\hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } )$ into the part that comes from the prior and the part that comes from the fitted function $h _ { X f ^ { m } }$ .
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\begin{array} { r l } & { \operatorname { V a r } _ { f _ { 1 } , \ldots , f _ { D } } \big [ \widehat { \mathcal { O } } _ { \sharp } ^ { \sharp } ( x , x ) \big ] } \\ & { = \operatorname { V a r } _ { f _ { 1 } , \ldots , f _ { D } } \bigg [ \sum _ { i = 1 } ^ { B } \frac { 1 } { M L ^ { D } } \big \lVert f ( x , x ) - h _ { X , f _ { i } } ( x , x ) \big \rVert ^ { 2 } \bigg ] } \\ & { = \frac { 1 } { R } \operatorname { V o r } _ { f } \Big [ \frac { 1 } { M } \big \lVert f ( x , x ) - h _ { X , f _ { i } } ( x , x ) \big \rVert ^ { 2 } \Big ] } \\ & { = \frac { 1 } { B } \frac { 1 } { M } \operatorname { V a r } _ { f } \Big [ \big ( \sum _ { m = 1 } ^ { M } \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 2 } \Big ] } \\ & { = \frac { 1 } { B } \frac { 1 } { M ^ { 2 } } \sum _ { m = 1 } ^ { M } \sum _ { i = 1 } ^ { M } \operatorname { C o r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 2 } , ( f ^ { t } ( x , x ) - h _ { X , f ^ { i } } ( x , x ) \big ) ^ { 2 } \big ] } \\ & { \leq \frac { 1 } { B } \frac { 1 } { M ^ { 2 } } M ^ { 2 } \operatorname { V a r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 2 } \big ] } \\ & { = \frac { 1 } { B } \operatorname { V a r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 2 } \big ] } \\ & { \leq \frac { 1 } { B } \operatorname { E a r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 2 } \big ] } \\ & { = \frac { 1 } { B } \operatorname { V a r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ { X , f ^ { m } } ( x , x ) \big ) ^ { 3 } \big ] } \\ & = \frac { 1 } { B } \operatorname { V a r } _ { f } \big [ \big ( f ^ { m } ( x , x ) - h _ X , f \end{array}
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
Here, line 27 holds by exchangeability of outputs and the Cauchy-Schwarz inequality.
|
| 464 |
+
|
| 465 |
+
Since $h _ { X f ^ { m } } ( x _ { \star } )$ is has support in $[ - U , U ]$ , we have
|
| 466 |
+
|
| 467 |
+
$$
|
| 468 |
+
\begin{array} { r } { \mathrm { E } _ { f } \left[ \left( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 2 } ) \right] \leq U ^ { 2 } , \mathrm { E } _ { f } \left[ \left( h _ { X f ^ { m } } ( x _ { \star } ) \right) ^ { 4 } ) \right] \leq U ^ { 4 } , \mathrm { E } _ { f } \left[ \left( h _ { X f ^ { m } } ( x _ { \star } ) \right) ^ { 6 } \right) \right] \leq U ^ { 6 } . } \end{array}
|
| 469 |
+
$$
|
| 470 |
+
|
| 471 |
+
Moreover, since $f ( x _ { \star } )$ is Gaussian and zero mean, we can write out the moments explicitly.
|
| 472 |
+
|
| 473 |
+
$$
|
| 474 |
+
\begin{array} { r } { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 4 } ) \right] = 3 ( \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } ) \right] ) ^ { 2 } } \\ { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 6 } ) \right] = 1 5 ( \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } ) \right] ) ^ { 3 } } \end{array}
|
| 475 |
+
$$
|
| 476 |
+
|
| 477 |
+
Since $f ( x _ { \star } )$ is Gaussian, we can use a sample-based estimate of the prior variance and obtain an probabilistic confidence interval. In particular, we know that $\begin{array} { r } { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } ) \right] \leq \hat { \sigma } _ { 0 } ^ { 2 } ( x _ { \star } ) \frac { B _ { 0 } - 1 } { \chi _ { I } ^ { 2 } ( \delta ) } } \end{array}$ with probability $1 - \delta$ , where $\chi _ { I } ^ { 2 }$ denotes the inverse CDF of the Chi-Squared distribution with $B _ { 0 } - 1$ degrees of freedom. We denote this upper bound with $\begin{array} { r } { w _ { \mathrm { U B } } = \hat { \sigma } _ { 0 } ^ { 2 } ( x _ { \star } ) \frac { B _ { 0 } - 1 } { \chi _ { I } ^ { 2 } ( \delta ) } } \end{array}$ .
|
| 478 |
+
|
| 479 |
+
We proceed by bounding the individual terms in equation 30 separately.
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
\begin{array} { r l } & { \quad \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 4 } \right] = 3 ( \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } \right] ) ^ { 2 } } \\ & { - \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 3 } h _ { X f ^ { m } } ( x _ { \star } ) \right] \leq \sqrt { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 6 } \right] \mathrm { E } _ { f } \left[ ( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 2 } \right] } } \\ & { \quad \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } ( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 2 } \right] \leq \sqrt { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 4 } \right] \mathrm { E } _ { f } \left[ ( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 4 } \right] } } \\ & { - \mathrm { E } _ { f } \left[ f ^ { m } ( x _ { \star } ) ( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 3 } \right] \leq \sqrt { \mathrm { E } _ { f } \left[ ( f ^ { m } ( x _ { \star } ) ) ^ { 2 } \right] \mathrm { E } _ { f } \left[ ( h _ { X f ^ { m } } ( x _ { \star } ) ) ^ { 6 } \right] } } \end{array}
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+
Combining the above, equation 30 and the bounds on individual moments in equations 31 and 32, we obtain
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
\begin{array} { r } { \operatorname { V a r } _ { f _ { 1 } , \ldots , f _ { B } } \left[ \widehat \sigma _ { \mu } ^ { 2 } ( x _ { \star } ) \right] \leq \underbrace { \frac { 1 } { B } \left( 3 w _ { \mathrm { U B } } ^ { 2 } + 4 \sqrt { 1 5 w _ { \mathrm { U B } } ^ { 3 } U ^ { 2 } } + 6 \sqrt { 3 w _ { \mathrm { U B } } ^ { 2 } U ^ { 4 } } + 4 \sqrt { w _ { \mathrm { U B } } U ^ { 6 } } + U ^ { 4 } \right) } _ { v _ { \mathrm { U B } } } . } \end{array}
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
Here, $\begin{array} { r } { w _ { \mathrm { U B } } = \hat { \sigma } _ { 0 } ^ { 2 } ( x _ { \star } ) \frac { B _ { 0 } - 1 } { \chi _ { I } ^ { 2 } ( \delta ) } } \end{array}$ , $\hat { \sigma } _ { 0 } ^ { 2 } ( x _ { \star } )$ is a sample-based estimate of the prior variance obtained with $B _ { 0 }$ samples, where $\chi _ { I } ^ { 2 }$ denotes the inverse CDF of the Chi-Squared distribution with $B _ { 0 } - 1$ degrees of freedom.
|
| 492 |
+
|
| 493 |
+
# APPENDIX F.2 PROOFS RELATING TO CONCENTRATION
|
| 494 |
+
|
| 495 |
+
We now proceed to the proofs showing concentration. We begin by formally defining a class of predictor networks.
|
| 496 |
+
|
| 497 |
+
Definition 1 (Class $\mathcal { H } _ { U }$ of Lipschitz networks). Consider functions $h ~ : ~ \mathbb { R } ^ { K } ~ \to ~ \mathbb { R } ^ { M }$ . Let $j , j ^ { \prime } \ = \ 1 , \ldots , M$ , index the outputs of the function. We define $\mathcal { H } _ { U }$ so that each $\textit { h } \in \ \mathcal { H } _ { U }$ has the following properties for each ${ j , j ^ { \prime } }$ . $\mathbf { ( P 1 }$ ) $h _ { j }$ is Lipschitz continuous with constant $L ,$ i.e. $\| h _ { j } ( x ) - h _ { j } ( x ^ { \prime } ) \| _ { 2 } \leq L \| x - x ^ { * } \| _ { 2 }$ for all $x , x ^ { \prime }$ with $\| x \| _ { \infty } \leq 1$ and $\| x ^ { \prime } \| _ { \infty } \leq 1$ , $( \mathbf { P } 2 )$ outputs are exchangeable, i.e. $\{ h _ { j } : h \in \mathcal { H } _ { U } \} = \{ h _ { j ^ { \prime } } : h \in \mathcal { H } _ { U } \}$ , (P3) the class is symmetric around zero, i.e. $h _ { j } \ \in \ \{ h _ { j } \ : \ \bar { h } \ \in \ \mathcal { H } _ { U } \}$ implies $- \bar { h } _ { j } \in \lbrace h _ { j } : h \in \rbrace { \mathcal { H } } _ { U } \rbrace$ . (P4) $h _ { j }$ is bounded, i.e. $\operatorname* { m a x } _ { \| x \| _ { \infty } \leq 1 } | h _ { j } ( x ) | \leq U$ .
|
| 498 |
+
|
| 499 |
+
While the conditions in Definition 1 look complicated, they are in fact easy to check for predictor networks that follow the architecture in Figure 2. In particular, Lipschitz continuity $( \mathbf { P 1 } )$ has to hold in practice because its absence would indicate extreme sensitivity to input perturbations. Output exchangeability $( \mathbf { P } 2 )$ holds since reordering the outputs does not change our architecture. Symmetry around zero $( { \bf P } { \bf 3 } )$ holds by flipping the sign in the last network layer. Boundedness $\mathbf { ( P 4 ) }$ is easy to ensure by clipping outputs. In the following Lemma, we obtain a bound on the expected uncertainty.
|
| 500 |
+
|
| 501 |
+
Lemma 4. Consider a target function $f : \mathbb { R } ^ { K } \to \mathbb { R } ^ { M }$ , where $j = 1 , \dots , M$ , with the domain restricted to $\| x \| _ { \infty } \leq 1$ . Introduce a constant $U$ such that $\operatorname* { m a x } _ { \| x \| \infty \leq 1 } | f _ { j } ( x ) | \leq U$ . Denote the data distribution with support on $\{ x : \| x \| _ { \infty } \leq 1 \}$ as $\mathcal { D }$ . Moreover, assume $K \geq 3 .$ . For $h _ { X f } \in \mathcal { H } _ { U }$ , with probability $1 - \delta$ we have
|
| 502 |
+
|
| 503 |
+
$$
|
| 504 |
+
\begin{array} { r } { \mathrm { E } _ { x _ { \star } \sim { D } } [ \frac { 1 } { M } \| f ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } ] \le \frac { 1 } { M N } \sum _ { i = 1 } ^ { N } \| f ( x _ { i } ) - h _ { X f } ( x _ { i } ) \| ^ { 2 } + L U { \cal O } \Big ( \frac { 1 } { \sqrt [ { k _ { \sqrt { N } } } ] { \frac { \log ( 1 / \delta ) } { N } } } \Big ) . } \end{array}
|
| 505 |
+
$$
|
| 506 |
+
|
| 507 |
+
Proof. The proof uses standard Rademacher tools. To avoid confusion across several conventions, we explicitly define the Rademacher complexity of a function class $\mathcal { G }$ as:
|
| 508 |
+
|
| 509 |
+
$$
|
| 510 |
+
\begin{array} { r } { \hat { \mathfrak { R } } _ { N } ( \mathcal { G } ) \triangleq \mathrm { E } _ { u _ { i } } \left[ \operatorname* { s u p } _ { g \in \mathcal { G } } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } u _ { i } g ( x _ { i } ) \right] = \mathrm { E } _ { u _ { i } } \left[ \operatorname* { s u p } _ { g \in \mathcal { G } } \frac { 1 } { N } \left| \sum _ { i = 1 } ^ { N } u _ { i } ^ { j } g ( x _ { i } ) \right| \right] . } \end{array}
|
| 511 |
+
$$
|
| 512 |
+
|
| 513 |
+
Here, the random variables $u _ { i }$ are sampled i.i.d. using a discrete distribution with $\mathrm { P r o b } ( u _ { i } ~ =$ $- 1 ) \ = \ \mathrm { P r o b } ( u _ { i } \ = \ 1 ) \ = \ { \textstyle { \frac { 1 } { 2 } } }$ and the the second equality follows by using property (P3). We start by applying the generic Rademacher bound (Mohri et al., 2018) to the function class $\mathcal { M } =$ $\begin{array} { r } { \{ x _ { 1 } , \ldots , \overset { \left. \right.} { x _ { N } } , t _ { 1 } \ldots , t _ { N } \frac { 1 } { U ^ { 2 } } \frac { 1 } { M } \| t _ { i } - h ( x _ { i } ) \| ^ { 2 } , h \in \mathcal { H } _ { U } \} . } \end{array}$ , which contains the possible errors of the predictor.
|
| 514 |
+
|
| 515 |
+
$$
|
| 516 |
+
\begin{array} { r l } & { \mathrm { E } _ { x _ { \star } \sim \mathcal { D } } [ \frac { 1 } { B ^ { 2 } } \frac { 1 } { M } \| f ( x _ { \star } ) - h _ { X f } ( x _ { \star } ) \| ^ { 2 } ] } \\ & { \phantom { \frac { 1 } { \theta } } \leq \frac { 1 } { M N } \frac { 1 } { B ^ { 2 } } \sum _ { i = 1 } ^ { N } \| f ( x _ { i } ) - h _ { X f } ( x _ { i } ) \| ^ { 2 } + \widehat { \mathfrak { R } } _ { N } ( \mathcal { M } ) + O \left( \sqrt { \frac { \log ( 1 / \delta ) } { N } } \right) . } \end{array}
|
| 517 |
+
$$
|
| 518 |
+
|
| 519 |
+
We now introduce the function class $\begin{array} { r } { \mathcal { M } ^ { \prime } = \{ x _ { 1 } , \ldots , x _ { N } , t _ { 1 } \ldots , t _ { N } \frac { 1 } { B ^ { 2 } } ( t _ { i } ^ { j } - h ^ { j } ( x _ { i } ) ) ^ { 2 } , h \in \mathcal { H } _ { U } \} } \end{array}$ which models the per-output squared error. Because of property (P2), ${ \bar { \mathcal { M } } } ^ { \prime }$ does not depend on the output index $j$ . By pulling out the sum outside the supremum in equation 35, we get
|
| 520 |
+
|
| 521 |
+
$$
|
| 522 |
+
\hat { \Re } _ { N } ( \mathcal { M } ) \leq \hat { \Re } _ { N } ( \mathcal { M } ^ { \prime } ) .
|
| 523 |
+
$$
|
| 524 |
+
|
| 525 |
+
by Talagrand’s Lemma (Mohri et al., 2018; Duchi, 2009), we also have
|
| 526 |
+
|
| 527 |
+
$$
|
| 528 |
+
\hat { \mathfrak { R } } _ { N } ( \mathcal { M } ^ { \prime } ) \leq 4 \hat { \mathfrak { R } } _ { N } ( \mathcal { H } _ { 1 } ) .
|
| 529 |
+
$$
|
| 530 |
+
|
| 531 |
+
Here, $\mathcal { H } _ { 1 } \ = \ \{ \frac { 1 } { \pi } h ^ { j } \ : \ h \in \ \mathcal { H } _ { U } \}$ . By property $( \mathbf { P 1 } )$ , functions in $\mathcal { H } _ { 1 }$ are Lipschitz continuous with constant $L / U$ . Instantiating a known bound for Lipschitz-continuous functions (Luxburg $\&$ Bousquet, 2004, Theorem 18 and Example 4), and using the assumption $K \geq 3$ , we get $\hat { \mathfrak { R } } _ { N } ( \varkappa _ { 1 } ) \leq$ $\begin{array} { r } { \frac { L } { U } O \left( \frac { 1 } { \sqrt [ K ] { N } } \right) } \end{array}$ . The Lemma follows by combining this with equation 37 and equation 38, plugging into equation 36 and re-scaling by $U ^ { 2 }$ . □
|
| 532 |
+
|
| 533 |
+
Lemma 4 allowed us to relate the error on the training set to the expected error on the test set. It also shows that the two will be closer for small values of the Lipschitz constant $L$ . We now use this Lemma to show our main concentration result (Proposition 2).
|
| 534 |
+
|
| 535 |
+
Proposition 2. If the training converges, i.e. the training loss $\begin{array} { r } { \frac { 1 } { M N } \sum _ { i = 1 } ^ { N } \| f ( x _ { i } ) - h _ { X f } ( x _ { i } ) \| ^ { 2 } = \sigma _ { A } ^ { 2 } } \end{array}$ for arbitrarily large training sets, then assuming the predictors $h _ { X f }$ are bounded and Lipschitz continuous with constant $L ,$ , then under technical conditions the uncertainties concentrate, i.e. $\hat { \sigma } ^ { 2 } ( x _ { \star } ) 0$ as $N \to \infty$ and $B \infty$ with probability $^ { l }$ .
|
| 536 |
+
|
| 537 |
+
Proof. We are assuming the technical conditions of Lemma 4. Instantiating Lemma 4, setting the training loss to $\sigma _ { A } ^ { 2 }$ in the RHS of equation 34 and letting $N \infty$ , we obtain the following with probability 1:
|
| 538 |
+
|
| 539 |
+
$$
|
| 540 |
+
\operatorname * { l i m } _ { N \infty } \mathrm { E } _ { x _ { \star } \sim \mathcal { D } } [ \widehat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) ] = \sigma _ { A } ^ { 2 } .
|
| 541 |
+
$$
|
| 542 |
+
|
| 543 |
+
This implies:
|
| 544 |
+
|
| 545 |
+
$$
|
| 546 |
+
\operatorname* { l i m } _ { N \infty } \mathrm { E } _ { x _ { \star } \sim \mathcal { D } } [ \operatorname* { m a x } ( 0 , \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) - \sigma _ { A } ^ { 2 } ) ] = 0 .
|
| 547 |
+
$$
|
| 548 |
+
|
| 549 |
+
From the continuity of $f$ and $h _ { X f }$ we have that $\hat { \sigma } _ { \mu } ^ { 2 }$ is continuous in $x _ { \star }$ . Together with the property that the expression under the expectation is non-negative, this gives that for every $x _ { \star }$ .
|
| 550 |
+
|
| 551 |
+
$$
|
| 552 |
+
\operatorname * { l i m } _ { N \infty } \operatorname * { m a x } ( 0 , \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) - \sigma _ { A } ^ { 2 } ) = 0 .
|
| 553 |
+
$$
|
| 554 |
+
|
| 555 |
+
Since the right-hand side does not depend on $B$ , we also have
|
| 556 |
+
|
| 557 |
+
$$
|
| 558 |
+
\operatorname * { l i m } _ { B \to \infty } \operatorname * { l i m } _ { N \to \infty } \operatorname * { m a x } ( 0 , \hat { \sigma } _ { \mu } ^ { 2 } ( x _ { \star } ) - \sigma _ { A } ^ { 2 } ) = 0 .
|
| 559 |
+
$$
|
| 560 |
+
|
| 561 |
+
From the definition of $\hat { v } _ { \sigma }$ , we have that
|
| 562 |
+
|
| 563 |
+
$$
|
| 564 |
+
\operatorname * { l i m } _ { B \infty } \operatorname * { l i m } _ { N \infty } \hat { v } _ { \sigma } = 0 .
|
| 565 |
+
$$
|
| 566 |
+
|
| 567 |
+
We show the Lemma by combining equation 42 and equation 43 with equation 1.
|
parse/train/BJlahxHYDS/BJlahxHYDS_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/BJlahxHYDS/BJlahxHYDS_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/BJlahxHYDS/BJlahxHYDS_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# UNDERSTANDING KNOWLEDGE DISTILLATION IN NON-AUTOREGRESSIVE MACHINE TRANSLATION
|
| 2 |
+
|
| 3 |
+
Chunting Zhou1∗, Jiatao $\mathbf { G u ^ { 2 * } }$ , Graham Neubig1
|
| 4 |
+
|
| 5 |
+
Language Technologies Institute, Carnegie Mellon University Facebook AI Research2 {chuntinz, gneubig}@cs.cmu.edu, jgu@fb.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Non-autoregressive machine translation (NAT) systems predict a sequence of output tokens in parallel, achieving substantial improvements in generation speed compared to autoregressive models. Existing NAT models usually rely on the technique of knowledge distillation, which creates the training data from a pretrained autoregressive model for better performance. Knowledge distillation is empirically useful, leading to large gains in accuracy for NAT models, but the reason for this success has, as of yet, been unclear. In this paper, we first design systematic experiments to investigate why knowledge distillation is crucial in NAT training. We find that knowledge distillation can reduce the complexity of data sets and help NAT to model the variations in the output data. Furthermore, a strong correlation is observed between the capacity of an NAT model and the complexity of the distilled data that provides the best translation quality. Based on these findings, we further propose several approaches that can alter the complexity of data sets to improve the performance of NAT models. We achieve state-of-theart performance for NAT-based models, and close the gap with the autoregressive baseline on the WMT14 En-De benchmark.1
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Traditional neural machine translation (NMT) systems (Bahdanau et al., 2015; Gehring et al., 2017; Vaswani et al., 2017) generate sequences in an autoregressive fashion; each target token is predicted step-by-step by conditioning on the previous generated tokens in a monotonic (e.g. left-to-right) order. While such autoregressive translation (AT) models have proven successful, the sequential dependence of decisions precludes taking full advantage of parallelism afforded by modern hardware (e.g. GPUs) at inference time. In contrast, non-autoregressive translation (NAT) models (Gu et al., 2018; Lee et al., 2018) predict the whole sequence or multi-token chunks of the sequence simultaneously, alleviating this problem by trading the model’s capacity for decoding efficiency. Such a non-autoregressive factorization assumes that the output tokens are independent from each other. However, this assumption obviously does not hold in reality and as a result NAT models generally perform worse than standard AT models.
|
| 14 |
+
|
| 15 |
+
One key ingredient in the training recipe for NAT models that is used in almost all existing works (Gu et al. (2018); Lee et al. (2018); Stern et al. (2019), inter alia) is creation of training data through knowledge distillation (Hinton et al., 2015). More precisely, sequence-level knowledge distillation (Kim & Rush, 2016) – a special variant of the original approach – is applied during NAT model training by replacing the target side of training samples with the outputs from a pre-trained AT model trained on the same corpus with a roughly equal number of parameters. It is usually assumed (Gu et al., 2018) that knowledge distillation’s reduction of the “modes” (alternative translations for an input) in the training data is the key reason why distillation benefits NAT training. However, this intuition has not been rigorously tested, leading to three important open questions:
|
| 16 |
+
|
| 17 |
+
• Exactly how does distillation reduce the “modes”, and how we could we measure this reduction quantitatively? Why does this reduction consistently improve NAT models? • What is the relationship between the NAT model (student) and the AT model (teacher)? Are different varieties of distilled data better for different NAT models? • Due to distillation, the performance of NAT models is largely bounded by the choice of AT teacher. Is there a way to further close the performance gap with standard AT models?
|
| 18 |
+
|
| 19 |
+
In this paper, we aim to answer the three questions above, improving understanding of knowledge distillation through empirical analysis over a variety of AT and NAT models. Specifically, our contributions are as follows:
|
| 20 |
+
|
| 21 |
+
• We first visualize explicitly on a synthetic dataset how modes are reduced by distillation (§3.1). Inspired by the synthetic experiments, we further propose metrics for measuring complexity and faithfulness for a given training set. Specifically, our metrics are the conditional entropy and KL-divergence of word translation based on an external alignment tool, and we show that these metrics are correlated with NAT model performance (§3.2). We conduct a systematic analysis (§4) over four AT teacher models and six NAT student models with various architectures on the standard WMT14 English-German translation benchmark. These experiments find a strong correlation between the capacity of an NAT model and the optimal dataset complexity that results in the best translation quality.
|
| 22 |
+
• Inspired by these observations, we propose approaches to further adjust the complexity of the distilled data in order to match the model’s capacity (§5). We also show that we can achieve the state-of-the-art performance for NAT models and largely match the performance of the AT model.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUND
|
| 25 |
+
|
| 26 |
+
# 2.1 NON-AUTOREGRESSIVE NEURAL MACHINE TRANSLATION
|
| 27 |
+
|
| 28 |
+
In order to model the joint probability of the output sequence $\textbf { { y } }$ , NMT models usually generate each output token conditioned on the previously generated ones $\begin{array} { r } { p ( \pmb { y } | \pmb { x } ) = \prod _ { t = 1 } ^ { T } p ( y _ { t } | \pmb { y } _ { < t } , \pmb { x } ) } \end{array}$ . This is known as the autoregressive factorization. To generate a translation from this model, one could predict one token at a time from left to right and greedily take arg max over each output probability distribution, or use beam search to consider a fixed number of hypotheses. In this work, we study non-autoregressive translation (NAT), a special subset of NMT models with an additional restriction (the zeroth-order Markov assumption) upon the output predictions or a subset thereof. The simplest formulation of an NAT model independently factors the conditional distribution: $\begin{array} { r } { p ( \pmb { y } | \pmb { x } ) = \overline { { \prod _ { t = 1 } ^ { T } p ( y _ { t } | \pmb { x } ) } } } \end{array}$ .
|
| 29 |
+
|
| 30 |
+
Standard NAT models (Gu et al., 2018) adopt an architecture similar to the Transformer (Vaswani et al., 2017) and make non-autoregressive predictions for the entire sequence with one forward pass of the decoder. However, because multiple translations are possible for a single input sentence (the so-called multi-modality problem; Gu et al. (2018)), vanilla NAT models can fail to capture the dependencies between output tokens. As a result, they tend to make egregious mistakes such as outputting tokens repeatedly. To improve the model’s ability to handle multi-modality, recent works have incorporated approaches including (1) relaxing the fully non-autoregressive restriction and adopting $K$ decoding passes (instead of just one) to iteratively refine the generated outputs (Lee et al., 2018; Ghazvininejad et al., 2019; Wang et al., 2018; Stern et al., 2018; 2019; Gu et al., 2019); (2) using latent variables (Kaiser et al., 2018; Ma et al., 2019; Shu et al., 2019) or structured information such as syntax trees (Akoury et al., 2019) to capture translation variation; (3) training NAT models with objectives other than maximum likelihood (Wang et al., 2019; Wei et al., 2019; Shao et al., 2019) which ameliorates the effects of multi-modality. However, to achieve competitive performance with the autoregressive model, almost all existing NAT models rely on training using data distilled from a pre-trained AT model instead of the real parallel training set, as described below.
|
| 31 |
+
|
| 32 |
+
# 2.2 SEQUENCE-LEVEL KNOWLEDGE DISTILLATION
|
| 33 |
+
|
| 34 |
+
Knowledge distillation (Liang et al., 2008; Hinton et al., 2015) was originally proposed for training a weaker student classifier on the targets predicted from a stronger teacher model. A typical approach is using the label probabilities produced by the teacher as “soft targets” $q _ { i } =$ $\mathrm { e x p } ( z _ { i } \bar { / \tau } ) / { \sum _ { j } \mathrm { e x p } ( z _ { j } \bar { / \tau } ) }$ for training the student model, where $q _ { i }$ and $z _ { i }$ are the probability and the logit of class $i$ respectively and $\tau$ is the temperature. Prior work has shown the effectiveness of adopting knowledge distillation in adversarial defense (Papernot et al., 2016), neural network compression (Howard et al., 2017), and fast inference for speech synthesis (Oord et al., 2018).
|
| 35 |
+
|
| 36 |
+
In the context of sequence generation, Kim & Rush (2016) extend knowledge distillation to the sentence level using “hard targets” from a pretrained large teacher model to train a small sequence generation model. More precisely, the teacher distribution $q ( t | x )$ is approximated by its mode: $\begin{array} { r } { \bar { q } ( { \pmb t } | { \pmb x } ) \approx \mathbb { 1 } \{ { \pmb t } = \arg \operatorname* { m a x } _ { { \pmb t } \in { \mathcal T } } q ( { \pmb t } | { \pmb x } ) \} } \end{array}$ with the following objectives:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\mathcal { L } _ { \mathrm { s e q } , \mathrm { K D } } = - \mathbb { E } _ { \mathbf { x } \sim \mathrm { d a t a } } \sum _ { t \in \mathcal { T } } q ( t | x ) \log p ( t | x ) \approx - \mathbb { E } _ { \mathbf { x } \sim \mathrm { d a t a } , \hat { y } = \mathbf { a r g } \operatorname* { m a x } _ { t \in \mathcal { T } } \mathbf { \Phi } } q ( t | x ) \left[ \log p ( t = \hat { y } | x ) \right] ,
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $t \in \tau$ is the space of possible target sequences. This can also be seen as a special case of standard distillation over the sentence space when the temperature $\tau$ approaches 0, which is equivalent to taking the arg max over all feasible translations. While the “hard target” $\hat { y }$ is the most likely translation predicted by the teacher, in practice we use beam search as an approximation. As mentioned earlier, almost all the existing literature trains NAT models using sequence-level knowledge distillation from a pre-trained AT model to achieve competitive performance. Particularly, it is common to train the teacher model as a standard autoregressive Transformer (Vaswani et al., 2017) with a roughly equal number of trainable parameters as the desired NAT model on the real data. Next, we will first study how this knowledge distillation process affects the behavior of NAT models.
|
| 43 |
+
|
| 44 |
+
# 3 HOW DOES DISTILLATION IMPROVE NAT?
|
| 45 |
+
|
| 46 |
+
In this section, we start from an introductory example to illustrate how NAT models fail to capture the multi-modality of data. Then we propose a metric to assess the multi-modality of a data set and use it to test our hypothesis about how knowledge distillation affects NAT models.
|
| 47 |
+
|
| 48 |
+
# 3.1 SYNTHETIC EXPERIMENT FOR MULTI-MODALITY
|
| 49 |
+
|
| 50 |
+
Dataset. We start by investigating NAT’s difficulties in modeling multi-modality in output data using a synthetic setup where we explicitly include multiple modes in the training data. More specifically, we utilize three language pairs – English-German (En-De), English-French (En-Fr), and English-Spanish (En-Es) – from the Europarl parallel corpus.2 We extract sentences that have aligned sentences for all languages, and create a multi-target En-De/Es/Fr corpus. In this case every English input sentence always corresponds to target sentences in three different languages, which forms three explicit output modes. Notably, this is similar to the one-to-many translation setting in Johnson et al. (2017) but in our case we do not have an explicit signal (e.g. target language tag) to tell the NMT model which target language to translate to.
|
| 51 |
+
|
| 52 |
+
Models. We train both the AT and NAT models on this concatenated data set, then compare the distributions of translations with each other. We use the standard Transformer(base) model (Vaswani et al., 2017) as the AT model, and a simplified version of Gu et al. (2018) as the NAT model where the decoder’s inputs are monotonically copied from the encoder embeddings and a length predictor is learned to predict the target sentence length. Both models are trained for 300, 000 steps using maximum likelihood. After training, we use both models to translate the English sentences in the validation and test sets.
|
| 53 |
+
|
| 54 |
+
Visualization of AT Outputs. The synthetic setup enables us to better understand and visualize the modes in the outputs more easily. First, we visualize the outputs from the AT model. For every translated sentence, we visualize the estimated probability distribution of language classes as a point in Fig. 1 (a). This probability is calculated as the average of the posterior probability of each token, and it is estimated based on the Bayes’ law:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
p ( l _ { i } | \pmb { y } ) \approx \frac { 1 } { T } \sum _ { t = 1 } ^ { T } p ( l _ { i } | y _ { t } ) = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \frac { p ( y _ { t } | l _ { i } ) p ( l _ { i } ) } { \sum _ { k } p ( y _ { t } | l _ { k } ) p ( l _ { k } ) }
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 1: Posterior distribution of language IDs for the outputs from different models. Each translation is represented as a point inside the simplex $\Delta ^ { 2 } = \{ ( p _ { \mathrm { d e } } , p _ { \mathrm { e s } } , p _ { \mathrm { f r } } ) | p _ { k } \in ( 0 , 1 ) , p _ { \mathrm { d e } } + p _ { \mathrm { e s } } + p _ { \mathrm { f r } } = 1 \}$ where $p _ { k }$ is the estimated probability of being translated into language $k \in ( \mathrm { d e } , \mathrm { e s } , \mathrm { f r } )$ . We distinguish the language that has the largest probability with different colors.
|
| 62 |
+
|
| 63 |
+
where $l _ { i }$ denotes the language class $i$ , and $p ( y _ { t } | l _ { i } )$ is the token frequency of $y _ { t }$ in language $l _ { i }$ . We assume $p ( l _ { i } )$ follows a uniform distribution. As shown in Fig. 1 (a), points of the AT outputs are clustered closely to each vertex of the simplex, indicating that the AT model prefers to generate the whole sequence in one language. This phenomenon verifies our assumption that decoding with the AT model (distillation) is essentially selecting “modes” over the real data.
|
| 64 |
+
|
| 65 |
+
Visualization of NAT Outputs. We visualize outputs for the NAT model trained on the same data in Fig. 1 (b). In contrast to the AT results, the NAT points are scattered broadly inside the simplex, indicating that the NAT model fails to capture the mode of language types. Instead, it predicts tokens mixed with multiple languages, which corroborates our hypothesis that the NAT model has trouble consistently selecting a single mode when multiple modes exist.
|
| 66 |
+
|
| 67 |
+
Next, we create two datasets that have fewer modes than the original dataset. First, we randomly select a single target sentence from one of the three languages for each source sentence. Second, we perform distillation, decoding from the AT model trained on the combined training set. As noted in the AT results, distillation will also roughly be selecting a language mode, but we conjecture that this selection may be more systematic, selecting a particular language for a particular type of training sentence. As shown in Fig. 1(c) (d), NAT models trained on both of these datasets are more likely to choose one mode (language) when generating translations, showing that training with reduced modes is essential for NAT model. Furthermore, points in Fig. 1 (d) are clearly clustered better than (c) indicating that modes selected by AT models are indeed likely more systematic and easy to capture than those generated by randomly assigning a language for each sentence.
|
| 68 |
+
|
| 69 |
+
# 3.2 QUANTITATIVE MEASURES FOR PARALLEL DATA
|
| 70 |
+
|
| 71 |
+
To better study why distillation is crucial for NAT models, in this section, we propose quantitative measures for analyzing the complexity and faithfulness of parallel data, two properties that we hypothesize are important for NAT training.
|
| 72 |
+
|
| 73 |
+
Measure of Complexity. Inspired by the observations in the synthetic experiments, we propose to use a measure of translation uncertainty, specifically operationalized as conditional entropy, as the measurement of complexity $C ( d )$ for any given dataset $d = \{ ( \pmb { x } _ { 1 } , \pmb { y } _ { 1 } ) , . . . , ( \pmb { x } _ { N } , \pmb { y } _ { N } ) \}$ , where $( { \pmb x } , { \pmb y } )$ is sentence pair instantiation of $( \mathbf { \bar { X } } , \mathbf { Y } )$ and $\mathbf { X } \in { \mathcal { X } } , \mathbf { Y } \in { \mathcal { Y } }$ :
|
| 74 |
+
|
| 75 |
+
asm.1: conditional independence
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r l } { \mathcal { H } ( { \mathbf { Y } } | { \mathbf { X } } = x ) = \displaystyle \sum _ { y \in \mathcal { Y } } p ( y | x ) \log p ( y | x ) } \\ & { ~ \mathrm { ~ } } \\ { \approx \displaystyle \sum _ { y \in \mathcal { Y } } ( \displaystyle \prod _ { \substack { l = 1 } } ^ { T _ { y } } p ( y | x ) ) ( \displaystyle \sum _ { t = 1 } ^ { T _ { y } } \log p ( y _ { t } | x ) ) } \\ & { ~ \approx \displaystyle \sum _ { t = 1 } ^ { T _ { y } } \displaystyle \sum _ { y _ { t } < A ( x ) } p ( y _ { t } | \mathrm { A l i g n } ( y _ { t } ) ) \log p ( y _ { t } | \mathrm { A l i g n } ( y _ { t } ) ) } \\ & { ~ = \displaystyle \sum _ { t = 1 } ^ { T _ { x } } \mathcal { H } ( y | x = x _ { t } ) } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
<table><tr><td>d</td><td>En-De</td><td>En-Es</td><td></td><td>En-Fr丨Full Real Data</td><td>Random Selection</td><td>Distillation</td></tr><tr><td>C(d)</td><td>3.12</td><td>2.81</td><td>2.89</td><td>3.67</td><td>3.30</td><td>2.64</td></tr></table>
|
| 82 |
+
|
| 83 |
+
Table 1: Complexity $C ( d )$ $\uparrow$ more complex) of the Europarl data set of different settings in $\ S 3 . 1$ .
|
| 84 |
+
|
| 85 |
+
where we use $x$ and $y$ to denote a word in the source and target vocabulary respectively. $T _ { x }$ and $T _ { y }$ denote the length of the source and target sentences. To make the computation tractable, we make two additional assumptions on the conditional distribution $p ( \pmb { y } | \pmb { x } )$ :
|
| 86 |
+
|
| 87 |
+
• Assumption 1: We assume the target tokens are independent given the source sentence. Then the conditional entropy of a sentence can be converted into the sum of entropy of target words conditioned on the source sentence $_ { \textbf { \em x } }$ .
|
| 88 |
+
• Assumption 2: We assume the distribution of $p ( y _ { t } | \pmb { x } )$ follows an alignment model (Dyer et al., $2 0 1 3 ) ^ { \bar { 3 } }$ where $y _ { t }$ is is generated from the word alignment distribution $p ( y _ { t } | \mathrm { A l i g n ( y _ { t } ) } )$ . This makes it possible to simplify the conditional entropy to the sum of entropy of target words conditioned on the aligned source words denoted $\mathcal { H } ( y \vert x = x _ { t } )$ ).
|
| 89 |
+
|
| 90 |
+
The corpus level complexity $C ( d )$ is then calculated by adding up the conditional entropy $\mathcal { H } ( \mathbf { Y } | \mathbf { X } =$ ${ \pmb x } )$ of all sentences. To prevent $C ( d )$ from being dominated by frequent words, we calculate $\ddot { C } ( d )$ by averaging the entropy of target words conditioned on a source word, denoted $C ( d ) \ =$ $\begin{array} { r } { \frac { 1 } { | \mathcal { V } _ { x } | } \overset { \cdot } { \sum _ { x \in \mathcal { V } _ { x } } } \mathcal { H } ( y | x ) } \end{array}$ .
|
| 91 |
+
|
| 92 |
+
To illustrate that the proposed metric is a reasonable measure of complexity of a parallel corpus, in Tab. 1 we compute $C ( d )$ for parallel data from different language pairs, the concatenated data set, and the data distilled from the AT model described in $\ S 3 . 1$ . We observe that the conditional entropy of the distilled data is much smaller than that of the concatenated or randomly selected data mentioned above. Additionally, we find that the conditional entropy of En-Es and En-Fr are similar but that of En-De is relatively larger, which can also explain why the student NAT model prefers to predict the modes of Es or Fr more often than De as shown in Fig. 1(d).
|
| 93 |
+
|
| 94 |
+
Measure of Faithfulness. $C ( d )$ reflects the level of multi-modality of a parallel corpus, and we have shown that a simpler data set is favorable to an NAT model. However, it is not fair to assess the data set only by its complexity; we can trivially construct a simple data set with no variations in the output, which obviously won’t be useful for training. The other important measurement of the data set is its faithfulness to the real data distribution. To measure the faithfulness of a parallel corpus $d$ , we use KL-divergence of the alignment distribution between the real parallel data set $r$ and an altered parallel data set $d$ , denoted $F ( d )$ :
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
F ( d ) = \frac { 1 } { | \mathcal { V } _ { x } | } \sum _ { x \in \mathcal { V } _ { x } } \sum _ { y \in \mathcal { V } _ { y } } p _ { r } ( y | x ) \log \frac { p _ { r } ( y | x ) } { p _ { d } ( y | x ) }
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
# 4 EMPIRICAL STUDY
|
| 101 |
+
|
| 102 |
+
In this section, we perform an extensive study over a variety of non-autoregressive (NAT) models trained from different autoregressive (AT) teacher models to assess how knowledge distillation affects the performance of NAT models.
|
| 103 |
+
|
| 104 |
+
# 4.1 EXPERIMENTAL SETTINGS
|
| 105 |
+
|
| 106 |
+
Data. We use the data set commonly used by prior work as our evaluation benchmark: WMT14 English-German $( \mathrm { E n - D e } ) ^ { 4 }$ . We use newstest2013 as the validation set for selecting the best model, and newstest2014 as the test set. We learn a byte-pair encoding (BPE, Sennrich et al., 2016) vocabulary of 37,000 on the tokenized data.
|
| 107 |
+
|
| 108 |
+
AT Models. We set up four Transformer models with different parameter sizes: Transformertiny/small/base/big denoted as tiny, small, base, big respectively. We build base and big models following settings described in Vaswani et al. (2017), and reduce the model sizes for tiny, small to create weaker teacher models. Details of the model architectures can be found in Appendix A.
|
| 109 |
+
|
| 110 |
+
All the models are trained using the Adam optimizer (Kingma & Ba, 2014) with the maximum number of steps set to 300, 000. After training, we use the resulting AT models to decode the whole training set with beam size 5 and replace the real target sentences to create a new parallel corpus.
|
| 111 |
+
|
| 112 |
+
NAT Models. We consider the following NAT models, from vanilla to state-of-the-art. All the models are using the Transformer as the basic backbone and are (re-)implemented based on Fairseq5 except for FlowSeq. We briefly outline the methods and parameters here, and describe detailed settings in the Appendix A.
|
| 113 |
+
|
| 114 |
+
• Vanilla NAT (Gu et al., 2018): Similarly to $\ S 3 . 1$ , we use a simplified version where the decoder’s inputs are directly copied from the encoder without considering latent variables.
|
| 115 |
+
• FlowSeq (Ma et al., 2019): FlowSeq adopts normalizing flows (Kingma & Dhariwal, 2018) as the latent variables to model the mappings from source sentences to a latent space.
|
| 116 |
+
• NAT with Iterative Refinement (iNAT, Lee et al., 2018): iNAT extends the vanilla NAT by iteratively reading and refining the translation. The number of iterations is set to 10 for decoding.
|
| 117 |
+
• Insertion Transformer (InsT, Stern et al., 2019): InsT adopts a similar architecture as iNAT while generating the sequence by parallel insertion operations. Here, we only consider InsT trained with uniform loss as described in the original paper.
|
| 118 |
+
• MaskPredict (MaskT, Ghazvininejad et al., 2019): MaskT adopts a masked language model (Devlin et al., 2018) to progressively generate the sequence from an entirely masked input. The number of iterations is set to be 10.
|
| 119 |
+
• Levenshtein Transformer (LevT, Gu et al., 2019): LevT uses similar architectures as in InsT and MaskT while generating based on both insertion and deletion operations. We experiment with a base and big LevT model (LevT and LevT-big in Tab. 2).
|
| 120 |
+
|
| 121 |
+
We also summarize the parameter size, performance and relative decoding speed of the NAT models introduced in Tab. 2. We use the decoding time of vanilla NAT to represent one unit of time, and $\mathtt { I t e r s } \times \mathtt { P a s s }$ represents the relative time units used for each model.
|
| 122 |
+
|
| 123 |
+
As mentioned earlier, we analyze each model by training from both the real and 4 distilled targets. We train the NAT models for the same number of steps as the AT models. For a fair comparison of the actual ability of each NAT-based model, we test all the models based on greedy decoding without any advanced search algorithms (e.g. length beam (Ghazvininejad et al., 2019), noisy parallel decoding (Ma et al., 2019), or re-ranking from the teacher model (Gu et al., 2018)). Notably, the vanilla NAT and FlowSeq output translations with single forward pass, while the remaining models are based on the iterative refinement.
|
| 124 |
+
|
| 125 |
+
# 4.2 ANALYSIS OF THE DISTILLED DATA
|
| 126 |
+
|
| 127 |
+
Table 2: AT and NAT models. Number of parameters and test BLEU when trained on the real data demonstrate model capacity. Iters is number of passes used in decoding for output length $n$ and hyperparameter $k$ . Pass is relative time used for one pass of decoding.
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Models</td><td>Params</td><td>BLEU</td><td>Pass</td><td>Iters</td></tr><tr><td>AT models</td><td></td><td></td><td></td><td></td></tr><tr><td>AT-tiny</td><td>16M</td><td>23.3</td><td></td><td>n</td></tr><tr><td>AT-small</td><td>37M</td><td>25.6</td><td></td><td>n</td></tr><tr><td>AT-base</td><td>65M</td><td>27.1</td><td></td><td>n</td></tr><tr><td>AT-big</td><td>218M</td><td>28.2</td><td></td><td>n</td></tr><tr><td>NAT models</td><td></td><td></td><td></td><td></td></tr><tr><td>vanilla</td><td>71M</td><td>11.4</td><td>1</td><td>1</td></tr><tr><td>FlowSeq</td><td>73M</td><td>18.6</td><td>13</td><td>1</td></tr><tr><td>iNAT</td><td>66M</td><td>19.3</td><td>1</td><td>k<n</td></tr><tr><td>InsT</td><td>66M</td><td>20.9</td><td>1</td><td>~ log2 n</td></tr><tr><td>MaskT</td><td>66M</td><td>23.5</td><td>1</td><td>10</td></tr><tr><td>LevT</td><td>66M</td><td>25.2</td><td>1</td><td>3k<n</td></tr><tr><td>LevT-big</td><td>220M</td><td>26.5</td><td>~3</td><td>3k<n</td></tr></table>
|
| 130 |
+
|
| 131 |
+
We compare different dimensions of the data generated by the four AT models and the real data set in Fig. 3. First, Fig. 3 (a) shows that as the capacity of the AT model increases, the
|
| 132 |
+
|
| 133 |
+
complexity $\dot { C } ( d )$ of the distilled data increases, which indicates that the multi-modality increases as well. At the same time, we observe that $F ( d )$ defined in $\ S 3 . 2$ also decreases, showing that the distilled data more faithfully represents the word-level translation distribution of the original data.
|
| 134 |
+
|
| 135 |
+
Source For more than 30 years , Josef Winkler has been writing from the heart , telling of the hardships of his childhood and youth . Distilled Target Seit mehr als 30 Jahren schreibt Josef Winkler aus dem Herzen und erzählt von der Not seiner Kindheit und Jugend . Real Target Josef Winkler schreibt sich seit mehr als 30 Jahren die Nöte seiner Kindheit und Jugend von der Seele .
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 2: A sampled pair together with its real target from the distilled data of the base-AT model. Chunks annotated in the same colors are approximately aligned with each other.
|
| 139 |
+
Figure 3: Complexity $C ( d )$ (↑ more complex), faithfulness $F ( d )$ ( $\downarrow$ more faithful), training BLEU, and reordering score $\uparrow$ more monotonic alignment) of different distilled sets of WMT14-ENDE.
|
| 140 |
+
|
| 141 |
+
Second, we plot the BLEU score of the distilled data w.r.t to the real data set in (b) and we observe that the BLEU score of the distilled data from a higher-capacity teacher model is higher, which is both intuitive and in agreement with the results on KL divergence.
|
| 142 |
+
|
| 143 |
+
We also investigate how the relative ordering of words in the source and target sentences is changed during distillation. We use the fuzzy reordering score proposed in Talbot et al. (2011). A larger fuzzy reordering score indicates the more monotonic alignments. As shown in Fig 3 (c), the distilled data has significantly less reordering compared to the real parallel sentences, and the distilled data from a weaker AT teacher is more monotonic than a stronger AT teacher. We also show a randomly sampled example in Fig. 2 where compared to the real translation, the AT distilled target is much more monotonically aligned to the source sentence. This has potential benefits in that these simpler reordering patterns may be easier to learn for NAT models, but also disadvantages in that it may prevent NAT models from learning complex reordering patterns.
|
| 144 |
+
|
| 145 |
+
# 4.3 ANALYSIS OF DISTILLATION STRATEGIES
|
| 146 |
+
|
| 147 |
+
In $\ S 4 . 2$ , we have shown that decoding with an AT model reduces the conditional entropy of the parallel data set, which mitigates multi-modality in the output data. But does the decoding method of the AT model affect this change in the data set? We also investigate different decoding strategies when creating distilled data, using the base Transformer model as the teacher and the vanilla NAT model as the student. In Tab. 3, four decoding methods are presented: sampling, sampling within the top-10 candidates, beam search, and greedy decoding. With the same AT model, the performance of the NAT model differs widely depending on the decoding approach, where distillation with beam search results in the best performance.
|
| 148 |
+
|
| 149 |
+
We can see that beam search or greedy decoding can reduce the complexity of the real data the most while maintaining high faithfulness. In contrast, sampling based decoding methods less aggressively reduce the modes in the output sequence. This finding is in concert with Ott et al. (2018), who demonstrate that because beam search approximately selects the most probable translation, it effectively reduces diversity in the output translations compared to sampling or the true distribution.
|
| 150 |
+
|
| 151 |
+
Table 3: Comparisons of decoding methods on WMT14-ENDE newstest 2014 test set.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Decoding Method</td><td>C(d)</td><td>F(d)</td><td>BLEU</td></tr><tr><td> sampling</td><td>3.623</td><td>3.354</td><td>6.6</td></tr><tr><td>sampling (Top 10)</td><td>2.411</td><td>2.932</td><td>14.6</td></tr><tr><td>greedy</td><td>1.960</td><td>2.959</td><td>18.9</td></tr><tr><td>beam search</td><td>1.902</td><td>2.948</td><td>19.5</td></tr></table>
|
| 154 |
+
|
| 155 |
+
# 4.4 DISTILLED DATA V.S. NAT MODELS
|
| 156 |
+
|
| 157 |
+
We next examine the relationship between the NAT students and distilled training data from different AT models. In Fig. 4, we demonstrate results for the NAT models listed in $\ S 4 . 1$ . We use the test set performance on real data as a simple metric to measure the capacity of the NAT model and arrange the subfigures in an increasing order of the performance (left-to-right, top-to-bottom). The results in the figure demonstrate that, interestingly, weaker NAT students prefer distilled data with smaller complexity as measured above in $\ S 4 . 2$ . The best performance of NAT models – from lower capacity ones to higher capacity ones – is achieved with distilled data of lower complexity to higher complexity, i.e. the vanilla NAT model performs best when using the distilled data from a small Transformer whereas LevT achieves the best performance when training with the distilled data from a big Transformer. Third, and notably, by simply changing the distilled data set upon which the models are trained, we are able to significantly improve the state-of-the-art results for models in a particular class. For example, FlowSeq increased to 22, by simply changing from the distilled data of Transformer(base) to Transformer(small). Finally, we find that by distilling from a big AT model, LevT is able to close the gap with the Transformer (base) with a similar number of parameters. Both LevT and LevT-big achieve the state-of-the-art performance for NAT-based models.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 4: The performance of NAT models of varying capacity trained on both the real and the distilled data from tiny, small, base and big AT models on WMT14-ENDE newstest 2014 test sets.
|
| 161 |
+
|
| 162 |
+
# 5 IMPROVEMENTS TO KNOWLEDGE DISTILLATION
|
| 163 |
+
|
| 164 |
+
The previous section shows that the optimal complexity of the dataset is highly correlated with the capacity of the NAT model. In this section, we introduce three techniques that can be used to alter the distilled data to match the capacity of NAT model. Specifically, these techniques can be used to simplify the data further (BANs, MoE) for a lower-capacity student model or increase faithfulness of the data set (Interpolation) for a higher-capacity student model.
|
| 165 |
+
|
| 166 |
+
Born-Again Networks. We apply Born-Again neworks (BANs) to create a simplified dataset for NAT models. BANs were originally proposed as a self-distillation technique (Furlanello et al., 2018) that uses the output distribution of a trained model to train the original model. Starting from the real data, we repeatedly train new AT models with decoded sentences from the AT model at the previous iteration. This process is repeated for $k$ times and yields $k$ distilled data sets, upon which we perform NAT training and examine how the $k$ born-again teachers affect the performance of NAT students.
|
| 167 |
+
|
| 168 |
+
We conduct experiments using the vanilla NAT model (Gu et al., 2018) (which achieved the best performance with distilled data from a small Transformer in $\ S 4 . 4 )$ and the base Transformer as the AT model. As shown in Fig. 5, we can make the following observations: (i) The performance of the base AT model almost remains unchanged during the reborn iterations. (ii) The performance of the vanilla NAT model can be improved by 2 BLEU when using the distilled data from reborn iteration 6. (iii) As the reborn iterations continue, the complexity of the distilled data decreases and becomes constant eventually. Meanwhile, the quality of the distilled data compared to the real data decreases.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 5: Reborn experiments: (from left to right) performance of the base AT model, performance of the vanilla NAT model, $C ( d )$ and $F ( d )$ of distilled data sets. R-i denotes the $i$ -th reborn iteration.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 6: MoE experiments: (from left to right) performance of the base AT model, performance of the vanilla NAT model, $C ( d )$ and $F ( d )$ of distilled data sets w.r.t the number of experts.
|
| 175 |
+
|
| 176 |
+
Mixture-of-Experts. The mixture-of-expert model (MoE; Shen et al. (2019)) learns different experts for diverse machine translation, and different mixture components were shown to capture consistent translation styles across examples. Inspired by this, we use one expert from the mixture model to translate the training data, which is supposed to generate a single style of translation and reduce the diversity in the original data set. Then we use the best single-expert translations as the distilled data to train the vanilla NAT model. Specifically, we follow Shen et al. (2019)’s setup, using the base Transformer model and uniform hard mixture model, varying the number of experts.
|
| 177 |
+
|
| 178 |
+
In Fig. 6, we observe that the performance of the best expert of MoE tends to decrease as the number of experts increases. However, the complexity $( C ( d ) )$ and faithfulness $( F ( D ) )$ of distilled data from different MoE models has a relatively large variance. Compared to using the distilled data from a plain base AT model, the performance of NAT model is improved by 1.21 BLEU when using the distilled data from the MoE model with the number of experts of 3 which produces the distilled data with the least complexity.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>d</td><td>C(d)</td><td>F(d)</td><td>BLEU</td></tr><tr><td>base</td><td>1.902</td><td>2.948</td><td>26.94</td></tr><tr><td>base-inter</td><td>1.908</td><td>2.916</td><td>27.32</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Sequence-Level Interpolation. $\ S 4 . 4$ shows stronger NAT models (e.g. MaskT, LevT) have the ability to learn from the dataset that is closer to the real data, and achieve better performance. We adopt the sequence-level interpolation proposed in Kim & Rush (2016) as a natural way to create a better dataset. Different from distillation, interpolation picks the sentence with the highest sentence-level BLEU score w.r.t. the ground truth from $K$ −best beam search hy
|
| 183 |
+
|
| 184 |
+
Table 4: Results w/ and w/o sequencelevel interpolation with LevT.
|
| 185 |
+
|
| 186 |
+
potheses. In our experiments, we first run beam search using the base Transformer model with a beam size of 5 then select the sentences with the highest BLEU score from the top-3 candidates.
|
| 187 |
+
|
| 188 |
+
Tab. 4 compares the performance of LevT trained with distilled data from the AT model with the standard distillation or interpolation. We observe that selection with BLEU score from the base AT model (base-inter) improves the performance of LevT $\sim 0 . 4$ BLEU while the dataset complexity $C ( d )$ does not increase much.
|
| 189 |
+
|
| 190 |
+
# 6 CONCLUSION
|
| 191 |
+
|
| 192 |
+
In this paper, we first systematically examine why knowledge distillation improves the performance of NAT models. We conducted extensive experiments with autoregressive teacher models of different capacity and a wide range of NAT models. Furthermore, we defined metrics that can quantitatively measure the complexity of a parallel data set. Empirically, we find that a higher-capacity
|
| 193 |
+
|
| 194 |
+
NAT model requires a more complex distilled data to achieve better performance. Accordingly, we propose several techniques that can adjust the complexity of a data set to match the capacity of an NAT model for better performance.
|
| 195 |
+
|
| 196 |
+
# REFERENCES
|
| 197 |
+
|
| 198 |
+
Nader Akoury, Kalpesh Krishna, and Mohit Iyyer. Syntactically supervised transformers for faster neural machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1269–1281, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1122. URL https://www.aclweb.org/ anthology/P19-1122.
|
| 199 |
+
|
| 200 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations (ICLR), 2015.
|
| 201 |
+
|
| 202 |
+
Satanjeev Banerjee and Alon Lavie. Meteor: An automatic metric for mt evaluation with improved correlation with human judgments. In Proceedings of the acl workshop on intrinsic and extrinsic evaluation measures for machine translation and/or summarization, pp. 65–72, 2005.
|
| 203 |
+
|
| 204 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805, 2018. URL http://arxiv.org/abs/1810.04805.
|
| 205 |
+
|
| 206 |
+
Chris Dyer, Victor Chahuneau, and Noah Smith. A simple, fast, and effective reparameterization of IBM Model 2. In NAACL, 2013.
|
| 207 |
+
|
| 208 |
+
Tommaso Furlanello, Zachary Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born-again neural networks. In International Conference on Machine Learning, pp. 1602–1611, 2018.
|
| 209 |
+
|
| 210 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1243–1252. JMLR. org, 2017.
|
| 211 |
+
|
| 212 |
+
Marjan Ghazvininejad, Omer Levy, Yinhan Liu, and Luke Zettlemoyer. Constant-time machine translation with conditional masked language models. arXiv preprint arXiv:1904.09324, 2019.
|
| 213 |
+
|
| 214 |
+
Jiatao Gu, James Bradbury, Caiming Xiong, Victor O.K. Li, and Richard Socher. Non-autoregressive neural machine translation. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, Canada, April 30-May 3, 2018, Conference Track Proceedings, 2018.
|
| 215 |
+
|
| 216 |
+
Jiatao Gu, Changhan Wang, and Jake Zhao. Levenshtein transformer. In Advances in Neural Information Processing Systems 33. 2019.
|
| 217 |
+
|
| 218 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 219 |
+
|
| 220 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 221 |
+
|
| 222 |
+
Hideki Isozaki, Tsutomu Hirao, Kevin Duh, Katsuhito Sudoh, and Hajime Tsukada. Automatic evaluation of translation quality for distant language pairs. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, pp. 944–952. Association for Computational Linguistics, 2010.
|
| 223 |
+
|
| 224 |
+
Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viegas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey Dean. ´ Google’s multilingual neural machine translation system: Enabling zero-shot translation. Transactions of the Association for Computational Linguistics, 5:339–351, 2017.
|
| 225 |
+
|
| 226 |
+
Lukasz Kaiser, Samy Bengio, Aurko Roy, Ashish Vaswani, Niki Parmar, Jakob Uszkoreit, and Noam Shazeer. Fast decoding in sequence models using discrete latent variables. In International Conference on Machine Learning, pp. 2395–2404, 2018.
|
| 227 |
+
|
| 228 |
+
Yoon Kim and Alexander M Rush. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1317–1327, 2016.
|
| 229 |
+
|
| 230 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 231 |
+
|
| 232 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018.
|
| 233 |
+
|
| 234 |
+
Jason Lee, Elman Mansimov, and Kyunghyun Cho. Deterministic non-autoregressive neural sequence modeling by iterative refinement. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 1173–1182, 2018.
|
| 235 |
+
|
| 236 |
+
Percy Liang, Hal Daume III, and Dan Klein. Structure compilation: trading structure for features. ´ In ICML, pp. 592–599, 2008.
|
| 237 |
+
|
| 238 |
+
Xuezhe Ma, Pengcheng Yin, Jingzhou Liu, Graham Neubig, and Eduard Hovy. Softmax qdistribution estimation for structured prediction: A theoretical interpretation for raml. arXiv preprint arXiv:1705.07136, 2017.
|
| 239 |
+
|
| 240 |
+
Xuezhe Ma, Chunting Zhou, Xian Li, Graham Neubig, and Eduard Hovy. Flowseq: Nonautoregressive conditional sequence generation with generative flow. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing, Hong Kong, November 2019.
|
| 241 |
+
|
| 242 |
+
Aaron Oord, Yazhe Li, Igor Babuschkin, Karen Simonyan, Oriol Vinyals, Koray Kavukcuoglu, George Driessche, Edward Lockhart, Luis Cobo, Florian Stimberg, et al. Parallel wavenet: Fast high-fidelity speech synthesis. In International Conference on Machine Learning, pp. 3915–3923, 2018.
|
| 243 |
+
|
| 244 |
+
Myle Ott, Michael Auli, David Grangier, and Marc’Aurelio Ranzato. Analyzing uncertainty in neural machine translation. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018 ¨ , pp. 3953–3962, 2018. URL http://proceedings.mlr.press/v80/ott18a.html.
|
| 245 |
+
|
| 246 |
+
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan $\mathrm { N g }$ , David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations, 2019.
|
| 247 |
+
|
| 248 |
+
Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In 2016 IEEE Symposium on Security and Privacy (SP), pp. 582–597. IEEE, 2016.
|
| 249 |
+
|
| 250 |
+
Maja Popovic. chrf: character n-gram f-score for automatic mt evaluation. In ´ Proceedings of the Tenth Workshop on Statistical Machine Translation, pp. 392–395, 2015.
|
| 251 |
+
|
| 252 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715–1725, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1162. URL https://www.aclweb. org/anthology/P16-1162.
|
| 253 |
+
|
| 254 |
+
Chenze Shao, Yang Feng, Jinchao Zhang, Fandong Meng, Xilin Chen, and Jie Zhou. Retrieving sequential information for non-autoregressive neural machine translation. arXiv preprint arXiv:1906.09444, 2019.
|
| 255 |
+
|
| 256 |
+
Tianxiao Shen, Myle Ott, Michael Auli, et al. Mixture models for diverse machine translation: Tricks of the trade. In International Conference on Machine Learning, pp. 5719–5728, 2019.
|
| 257 |
+
|
| 258 |
+
Raphael Shu, Jason Lee, Hideki Nakayama, and Kyunghyun Cho. Latent-variable nonautoregressive neural machine translation with deterministic inference using a delta posterior. arXiv preprint arXiv:1908.07181, 2019.
|
| 259 |
+
|
| 260 |
+
Matthew Snover, Bonnie Dorr, Richard Schwartz, Linnea Micciulla, and John Makhoul. A study of translation edit rate with targeted human annotation. In In Proceedings of Association for Machine Translation in the Americas, pp. 223–231, 2006.
|
| 261 |
+
|
| 262 |
+
Milos Stanojevic and Khalil Simaan. Beer: Better evaluation as ranking. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pp. 414–419, 2014.
|
| 263 |
+
|
| 264 |
+
Mitchell Stern, Noam Shazeer, and Jakob Uszkoreit. Blockwise parallel decoding for deep autoregressive models. In Advances in Neural Information Processing Systems, pp. 10107–10116, 2018.
|
| 265 |
+
|
| 266 |
+
Mitchell Stern, William Chan, Jamie Kiros, and Jakob Uszkoreit. Insertion transformer: Flexible sequence generation via insertion operations. arXiv preprint arXiv:1902.03249, 2019.
|
| 267 |
+
|
| 268 |
+
David Talbot, Hideto Kazawa, Hiroshi Ichikawa, Jason Katz-Brown, Masakazu Seno, and Franz J Och. A lightweight evaluation framework for machine translation reordering. In Proceedings of the Sixth Workshop on Statistical Machine Translation, pp. 12–21. Association for Computational Linguistics, 2011.
|
| 269 |
+
|
| 270 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 271 |
+
|
| 272 |
+
Chunqi Wang, Ji Zhang, and Haiqing Chen. Semi-autoregressive neural machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 479–488, 2018.
|
| 273 |
+
|
| 274 |
+
Yiren Wang, Fei Tian, Di He, Tao Qin, ChengXiang Zhai, and Tie-Yan Liu. Non-autoregressive machine translation with auxiliary regularization. arXiv preprint arXiv:1902.10245, 2019.
|
| 275 |
+
|
| 276 |
+
Bingzhen Wei, Mingxuan Wang, Hao Zhou, Junyang Lin, and Xu Sun. Imitation learning for nonautoregressive neural machine translation. arXiv preprint arXiv:1906.02041, 2019.
|
| 277 |
+
|
| 278 |
+
# A EXPERIMENTAL DETAILS
|
| 279 |
+
|
| 280 |
+
# A.1 AT MODELS
|
| 281 |
+
|
| 282 |
+
Model All the AT models are implemented based on the Transformer model using fairseq (Ott et al., 2019), and we basically follow the fairseq examples to train the transformers6. Following the notation from Vaswani et al. (2017), we list the basic parameters of all the AT model we used:
|
| 283 |
+
|
| 284 |
+
Table 5: Basic hyper-parameters of architecture for AT models.
|
| 285 |
+
|
| 286 |
+
<table><tr><td>Models</td><td>tiny</td><td>small</td><td>base</td><td>big</td></tr><tr><td>dmodel</td><td>256</td><td>512</td><td>512</td><td>1024</td></tr><tr><td>dhidden</td><td>1024</td><td>1024</td><td>2048</td><td>4096</td></tr><tr><td>nlayers</td><td>3</td><td>3</td><td>6</td><td>6</td></tr><tr><td>nheads</td><td>4</td><td>8</td><td>8</td><td>16</td></tr><tr><td>Pdropout</td><td>0.1</td><td>0.1</td><td>0.3</td><td>0.3</td></tr></table>
|
| 287 |
+
|
| 288 |
+
Training For all experiments, we adopt the Adam optimizer (Kingma & Ba, 2014) using $\beta _ { 1 } =$ $0 . 9 , \beta _ { 2 } = 0 . 9 8$ , $\epsilon = 1 e - 8$ . The learning rate is scheduled using inverse sqrt with a maximum learning rate 0.0005 and 4000 warmup steps. We set the label smoothing as 0.1. All the models are run on 8 GPUs for 300, 000 updates with an effective batch size of 32, 000 tokens. The best model is selected based on the validation loss except for FlowSeq which uses valid BLEU score.
|
| 289 |
+
|
| 290 |
+
Decoding After training, we use beam-search with a fixed beam size 5 for all AT models to create the distilled dataset. We use length normalization without length penalty.
|
| 291 |
+
|
| 292 |
+
# A.2 NAT MODELS
|
| 293 |
+
|
| 294 |
+
Model Tab. 2 also lists all the NAT models we test in this work. In general, all the NAT models except FlowSeq and LevT-big adopts a similar architecture and hyper-parameters as the Transformerbase (see Tab. 5). LevT-big is a naive extension of the original LevT model with a comparable parameter setting as Transformer-big (Tab. 5). For FlowSeq, we use the base model (FlowSeq-base) described in (Ma et al., 2019). We re-implemented the vanilla NAT as a simplified version of Gu et al. (2018) where instead of modeling fertility as described in the original paper, we monotonically copy the encoder embeddings to the input of the decoder. All the models except InsT require the additional module to predict the length of the output sequence, or the number of placeholders to be inserted, which is implemented as a standard softmax classifier over the lengths of [0, 256). For LevT, we also have a binary classifier to predict the deletion of the incorrect tokens.
|
| 295 |
+
|
| 296 |
+
Training Similar to the AT models, all the NAT models are trained using the Adam optimizer with the same learning rate scheduler, in which the warmup steps are set to 10, 000. We train the FlowSeq model on 32 GPUs with a batch size as 2048 sentences, while all the other models are trained on 8 GPUs with an effective batch size of 64, 000 tokens. Note that, the batch sizes for training NAT is typically larger than the AT model, which improves final results. There are also specialized training settings for each models:
|
| 297 |
+
|
| 298 |
+
• iNAT (Lee et al., 2018): following the original paper, we train the iNAT model jointly with 4 iterations of refinement during training. For each iteration, the model has the $5 0 \%$ probability to learn as a denoising autoencoder, and the rest of the probability to learn from the model’s own prediction.
|
| 299 |
+
• InsT (Stern et al., 2019): in this work, we only consider training the Insertion Transformer (InsT) using the slot-loss based on the uniform loss function (Stern et al., 2019). That is, we assign equal probabilities to all the insertable tokens inside each slot.
|
| 300 |
+
• MaskT (Ghazvininejad et al., 2019): following the original paper, we train the model as a typical masked language model where the ratio of masked tokens is sampled from $0 \sim 1 0 0 \%$ .
|
| 301 |
+
|
| 302 |
+
• LevT (Gu et al., 2019): in this work, we only consider sequence generation tasks, which means the training of LevT is very similar to InsT. We use sentences with randomly deleted tokens to learn insertion, and learn deletion based on the model’s own prediction.
|
| 303 |
+
|
| 304 |
+
Decoding For a fair comparison over all the NAT models, we use greedy decoding for all the models without considering any advanced decoding methods such as searching or re-ranking from a teacher model. For the vanilla NAT and FlowSeq, decoding is quite straight-forward and simply picks the arg max at every position. For iNAT and MaskT, we fix the decoding steps to 10. Both InsT and LevT decode in an adaptive number of iterations, and we set the maximum iterations for both models to be 10. A special EOS penalty that penalizes generating too short sequences is tuned based on the validation set for both InsT and LevT.
|
| 305 |
+
|
| 306 |
+
For all models, final results are calculated using tokenized BLEU score.
|
| 307 |
+
|
| 308 |
+
# B REAL DATA STATISTICS
|
| 309 |
+
|
| 310 |
+
The detailed dataset split for WMT14 En-De is shown in Tab. 6. In Fig. 7, we also plot the histogram of the conditional entropy of each pair of sentences $\scriptstyle { \mathcal { H } } ( y | x )$ in the real parallel data and different distilled data sets from the big-AT, base-AT, small-AT and tiny-AT respectively. It shows that the distribution of the sentence-level conditional entropy differs widely. The mode of $\scriptstyle { \mathcal { H } } ( y | x )$ in the real data is the highest and follows by distilled data from the big-AT, base-AT, small-AT and tiny-AT. This observation aligns with the complexity value $C ( d )$ proposed in $\ S 3 . 2$ .
|
| 311 |
+
|
| 312 |
+
Table 6: Dataset statistics for WMT14 En-De.
|
| 313 |
+
|
| 314 |
+
<table><tr><td>Dataset</td><td>Train</td><td>Valid</td><td>Test</td><td>Vocabulary</td></tr><tr><td>WMT'14 En-De</td><td>4,500,966</td><td>3000</td><td>3003</td><td>37,009</td></tr></table>
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 7: Density of conditional entropy $C ( d )$ of each sentence pairs in different distilled data sets and the real data.
|
| 318 |
+
|
| 319 |
+
# C ADDITIONAL METRICS
|
| 320 |
+
|
| 321 |
+
In Figure 8, we also showed results with different metrics together with BLEU scores considering that BLEU scores sometimes cannot fully capture the changes in the system. We considered 5 additional metrics in our experiments: METEOR (Banerjee & Lavie, 2005), RIBES (Isozaki et al., 2010), ChrF (Popovic, 2015) TER (Snover et al., 2006), and BEER (Stanojevic & Simaan, 2014). ´ Not surprisingly, we find that all the metrics are correlated with the original BLEU scores quite well showing a similar trend as discussed earlier.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 8: The performance of variant measure (BLEU $\uparrow$ , METEOR $\uparrow$ , RIBES $\uparrow$ , ChrF $\uparrow$ , TER $\downarrow$ BEER $\uparrow$ ) for the vanilla NAT model trained on the distilled data from tiny, small, base and big AT models on WMT14-ENDE newstest 2014 test sets.
|
| 325 |
+
|
| 326 |
+
# D SYNTHETIC DATA WITH ACCESS TO THE TRUE DISTRIBUTION
|
| 327 |
+
|
| 328 |
+
D.1 BACKGROUND: BAYESIAN DECISION THEORY
|
| 329 |
+
|
| 330 |
+
Bayesian decision theory is a fundamental statistical approach to the problem of pattern classification, which provides a principled rule of finding the optimal classification decision using probability and losses that accompany such decisions.
|
| 331 |
+
|
| 332 |
+
In the problem of structured prediction (Ma et al., 2017), let $_ { \textbf { \em x } }$ denote the input sequence and $\textbf { { y } }$ denote the output label sequence. Let $\mathcal { H }$ denote all the possible hypothesis functions from the input to the output space: $\mathcal { H } = \{ h : \mathcal { X } \mathcal { Y } \}$ . Let $r ( \pmb { y } | \pmb { x } )$ denote the conditional risk on the input $_ { \textbf { \em x } }$ , which is the expected loss of predicting $\textbf { { y } }$ based on the posterior probabilities:
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
r ( { \pmb y } | { \pmb x } ) = \mathbb { E } _ { P ( { \pmb y } ^ { \prime } | { \pmb x } ) } [ L ( { \pmb y } , { \pmb y } ^ { \prime } ) ] ,
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
, where $L ( \boldsymbol { y } , \boldsymbol { y } ^ { \prime } )$ is the loss function that penalizes predicting the true target $\boldsymbol { y } ^ { \prime }$ as $\textbf { { y } }$ . The classification task aims to find a hypothesis function $h$ that minimizes the overall risk $R$ given by
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
R ( h ) = \mathbb { E } _ { P ( \pmb { x } ) } [ r ( h ( \pmb { x } ) | \pmb { x } ) ]
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
This is known as the Bayes risk. To minimize the overall risk, obviously we need to minimize the conditional risk for each input $_ { \textbf { \em x } }$ . The Bayesian decision rule states that the global minimum of $R ( h )$ is achieved when the classifier make predictions that minimize each conditional risk given $_ { \textbf { \em x } }$ and this gives the Bayes optimal classifier:
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
h ^ { * } ( { \pmb x } ) = \arg \operatorname* { m i n } _ { { \pmb y } \in { \pmb y } } r ( { \pmb y } | { \pmb x } )
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
Let us consider two loss functions defined in Eq. 5. First is the sequence-level loss $L _ { s e q } ( { \pmb y } , { \pmb y } ^ { \prime } ) =$ $1 - \mathbb { I } ( { \pmb y } = { \pmb y } ^ { \prime } )$ , then in this case the Bayes classifier is:
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
h _ { s e q } ^ { * } ( { \pmb x } ) = \arg \operatorname* { m a x } _ { { \pmb y } \in \mathcal { V } } P ( { \pmb y } | { \pmb x } )
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
, which is the most probable output label sequence given the input sequence $_ { \textbf { \em x } }$
|
| 357 |
+
|
| 358 |
+
Second let us consider the token-level loss $\begin{array} { r } { L _ { t o k } ( \pmb { y } , \pmb { y } ^ { \prime } ) = \sum _ { t = 1 } ^ { T } 1 - \mathbb { I } ( y _ { t } = y _ { t } ^ { \prime } ) } \end{array}$ , i.e the sum of zero-one loss at each time step. We have:
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { r l } { h _ { t o k } ^ { * } ( \pmb { x } ) } & { = \underset { y \in \pmb { \mathscr { Y } } } { \mathrm { a r g ~ m i n ~ } } \mathbb { E } _ { P ( \pmb { y ^ { \prime } } | \pmb { x } ) } [ L _ { 2 } ( \pmb { y } , \pmb { y ^ { \prime } } ) ] } \\ & { = \underset { y \in \pmb { \mathscr { Y } } } { \mathrm { a r g ~ m a x ~ } } \mathbb { E } _ { P ( \pmb { y ^ { \prime } } | \pmb { x } ) } [ \sum _ { t = 1 } ^ { T } \mathbb { I } ( y _ { t } = y _ { t } ^ { \prime } ) ] } \\ & { = \underset { y \in \pmb { \mathscr { Y } } } { \mathrm { a r g ~ m a x } } \sum _ { t = 1 } ^ { T } \mathbb { E } _ { P ( \pmb { y ^ { \prime } } | \pmb { x } ) } [ \mathbb { I } ( y _ { t } = y _ { t } ^ { \prime } ) ] } \\ & { = \underset { y \in \pmb { \mathscr { Y } } } { \mathrm { a r g ~ m a x } } \sum _ { t = 1 } ^ { T } \mathbb { E } _ { P ( y _ { t } ^ { \prime } | \pmb { x } ) } [ \mathbb { I } ( y _ { t } = y _ { t } ^ { \prime } ) ] } \\ & { = \underset { y \in \pmb { \mathscr { Y } } } { \mathrm { a r g ~ m a x } } \underset { t = 1 } { \overset { T } { \prod } } P ( y _ { t } | \pmb { x } ) } \end{array}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
This suggests that the Bayes classifier finds the most probable label at each time step given the input sequence.
|
| 365 |
+
|
| 366 |
+
# D.2 EXPERIMENTAL SETUPS AND ANALYSIS
|
| 367 |
+
|
| 368 |
+
To study how training data affects the performance of a weaker classifier, we construct a Hidden Markov Model (HMM) by sampling the parameters of the transition and emission probabilities uniformly within $( 0 , a ]$ and $( 0 , b ]$ respectively. A higher value of $a$ and $b$ indicates an HMM model with higher uncertainty. We refer this HMM as the “true HMM” as our real data generator. Next we consider a weaker classifier that uses a low-dimension bidirectional-LSTM (Bi-LSTM) to encode the input sequence and individual softmax functions at each time step to predict labels independently, which is referred as the “Bi-LSTM” classifier. Obviously, the Bi-LSTM classifier is not able to model the dependencies between output labels embedded in the HMM, and it is equivalent to a simplified non-autoregressive generation model.
|
| 369 |
+
|
| 370 |
+
We generate the real training data $D _ { r e a l } = \{ ( { \pmb x } _ { 1 } , { \pmb y } _ { 1 } ) , \cdot \cdot \cdot , ( { \pmb x } _ { N } , { \pmb y } _ { N } ) \}$ of size $N$ by sampling from the joint probability of the true HMM. Similarly we sample $N _ { t e s t }$ data points as the test data and $N _ { v a l i d }$ data points as the validation data. We evaluate the classifier’s token-level accuracy tacc and sequand n the test data respectively, where . These two metrics correspond $\begin{array} { r } { t a c c = \frac { \sum _ { i = 1 } ^ { N _ { t e s t } } \sum _ { t = 1 } ^ { T } \mathbb { I } ( h ( \pmb { x } _ { i } ) ^ { t } = \pmb { y } _ { i } ^ { t } ) } { T \times N _ { t e s t } } } \end{array}$ $\begin{array} { r } { s a c c \ = \ \frac { \sum _ { i = 1 } ^ { N _ { t e s t } } { \mathbb { I } \left( { h ( { \bf { x } } _ { i } ) = y _ { i } } \right) } } { N _ { t e s t } } } \end{array}$ $L _ { t o k }$ sequence-level loss $L _ { s e q }$ on each data point of the test data.
|
| 371 |
+
|
| 372 |
+
First, we use $h _ { s e q } ^ { * } ( { \pmb x } )$ to generate the distillation labels $\boldsymbol { y } ^ { \prime }$ from the true HMM, which corresponds to applying the Viterbi decoding to each $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ in $D _ { r e a l }$ . The training data set $D _ { s e q }$ is created with $( { \pmb x } _ { i }$ , $\pmb { y } _ { i } ^ { \prime } )$ . Next, we use $h _ { t o k } ^ { * } ( x )$ to generate the distillation labels $\hat { y }$ and create the training data $D _ { t o k }$ of $( \dot { \pmb x } _ { i } , \hat { \pmb y } _ { i } )$ . To generate $\hat { y }$ , we apply the forward-backward algorithm to each $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ in $D _ { r e a l }$ and obtain $P ( y _ { i } ^ { t } | \mathbf { x } _ { i } )$ . We take arg max over the label space $\mathcal { L }$ : $\hat { y } _ { i } ^ { t } = \underset { y _ { i } ^ { t } \in \mathcal { L } } { \operatorname { a r g m a x } } P ( y _ { i } ^ { t } | \mathbf { x } _ { i } )$ .
|
| 373 |
+
|
| 374 |
+
We use these three training data $( D _ { r e a l } , D _ { t o k } , D _ { s e q } )$ to train the Bi-LSTM classifier respectively. We repeat the experiment for 50 times by constructing 50 HMM models with different random seeds as the data generator. We find that when evaluating with the token-level accuracy tacc, models trained with $D _ { t o k }$ yields the best performance (Bi-LSTM trained with $D _ { t o k }$ win $9 7 . 6 \%$ runs); when evaluating with the sequence-level accuracy sacc, models trained with $D _ { s e q }$ yields the best performance (Bi-LSTM trained with $D _ { s e q }$ win $9 8 . 5 \%$ runs). This is because the Bi-LSTM classifier has difficulty modeling the true data distribution defined by an HMM. On the other hand, it is easier for the Bi-LSTM classifier to model the distributions of $D _ { s e q }$ and $D _ { t o k }$ . Data sets $D _ { s e q }$ and $D _ { t o k }$ define deterministic conditional distributions over the input data, which are much simpler than the real data distribution. By definition, $D _ { t o k }$ is created by the optimal Bayes classifier $\bar { h } _ { t o k } ^ { * } ( { \pmb x } )$ , this means that the Bi-LSTM classifier trained with $D _ { t o k }$ can better capture the distribution of $P ( y _ { t } | \mathbf { x } ) = \operatorname* { m a x } _ { u _ { t } } P ( u _ { t } | \mathbf { x } )$ , which can generalize better to the test data when evaluated with the token-level accuracy. Similarly, Bi-LSTM trained with $D _ { s e q }$ performs better on the test data with the sequence-level metric.
|
| 375 |
+
|
| 376 |
+
This corroborates our observation in machine translation task that NAT has difficulty in modeling the real conditional distribution of true sentence pairs. However, when using the distilled data translated from a pretrained autoregressive model with beam-search decoding, it performs better on the test set when evaluated with the BLEU score metric.
|
parse/train/BygFVAEKDH/BygFVAEKDH_content_list.json
ADDED
|
@@ -0,0 +1,1980 @@
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "UNDERSTANDING KNOWLEDGE DISTILLATION IN NON-AUTOREGRESSIVE MACHINE TRANSLATION ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
176,
|
| 8 |
+
98,
|
| 9 |
+
766,
|
| 10 |
+
146
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Chunting Zhou1∗, Jiatao $\\mathbf { G u ^ { 2 * } }$ , Graham Neubig1 ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
186,
|
| 19 |
+
169,
|
| 20 |
+
514,
|
| 21 |
+
184
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "Language Technologies Institute, Carnegie Mellon University Facebook AI Research2 {chuntinz, gneubig}@cs.cmu.edu, jgu@fb.com ",
|
| 28 |
+
"bbox": [
|
| 29 |
+
184,
|
| 30 |
+
186,
|
| 31 |
+
589,
|
| 32 |
+
227
|
| 33 |
+
],
|
| 34 |
+
"page_idx": 0
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"type": "text",
|
| 38 |
+
"text": "ABSTRACT ",
|
| 39 |
+
"text_level": 1,
|
| 40 |
+
"bbox": [
|
| 41 |
+
454,
|
| 42 |
+
263,
|
| 43 |
+
544,
|
| 44 |
+
279
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "Non-autoregressive machine translation (NAT) systems predict a sequence of output tokens in parallel, achieving substantial improvements in generation speed compared to autoregressive models. Existing NAT models usually rely on the technique of knowledge distillation, which creates the training data from a pretrained autoregressive model for better performance. Knowledge distillation is empirically useful, leading to large gains in accuracy for NAT models, but the reason for this success has, as of yet, been unclear. In this paper, we first design systematic experiments to investigate why knowledge distillation is crucial in NAT training. We find that knowledge distillation can reduce the complexity of data sets and help NAT to model the variations in the output data. Furthermore, a strong correlation is observed between the capacity of an NAT model and the complexity of the distilled data that provides the best translation quality. Based on these findings, we further propose several approaches that can alter the complexity of data sets to improve the performance of NAT models. We achieve state-of-theart performance for NAT-based models, and close the gap with the autoregressive baseline on the WMT14 En-De benchmark.1 ",
|
| 51 |
+
"bbox": [
|
| 52 |
+
233,
|
| 53 |
+
296,
|
| 54 |
+
764,
|
| 55 |
+
518
|
| 56 |
+
],
|
| 57 |
+
"page_idx": 0
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"type": "text",
|
| 61 |
+
"text": "1 INTRODUCTION ",
|
| 62 |
+
"text_level": 1,
|
| 63 |
+
"bbox": [
|
| 64 |
+
178,
|
| 65 |
+
551,
|
| 66 |
+
336,
|
| 67 |
+
566
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "Traditional neural machine translation (NMT) systems (Bahdanau et al., 2015; Gehring et al., 2017; Vaswani et al., 2017) generate sequences in an autoregressive fashion; each target token is predicted step-by-step by conditioning on the previous generated tokens in a monotonic (e.g. left-to-right) order. While such autoregressive translation (AT) models have proven successful, the sequential dependence of decisions precludes taking full advantage of parallelism afforded by modern hardware (e.g. GPUs) at inference time. In contrast, non-autoregressive translation (NAT) models (Gu et al., 2018; Lee et al., 2018) predict the whole sequence or multi-token chunks of the sequence simultaneously, alleviating this problem by trading the model’s capacity for decoding efficiency. Such a non-autoregressive factorization assumes that the output tokens are independent from each other. However, this assumption obviously does not hold in reality and as a result NAT models generally perform worse than standard AT models. ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
584,
|
| 77 |
+
825,
|
| 78 |
+
737
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "One key ingredient in the training recipe for NAT models that is used in almost all existing works (Gu et al. (2018); Lee et al. (2018); Stern et al. (2019), inter alia) is creation of training data through knowledge distillation (Hinton et al., 2015). More precisely, sequence-level knowledge distillation (Kim & Rush, 2016) – a special variant of the original approach – is applied during NAT model training by replacing the target side of training samples with the outputs from a pre-trained AT model trained on the same corpus with a roughly equal number of parameters. It is usually assumed (Gu et al., 2018) that knowledge distillation’s reduction of the “modes” (alternative translations for an input) in the training data is the key reason why distillation benefits NAT training. However, this intuition has not been rigorously tested, leading to three important open questions: ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
174,
|
| 87 |
+
743,
|
| 88 |
+
825,
|
| 89 |
+
869
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "• Exactly how does distillation reduce the “modes”, and how we could we measure this reduction quantitatively? Why does this reduction consistently improve NAT models? • What is the relationship between the NAT model (student) and the AT model (teacher)? Are different varieties of distilled data better for different NAT models? • Due to distillation, the performance of NAT models is largely bounded by the choice of AT teacher. Is there a way to further close the performance gap with standard AT models? ",
|
| 96 |
+
"bbox": [
|
| 97 |
+
174,
|
| 98 |
+
103,
|
| 99 |
+
825,
|
| 100 |
+
195
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 1
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "In this paper, we aim to answer the three questions above, improving understanding of knowledge distillation through empirical analysis over a variety of AT and NAT models. Specifically, our contributions are as follows: ",
|
| 107 |
+
"bbox": [
|
| 108 |
+
176,
|
| 109 |
+
205,
|
| 110 |
+
821,
|
| 111 |
+
247
|
| 112 |
+
],
|
| 113 |
+
"page_idx": 1
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"type": "text",
|
| 117 |
+
"text": "• We first visualize explicitly on a synthetic dataset how modes are reduced by distillation (§3.1). Inspired by the synthetic experiments, we further propose metrics for measuring complexity and faithfulness for a given training set. Specifically, our metrics are the conditional entropy and KL-divergence of word translation based on an external alignment tool, and we show that these metrics are correlated with NAT model performance (§3.2). We conduct a systematic analysis (§4) over four AT teacher models and six NAT student models with various architectures on the standard WMT14 English-German translation benchmark. These experiments find a strong correlation between the capacity of an NAT model and the optimal dataset complexity that results in the best translation quality. \n• Inspired by these observations, we propose approaches to further adjust the complexity of the distilled data in order to match the model’s capacity (§5). We also show that we can achieve the state-of-the-art performance for NAT models and largely match the performance of the AT model. ",
|
| 118 |
+
"bbox": [
|
| 119 |
+
173,
|
| 120 |
+
257,
|
| 121 |
+
825,
|
| 122 |
+
433
|
| 123 |
+
],
|
| 124 |
+
"page_idx": 1
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"type": "text",
|
| 128 |
+
"text": "2 BACKGROUND ",
|
| 129 |
+
"text_level": 1,
|
| 130 |
+
"bbox": [
|
| 131 |
+
174,
|
| 132 |
+
452,
|
| 133 |
+
326,
|
| 134 |
+
468
|
| 135 |
+
],
|
| 136 |
+
"page_idx": 1
|
| 137 |
+
},
|
| 138 |
+
{
|
| 139 |
+
"type": "text",
|
| 140 |
+
"text": "2.1 NON-AUTOREGRESSIVE NEURAL MACHINE TRANSLATION ",
|
| 141 |
+
"text_level": 1,
|
| 142 |
+
"bbox": [
|
| 143 |
+
174,
|
| 144 |
+
482,
|
| 145 |
+
620,
|
| 146 |
+
496
|
| 147 |
+
],
|
| 148 |
+
"page_idx": 1
|
| 149 |
+
},
|
| 150 |
+
{
|
| 151 |
+
"type": "text",
|
| 152 |
+
"text": "In order to model the joint probability of the output sequence $\\textbf { { y } }$ , NMT models usually generate each output token conditioned on the previously generated ones $\\begin{array} { r } { p ( \\pmb { y } | \\pmb { x } ) = \\prod _ { t = 1 } ^ { T } p ( y _ { t } | \\pmb { y } _ { < t } , \\pmb { x } ) } \\end{array}$ . This is known as the autoregressive factorization. To generate a translation from this model, one could predict one token at a time from left to right and greedily take arg max over each output probability distribution, or use beam search to consider a fixed number of hypotheses. In this work, we study non-autoregressive translation (NAT), a special subset of NMT models with an additional restriction (the zeroth-order Markov assumption) upon the output predictions or a subset thereof. The simplest formulation of an NAT model independently factors the conditional distribution: $\\begin{array} { r } { p ( \\pmb { y } | \\pmb { x } ) = \\overline { { \\prod _ { t = 1 } ^ { T } p ( y _ { t } | \\pmb { x } ) } } } \\end{array}$ . ",
|
| 153 |
+
"bbox": [
|
| 154 |
+
174,
|
| 155 |
+
507,
|
| 156 |
+
825,
|
| 157 |
+
640
|
| 158 |
+
],
|
| 159 |
+
"page_idx": 1
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"type": "text",
|
| 163 |
+
"text": "Standard NAT models (Gu et al., 2018) adopt an architecture similar to the Transformer (Vaswani et al., 2017) and make non-autoregressive predictions for the entire sequence with one forward pass of the decoder. However, because multiple translations are possible for a single input sentence (the so-called multi-modality problem; Gu et al. (2018)), vanilla NAT models can fail to capture the dependencies between output tokens. As a result, they tend to make egregious mistakes such as outputting tokens repeatedly. To improve the model’s ability to handle multi-modality, recent works have incorporated approaches including (1) relaxing the fully non-autoregressive restriction and adopting $K$ decoding passes (instead of just one) to iteratively refine the generated outputs (Lee et al., 2018; Ghazvininejad et al., 2019; Wang et al., 2018; Stern et al., 2018; 2019; Gu et al., 2019); (2) using latent variables (Kaiser et al., 2018; Ma et al., 2019; Shu et al., 2019) or structured information such as syntax trees (Akoury et al., 2019) to capture translation variation; (3) training NAT models with objectives other than maximum likelihood (Wang et al., 2019; Wei et al., 2019; Shao et al., 2019) which ameliorates the effects of multi-modality. However, to achieve competitive performance with the autoregressive model, almost all existing NAT models rely on training using data distilled from a pre-trained AT model instead of the real parallel training set, as described below. ",
|
| 164 |
+
"bbox": [
|
| 165 |
+
173,
|
| 166 |
+
645,
|
| 167 |
+
825,
|
| 168 |
+
852
|
| 169 |
+
],
|
| 170 |
+
"page_idx": 1
|
| 171 |
+
},
|
| 172 |
+
{
|
| 173 |
+
"type": "text",
|
| 174 |
+
"text": "2.2 SEQUENCE-LEVEL KNOWLEDGE DISTILLATION ",
|
| 175 |
+
"text_level": 1,
|
| 176 |
+
"bbox": [
|
| 177 |
+
174,
|
| 178 |
+
869,
|
| 179 |
+
544,
|
| 180 |
+
883
|
| 181 |
+
],
|
| 182 |
+
"page_idx": 1
|
| 183 |
+
},
|
| 184 |
+
{
|
| 185 |
+
"type": "text",
|
| 186 |
+
"text": "Knowledge distillation (Liang et al., 2008; Hinton et al., 2015) was originally proposed for training a weaker student classifier on the targets predicted from a stronger teacher model. A typical approach is using the label probabilities produced by the teacher as “soft targets” $q _ { i } =$ $\\mathrm { e x p } ( z _ { i } \\bar { / \\tau } ) / { \\sum _ { j } \\mathrm { e x p } ( z _ { j } \\bar { / \\tau } ) }$ for training the student model, where $q _ { i }$ and $z _ { i }$ are the probability and the logit of class $i$ respectively and $\\tau$ is the temperature. Prior work has shown the effectiveness of adopting knowledge distillation in adversarial defense (Papernot et al., 2016), neural network compression (Howard et al., 2017), and fast inference for speech synthesis (Oord et al., 2018). ",
|
| 187 |
+
"bbox": [
|
| 188 |
+
176,
|
| 189 |
+
895,
|
| 190 |
+
823,
|
| 191 |
+
924
|
| 192 |
+
],
|
| 193 |
+
"page_idx": 1
|
| 194 |
+
},
|
| 195 |
+
{
|
| 196 |
+
"type": "text",
|
| 197 |
+
"text": "",
|
| 198 |
+
"bbox": [
|
| 199 |
+
174,
|
| 200 |
+
103,
|
| 201 |
+
825,
|
| 202 |
+
175
|
| 203 |
+
],
|
| 204 |
+
"page_idx": 2
|
| 205 |
+
},
|
| 206 |
+
{
|
| 207 |
+
"type": "text",
|
| 208 |
+
"text": "In the context of sequence generation, Kim & Rush (2016) extend knowledge distillation to the sentence level using “hard targets” from a pretrained large teacher model to train a small sequence generation model. More precisely, the teacher distribution $q ( t | x )$ is approximated by its mode: $\\begin{array} { r } { \\bar { q } ( { \\pmb t } | { \\pmb x } ) \\approx \\mathbb { 1 } \\{ { \\pmb t } = \\arg \\operatorname* { m a x } _ { { \\pmb t } \\in { \\mathcal T } } q ( { \\pmb t } | { \\pmb x } ) \\} } \\end{array}$ with the following objectives: ",
|
| 209 |
+
"bbox": [
|
| 210 |
+
174,
|
| 211 |
+
181,
|
| 212 |
+
825,
|
| 213 |
+
238
|
| 214 |
+
],
|
| 215 |
+
"page_idx": 2
|
| 216 |
+
},
|
| 217 |
+
{
|
| 218 |
+
"type": "equation",
|
| 219 |
+
"img_path": "images/33f2a3d8914d70fe05b21dcd770e104a469b9efbe4a230165a474cac118ee8d9.jpg",
|
| 220 |
+
"text": "$$\n\\mathcal { L } _ { \\mathrm { s e q } , \\mathrm { K D } } = - \\mathbb { E } _ { \\mathbf { x } \\sim \\mathrm { d a t a } } \\sum _ { t \\in \\mathcal { T } } q ( t | x ) \\log p ( t | x ) \\approx - \\mathbb { E } _ { \\mathbf { x } \\sim \\mathrm { d a t a } , \\hat { y } = \\mathbf { a r g } \\operatorname* { m a x } _ { t \\in \\mathcal { T } } \\mathbf { \\Phi } } q ( t | x ) \\left[ \\log p ( t = \\hat { y } | x ) \\right] ,\n$$",
|
| 221 |
+
"text_format": "latex",
|
| 222 |
+
"bbox": [
|
| 223 |
+
191,
|
| 224 |
+
244,
|
| 225 |
+
771,
|
| 226 |
+
279
|
| 227 |
+
],
|
| 228 |
+
"page_idx": 2
|
| 229 |
+
},
|
| 230 |
+
{
|
| 231 |
+
"type": "text",
|
| 232 |
+
"text": "where $t \\in \\tau$ is the space of possible target sequences. This can also be seen as a special case of standard distillation over the sentence space when the temperature $\\tau$ approaches 0, which is equivalent to taking the arg max over all feasible translations. While the “hard target” $\\hat { y }$ is the most likely translation predicted by the teacher, in practice we use beam search as an approximation. As mentioned earlier, almost all the existing literature trains NAT models using sequence-level knowledge distillation from a pre-trained AT model to achieve competitive performance. Particularly, it is common to train the teacher model as a standard autoregressive Transformer (Vaswani et al., 2017) with a roughly equal number of trainable parameters as the desired NAT model on the real data. Next, we will first study how this knowledge distillation process affects the behavior of NAT models. ",
|
| 233 |
+
"bbox": [
|
| 234 |
+
173,
|
| 235 |
+
284,
|
| 236 |
+
825,
|
| 237 |
+
410
|
| 238 |
+
],
|
| 239 |
+
"page_idx": 2
|
| 240 |
+
},
|
| 241 |
+
{
|
| 242 |
+
"type": "text",
|
| 243 |
+
"text": "3 HOW DOES DISTILLATION IMPROVE NAT? ",
|
| 244 |
+
"text_level": 1,
|
| 245 |
+
"bbox": [
|
| 246 |
+
174,
|
| 247 |
+
429,
|
| 248 |
+
560,
|
| 249 |
+
445
|
| 250 |
+
],
|
| 251 |
+
"page_idx": 2
|
| 252 |
+
},
|
| 253 |
+
{
|
| 254 |
+
"type": "text",
|
| 255 |
+
"text": "In this section, we start from an introductory example to illustrate how NAT models fail to capture the multi-modality of data. Then we propose a metric to assess the multi-modality of a data set and use it to test our hypothesis about how knowledge distillation affects NAT models. ",
|
| 256 |
+
"bbox": [
|
| 257 |
+
174,
|
| 258 |
+
460,
|
| 259 |
+
825,
|
| 260 |
+
502
|
| 261 |
+
],
|
| 262 |
+
"page_idx": 2
|
| 263 |
+
},
|
| 264 |
+
{
|
| 265 |
+
"type": "text",
|
| 266 |
+
"text": "3.1 SYNTHETIC EXPERIMENT FOR MULTI-MODALITY ",
|
| 267 |
+
"text_level": 1,
|
| 268 |
+
"bbox": [
|
| 269 |
+
174,
|
| 270 |
+
520,
|
| 271 |
+
557,
|
| 272 |
+
534
|
| 273 |
+
],
|
| 274 |
+
"page_idx": 2
|
| 275 |
+
},
|
| 276 |
+
{
|
| 277 |
+
"type": "text",
|
| 278 |
+
"text": "Dataset. We start by investigating NAT’s difficulties in modeling multi-modality in output data using a synthetic setup where we explicitly include multiple modes in the training data. More specifically, we utilize three language pairs – English-German (En-De), English-French (En-Fr), and English-Spanish (En-Es) – from the Europarl parallel corpus.2 We extract sentences that have aligned sentences for all languages, and create a multi-target En-De/Es/Fr corpus. In this case every English input sentence always corresponds to target sentences in three different languages, which forms three explicit output modes. Notably, this is similar to the one-to-many translation setting in Johnson et al. (2017) but in our case we do not have an explicit signal (e.g. target language tag) to tell the NMT model which target language to translate to. ",
|
| 279 |
+
"bbox": [
|
| 280 |
+
173,
|
| 281 |
+
545,
|
| 282 |
+
825,
|
| 283 |
+
671
|
| 284 |
+
],
|
| 285 |
+
"page_idx": 2
|
| 286 |
+
},
|
| 287 |
+
{
|
| 288 |
+
"type": "text",
|
| 289 |
+
"text": "Models. We train both the AT and NAT models on this concatenated data set, then compare the distributions of translations with each other. We use the standard Transformer(base) model (Vaswani et al., 2017) as the AT model, and a simplified version of Gu et al. (2018) as the NAT model where the decoder’s inputs are monotonically copied from the encoder embeddings and a length predictor is learned to predict the target sentence length. Both models are trained for 300, 000 steps using maximum likelihood. After training, we use both models to translate the English sentences in the validation and test sets. ",
|
| 290 |
+
"bbox": [
|
| 291 |
+
173,
|
| 292 |
+
678,
|
| 293 |
+
825,
|
| 294 |
+
775
|
| 295 |
+
],
|
| 296 |
+
"page_idx": 2
|
| 297 |
+
},
|
| 298 |
+
{
|
| 299 |
+
"type": "text",
|
| 300 |
+
"text": "Visualization of AT Outputs. The synthetic setup enables us to better understand and visualize the modes in the outputs more easily. First, we visualize the outputs from the AT model. For every translated sentence, we visualize the estimated probability distribution of language classes as a point in Fig. 1 (a). This probability is calculated as the average of the posterior probability of each token, and it is estimated based on the Bayes’ law: ",
|
| 301 |
+
"bbox": [
|
| 302 |
+
174,
|
| 303 |
+
781,
|
| 304 |
+
823,
|
| 305 |
+
852
|
| 306 |
+
],
|
| 307 |
+
"page_idx": 2
|
| 308 |
+
},
|
| 309 |
+
{
|
| 310 |
+
"type": "equation",
|
| 311 |
+
"img_path": "images/4087ddb1b27e7259b3afbcafa70deadfe2f7d37b1186e34d9fbe3ae22333625a.jpg",
|
| 312 |
+
"text": "$$\np ( l _ { i } | \\pmb { y } ) \\approx \\frac { 1 } { T } \\sum _ { t = 1 } ^ { T } p ( l _ { i } | y _ { t } ) = \\frac { 1 } { T } \\sum _ { t = 1 } ^ { T } \\frac { p ( y _ { t } | l _ { i } ) p ( l _ { i } ) } { \\sum _ { k } p ( y _ { t } | l _ { k } ) p ( l _ { k } ) }\n$$",
|
| 313 |
+
"text_format": "latex",
|
| 314 |
+
"bbox": [
|
| 315 |
+
323,
|
| 316 |
+
858,
|
| 317 |
+
673,
|
| 318 |
+
901
|
| 319 |
+
],
|
| 320 |
+
"page_idx": 2
|
| 321 |
+
},
|
| 322 |
+
{
|
| 323 |
+
"type": "image",
|
| 324 |
+
"img_path": "images/04bb8eff87b145aae5ac0c3657d855270a0514db707480b75e062d08f96c9c87.jpg",
|
| 325 |
+
"image_caption": [
|
| 326 |
+
"Figure 1: Posterior distribution of language IDs for the outputs from different models. Each translation is represented as a point inside the simplex $\\Delta ^ { 2 } = \\{ ( p _ { \\mathrm { d e } } , p _ { \\mathrm { e s } } , p _ { \\mathrm { f r } } ) | p _ { k } \\in ( 0 , 1 ) , p _ { \\mathrm { d e } } + p _ { \\mathrm { e s } } + p _ { \\mathrm { f r } } = 1 \\}$ where $p _ { k }$ is the estimated probability of being translated into language $k \\in ( \\mathrm { d e } , \\mathrm { e s } , \\mathrm { f r } )$ . We distinguish the language that has the largest probability with different colors. "
|
| 327 |
+
],
|
| 328 |
+
"image_footnote": [],
|
| 329 |
+
"bbox": [
|
| 330 |
+
181,
|
| 331 |
+
117,
|
| 332 |
+
816,
|
| 333 |
+
250
|
| 334 |
+
],
|
| 335 |
+
"page_idx": 3
|
| 336 |
+
},
|
| 337 |
+
{
|
| 338 |
+
"type": "text",
|
| 339 |
+
"text": "where $l _ { i }$ denotes the language class $i$ , and $p ( y _ { t } | l _ { i } )$ is the token frequency of $y _ { t }$ in language $l _ { i }$ . We assume $p ( l _ { i } )$ follows a uniform distribution. As shown in Fig. 1 (a), points of the AT outputs are clustered closely to each vertex of the simplex, indicating that the AT model prefers to generate the whole sequence in one language. This phenomenon verifies our assumption that decoding with the AT model (distillation) is essentially selecting ���modes” over the real data. ",
|
| 340 |
+
"bbox": [
|
| 341 |
+
174,
|
| 342 |
+
321,
|
| 343 |
+
825,
|
| 344 |
+
392
|
| 345 |
+
],
|
| 346 |
+
"page_idx": 3
|
| 347 |
+
},
|
| 348 |
+
{
|
| 349 |
+
"type": "text",
|
| 350 |
+
"text": "Visualization of NAT Outputs. We visualize outputs for the NAT model trained on the same data in Fig. 1 (b). In contrast to the AT results, the NAT points are scattered broadly inside the simplex, indicating that the NAT model fails to capture the mode of language types. Instead, it predicts tokens mixed with multiple languages, which corroborates our hypothesis that the NAT model has trouble consistently selecting a single mode when multiple modes exist. ",
|
| 351 |
+
"bbox": [
|
| 352 |
+
173,
|
| 353 |
+
398,
|
| 354 |
+
825,
|
| 355 |
+
469
|
| 356 |
+
],
|
| 357 |
+
"page_idx": 3
|
| 358 |
+
},
|
| 359 |
+
{
|
| 360 |
+
"type": "text",
|
| 361 |
+
"text": "Next, we create two datasets that have fewer modes than the original dataset. First, we randomly select a single target sentence from one of the three languages for each source sentence. Second, we perform distillation, decoding from the AT model trained on the combined training set. As noted in the AT results, distillation will also roughly be selecting a language mode, but we conjecture that this selection may be more systematic, selecting a particular language for a particular type of training sentence. As shown in Fig. 1(c) (d), NAT models trained on both of these datasets are more likely to choose one mode (language) when generating translations, showing that training with reduced modes is essential for NAT model. Furthermore, points in Fig. 1 (d) are clearly clustered better than (c) indicating that modes selected by AT models are indeed likely more systematic and easy to capture than those generated by randomly assigning a language for each sentence. ",
|
| 362 |
+
"bbox": [
|
| 363 |
+
173,
|
| 364 |
+
476,
|
| 365 |
+
825,
|
| 366 |
+
616
|
| 367 |
+
],
|
| 368 |
+
"page_idx": 3
|
| 369 |
+
},
|
| 370 |
+
{
|
| 371 |
+
"type": "text",
|
| 372 |
+
"text": "3.2 QUANTITATIVE MEASURES FOR PARALLEL DATA ",
|
| 373 |
+
"text_level": 1,
|
| 374 |
+
"bbox": [
|
| 375 |
+
174,
|
| 376 |
+
632,
|
| 377 |
+
555,
|
| 378 |
+
646
|
| 379 |
+
],
|
| 380 |
+
"page_idx": 3
|
| 381 |
+
},
|
| 382 |
+
{
|
| 383 |
+
"type": "text",
|
| 384 |
+
"text": "To better study why distillation is crucial for NAT models, in this section, we propose quantitative measures for analyzing the complexity and faithfulness of parallel data, two properties that we hypothesize are important for NAT training. ",
|
| 385 |
+
"bbox": [
|
| 386 |
+
174,
|
| 387 |
+
657,
|
| 388 |
+
825,
|
| 389 |
+
700
|
| 390 |
+
],
|
| 391 |
+
"page_idx": 3
|
| 392 |
+
},
|
| 393 |
+
{
|
| 394 |
+
"type": "text",
|
| 395 |
+
"text": "Measure of Complexity. Inspired by the observations in the synthetic experiments, we propose to use a measure of translation uncertainty, specifically operationalized as conditional entropy, as the measurement of complexity $C ( d )$ for any given dataset $d = \\{ ( \\pmb { x } _ { 1 } , \\pmb { y } _ { 1 } ) , . . . , ( \\pmb { x } _ { N } , \\pmb { y } _ { N } ) \\}$ , where $( { \\pmb x } , { \\pmb y } )$ is sentence pair instantiation of $( \\mathbf { \\bar { X } } , \\mathbf { Y } )$ and $\\mathbf { X } \\in { \\mathcal { X } } , \\mathbf { Y } \\in { \\mathcal { Y } }$ : ",
|
| 396 |
+
"bbox": [
|
| 397 |
+
174,
|
| 398 |
+
707,
|
| 399 |
+
825,
|
| 400 |
+
763
|
| 401 |
+
],
|
| 402 |
+
"page_idx": 3
|
| 403 |
+
},
|
| 404 |
+
{
|
| 405 |
+
"type": "text",
|
| 406 |
+
"text": "asm.1: conditional independence ",
|
| 407 |
+
"bbox": [
|
| 408 |
+
598,
|
| 409 |
+
816,
|
| 410 |
+
795,
|
| 411 |
+
830
|
| 412 |
+
],
|
| 413 |
+
"page_idx": 3
|
| 414 |
+
},
|
| 415 |
+
{
|
| 416 |
+
"type": "equation",
|
| 417 |
+
"img_path": "images/a82e426f55c161d4320380b414d6005a9c8f309766f2a6ea5812d22a9fd42b07.jpg",
|
| 418 |
+
"text": "$$\n\\begin{array} { r l } { \\mathcal { H } ( { \\mathbf { Y } } | { \\mathbf { X } } = x ) = \\displaystyle \\sum _ { y \\in \\mathcal { Y } } p ( y | x ) \\log p ( y | x ) } \\\\ & { ~ \\mathrm { ~ } } \\\\ { \\approx \\displaystyle \\sum _ { y \\in \\mathcal { Y } } ( \\displaystyle \\prod _ { \\substack { l = 1 } } ^ { T _ { y } } p ( y | x ) ) ( \\displaystyle \\sum _ { t = 1 } ^ { T _ { y } } \\log p ( y _ { t } | x ) ) } \\\\ & { ~ \\approx \\displaystyle \\sum _ { t = 1 } ^ { T _ { y } } \\displaystyle \\sum _ { y _ { t } < A ( x ) } p ( y _ { t } | \\mathrm { A l i g n } ( y _ { t } ) ) \\log p ( y _ { t } | \\mathrm { A l i g n } ( y _ { t } ) ) } \\\\ & { ~ = \\displaystyle \\sum _ { t = 1 } ^ { T _ { x } } \\mathcal { H } ( y | x = x _ { t } ) } \\end{array}\n$$",
|
| 419 |
+
"text_format": "latex",
|
| 420 |
+
"bbox": [
|
| 421 |
+
184,
|
| 422 |
+
768,
|
| 423 |
+
584,
|
| 424 |
+
929
|
| 425 |
+
],
|
| 426 |
+
"page_idx": 3
|
| 427 |
+
},
|
| 428 |
+
{
|
| 429 |
+
"type": "table",
|
| 430 |
+
"img_path": "images/828cec2952fa231d4f127b152649d8ecc3ff7bb66af323bda80be609b43c736e.jpg",
|
| 431 |
+
"table_caption": [],
|
| 432 |
+
"table_footnote": [],
|
| 433 |
+
"table_body": "<table><tr><td>d</td><td>En-De</td><td>En-Es</td><td></td><td>En-Fr丨Full Real Data</td><td>Random Selection</td><td>Distillation</td></tr><tr><td>C(d���</td><td>3.12</td><td>2.81</td><td>2.89</td><td>3.67</td><td>3.30</td><td>2.64</td></tr></table>",
|
| 434 |
+
"bbox": [
|
| 435 |
+
209,
|
| 436 |
+
102,
|
| 437 |
+
790,
|
| 438 |
+
145
|
| 439 |
+
],
|
| 440 |
+
"page_idx": 4
|
| 441 |
+
},
|
| 442 |
+
{
|
| 443 |
+
"type": "text",
|
| 444 |
+
"text": "Table 1: Complexity $C ( d )$ $\\uparrow$ more complex) of the Europarl data set of different settings in $\\ S 3 . 1$ . ",
|
| 445 |
+
"bbox": [
|
| 446 |
+
178,
|
| 447 |
+
155,
|
| 448 |
+
816,
|
| 449 |
+
170
|
| 450 |
+
],
|
| 451 |
+
"page_idx": 4
|
| 452 |
+
},
|
| 453 |
+
{
|
| 454 |
+
"type": "text",
|
| 455 |
+
"text": "where we use $x$ and $y$ to denote a word in the source and target vocabulary respectively. $T _ { x }$ and $T _ { y }$ denote the length of the source and target sentences. To make the computation tractable, we make two additional assumptions on the conditional distribution $p ( \\pmb { y } | \\pmb { x } )$ : ",
|
| 456 |
+
"bbox": [
|
| 457 |
+
176,
|
| 458 |
+
175,
|
| 459 |
+
818,
|
| 460 |
+
218
|
| 461 |
+
],
|
| 462 |
+
"page_idx": 4
|
| 463 |
+
},
|
| 464 |
+
{
|
| 465 |
+
"type": "text",
|
| 466 |
+
"text": "• Assumption 1: We assume the target tokens are independent given the source sentence. Then the conditional entropy of a sentence can be converted into the sum of entropy of target words conditioned on the source sentence $_ { \\textbf { \\em x } }$ . \n• Assumption 2: We assume the distribution of $p ( y _ { t } | \\pmb { x } )$ follows an alignment model (Dyer et al., $2 0 1 3 ) ^ { \\bar { 3 } }$ where $y _ { t }$ is is generated from the word alignment distribution $p ( y _ { t } | \\mathrm { A l i g n ( y _ { t } ) } )$ . This makes it possible to simplify the conditional entropy to the sum of entropy of target words conditioned on the aligned source words denoted $\\mathcal { H } ( y \\vert x = x _ { t } )$ ). ",
|
| 467 |
+
"bbox": [
|
| 468 |
+
173,
|
| 469 |
+
231,
|
| 470 |
+
826,
|
| 471 |
+
334
|
| 472 |
+
],
|
| 473 |
+
"page_idx": 4
|
| 474 |
+
},
|
| 475 |
+
{
|
| 476 |
+
"type": "text",
|
| 477 |
+
"text": "The corpus level complexity $C ( d )$ is then calculated by adding up the conditional entropy $\\mathcal { H } ( \\mathbf { Y } | \\mathbf { X } =$ ${ \\pmb x } )$ of all sentences. To prevent $C ( d )$ from being dominated by frequent words, we calculate $\\ddot { C } ( d )$ by averaging the entropy of target words conditioned on a source word, denoted $C ( d ) \\ =$ $\\begin{array} { r } { \\frac { 1 } { | \\mathcal { V } _ { x } | } \\overset { \\cdot } { \\sum _ { x \\in \\mathcal { V } _ { x } } } \\mathcal { H } ( y | x ) } \\end{array}$ . ",
|
| 478 |
+
"bbox": [
|
| 479 |
+
173,
|
| 480 |
+
345,
|
| 481 |
+
825,
|
| 482 |
+
405
|
| 483 |
+
],
|
| 484 |
+
"page_idx": 4
|
| 485 |
+
},
|
| 486 |
+
{
|
| 487 |
+
"type": "text",
|
| 488 |
+
"text": "To illustrate that the proposed metric is a reasonable measure of complexity of a parallel corpus, in Tab. 1 we compute $C ( d )$ for parallel data from different language pairs, the concatenated data set, and the data distilled from the AT model described in $\\ S 3 . 1$ . We observe that the conditional entropy of the distilled data is much smaller than that of the concatenated or randomly selected data mentioned above. Additionally, we find that the conditional entropy of En-Es and En-Fr are similar but that of En-De is relatively larger, which can also explain why the student NAT model prefers to predict the modes of Es or Fr more often than De as shown in Fig. 1(d). ",
|
| 489 |
+
"bbox": [
|
| 490 |
+
173,
|
| 491 |
+
411,
|
| 492 |
+
825,
|
| 493 |
+
510
|
| 494 |
+
],
|
| 495 |
+
"page_idx": 4
|
| 496 |
+
},
|
| 497 |
+
{
|
| 498 |
+
"type": "text",
|
| 499 |
+
"text": "Measure of Faithfulness. $C ( d )$ reflects the level of multi-modality of a parallel corpus, and we have shown that a simpler data set is favorable to an NAT model. However, it is not fair to assess the data set only by its complexity; we can trivially construct a simple data set with no variations in the output, which obviously won’t be useful for training. The other important measurement of the data set is its faithfulness to the real data distribution. To measure the faithfulness of a parallel corpus $d$ , we use KL-divergence of the alignment distribution between the real parallel data set $r$ and an altered parallel data set $d$ , denoted $F ( d )$ : ",
|
| 500 |
+
"bbox": [
|
| 501 |
+
173,
|
| 502 |
+
516,
|
| 503 |
+
825,
|
| 504 |
+
614
|
| 505 |
+
],
|
| 506 |
+
"page_idx": 4
|
| 507 |
+
},
|
| 508 |
+
{
|
| 509 |
+
"type": "equation",
|
| 510 |
+
"img_path": "images/fe15653e21957718de952c5ada93d4206b5366da172c13bd1695d400c1d9befb.jpg",
|
| 511 |
+
"text": "$$\nF ( d ) = \\frac { 1 } { | \\mathcal { V } _ { x } | } \\sum _ { x \\in \\mathcal { V } _ { x } } \\sum _ { y \\in \\mathcal { V } _ { y } } p _ { r } ( y | x ) \\log \\frac { p _ { r } ( y | x ) } { p _ { d } ( y | x ) }\n$$",
|
| 512 |
+
"text_format": "latex",
|
| 513 |
+
"bbox": [
|
| 514 |
+
352,
|
| 515 |
+
621,
|
| 516 |
+
647,
|
| 517 |
+
662
|
| 518 |
+
],
|
| 519 |
+
"page_idx": 4
|
| 520 |
+
},
|
| 521 |
+
{
|
| 522 |
+
"type": "text",
|
| 523 |
+
"text": "4 EMPIRICAL STUDY ",
|
| 524 |
+
"text_level": 1,
|
| 525 |
+
"bbox": [
|
| 526 |
+
176,
|
| 527 |
+
678,
|
| 528 |
+
364,
|
| 529 |
+
694
|
| 530 |
+
],
|
| 531 |
+
"page_idx": 4
|
| 532 |
+
},
|
| 533 |
+
{
|
| 534 |
+
"type": "text",
|
| 535 |
+
"text": "In this section, we perform an extensive study over a variety of non-autoregressive (NAT) models trained from different autoregressive (AT) teacher models to assess how knowledge distillation affects the performance of NAT models. ",
|
| 536 |
+
"bbox": [
|
| 537 |
+
174,
|
| 538 |
+
709,
|
| 539 |
+
823,
|
| 540 |
+
752
|
| 541 |
+
],
|
| 542 |
+
"page_idx": 4
|
| 543 |
+
},
|
| 544 |
+
{
|
| 545 |
+
"type": "text",
|
| 546 |
+
"text": "4.1 EXPERIMENTAL SETTINGS ",
|
| 547 |
+
"text_level": 1,
|
| 548 |
+
"bbox": [
|
| 549 |
+
176,
|
| 550 |
+
768,
|
| 551 |
+
400,
|
| 552 |
+
784
|
| 553 |
+
],
|
| 554 |
+
"page_idx": 4
|
| 555 |
+
},
|
| 556 |
+
{
|
| 557 |
+
"type": "text",
|
| 558 |
+
"text": "Data. We use the data set commonly used by prior work as our evaluation benchmark: WMT14 English-German $( \\mathrm { E n - D e } ) ^ { 4 }$ . We use newstest2013 as the validation set for selecting the best model, and newstest2014 as the test set. We learn a byte-pair encoding (BPE, Sennrich et al., 2016) vocabulary of 37,000 on the tokenized data. ",
|
| 559 |
+
"bbox": [
|
| 560 |
+
173,
|
| 561 |
+
795,
|
| 562 |
+
825,
|
| 563 |
+
851
|
| 564 |
+
],
|
| 565 |
+
"page_idx": 4
|
| 566 |
+
},
|
| 567 |
+
{
|
| 568 |
+
"type": "text",
|
| 569 |
+
"text": "AT Models. We set up four Transformer models with different parameter sizes: Transformertiny/small/base/big denoted as tiny, small, base, big respectively. We build base and big models following settings described in Vaswani et al. (2017), and reduce the model sizes for tiny, small to create weaker teacher models. Details of the model architectures can be found in Appendix A. ",
|
| 570 |
+
"bbox": [
|
| 571 |
+
173,
|
| 572 |
+
857,
|
| 573 |
+
820,
|
| 574 |
+
886
|
| 575 |
+
],
|
| 576 |
+
"page_idx": 4
|
| 577 |
+
},
|
| 578 |
+
{
|
| 579 |
+
"type": "text",
|
| 580 |
+
"text": "",
|
| 581 |
+
"bbox": [
|
| 582 |
+
171,
|
| 583 |
+
103,
|
| 584 |
+
823,
|
| 585 |
+
132
|
| 586 |
+
],
|
| 587 |
+
"page_idx": 5
|
| 588 |
+
},
|
| 589 |
+
{
|
| 590 |
+
"type": "text",
|
| 591 |
+
"text": "All the models are trained using the Adam optimizer (Kingma & Ba, 2014) with the maximum number of steps set to 300, 000. After training, we use the resulting AT models to decode the whole training set with beam size 5 and replace the real target sentences to create a new parallel corpus. ",
|
| 592 |
+
"bbox": [
|
| 593 |
+
176,
|
| 594 |
+
138,
|
| 595 |
+
823,
|
| 596 |
+
180
|
| 597 |
+
],
|
| 598 |
+
"page_idx": 5
|
| 599 |
+
},
|
| 600 |
+
{
|
| 601 |
+
"type": "text",
|
| 602 |
+
"text": "NAT Models. We consider the following NAT models, from vanilla to state-of-the-art. All the models are using the Transformer as the basic backbone and are (re-)implemented based on Fairseq5 except for FlowSeq. We briefly outline the methods and parameters here, and describe detailed settings in the Appendix A. ",
|
| 603 |
+
"bbox": [
|
| 604 |
+
174,
|
| 605 |
+
188,
|
| 606 |
+
825,
|
| 607 |
+
244
|
| 608 |
+
],
|
| 609 |
+
"page_idx": 5
|
| 610 |
+
},
|
| 611 |
+
{
|
| 612 |
+
"type": "text",
|
| 613 |
+
"text": "• Vanilla NAT (Gu et al., 2018): Similarly to $\\ S 3 . 1$ , we use a simplified version where the decoder’s inputs are directly copied from the encoder without considering latent variables. \n• FlowSeq (Ma et al., 2019): FlowSeq adopts normalizing flows (Kingma & Dhariwal, 2018) as the latent variables to model the mappings from source sentences to a latent space. \n• NAT with Iterative Refinement (iNAT, Lee et al., 2018): iNAT extends the vanilla NAT by iteratively reading and refining the translation. The number of iterations is set to 10 for decoding. \n• Insertion Transformer (InsT, Stern et al., 2019): InsT adopts a similar architecture as iNAT while generating the sequence by parallel insertion operations. Here, we only consider InsT trained with uniform loss as described in the original paper. \n• MaskPredict (MaskT, Ghazvininejad et al., 2019): MaskT adopts a masked language model (Devlin et al., 2018) to progressively generate the sequence from an entirely masked input. The number of iterations is set to be 10. \n• Levenshtein Transformer (LevT, Gu et al., 2019): LevT uses similar architectures as in InsT and MaskT while generating based on both insertion and deletion operations. We experiment with a base and big LevT model (LevT and LevT-big in Tab. 2). ",
|
| 614 |
+
"bbox": [
|
| 615 |
+
173,
|
| 616 |
+
256,
|
| 617 |
+
826,
|
| 618 |
+
489
|
| 619 |
+
],
|
| 620 |
+
"page_idx": 5
|
| 621 |
+
},
|
| 622 |
+
{
|
| 623 |
+
"type": "text",
|
| 624 |
+
"text": "We also summarize the parameter size, performance and relative decoding speed of the NAT models introduced in Tab. 2. We use the decoding time of vanilla NAT to represent one unit of time, and $\\mathtt { I t e r s } \\times \\mathtt { P a s s }$ represents the relative time units used for each model. ",
|
| 625 |
+
"bbox": [
|
| 626 |
+
176,
|
| 627 |
+
502,
|
| 628 |
+
821,
|
| 629 |
+
544
|
| 630 |
+
],
|
| 631 |
+
"page_idx": 5
|
| 632 |
+
},
|
| 633 |
+
{
|
| 634 |
+
"type": "text",
|
| 635 |
+
"text": "As mentioned earlier, we analyze each model by training from both the real and 4 distilled targets. We train the NAT models for the same number of steps as the AT models. For a fair comparison of the actual ability of each NAT-based model, we test all the models based on greedy decoding without any advanced search algorithms (e.g. length beam (Ghazvininejad et al., 2019), noisy parallel decoding (Ma et al., 2019), or re-ranking from the teacher model (Gu et al., 2018)). Notably, the vanilla NAT and FlowSeq output translations with single forward pass, while the remaining models are based on the iterative refinement. ",
|
| 636 |
+
"bbox": [
|
| 637 |
+
174,
|
| 638 |
+
551,
|
| 639 |
+
470,
|
| 640 |
+
758
|
| 641 |
+
],
|
| 642 |
+
"page_idx": 5
|
| 643 |
+
},
|
| 644 |
+
{
|
| 645 |
+
"type": "text",
|
| 646 |
+
"text": "4.2 ANALYSIS OF THE DISTILLED DATA ",
|
| 647 |
+
"text_level": 1,
|
| 648 |
+
"bbox": [
|
| 649 |
+
178,
|
| 650 |
+
776,
|
| 651 |
+
462,
|
| 652 |
+
790
|
| 653 |
+
],
|
| 654 |
+
"page_idx": 5
|
| 655 |
+
},
|
| 656 |
+
{
|
| 657 |
+
"type": "table",
|
| 658 |
+
"img_path": "images/9f9538e25d56ad999b7c5e5e39a4f518388319007e44426b24201d047abe3f8a.jpg",
|
| 659 |
+
"table_caption": [
|
| 660 |
+
"Table 2: AT and NAT models. Number of parameters and test BLEU when trained on the real data demonstrate model capacity. Iters is number of passes used in decoding for output length $n$ and hyperparameter $k$ . Pass is relative time used for one pass of decoding. "
|
| 661 |
+
],
|
| 662 |
+
"table_footnote": [],
|
| 663 |
+
"table_body": "<table><tr><td>Models</td><td>Params</td><td>BLEU</td><td>Pass</td><td>Iters</td></tr><tr><td>AT models</td><td></td><td></td><td></td><td></td></tr><tr><td>AT-tiny</td><td>16M</td><td>23.3</td><td></td><td>n</td></tr><tr><td>AT-small</td><td>37M</td><td>25.6</td><td></td><td>n</td></tr><tr><td>AT-base</td><td>65M</td><td>27.1</td><td></td><td>n</td></tr><tr><td>AT-big</td><td>218M</td><td>28.2</td><td></td><td>n</td></tr><tr><td>NAT models</td><td></td><td></td><td></td><td></td></tr><tr><td>vanilla</td><td>71M</td><td>11.4</td><td>1</td><td>1</td></tr><tr><td>FlowSeq</td><td>73M</td><td>18.6</td><td>13</td><td>1</td></tr><tr><td>iNAT</td><td>66M</td><td>19.3</td><td>1</td><td>k<n</td></tr><tr><td>InsT</td><td>66M</td><td>20.9</td><td>1</td><td>~ log2 n</td></tr><tr><td>MaskT</td><td>66M</td><td>23.5</td><td>1</td><td>10</td></tr><tr><td>LevT</td><td>66M</td><td>25.2</td><td>1</td><td>3k<n</td></tr><tr><td>LevT-big</td><td>220M</td><td>26.5</td><td>~3</td><td>3k<n</td></tr></table>",
|
| 664 |
+
"bbox": [
|
| 665 |
+
485,
|
| 666 |
+
554,
|
| 667 |
+
821,
|
| 668 |
+
753
|
| 669 |
+
],
|
| 670 |
+
"page_idx": 5
|
| 671 |
+
},
|
| 672 |
+
{
|
| 673 |
+
"type": "text",
|
| 674 |
+
"text": "We compare different dimensions of the data generated by the four AT models and the real data set in Fig. 3. First, Fig. 3 (a) shows that as the capacity of the AT model increases, the ",
|
| 675 |
+
"bbox": [
|
| 676 |
+
174,
|
| 677 |
+
803,
|
| 678 |
+
470,
|
| 679 |
+
858
|
| 680 |
+
],
|
| 681 |
+
"page_idx": 5
|
| 682 |
+
},
|
| 683 |
+
{
|
| 684 |
+
"type": "text",
|
| 685 |
+
"text": "complexity $\\dot { C } ( d )$ of the distilled data increases, which indicates that the multi-modality increases as well. At the same time, we observe that $F ( d )$ defined in $\\ S 3 . 2$ also decreases, showing that the distilled data more faithfully represents the word-level translation distribution of the original data. ",
|
| 686 |
+
"bbox": [
|
| 687 |
+
174,
|
| 688 |
+
858,
|
| 689 |
+
825,
|
| 690 |
+
900
|
| 691 |
+
],
|
| 692 |
+
"page_idx": 5
|
| 693 |
+
},
|
| 694 |
+
{
|
| 695 |
+
"type": "text",
|
| 696 |
+
"text": "Source For more than 30 years , Josef Winkler has been writing from the heart , telling of the hardships of his childhood and youth . Distilled Target Seit mehr als 30 Jahren schreibt Josef Winkler aus dem Herzen und erzählt von der Not seiner Kindheit und Jugend . Real Target Josef Winkler schreibt sich seit mehr als 30 Jahren die Nöte seiner Kindheit und Jugend von der Seele . ",
|
| 697 |
+
"bbox": [
|
| 698 |
+
176,
|
| 699 |
+
103,
|
| 700 |
+
821,
|
| 701 |
+
150
|
| 702 |
+
],
|
| 703 |
+
"page_idx": 6
|
| 704 |
+
},
|
| 705 |
+
{
|
| 706 |
+
"type": "image",
|
| 707 |
+
"img_path": "images/9d2dae1ad08ba3f51683aa3a4a8e8fbbf67cb76c9b3302cdae14915855e67e63.jpg",
|
| 708 |
+
"image_caption": [
|
| 709 |
+
"Figure 2: A sampled pair together with its real target from the distilled data of the base-AT model. Chunks annotated in the same colors are approximately aligned with each other. ",
|
| 710 |
+
"Figure 3: Complexity $C ( d )$ (↑ more complex), faithfulness $F ( d )$ ( $\\downarrow$ more faithful), training BLEU, and reordering score $\\uparrow$ more monotonic alignment) of different distilled sets of WMT14-ENDE. "
|
| 711 |
+
],
|
| 712 |
+
"image_footnote": [],
|
| 713 |
+
"bbox": [
|
| 714 |
+
174,
|
| 715 |
+
207,
|
| 716 |
+
823,
|
| 717 |
+
316
|
| 718 |
+
],
|
| 719 |
+
"page_idx": 6
|
| 720 |
+
},
|
| 721 |
+
{
|
| 722 |
+
"type": "text",
|
| 723 |
+
"text": "Second, we plot the BLEU score of the distilled data w.r.t to the real data set in (b) and we observe that the BLEU score of the distilled data from a higher-capacity teacher model is higher, which is both intuitive and in agreement with the results on KL divergence. ",
|
| 724 |
+
"bbox": [
|
| 725 |
+
174,
|
| 726 |
+
383,
|
| 727 |
+
825,
|
| 728 |
+
425
|
| 729 |
+
],
|
| 730 |
+
"page_idx": 6
|
| 731 |
+
},
|
| 732 |
+
{
|
| 733 |
+
"type": "text",
|
| 734 |
+
"text": "We also investigate how the relative ordering of words in the source and target sentences is changed during distillation. We use the fuzzy reordering score proposed in Talbot et al. (2011). A larger fuzzy reordering score indicates the more monotonic alignments. As shown in Fig 3 (c), the distilled data has significantly less reordering compared to the real parallel sentences, and the distilled data from a weaker AT teacher is more monotonic than a stronger AT teacher. We also show a randomly sampled example in Fig. 2 where compared to the real translation, the AT distilled target is much more monotonically aligned to the source sentence. This has potential benefits in that these simpler reordering patterns may be easier to learn for NAT models, but also disadvantages in that it may prevent NAT models from learning complex reordering patterns. ",
|
| 735 |
+
"bbox": [
|
| 736 |
+
174,
|
| 737 |
+
433,
|
| 738 |
+
825,
|
| 739 |
+
558
|
| 740 |
+
],
|
| 741 |
+
"page_idx": 6
|
| 742 |
+
},
|
| 743 |
+
{
|
| 744 |
+
"type": "text",
|
| 745 |
+
"text": "4.3 ANALYSIS OF DISTILLATION STRATEGIES ",
|
| 746 |
+
"text_level": 1,
|
| 747 |
+
"bbox": [
|
| 748 |
+
174,
|
| 749 |
+
575,
|
| 750 |
+
503,
|
| 751 |
+
589
|
| 752 |
+
],
|
| 753 |
+
"page_idx": 6
|
| 754 |
+
},
|
| 755 |
+
{
|
| 756 |
+
"type": "text",
|
| 757 |
+
"text": "In $\\ S 4 . 2$ , we have shown that decoding with an AT model reduces the conditional entropy of the parallel data set, which mitigates multi-modality in the output data. But does the decoding method of the AT model affect this change in the data set? We also investigate different decoding strategies when creating distilled data, using the base Transformer model as the teacher and the vanilla NAT model as the student. In Tab. 3, four decoding methods are presented: sampling, sampling within the top-10 candidates, beam search, and greedy decoding. With the same AT model, the performance of the NAT model differs widely depending on the decoding approach, where distillation with beam search results in the best performance. ",
|
| 758 |
+
"bbox": [
|
| 759 |
+
173,
|
| 760 |
+
602,
|
| 761 |
+
825,
|
| 762 |
+
713
|
| 763 |
+
],
|
| 764 |
+
"page_idx": 6
|
| 765 |
+
},
|
| 766 |
+
{
|
| 767 |
+
"type": "text",
|
| 768 |
+
"text": "We can see that beam search or greedy decoding can reduce the complexity of the real data the most while maintaining high faithfulness. In contrast, sampling based decoding methods less aggressively reduce the modes in the output sequence. This finding is in concert with Ott et al. (2018), who demonstrate that because beam search approximately selects the most probable translation, it effectively reduces diversity in the output translations compared to sampling or the true distribution. ",
|
| 769 |
+
"bbox": [
|
| 770 |
+
174,
|
| 771 |
+
713,
|
| 772 |
+
516,
|
| 773 |
+
851
|
| 774 |
+
],
|
| 775 |
+
"page_idx": 6
|
| 776 |
+
},
|
| 777 |
+
{
|
| 778 |
+
"type": "table",
|
| 779 |
+
"img_path": "images/1da83ec2069020cd0fff99f7084b27c893f82a99ec687bd3f14fe3d0880064df.jpg",
|
| 780 |
+
"table_caption": [
|
| 781 |
+
"Table 3: Comparisons of decoding methods on WMT14-ENDE newstest 2014 test set. "
|
| 782 |
+
],
|
| 783 |
+
"table_footnote": [],
|
| 784 |
+
"table_body": "<table><tr><td>Decoding Method</td><td>C(d)</td><td>F(d)</td><td>BLEU</td></tr><tr><td> sampling</td><td>3.623</td><td>3.354</td><td>6.6</td></tr><tr><td>sampling (Top 10)</td><td>2.411</td><td>2.932</td><td>14.6</td></tr><tr><td>greedy</td><td>1.960</td><td>2.959</td><td>18.9</td></tr><tr><td>beam search</td><td>1.902</td><td>2.948</td><td>19.5</td></tr></table>",
|
| 785 |
+
"bbox": [
|
| 786 |
+
529,
|
| 787 |
+
723,
|
| 788 |
+
823,
|
| 789 |
+
803
|
| 790 |
+
],
|
| 791 |
+
"page_idx": 6
|
| 792 |
+
},
|
| 793 |
+
{
|
| 794 |
+
"type": "text",
|
| 795 |
+
"text": "4.4 DISTILLED DATA V.S. NAT MODELS ",
|
| 796 |
+
"text_level": 1,
|
| 797 |
+
"bbox": [
|
| 798 |
+
176,
|
| 799 |
+
869,
|
| 800 |
+
465,
|
| 801 |
+
882
|
| 802 |
+
],
|
| 803 |
+
"page_idx": 6
|
| 804 |
+
},
|
| 805 |
+
{
|
| 806 |
+
"type": "text",
|
| 807 |
+
"text": "We next examine the relationship between the NAT students and distilled training data from different AT models. In Fig. 4, we demonstrate results for the NAT models listed in $\\ S 4 . 1$ . We use the test set performance on real data as a simple metric to measure the capacity of the NAT model and arrange the subfigures in an increasing order of the performance (left-to-right, top-to-bottom). The results in the figure demonstrate that, interestingly, weaker NAT students prefer distilled data with smaller complexity as measured above in $\\ S 4 . 2$ . The best performance of NAT models – from lower capacity ones to higher capacity ones – is achieved with distilled data of lower complexity to higher complexity, i.e. the vanilla NAT model performs best when using the distilled data from a small Transformer whereas LevT achieves the best performance when training with the distilled data from a big Transformer. Third, and notably, by simply changing the distilled data set upon which the models are trained, we are able to significantly improve the state-of-the-art results for models in a particular class. For example, FlowSeq increased to 22, by simply changing from the distilled data of Transformer(base) to Transformer(small). Finally, we find that by distilling from a big AT model, LevT is able to close the gap with the Transformer (base) with a similar number of parameters. Both LevT and LevT-big achieve the state-of-the-art performance for NAT-based models. ",
|
| 808 |
+
"bbox": [
|
| 809 |
+
174,
|
| 810 |
+
895,
|
| 811 |
+
823,
|
| 812 |
+
924
|
| 813 |
+
],
|
| 814 |
+
"page_idx": 6
|
| 815 |
+
},
|
| 816 |
+
{
|
| 817 |
+
"type": "image",
|
| 818 |
+
"img_path": "images/8c8bc95789674f33498144f066b57d9e7e1a9e111bba99613a08d8b91a621590.jpg",
|
| 819 |
+
"image_caption": [
|
| 820 |
+
"Figure 4: The performance of NAT models of varying capacity trained on both the real and the distilled data from tiny, small, base and big AT models on WMT14-ENDE newstest 2014 test sets. "
|
| 821 |
+
],
|
| 822 |
+
"image_footnote": [],
|
| 823 |
+
"bbox": [
|
| 824 |
+
184,
|
| 825 |
+
102,
|
| 826 |
+
821,
|
| 827 |
+
354
|
| 828 |
+
],
|
| 829 |
+
"page_idx": 7
|
| 830 |
+
},
|
| 831 |
+
{
|
| 832 |
+
"type": "text",
|
| 833 |
+
"text": "",
|
| 834 |
+
"bbox": [
|
| 835 |
+
173,
|
| 836 |
+
414,
|
| 837 |
+
825,
|
| 838 |
+
594
|
| 839 |
+
],
|
| 840 |
+
"page_idx": 7
|
| 841 |
+
},
|
| 842 |
+
{
|
| 843 |
+
"type": "text",
|
| 844 |
+
"text": "5 IMPROVEMENTS TO KNOWLEDGE DISTILLATION ",
|
| 845 |
+
"text_level": 1,
|
| 846 |
+
"bbox": [
|
| 847 |
+
174,
|
| 848 |
+
622,
|
| 849 |
+
607,
|
| 850 |
+
638
|
| 851 |
+
],
|
| 852 |
+
"page_idx": 7
|
| 853 |
+
},
|
| 854 |
+
{
|
| 855 |
+
"type": "text",
|
| 856 |
+
"text": "The previous section shows that the optimal complexity of the dataset is highly correlated with the capacity of the NAT model. In this section, we introduce three techniques that can be used to alter the distilled data to match the capacity of NAT model. Specifically, these techniques can be used to simplify the data further (BANs, MoE) for a lower-capacity student model or increase faithfulness of the data set (Interpolation) for a higher-capacity student model. ",
|
| 857 |
+
"bbox": [
|
| 858 |
+
174,
|
| 859 |
+
659,
|
| 860 |
+
825,
|
| 861 |
+
728
|
| 862 |
+
],
|
| 863 |
+
"page_idx": 7
|
| 864 |
+
},
|
| 865 |
+
{
|
| 866 |
+
"type": "text",
|
| 867 |
+
"text": "Born-Again Networks. We apply Born-Again neworks (BANs) to create a simplified dataset for NAT models. BANs were originally proposed as a self-distillation technique (Furlanello et al., 2018) that uses the output distribution of a trained model to train the original model. Starting from the real data, we repeatedly train new AT models with decoded sentences from the AT model at the previous iteration. This process is repeated for $k$ times and yields $k$ distilled data sets, upon which we perform NAT training and examine how the $k$ born-again teachers affect the performance of NAT students. ",
|
| 868 |
+
"bbox": [
|
| 869 |
+
174,
|
| 870 |
+
734,
|
| 871 |
+
825,
|
| 872 |
+
819
|
| 873 |
+
],
|
| 874 |
+
"page_idx": 7
|
| 875 |
+
},
|
| 876 |
+
{
|
| 877 |
+
"type": "text",
|
| 878 |
+
"text": "We conduct experiments using the vanilla NAT model (Gu et al., 2018) (which achieved the best performance with distilled data from a small Transformer in $\\ S 4 . 4 )$ and the base Transformer as the AT model. As shown in Fig. 5, we can make the following observations: (i) The performance of the base AT model almost remains unchanged during the reborn iterations. (ii) The performance of the vanilla NAT model can be improved by 2 BLEU when using the distilled data from reborn iteration 6. (iii) As the reborn iterations continue, the complexity of the distilled data decreases and becomes constant eventually. Meanwhile, the quality of the distilled data compared to the real data decreases. ",
|
| 879 |
+
"bbox": [
|
| 880 |
+
174,
|
| 881 |
+
825,
|
| 882 |
+
825,
|
| 883 |
+
924
|
| 884 |
+
],
|
| 885 |
+
"page_idx": 7
|
| 886 |
+
},
|
| 887 |
+
{
|
| 888 |
+
"type": "image",
|
| 889 |
+
"img_path": "images/c7ab20bb73c27a4ac97a5717c91102afc55b5a1abcb6a9e767b6f2f3eed361cc.jpg",
|
| 890 |
+
"image_caption": [
|
| 891 |
+
"Figure 5: Reborn experiments: (from left to right) performance of the base AT model, performance of the vanilla NAT model, $C ( d )$ and $F ( d )$ of distilled data sets. R-i denotes the $i$ -th reborn iteration. "
|
| 892 |
+
],
|
| 893 |
+
"image_footnote": [],
|
| 894 |
+
"bbox": [
|
| 895 |
+
171,
|
| 896 |
+
99,
|
| 897 |
+
826,
|
| 898 |
+
208
|
| 899 |
+
],
|
| 900 |
+
"page_idx": 8
|
| 901 |
+
},
|
| 902 |
+
{
|
| 903 |
+
"type": "image",
|
| 904 |
+
"img_path": "images/03d4b5c7927e24575af28a689c18d019d84c75e0dab3808abe1e78b6906ae218.jpg",
|
| 905 |
+
"image_caption": [
|
| 906 |
+
"Figure 6: MoE experiments: (from left to right) performance of the base AT model, performance of the vanilla NAT model, $C ( d )$ and $F ( d )$ of distilled data sets w.r.t the number of experts. "
|
| 907 |
+
],
|
| 908 |
+
"image_footnote": [],
|
| 909 |
+
"bbox": [
|
| 910 |
+
171,
|
| 911 |
+
258,
|
| 912 |
+
825,
|
| 913 |
+
367
|
| 914 |
+
],
|
| 915 |
+
"page_idx": 8
|
| 916 |
+
},
|
| 917 |
+
{
|
| 918 |
+
"type": "text",
|
| 919 |
+
"text": "Mixture-of-Experts. The mixture-of-expert model (MoE; Shen et al. (2019)) learns different experts for diverse machine translation, and different mixture components were shown to capture consistent translation styles across examples. Inspired by this, we use one expert from the mixture model to translate the training data, which is supposed to generate a single style of translation and reduce the diversity in the original data set. Then we use the best single-expert translations as the distilled data to train the vanilla NAT model. Specifically, we follow Shen et al. (2019)’s setup, using the base Transformer model and uniform hard mixture model, varying the number of experts. ",
|
| 920 |
+
"bbox": [
|
| 921 |
+
173,
|
| 922 |
+
417,
|
| 923 |
+
825,
|
| 924 |
+
516
|
| 925 |
+
],
|
| 926 |
+
"page_idx": 8
|
| 927 |
+
},
|
| 928 |
+
{
|
| 929 |
+
"type": "text",
|
| 930 |
+
"text": "In Fig. 6, we observe that the performance of the best expert of MoE tends to decrease as the number of experts increases. However, the complexity $( C ( d ) )$ and faithfulness $( F ( D ) )$ of distilled data from different MoE models has a relatively large variance. Compared to using the distilled data from a plain base AT model, the performance of NAT model is improved by 1.21 BLEU when using the distilled data from the MoE model with the number of experts of 3 which produces the distilled data with the least complexity. ",
|
| 931 |
+
"bbox": [
|
| 932 |
+
173,
|
| 933 |
+
522,
|
| 934 |
+
825,
|
| 935 |
+
607
|
| 936 |
+
],
|
| 937 |
+
"page_idx": 8
|
| 938 |
+
},
|
| 939 |
+
{
|
| 940 |
+
"type": "table",
|
| 941 |
+
"img_path": "images/a77529fbea3ca62170b85216dcb9147bbbbd4176d389c0e872e7bc3f35339357.jpg",
|
| 942 |
+
"table_caption": [],
|
| 943 |
+
"table_footnote": [],
|
| 944 |
+
"table_body": "<table><tr><td>d</td><td>C(d)</td><td>F(d)</td><td>BLEU</td></tr><tr><td>base</td><td>1.902</td><td>2.948</td><td>26.94</td></tr><tr><td>base-inter</td><td>1.908</td><td>2.916</td><td>27.32</td></tr></table>",
|
| 945 |
+
"bbox": [
|
| 946 |
+
576,
|
| 947 |
+
617,
|
| 948 |
+
821,
|
| 949 |
+
671
|
| 950 |
+
],
|
| 951 |
+
"page_idx": 8
|
| 952 |
+
},
|
| 953 |
+
{
|
| 954 |
+
"type": "text",
|
| 955 |
+
"text": "Sequence-Level Interpolation. $\\ S 4 . 4$ shows stronger NAT models (e.g. MaskT, LevT) have the ability to learn from the dataset that is closer to the real data, and achieve better performance. We adopt the sequence-level interpolation proposed in Kim & Rush (2016) as a natural way to create a better dataset. Different from distillation, interpolation picks the sentence with the highest sentence-level BLEU score w.r.t. the ground truth from $K$ −best beam search hy",
|
| 956 |
+
"bbox": [
|
| 957 |
+
174,
|
| 958 |
+
613,
|
| 959 |
+
562,
|
| 960 |
+
724
|
| 961 |
+
],
|
| 962 |
+
"page_idx": 8
|
| 963 |
+
},
|
| 964 |
+
{
|
| 965 |
+
"type": "text",
|
| 966 |
+
"text": "Table 4: Results w/ and w/o sequencelevel interpolation with LevT. ",
|
| 967 |
+
"bbox": [
|
| 968 |
+
576,
|
| 969 |
+
683,
|
| 970 |
+
821,
|
| 971 |
+
710
|
| 972 |
+
],
|
| 973 |
+
"page_idx": 8
|
| 974 |
+
},
|
| 975 |
+
{
|
| 976 |
+
"type": "text",
|
| 977 |
+
"text": "potheses. In our experiments, we first run beam search using the base Transformer model with a beam size of 5 then select the sentences with the highest BLEU score from the top-3 candidates. ",
|
| 978 |
+
"bbox": [
|
| 979 |
+
176,
|
| 980 |
+
726,
|
| 981 |
+
823,
|
| 982 |
+
752
|
| 983 |
+
],
|
| 984 |
+
"page_idx": 8
|
| 985 |
+
},
|
| 986 |
+
{
|
| 987 |
+
"type": "text",
|
| 988 |
+
"text": "Tab. 4 compares the performance of LevT trained with distilled data from the AT model with the standard distillation or interpolation. We observe that selection with BLEU score from the base AT model (base-inter) improves the performance of LevT $\\sim 0 . 4$ BLEU while the dataset complexity $C ( d )$ does not increase much. ",
|
| 989 |
+
"bbox": [
|
| 990 |
+
174,
|
| 991 |
+
760,
|
| 992 |
+
825,
|
| 993 |
+
815
|
| 994 |
+
],
|
| 995 |
+
"page_idx": 8
|
| 996 |
+
},
|
| 997 |
+
{
|
| 998 |
+
"type": "text",
|
| 999 |
+
"text": "6 CONCLUSION ",
|
| 1000 |
+
"text_level": 1,
|
| 1001 |
+
"bbox": [
|
| 1002 |
+
174,
|
| 1003 |
+
835,
|
| 1004 |
+
318,
|
| 1005 |
+
852
|
| 1006 |
+
],
|
| 1007 |
+
"page_idx": 8
|
| 1008 |
+
},
|
| 1009 |
+
{
|
| 1010 |
+
"type": "text",
|
| 1011 |
+
"text": "In this paper, we first systematically examine why knowledge distillation improves the performance of NAT models. We conducted extensive experiments with autoregressive teacher models of different capacity and a wide range of NAT models. Furthermore, we defined metrics that can quantitatively measure the complexity of a parallel data set. Empirically, we find that a higher-capacity ",
|
| 1012 |
+
"bbox": [
|
| 1013 |
+
174,
|
| 1014 |
+
867,
|
| 1015 |
+
823,
|
| 1016 |
+
924
|
| 1017 |
+
],
|
| 1018 |
+
"page_idx": 8
|
| 1019 |
+
},
|
| 1020 |
+
{
|
| 1021 |
+
"type": "text",
|
| 1022 |
+
"text": "NAT model requires a more complex distilled data to achieve better performance. Accordingly, we propose several techniques that can adjust the complexity of a data set to match the capacity of an NAT model for better performance. ",
|
| 1023 |
+
"bbox": [
|
| 1024 |
+
174,
|
| 1025 |
+
103,
|
| 1026 |
+
823,
|
| 1027 |
+
146
|
| 1028 |
+
],
|
| 1029 |
+
"page_idx": 9
|
| 1030 |
+
},
|
| 1031 |
+
{
|
| 1032 |
+
"type": "text",
|
| 1033 |
+
"text": "REFERENCES ",
|
| 1034 |
+
"text_level": 1,
|
| 1035 |
+
"bbox": [
|
| 1036 |
+
174,
|
| 1037 |
+
167,
|
| 1038 |
+
285,
|
| 1039 |
+
183
|
| 1040 |
+
],
|
| 1041 |
+
"page_idx": 9
|
| 1042 |
+
},
|
| 1043 |
+
{
|
| 1044 |
+
"type": "text",
|
| 1045 |
+
"text": "Nader Akoury, Kalpesh Krishna, and Mohit Iyyer. Syntactically supervised transformers for faster neural machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1269–1281, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1122. URL https://www.aclweb.org/ anthology/P19-1122. ",
|
| 1046 |
+
"bbox": [
|
| 1047 |
+
174,
|
| 1048 |
+
191,
|
| 1049 |
+
825,
|
| 1050 |
+
261
|
| 1051 |
+
],
|
| 1052 |
+
"page_idx": 9
|
| 1053 |
+
},
|
| 1054 |
+
{
|
| 1055 |
+
"type": "text",
|
| 1056 |
+
"text": "Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations (ICLR), 2015. ",
|
| 1057 |
+
"bbox": [
|
| 1058 |
+
173,
|
| 1059 |
+
272,
|
| 1060 |
+
825,
|
| 1061 |
+
314
|
| 1062 |
+
],
|
| 1063 |
+
"page_idx": 9
|
| 1064 |
+
},
|
| 1065 |
+
{
|
| 1066 |
+
"type": "text",
|
| 1067 |
+
"text": "Satanjeev Banerjee and Alon Lavie. Meteor: An automatic metric for mt evaluation with improved correlation with human judgments. In Proceedings of the acl workshop on intrinsic and extrinsic evaluation measures for machine translation and/or summarization, pp. 65–72, 2005. ",
|
| 1068 |
+
"bbox": [
|
| 1069 |
+
174,
|
| 1070 |
+
325,
|
| 1071 |
+
823,
|
| 1072 |
+
368
|
| 1073 |
+
],
|
| 1074 |
+
"page_idx": 9
|
| 1075 |
+
},
|
| 1076 |
+
{
|
| 1077 |
+
"type": "text",
|
| 1078 |
+
"text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. CoRR, abs/1810.04805, 2018. URL http://arxiv.org/abs/1810.04805. ",
|
| 1079 |
+
"bbox": [
|
| 1080 |
+
174,
|
| 1081 |
+
378,
|
| 1082 |
+
823,
|
| 1083 |
+
421
|
| 1084 |
+
],
|
| 1085 |
+
"page_idx": 9
|
| 1086 |
+
},
|
| 1087 |
+
{
|
| 1088 |
+
"type": "text",
|
| 1089 |
+
"text": "Chris Dyer, Victor Chahuneau, and Noah Smith. A simple, fast, and effective reparameterization of IBM Model 2. In NAACL, 2013. ",
|
| 1090 |
+
"bbox": [
|
| 1091 |
+
171,
|
| 1092 |
+
431,
|
| 1093 |
+
823,
|
| 1094 |
+
460
|
| 1095 |
+
],
|
| 1096 |
+
"page_idx": 9
|
| 1097 |
+
},
|
| 1098 |
+
{
|
| 1099 |
+
"type": "text",
|
| 1100 |
+
"text": "Tommaso Furlanello, Zachary Lipton, Michael Tschannen, Laurent Itti, and Anima Anandkumar. Born-again neural networks. In International Conference on Machine Learning, pp. 1602–1611, 2018. ",
|
| 1101 |
+
"bbox": [
|
| 1102 |
+
174,
|
| 1103 |
+
469,
|
| 1104 |
+
825,
|
| 1105 |
+
512
|
| 1106 |
+
],
|
| 1107 |
+
"page_idx": 9
|
| 1108 |
+
},
|
| 1109 |
+
{
|
| 1110 |
+
"type": "text",
|
| 1111 |
+
"text": "Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1243–1252. JMLR. org, 2017. ",
|
| 1112 |
+
"bbox": [
|
| 1113 |
+
173,
|
| 1114 |
+
522,
|
| 1115 |
+
825,
|
| 1116 |
+
566
|
| 1117 |
+
],
|
| 1118 |
+
"page_idx": 9
|
| 1119 |
+
},
|
| 1120 |
+
{
|
| 1121 |
+
"type": "text",
|
| 1122 |
+
"text": "Marjan Ghazvininejad, Omer Levy, Yinhan Liu, and Luke Zettlemoyer. Constant-time machine translation with conditional masked language models. arXiv preprint arXiv:1904.09324, 2019. ",
|
| 1123 |
+
"bbox": [
|
| 1124 |
+
169,
|
| 1125 |
+
575,
|
| 1126 |
+
823,
|
| 1127 |
+
606
|
| 1128 |
+
],
|
| 1129 |
+
"page_idx": 9
|
| 1130 |
+
},
|
| 1131 |
+
{
|
| 1132 |
+
"type": "text",
|
| 1133 |
+
"text": "Jiatao Gu, James Bradbury, Caiming Xiong, Victor O.K. Li, and Richard Socher. Non-autoregressive neural machine translation. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, Canada, April 30-May 3, 2018, Conference Track Proceedings, 2018. ",
|
| 1134 |
+
"bbox": [
|
| 1135 |
+
173,
|
| 1136 |
+
616,
|
| 1137 |
+
825,
|
| 1138 |
+
659
|
| 1139 |
+
],
|
| 1140 |
+
"page_idx": 9
|
| 1141 |
+
},
|
| 1142 |
+
{
|
| 1143 |
+
"type": "text",
|
| 1144 |
+
"text": "Jiatao Gu, Changhan Wang, and Jake Zhao. Levenshtein transformer. In Advances in Neural Information Processing Systems 33. 2019. ",
|
| 1145 |
+
"bbox": [
|
| 1146 |
+
168,
|
| 1147 |
+
667,
|
| 1148 |
+
823,
|
| 1149 |
+
698
|
| 1150 |
+
],
|
| 1151 |
+
"page_idx": 9
|
| 1152 |
+
},
|
| 1153 |
+
{
|
| 1154 |
+
"type": "text",
|
| 1155 |
+
"text": "Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. ",
|
| 1156 |
+
"bbox": [
|
| 1157 |
+
173,
|
| 1158 |
+
708,
|
| 1159 |
+
823,
|
| 1160 |
+
737
|
| 1161 |
+
],
|
| 1162 |
+
"page_idx": 9
|
| 1163 |
+
},
|
| 1164 |
+
{
|
| 1165 |
+
"type": "text",
|
| 1166 |
+
"text": "Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. ",
|
| 1167 |
+
"bbox": [
|
| 1168 |
+
173,
|
| 1169 |
+
747,
|
| 1170 |
+
825,
|
| 1171 |
+
790
|
| 1172 |
+
],
|
| 1173 |
+
"page_idx": 9
|
| 1174 |
+
},
|
| 1175 |
+
{
|
| 1176 |
+
"type": "text",
|
| 1177 |
+
"text": "Hideki Isozaki, Tsutomu Hirao, Kevin Duh, Katsuhito Sudoh, and Hajime Tsukada. Automatic evaluation of translation quality for distant language pairs. In Proceedings of the 2010 Conference on Empirical Methods in Natural Language Processing, pp. 944–952. Association for Computational Linguistics, 2010. ",
|
| 1178 |
+
"bbox": [
|
| 1179 |
+
173,
|
| 1180 |
+
800,
|
| 1181 |
+
825,
|
| 1182 |
+
857
|
| 1183 |
+
],
|
| 1184 |
+
"page_idx": 9
|
| 1185 |
+
},
|
| 1186 |
+
{
|
| 1187 |
+
"type": "text",
|
| 1188 |
+
"text": "Melvin Johnson, Mike Schuster, Quoc V. Le, Maxim Krikun, Yonghui Wu, Zhifeng Chen, Nikhil Thorat, Fernanda Viegas, Martin Wattenberg, Greg Corrado, Macduff Hughes, and Jeffrey Dean. ´ Google’s multilingual neural machine translation system: Enabling zero-shot translation. Transactions of the Association for Computational Linguistics, 5:339–351, 2017. ",
|
| 1189 |
+
"bbox": [
|
| 1190 |
+
174,
|
| 1191 |
+
867,
|
| 1192 |
+
825,
|
| 1193 |
+
924
|
| 1194 |
+
],
|
| 1195 |
+
"page_idx": 9
|
| 1196 |
+
},
|
| 1197 |
+
{
|
| 1198 |
+
"type": "text",
|
| 1199 |
+
"text": "Lukasz Kaiser, Samy Bengio, Aurko Roy, Ashish Vaswani, Niki Parmar, Jakob Uszkoreit, and Noam Shazeer. Fast decoding in sequence models using discrete latent variables. In International Conference on Machine Learning, pp. 2395–2404, 2018. ",
|
| 1200 |
+
"bbox": [
|
| 1201 |
+
176,
|
| 1202 |
+
103,
|
| 1203 |
+
823,
|
| 1204 |
+
146
|
| 1205 |
+
],
|
| 1206 |
+
"page_idx": 10
|
| 1207 |
+
},
|
| 1208 |
+
{
|
| 1209 |
+
"type": "text",
|
| 1210 |
+
"text": "Yoon Kim and Alexander M Rush. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1317–1327, 2016. ",
|
| 1211 |
+
"bbox": [
|
| 1212 |
+
174,
|
| 1213 |
+
156,
|
| 1214 |
+
821,
|
| 1215 |
+
186
|
| 1216 |
+
],
|
| 1217 |
+
"page_idx": 10
|
| 1218 |
+
},
|
| 1219 |
+
{
|
| 1220 |
+
"type": "text",
|
| 1221 |
+
"text": "Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. ",
|
| 1222 |
+
"bbox": [
|
| 1223 |
+
174,
|
| 1224 |
+
196,
|
| 1225 |
+
823,
|
| 1226 |
+
226
|
| 1227 |
+
],
|
| 1228 |
+
"page_idx": 10
|
| 1229 |
+
},
|
| 1230 |
+
{
|
| 1231 |
+
"type": "text",
|
| 1232 |
+
"text": "Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In Advances in Neural Information Processing Systems, pp. 10215–10224, 2018. ",
|
| 1233 |
+
"bbox": [
|
| 1234 |
+
171,
|
| 1235 |
+
236,
|
| 1236 |
+
823,
|
| 1237 |
+
266
|
| 1238 |
+
],
|
| 1239 |
+
"page_idx": 10
|
| 1240 |
+
},
|
| 1241 |
+
{
|
| 1242 |
+
"type": "text",
|
| 1243 |
+
"text": "Jason Lee, Elman Mansimov, and Kyunghyun Cho. Deterministic non-autoregressive neural sequence modeling by iterative refinement. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 1173–1182, 2018. ",
|
| 1244 |
+
"bbox": [
|
| 1245 |
+
173,
|
| 1246 |
+
276,
|
| 1247 |
+
821,
|
| 1248 |
+
320
|
| 1249 |
+
],
|
| 1250 |
+
"page_idx": 10
|
| 1251 |
+
},
|
| 1252 |
+
{
|
| 1253 |
+
"type": "text",
|
| 1254 |
+
"text": "Percy Liang, Hal Daume III, and Dan Klein. Structure compilation: trading structure for features. ´ In ICML, pp. 592–599, 2008. ",
|
| 1255 |
+
"bbox": [
|
| 1256 |
+
171,
|
| 1257 |
+
330,
|
| 1258 |
+
823,
|
| 1259 |
+
359
|
| 1260 |
+
],
|
| 1261 |
+
"page_idx": 10
|
| 1262 |
+
},
|
| 1263 |
+
{
|
| 1264 |
+
"type": "text",
|
| 1265 |
+
"text": "Xuezhe Ma, Pengcheng Yin, Jingzhou Liu, Graham Neubig, and Eduard Hovy. Softmax qdistribution estimation for structured prediction: A theoretical interpretation for raml. arXiv preprint arXiv:1705.07136, 2017. ",
|
| 1266 |
+
"bbox": [
|
| 1267 |
+
174,
|
| 1268 |
+
369,
|
| 1269 |
+
826,
|
| 1270 |
+
412
|
| 1271 |
+
],
|
| 1272 |
+
"page_idx": 10
|
| 1273 |
+
},
|
| 1274 |
+
{
|
| 1275 |
+
"type": "text",
|
| 1276 |
+
"text": "Xuezhe Ma, Chunting Zhou, Xian Li, Graham Neubig, and Eduard Hovy. Flowseq: Nonautoregressive conditional sequence generation with generative flow. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing, Hong Kong, November 2019. ",
|
| 1277 |
+
"bbox": [
|
| 1278 |
+
173,
|
| 1279 |
+
422,
|
| 1280 |
+
826,
|
| 1281 |
+
467
|
| 1282 |
+
],
|
| 1283 |
+
"page_idx": 10
|
| 1284 |
+
},
|
| 1285 |
+
{
|
| 1286 |
+
"type": "text",
|
| 1287 |
+
"text": "Aaron Oord, Yazhe Li, Igor Babuschkin, Karen Simonyan, Oriol Vinyals, Koray Kavukcuoglu, George Driessche, Edward Lockhart, Luis Cobo, Florian Stimberg, et al. Parallel wavenet: Fast high-fidelity speech synthesis. In International Conference on Machine Learning, pp. 3915–3923, 2018. ",
|
| 1288 |
+
"bbox": [
|
| 1289 |
+
173,
|
| 1290 |
+
478,
|
| 1291 |
+
826,
|
| 1292 |
+
534
|
| 1293 |
+
],
|
| 1294 |
+
"page_idx": 10
|
| 1295 |
+
},
|
| 1296 |
+
{
|
| 1297 |
+
"type": "text",
|
| 1298 |
+
"text": "Myle Ott, Michael Auli, David Grangier, and Marc’Aurelio Ranzato. Analyzing uncertainty in neural machine translation. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmassan, Stockholm, Sweden, July 10-15, 2018 ¨ , pp. 3953–3962, 2018. URL http://proceedings.mlr.press/v80/ott18a.html. ",
|
| 1299 |
+
"bbox": [
|
| 1300 |
+
173,
|
| 1301 |
+
545,
|
| 1302 |
+
825,
|
| 1303 |
+
602
|
| 1304 |
+
],
|
| 1305 |
+
"page_idx": 10
|
| 1306 |
+
},
|
| 1307 |
+
{
|
| 1308 |
+
"type": "text",
|
| 1309 |
+
"text": "Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan $\\mathrm { N g }$ , David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. In Proceedings of NAACL-HLT 2019: Demonstrations, 2019. ",
|
| 1310 |
+
"bbox": [
|
| 1311 |
+
174,
|
| 1312 |
+
613,
|
| 1313 |
+
825,
|
| 1314 |
+
655
|
| 1315 |
+
],
|
| 1316 |
+
"page_idx": 10
|
| 1317 |
+
},
|
| 1318 |
+
{
|
| 1319 |
+
"type": "text",
|
| 1320 |
+
"text": "Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In 2016 IEEE Symposium on Security and Privacy (SP), pp. 582–597. IEEE, 2016. ",
|
| 1321 |
+
"bbox": [
|
| 1322 |
+
173,
|
| 1323 |
+
666,
|
| 1324 |
+
823,
|
| 1325 |
+
709
|
| 1326 |
+
],
|
| 1327 |
+
"page_idx": 10
|
| 1328 |
+
},
|
| 1329 |
+
{
|
| 1330 |
+
"type": "text",
|
| 1331 |
+
"text": "Maja Popovic. chrf: character n-gram f-score for automatic mt evaluation. In ´ Proceedings of the Tenth Workshop on Statistical Machine Translation, pp. 392–395, 2015. ",
|
| 1332 |
+
"bbox": [
|
| 1333 |
+
171,
|
| 1334 |
+
719,
|
| 1335 |
+
823,
|
| 1336 |
+
750
|
| 1337 |
+
],
|
| 1338 |
+
"page_idx": 10
|
| 1339 |
+
},
|
| 1340 |
+
{
|
| 1341 |
+
"type": "text",
|
| 1342 |
+
"text": "Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1715–1725, Berlin, Germany, August 2016. Association for Computational Linguistics. doi: 10.18653/v1/P16-1162. URL https://www.aclweb. org/anthology/P16-1162. ",
|
| 1343 |
+
"bbox": [
|
| 1344 |
+
173,
|
| 1345 |
+
760,
|
| 1346 |
+
825,
|
| 1347 |
+
830
|
| 1348 |
+
],
|
| 1349 |
+
"page_idx": 10
|
| 1350 |
+
},
|
| 1351 |
+
{
|
| 1352 |
+
"type": "text",
|
| 1353 |
+
"text": "Chenze Shao, Yang Feng, Jinchao Zhang, Fandong Meng, Xilin Chen, and Jie Zhou. Retrieving sequential information for non-autoregressive neural machine translation. arXiv preprint arXiv:1906.09444, 2019. ",
|
| 1354 |
+
"bbox": [
|
| 1355 |
+
173,
|
| 1356 |
+
842,
|
| 1357 |
+
823,
|
| 1358 |
+
883
|
| 1359 |
+
],
|
| 1360 |
+
"page_idx": 10
|
| 1361 |
+
},
|
| 1362 |
+
{
|
| 1363 |
+
"type": "text",
|
| 1364 |
+
"text": "Tianxiao Shen, Myle Ott, Michael Auli, et al. Mixture models for diverse machine translation: Tricks of the trade. In International Conference on Machine Learning, pp. 5719–5728, 2019. ",
|
| 1365 |
+
"bbox": [
|
| 1366 |
+
174,
|
| 1367 |
+
895,
|
| 1368 |
+
818,
|
| 1369 |
+
924
|
| 1370 |
+
],
|
| 1371 |
+
"page_idx": 10
|
| 1372 |
+
},
|
| 1373 |
+
{
|
| 1374 |
+
"type": "text",
|
| 1375 |
+
"text": "Raphael Shu, Jason Lee, Hideki Nakayama, and Kyunghyun Cho. Latent-variable nonautoregressive neural machine translation with deterministic inference using a delta posterior. arXiv preprint arXiv:1908.07181, 2019. ",
|
| 1376 |
+
"bbox": [
|
| 1377 |
+
174,
|
| 1378 |
+
103,
|
| 1379 |
+
821,
|
| 1380 |
+
145
|
| 1381 |
+
],
|
| 1382 |
+
"page_idx": 11
|
| 1383 |
+
},
|
| 1384 |
+
{
|
| 1385 |
+
"type": "text",
|
| 1386 |
+
"text": "Matthew Snover, Bonnie Dorr, Richard Schwartz, Linnea Micciulla, and John Makhoul. A study of translation edit rate with targeted human annotation. In In Proceedings of Association for Machine Translation in the Americas, pp. 223–231, 2006. ",
|
| 1387 |
+
"bbox": [
|
| 1388 |
+
176,
|
| 1389 |
+
155,
|
| 1390 |
+
821,
|
| 1391 |
+
198
|
| 1392 |
+
],
|
| 1393 |
+
"page_idx": 11
|
| 1394 |
+
},
|
| 1395 |
+
{
|
| 1396 |
+
"type": "text",
|
| 1397 |
+
"text": "Milos Stanojevic and Khalil Simaan. Beer: Better evaluation as ranking. In Proceedings of the Ninth Workshop on Statistical Machine Translation, pp. 414–419, 2014. ",
|
| 1398 |
+
"bbox": [
|
| 1399 |
+
173,
|
| 1400 |
+
205,
|
| 1401 |
+
823,
|
| 1402 |
+
236
|
| 1403 |
+
],
|
| 1404 |
+
"page_idx": 11
|
| 1405 |
+
},
|
| 1406 |
+
{
|
| 1407 |
+
"type": "text",
|
| 1408 |
+
"text": "Mitchell Stern, Noam Shazeer, and Jakob Uszkoreit. Blockwise parallel decoding for deep autoregressive models. In Advances in Neural Information Processing Systems, pp. 10107–10116, 2018. ",
|
| 1409 |
+
"bbox": [
|
| 1410 |
+
174,
|
| 1411 |
+
244,
|
| 1412 |
+
821,
|
| 1413 |
+
286
|
| 1414 |
+
],
|
| 1415 |
+
"page_idx": 11
|
| 1416 |
+
},
|
| 1417 |
+
{
|
| 1418 |
+
"type": "text",
|
| 1419 |
+
"text": "Mitchell Stern, William Chan, Jamie Kiros, and Jakob Uszkoreit. Insertion transformer: Flexible sequence generation via insertion operations. arXiv preprint arXiv:1902.03249, 2019. ",
|
| 1420 |
+
"bbox": [
|
| 1421 |
+
173,
|
| 1422 |
+
295,
|
| 1423 |
+
823,
|
| 1424 |
+
325
|
| 1425 |
+
],
|
| 1426 |
+
"page_idx": 11
|
| 1427 |
+
},
|
| 1428 |
+
{
|
| 1429 |
+
"type": "text",
|
| 1430 |
+
"text": "David Talbot, Hideto Kazawa, Hiroshi Ichikawa, Jason Katz-Brown, Masakazu Seno, and Franz J Och. A lightweight evaluation framework for machine translation reordering. In Proceedings of the Sixth Workshop on Statistical Machine Translation, pp. 12–21. Association for Computational Linguistics, 2011. ",
|
| 1431 |
+
"bbox": [
|
| 1432 |
+
178,
|
| 1433 |
+
333,
|
| 1434 |
+
825,
|
| 1435 |
+
390
|
| 1436 |
+
],
|
| 1437 |
+
"page_idx": 11
|
| 1438 |
+
},
|
| 1439 |
+
{
|
| 1440 |
+
"type": "text",
|
| 1441 |
+
"text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017. ",
|
| 1442 |
+
"bbox": [
|
| 1443 |
+
174,
|
| 1444 |
+
398,
|
| 1445 |
+
823,
|
| 1446 |
+
441
|
| 1447 |
+
],
|
| 1448 |
+
"page_idx": 11
|
| 1449 |
+
},
|
| 1450 |
+
{
|
| 1451 |
+
"type": "text",
|
| 1452 |
+
"text": "Chunqi Wang, Ji Zhang, and Haiqing Chen. Semi-autoregressive neural machine translation. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, pp. 479–488, 2018. ",
|
| 1453 |
+
"bbox": [
|
| 1454 |
+
173,
|
| 1455 |
+
450,
|
| 1456 |
+
823,
|
| 1457 |
+
492
|
| 1458 |
+
],
|
| 1459 |
+
"page_idx": 11
|
| 1460 |
+
},
|
| 1461 |
+
{
|
| 1462 |
+
"type": "text",
|
| 1463 |
+
"text": "Yiren Wang, Fei Tian, Di He, Tao Qin, ChengXiang Zhai, and Tie-Yan Liu. Non-autoregressive machine translation with auxiliary regularization. arXiv preprint arXiv:1902.10245, 2019. ",
|
| 1464 |
+
"bbox": [
|
| 1465 |
+
171,
|
| 1466 |
+
501,
|
| 1467 |
+
823,
|
| 1468 |
+
531
|
| 1469 |
+
],
|
| 1470 |
+
"page_idx": 11
|
| 1471 |
+
},
|
| 1472 |
+
{
|
| 1473 |
+
"type": "text",
|
| 1474 |
+
"text": "Bingzhen Wei, Mingxuan Wang, Hao Zhou, Junyang Lin, and Xu Sun. Imitation learning for nonautoregressive neural machine translation. arXiv preprint arXiv:1906.02041, 2019. ",
|
| 1475 |
+
"bbox": [
|
| 1476 |
+
171,
|
| 1477 |
+
540,
|
| 1478 |
+
821,
|
| 1479 |
+
569
|
| 1480 |
+
],
|
| 1481 |
+
"page_idx": 11
|
| 1482 |
+
},
|
| 1483 |
+
{
|
| 1484 |
+
"type": "text",
|
| 1485 |
+
"text": "A EXPERIMENTAL DETAILS ",
|
| 1486 |
+
"text_level": 1,
|
| 1487 |
+
"bbox": [
|
| 1488 |
+
176,
|
| 1489 |
+
102,
|
| 1490 |
+
421,
|
| 1491 |
+
118
|
| 1492 |
+
],
|
| 1493 |
+
"page_idx": 12
|
| 1494 |
+
},
|
| 1495 |
+
{
|
| 1496 |
+
"type": "text",
|
| 1497 |
+
"text": "A.1 AT MODELS ",
|
| 1498 |
+
"text_level": 1,
|
| 1499 |
+
"bbox": [
|
| 1500 |
+
176,
|
| 1501 |
+
132,
|
| 1502 |
+
305,
|
| 1503 |
+
147
|
| 1504 |
+
],
|
| 1505 |
+
"page_idx": 12
|
| 1506 |
+
},
|
| 1507 |
+
{
|
| 1508 |
+
"type": "text",
|
| 1509 |
+
"text": "Model All the AT models are implemented based on the Transformer model using fairseq (Ott et al., 2019), and we basically follow the fairseq examples to train the transformers6. Following the notation from Vaswani et al. (2017), we list the basic parameters of all the AT model we used: ",
|
| 1510 |
+
"bbox": [
|
| 1511 |
+
176,
|
| 1512 |
+
159,
|
| 1513 |
+
823,
|
| 1514 |
+
202
|
| 1515 |
+
],
|
| 1516 |
+
"page_idx": 12
|
| 1517 |
+
},
|
| 1518 |
+
{
|
| 1519 |
+
"type": "table",
|
| 1520 |
+
"img_path": "images/0a1238cddcb9c8a28ae886c68f895e4be88f3722d8b6ae3f1792d016ba96166a.jpg",
|
| 1521 |
+
"table_caption": [
|
| 1522 |
+
"Table 5: Basic hyper-parameters of architecture for AT models. "
|
| 1523 |
+
],
|
| 1524 |
+
"table_footnote": [],
|
| 1525 |
+
"table_body": "<table><tr><td>Models</td><td>tiny</td><td>small</td><td>base</td><td>big</td></tr><tr><td>dmodel</td><td>256</td><td>512</td><td>512</td><td>1024</td></tr><tr><td>dhidden</td><td>1024</td><td>1024</td><td>2048</td><td>4096</td></tr><tr><td>nlayers</td><td>3</td><td>3</td><td>6</td><td>6</td></tr><tr><td>nheads</td><td>4</td><td>8</td><td>8</td><td>16</td></tr><tr><td>Pdropout</td><td>0.1</td><td>0.1</td><td>0.3</td><td>0.3</td></tr></table>",
|
| 1526 |
+
"bbox": [
|
| 1527 |
+
356,
|
| 1528 |
+
213,
|
| 1529 |
+
642,
|
| 1530 |
+
314
|
| 1531 |
+
],
|
| 1532 |
+
"page_idx": 12
|
| 1533 |
+
},
|
| 1534 |
+
{
|
| 1535 |
+
"type": "text",
|
| 1536 |
+
"text": "Training For all experiments, we adopt the Adam optimizer (Kingma & Ba, 2014) using $\\beta _ { 1 } =$ $0 . 9 , \\beta _ { 2 } = 0 . 9 8$ , $\\epsilon = 1 e - 8$ . The learning rate is scheduled using inverse sqrt with a maximum learning rate 0.0005 and 4000 warmup steps. We set the label smoothing as 0.1. All the models are run on 8 GPUs for 300, 000 updates with an effective batch size of 32, 000 tokens. The best model is selected based on the validation loss except for FlowSeq which uses valid BLEU score. ",
|
| 1537 |
+
"bbox": [
|
| 1538 |
+
173,
|
| 1539 |
+
361,
|
| 1540 |
+
825,
|
| 1541 |
+
431
|
| 1542 |
+
],
|
| 1543 |
+
"page_idx": 12
|
| 1544 |
+
},
|
| 1545 |
+
{
|
| 1546 |
+
"type": "text",
|
| 1547 |
+
"text": "Decoding After training, we use beam-search with a fixed beam size 5 for all AT models to create the distilled dataset. We use length normalization without length penalty. ",
|
| 1548 |
+
"bbox": [
|
| 1549 |
+
174,
|
| 1550 |
+
445,
|
| 1551 |
+
821,
|
| 1552 |
+
474
|
| 1553 |
+
],
|
| 1554 |
+
"page_idx": 12
|
| 1555 |
+
},
|
| 1556 |
+
{
|
| 1557 |
+
"type": "text",
|
| 1558 |
+
"text": "A.2 NAT MODELS ",
|
| 1559 |
+
"text_level": 1,
|
| 1560 |
+
"bbox": [
|
| 1561 |
+
176,
|
| 1562 |
+
491,
|
| 1563 |
+
318,
|
| 1564 |
+
505
|
| 1565 |
+
],
|
| 1566 |
+
"page_idx": 12
|
| 1567 |
+
},
|
| 1568 |
+
{
|
| 1569 |
+
"type": "text",
|
| 1570 |
+
"text": "Model Tab. 2 also lists all the NAT models we test in this work. In general, all the NAT models except FlowSeq and LevT-big adopts a similar architecture and hyper-parameters as the Transformerbase (see Tab. 5). LevT-big is a naive extension of the original LevT model with a comparable parameter setting as Transformer-big (Tab. 5). For FlowSeq, we use the base model (FlowSeq-base) described in (Ma et al., 2019). We re-implemented the vanilla NAT as a simplified version of Gu et al. (2018) where instead of modeling fertility as described in the original paper, we monotonically copy the encoder embeddings to the input of the decoder. All the models except InsT require the additional module to predict the length of the output sequence, or the number of placeholders to be inserted, which is implemented as a standard softmax classifier over the lengths of [0, 256). For LevT, we also have a binary classifier to predict the deletion of the incorrect tokens. ",
|
| 1571 |
+
"bbox": [
|
| 1572 |
+
173,
|
| 1573 |
+
516,
|
| 1574 |
+
825,
|
| 1575 |
+
655
|
| 1576 |
+
],
|
| 1577 |
+
"page_idx": 12
|
| 1578 |
+
},
|
| 1579 |
+
{
|
| 1580 |
+
"type": "text",
|
| 1581 |
+
"text": "Training Similar to the AT models, all the NAT models are trained using the Adam optimizer with the same learning rate scheduler, in which the warmup steps are set to 10, 000. We train the FlowSeq model on 32 GPUs with a batch size as 2048 sentences, while all the other models are trained on 8 GPUs with an effective batch size of 64, 000 tokens. Note that, the batch sizes for training NAT is typically larger than the AT model, which improves final results. There are also specialized training settings for each models: ",
|
| 1582 |
+
"bbox": [
|
| 1583 |
+
174,
|
| 1584 |
+
670,
|
| 1585 |
+
825,
|
| 1586 |
+
753
|
| 1587 |
+
],
|
| 1588 |
+
"page_idx": 12
|
| 1589 |
+
},
|
| 1590 |
+
{
|
| 1591 |
+
"type": "text",
|
| 1592 |
+
"text": "• iNAT (Lee et al., 2018): following the original paper, we train the iNAT model jointly with 4 iterations of refinement during training. For each iteration, the model has the $5 0 \\%$ probability to learn as a denoising autoencoder, and the rest of the probability to learn from the model’s own prediction. \n• InsT (Stern et al., 2019): in this work, we only consider training the Insertion Transformer (InsT) using the slot-loss based on the uniform loss function (Stern et al., 2019). That is, we assign equal probabilities to all the insertable tokens inside each slot. \n• MaskT (Ghazvininejad et al., 2019): following the original paper, we train the model as a typical masked language model where the ratio of masked tokens is sampled from $0 \\sim 1 0 0 \\%$ . ",
|
| 1593 |
+
"bbox": [
|
| 1594 |
+
173,
|
| 1595 |
+
765,
|
| 1596 |
+
826,
|
| 1597 |
+
901
|
| 1598 |
+
],
|
| 1599 |
+
"page_idx": 12
|
| 1600 |
+
},
|
| 1601 |
+
{
|
| 1602 |
+
"type": "text",
|
| 1603 |
+
"text": "• LevT (Gu et al., 2019): in this work, we only consider sequence generation tasks, which means the training of LevT is very similar to InsT. We use sentences with randomly deleted tokens to learn insertion, and learn deletion based on the model’s own prediction. ",
|
| 1604 |
+
"bbox": [
|
| 1605 |
+
176,
|
| 1606 |
+
103,
|
| 1607 |
+
823,
|
| 1608 |
+
146
|
| 1609 |
+
],
|
| 1610 |
+
"page_idx": 13
|
| 1611 |
+
},
|
| 1612 |
+
{
|
| 1613 |
+
"type": "text",
|
| 1614 |
+
"text": "Decoding For a fair comparison over all the NAT models, we use greedy decoding for all the models without considering any advanced decoding methods such as searching or re-ranking from a teacher model. For the vanilla NAT and FlowSeq, decoding is quite straight-forward and simply picks the arg max at every position. For iNAT and MaskT, we fix the decoding steps to 10. Both InsT and LevT decode in an adaptive number of iterations, and we set the maximum iterations for both models to be 10. A special EOS penalty that penalizes generating too short sequences is tuned based on the validation set for both InsT and LevT. ",
|
| 1615 |
+
"bbox": [
|
| 1616 |
+
173,
|
| 1617 |
+
160,
|
| 1618 |
+
825,
|
| 1619 |
+
257
|
| 1620 |
+
],
|
| 1621 |
+
"page_idx": 13
|
| 1622 |
+
},
|
| 1623 |
+
{
|
| 1624 |
+
"type": "text",
|
| 1625 |
+
"text": "For all models, final results are calculated using tokenized BLEU score. ",
|
| 1626 |
+
"bbox": [
|
| 1627 |
+
173,
|
| 1628 |
+
265,
|
| 1629 |
+
643,
|
| 1630 |
+
280
|
| 1631 |
+
],
|
| 1632 |
+
"page_idx": 13
|
| 1633 |
+
},
|
| 1634 |
+
{
|
| 1635 |
+
"type": "text",
|
| 1636 |
+
"text": "B REAL DATA STATISTICS ",
|
| 1637 |
+
"text_level": 1,
|
| 1638 |
+
"bbox": [
|
| 1639 |
+
176,
|
| 1640 |
+
297,
|
| 1641 |
+
406,
|
| 1642 |
+
315
|
| 1643 |
+
],
|
| 1644 |
+
"page_idx": 13
|
| 1645 |
+
},
|
| 1646 |
+
{
|
| 1647 |
+
"type": "text",
|
| 1648 |
+
"text": "The detailed dataset split for WMT14 En-De is shown in Tab. 6. In Fig. 7, we also plot the histogram of the conditional entropy of each pair of sentences $\\scriptstyle { \\mathcal { H } } ( y | x )$ in the real parallel data and different distilled data sets from the big-AT, base-AT, small-AT and tiny-AT respectively. It shows that the distribution of the sentence-level conditional entropy differs widely. The mode of $\\scriptstyle { \\mathcal { H } } ( y | x )$ in the real data is the highest and follows by distilled data from the big-AT, base-AT, small-AT and tiny-AT. This observation aligns with the complexity value $C ( d )$ proposed in $\\ S 3 . 2$ . ",
|
| 1649 |
+
"bbox": [
|
| 1650 |
+
174,
|
| 1651 |
+
329,
|
| 1652 |
+
825,
|
| 1653 |
+
414
|
| 1654 |
+
],
|
| 1655 |
+
"page_idx": 13
|
| 1656 |
+
},
|
| 1657 |
+
{
|
| 1658 |
+
"type": "table",
|
| 1659 |
+
"img_path": "images/e6350230c2f458f93d00f9063a429065c836462d27bd01be899d139f4064d60b.jpg",
|
| 1660 |
+
"table_caption": [
|
| 1661 |
+
"Table 6: Dataset statistics for WMT14 En-De. "
|
| 1662 |
+
],
|
| 1663 |
+
"table_footnote": [],
|
| 1664 |
+
"table_body": "<table><tr><td>Dataset</td><td>Train</td><td>Valid</td><td>Test</td><td>Vocabulary</td></tr><tr><td>WMT'14 En-De</td><td>4,500,966</td><td>3000</td><td>3003</td><td>37,009</td></tr></table>",
|
| 1665 |
+
"bbox": [
|
| 1666 |
+
292,
|
| 1667 |
+
424,
|
| 1668 |
+
707,
|
| 1669 |
+
469
|
| 1670 |
+
],
|
| 1671 |
+
"page_idx": 13
|
| 1672 |
+
},
|
| 1673 |
+
{
|
| 1674 |
+
"type": "image",
|
| 1675 |
+
"img_path": "images/4d3419abecf8394d78b6372a60c65aa9278b66cf583d10b8e357ecdc3d8b1693.jpg",
|
| 1676 |
+
"image_caption": [
|
| 1677 |
+
"Figure 7: Density of conditional entropy $C ( d )$ of each sentence pairs in different distilled data sets and the real data. "
|
| 1678 |
+
],
|
| 1679 |
+
"image_footnote": [],
|
| 1680 |
+
"bbox": [
|
| 1681 |
+
305,
|
| 1682 |
+
523,
|
| 1683 |
+
686,
|
| 1684 |
+
739
|
| 1685 |
+
],
|
| 1686 |
+
"page_idx": 13
|
| 1687 |
+
},
|
| 1688 |
+
{
|
| 1689 |
+
"type": "text",
|
| 1690 |
+
"text": "C ADDITIONAL METRICS ",
|
| 1691 |
+
"text_level": 1,
|
| 1692 |
+
"bbox": [
|
| 1693 |
+
176,
|
| 1694 |
+
809,
|
| 1695 |
+
401,
|
| 1696 |
+
825
|
| 1697 |
+
],
|
| 1698 |
+
"page_idx": 13
|
| 1699 |
+
},
|
| 1700 |
+
{
|
| 1701 |
+
"type": "text",
|
| 1702 |
+
"text": "In Figure 8, we also showed results with different metrics together with BLEU scores considering that BLEU scores sometimes cannot fully capture the changes in the system. We considered 5 additional metrics in our experiments: METEOR (Banerjee & Lavie, 2005), RIBES (Isozaki et al., 2010), ChrF (Popovic, 2015) TER (Snover et al., 2006), and BEER (Stanojevic & Simaan, 2014). ´ Not surprisingly, we find that all the metrics are correlated with the original BLEU scores quite well showing a similar trend as discussed earlier. ",
|
| 1703 |
+
"bbox": [
|
| 1704 |
+
174,
|
| 1705 |
+
839,
|
| 1706 |
+
825,
|
| 1707 |
+
922
|
| 1708 |
+
],
|
| 1709 |
+
"page_idx": 13
|
| 1710 |
+
},
|
| 1711 |
+
{
|
| 1712 |
+
"type": "image",
|
| 1713 |
+
"img_path": "images/59acb8be944f9e6e1e36b5c6446334fbf6fe467a12c68af3b40f6b72d132ecf5.jpg",
|
| 1714 |
+
"image_caption": [
|
| 1715 |
+
"Figure 8: The performance of variant measure (BLEU $\\uparrow$ , METEOR $\\uparrow$ , RIBES $\\uparrow$ , ChrF $\\uparrow$ , TER $\\downarrow$ BEER $\\uparrow$ ) for the vanilla NAT model trained on the distilled data from tiny, small, base and big AT models on WMT14-ENDE newstest 2014 test sets. "
|
| 1716 |
+
],
|
| 1717 |
+
"image_footnote": [],
|
| 1718 |
+
"bbox": [
|
| 1719 |
+
174,
|
| 1720 |
+
101,
|
| 1721 |
+
823,
|
| 1722 |
+
342
|
| 1723 |
+
],
|
| 1724 |
+
"page_idx": 14
|
| 1725 |
+
},
|
| 1726 |
+
{
|
| 1727 |
+
"type": "text",
|
| 1728 |
+
"text": "D SYNTHETIC DATA WITH ACCESS TO THE TRUE DISTRIBUTION ",
|
| 1729 |
+
"text_level": 1,
|
| 1730 |
+
"bbox": [
|
| 1731 |
+
173,
|
| 1732 |
+
426,
|
| 1733 |
+
723,
|
| 1734 |
+
443
|
| 1735 |
+
],
|
| 1736 |
+
"page_idx": 14
|
| 1737 |
+
},
|
| 1738 |
+
{
|
| 1739 |
+
"type": "text",
|
| 1740 |
+
"text": "D.1 BACKGROUND: BAYESIAN DECISION THEORY",
|
| 1741 |
+
"bbox": [
|
| 1742 |
+
173,
|
| 1743 |
+
460,
|
| 1744 |
+
539,
|
| 1745 |
+
477
|
| 1746 |
+
],
|
| 1747 |
+
"page_idx": 14
|
| 1748 |
+
},
|
| 1749 |
+
{
|
| 1750 |
+
"type": "text",
|
| 1751 |
+
"text": "Bayesian decision theory is a fundamental statistical approach to the problem of pattern classification, which provides a principled rule of finding the optimal classification decision using probability and losses that accompany such decisions. ",
|
| 1752 |
+
"bbox": [
|
| 1753 |
+
174,
|
| 1754 |
+
491,
|
| 1755 |
+
823,
|
| 1756 |
+
534
|
| 1757 |
+
],
|
| 1758 |
+
"page_idx": 14
|
| 1759 |
+
},
|
| 1760 |
+
{
|
| 1761 |
+
"type": "text",
|
| 1762 |
+
"text": "In the problem of structured prediction (Ma et al., 2017), let $_ { \\textbf { \\em x } }$ denote the input sequence and $\\textbf { { y } }$ denote the output label sequence. Let $\\mathcal { H }$ denote all the possible hypothesis functions from the input to the output space: $\\mathcal { H } = \\{ h : \\mathcal { X } \\mathcal { Y } \\}$ . Let $r ( \\pmb { y } | \\pmb { x } )$ denote the conditional risk on the input $_ { \\textbf { \\em x } }$ , which is the expected loss of predicting $\\textbf { { y } }$ based on the posterior probabilities: ",
|
| 1763 |
+
"bbox": [
|
| 1764 |
+
173,
|
| 1765 |
+
540,
|
| 1766 |
+
825,
|
| 1767 |
+
597
|
| 1768 |
+
],
|
| 1769 |
+
"page_idx": 14
|
| 1770 |
+
},
|
| 1771 |
+
{
|
| 1772 |
+
"type": "equation",
|
| 1773 |
+
"img_path": "images/554c63acac3525f8e97b3d7a36aae425b98092e71c4315b78c8b631c0253c63a.jpg",
|
| 1774 |
+
"text": "$$\nr ( { \\pmb y } | { \\pmb x } ) = \\mathbb { E } _ { P ( { \\pmb y } ^ { \\prime } | { \\pmb x } ) } [ L ( { \\pmb y } , { \\pmb y } ^ { \\prime } ) ] ,\n$$",
|
| 1775 |
+
"text_format": "latex",
|
| 1776 |
+
"bbox": [
|
| 1777 |
+
398,
|
| 1778 |
+
608,
|
| 1779 |
+
598,
|
| 1780 |
+
627
|
| 1781 |
+
],
|
| 1782 |
+
"page_idx": 14
|
| 1783 |
+
},
|
| 1784 |
+
{
|
| 1785 |
+
"type": "text",
|
| 1786 |
+
"text": ", where $L ( \\boldsymbol { y } , \\boldsymbol { y } ^ { \\prime } )$ is the loss function that penalizes predicting the true target $\\boldsymbol { y } ^ { \\prime }$ as $\\textbf { { y } }$ . The classification task aims to find a hypothesis function $h$ that minimizes the overall risk $R$ given by ",
|
| 1787 |
+
"bbox": [
|
| 1788 |
+
171,
|
| 1789 |
+
640,
|
| 1790 |
+
823,
|
| 1791 |
+
670
|
| 1792 |
+
],
|
| 1793 |
+
"page_idx": 14
|
| 1794 |
+
},
|
| 1795 |
+
{
|
| 1796 |
+
"type": "equation",
|
| 1797 |
+
"img_path": "images/7591c40b5008d223734ea4f774ada6872dfad66dc86e938ea4b9554568341d12.jpg",
|
| 1798 |
+
"text": "$$\nR ( h ) = \\mathbb { E } _ { P ( \\pmb { x } ) } [ r ( h ( \\pmb { x } ) | \\pmb { x } ) ]\n$$",
|
| 1799 |
+
"text_format": "latex",
|
| 1800 |
+
"bbox": [
|
| 1801 |
+
410,
|
| 1802 |
+
681,
|
| 1803 |
+
588,
|
| 1804 |
+
700
|
| 1805 |
+
],
|
| 1806 |
+
"page_idx": 14
|
| 1807 |
+
},
|
| 1808 |
+
{
|
| 1809 |
+
"type": "text",
|
| 1810 |
+
"text": "This is known as the Bayes risk. To minimize the overall risk, obviously we need to minimize the conditional risk for each input $_ { \\textbf { \\em x } }$ . The Bayesian decision rule states that the global minimum of $R ( h )$ is achieved when the classifier make predictions that minimize each conditional risk given $_ { \\textbf { \\em x } }$ and this gives the Bayes optimal classifier: ",
|
| 1811 |
+
"bbox": [
|
| 1812 |
+
173,
|
| 1813 |
+
710,
|
| 1814 |
+
825,
|
| 1815 |
+
767
|
| 1816 |
+
],
|
| 1817 |
+
"page_idx": 14
|
| 1818 |
+
},
|
| 1819 |
+
{
|
| 1820 |
+
"type": "equation",
|
| 1821 |
+
"img_path": "images/c93fc45cac56991de21de2e4d5167d0e984c11a7b1cc00e3541d102bcd5c2e6e.jpg",
|
| 1822 |
+
"text": "$$\nh ^ { * } ( { \\pmb x } ) = \\arg \\operatorname* { m i n } _ { { \\pmb y } \\in { \\pmb y } } r ( { \\pmb y } | { \\pmb x } )\n$$",
|
| 1823 |
+
"text_format": "latex",
|
| 1824 |
+
"bbox": [
|
| 1825 |
+
415,
|
| 1826 |
+
780,
|
| 1827 |
+
583,
|
| 1828 |
+
808
|
| 1829 |
+
],
|
| 1830 |
+
"page_idx": 14
|
| 1831 |
+
},
|
| 1832 |
+
{
|
| 1833 |
+
"type": "text",
|
| 1834 |
+
"text": "Let us consider two loss functions defined in Eq. 5. First is the sequence-level loss $L _ { s e q } ( { \\pmb y } , { \\pmb y } ^ { \\prime } ) =$ $1 - \\mathbb { I } ( { \\pmb y } = { \\pmb y } ^ { \\prime } )$ , then in this case the Bayes classifier is: ",
|
| 1835 |
+
"bbox": [
|
| 1836 |
+
171,
|
| 1837 |
+
828,
|
| 1838 |
+
823,
|
| 1839 |
+
857
|
| 1840 |
+
],
|
| 1841 |
+
"page_idx": 14
|
| 1842 |
+
},
|
| 1843 |
+
{
|
| 1844 |
+
"type": "equation",
|
| 1845 |
+
"img_path": "images/179239b8ad164914ad4352dda5c70d4c97bfb5cc75a3e4dbeaa2cff61d9a0d22.jpg",
|
| 1846 |
+
"text": "$$\nh _ { s e q } ^ { * } ( { \\pmb x } ) = \\arg \\operatorname* { m a x } _ { { \\pmb y } \\in \\mathcal { V } } P ( { \\pmb y } | { \\pmb x } )\n$$",
|
| 1847 |
+
"text_format": "latex",
|
| 1848 |
+
"bbox": [
|
| 1849 |
+
405,
|
| 1850 |
+
869,
|
| 1851 |
+
593,
|
| 1852 |
+
896
|
| 1853 |
+
],
|
| 1854 |
+
"page_idx": 14
|
| 1855 |
+
},
|
| 1856 |
+
{
|
| 1857 |
+
"type": "text",
|
| 1858 |
+
"text": ", which is the most probable output label sequence given the input sequence $_ { \\textbf { \\em x } }$ ",
|
| 1859 |
+
"bbox": [
|
| 1860 |
+
173,
|
| 1861 |
+
909,
|
| 1862 |
+
687,
|
| 1863 |
+
924
|
| 1864 |
+
],
|
| 1865 |
+
"page_idx": 14
|
| 1866 |
+
},
|
| 1867 |
+
{
|
| 1868 |
+
"type": "text",
|
| 1869 |
+
"text": "Second let us consider the token-level loss $\\begin{array} { r } { L _ { t o k } ( \\pmb { y } , \\pmb { y } ^ { \\prime } ) = \\sum _ { t = 1 } ^ { T } 1 - \\mathbb { I } ( y _ { t } = y _ { t } ^ { \\prime } ) } \\end{array}$ , i.e the sum of zero-one loss at each time step. We have: ",
|
| 1870 |
+
"bbox": [
|
| 1871 |
+
173,
|
| 1872 |
+
101,
|
| 1873 |
+
825,
|
| 1874 |
+
132
|
| 1875 |
+
],
|
| 1876 |
+
"page_idx": 15
|
| 1877 |
+
},
|
| 1878 |
+
{
|
| 1879 |
+
"type": "equation",
|
| 1880 |
+
"img_path": "images/f0b53f776cf9667b5fceadf50ed81f28b7889c182d08225131c2b35171244f77.jpg",
|
| 1881 |
+
"text": "$$\n\\begin{array} { r l } { h _ { t o k } ^ { * } ( \\pmb { x } ) } & { = \\underset { y \\in \\pmb { \\mathscr { Y } } } { \\mathrm { a r g ~ m i n ~ } } \\mathbb { E } _ { P ( \\pmb { y ^ { \\prime } } | \\pmb { x } ) } [ L _ { 2 } ( \\pmb { y } , \\pmb { y ^ { \\prime } } ) ] } \\\\ & { = \\underset { y \\in \\pmb { \\mathscr { Y } } } { \\mathrm { a r g ~ m a x ~ } } \\mathbb { E } _ { P ( \\pmb { y ^ { \\prime } } | \\pmb { x } ) } [ \\sum _ { t = 1 } ^ { T } \\mathbb { I } ( y _ { t } = y _ { t } ^ { \\prime } ) ] } \\\\ & { = \\underset { y \\in \\pmb { \\mathscr { Y } } } { \\mathrm { a r g ~ m a x } } \\sum _ { t = 1 } ^ { T } \\mathbb { E } _ { P ( \\pmb { y ^ { \\prime } } | \\pmb { x } ) } [ \\mathbb { I } ( y _ { t } = y _ { t } ^ { \\prime } ) ] } \\\\ & { = \\underset { y \\in \\pmb { \\mathscr { Y } } } { \\mathrm { a r g ~ m a x } } \\sum _ { t = 1 } ^ { T } \\mathbb { E } _ { P ( y _ { t } ^ { \\prime } | \\pmb { x } ) } [ \\mathbb { I } ( y _ { t } = y _ { t } ^ { \\prime } ) ] } \\\\ & { = \\underset { y \\in \\pmb { \\mathscr { Y } } } { \\mathrm { a r g ~ m a x } } \\underset { t = 1 } { \\overset { T } { \\prod } } P ( y _ { t } | \\pmb { x } ) } \\end{array}\n$$",
|
| 1882 |
+
"text_format": "latex",
|
| 1883 |
+
"bbox": [
|
| 1884 |
+
334,
|
| 1885 |
+
138,
|
| 1886 |
+
661,
|
| 1887 |
+
279
|
| 1888 |
+
],
|
| 1889 |
+
"page_idx": 15
|
| 1890 |
+
},
|
| 1891 |
+
{
|
| 1892 |
+
"type": "text",
|
| 1893 |
+
"text": "This suggests that the Bayes classifier finds the most probable label at each time step given the input sequence. ",
|
| 1894 |
+
"bbox": [
|
| 1895 |
+
174,
|
| 1896 |
+
286,
|
| 1897 |
+
823,
|
| 1898 |
+
314
|
| 1899 |
+
],
|
| 1900 |
+
"page_idx": 15
|
| 1901 |
+
},
|
| 1902 |
+
{
|
| 1903 |
+
"type": "text",
|
| 1904 |
+
"text": "D.2 EXPERIMENTAL SETUPS AND ANALYSIS ",
|
| 1905 |
+
"text_level": 1,
|
| 1906 |
+
"bbox": [
|
| 1907 |
+
174,
|
| 1908 |
+
333,
|
| 1909 |
+
496,
|
| 1910 |
+
348
|
| 1911 |
+
],
|
| 1912 |
+
"page_idx": 15
|
| 1913 |
+
},
|
| 1914 |
+
{
|
| 1915 |
+
"type": "text",
|
| 1916 |
+
"text": "To study how training data affects the performance of a weaker classifier, we construct a Hidden Markov Model (HMM) by sampling the parameters of the transition and emission probabilities uniformly within $( 0 , a ]$ and $( 0 , b ]$ respectively. A higher value of $a$ and $b$ indicates an HMM model with higher uncertainty. We refer this HMM as the “true HMM” as our real data generator. Next we consider a weaker classifier that uses a low-dimension bidirectional-LSTM (Bi-LSTM) to encode the input sequence and individual softmax functions at each time step to predict labels independently, which is referred as the “Bi-LSTM” classifier. Obviously, the Bi-LSTM classifier is not able to model the dependencies between output labels embedded in the HMM, and it is equivalent to a simplified non-autoregressive generation model. ",
|
| 1917 |
+
"bbox": [
|
| 1918 |
+
174,
|
| 1919 |
+
359,
|
| 1920 |
+
825,
|
| 1921 |
+
486
|
| 1922 |
+
],
|
| 1923 |
+
"page_idx": 15
|
| 1924 |
+
},
|
| 1925 |
+
{
|
| 1926 |
+
"type": "text",
|
| 1927 |
+
"text": "We generate the real training data $D _ { r e a l } = \\{ ( { \\pmb x } _ { 1 } , { \\pmb y } _ { 1 } ) , \\cdot \\cdot \\cdot , ( { \\pmb x } _ { N } , { \\pmb y } _ { N } ) \\}$ of size $N$ by sampling from the joint probability of the true HMM. Similarly we sample $N _ { t e s t }$ data points as the test data and $N _ { v a l i d }$ data points as the validation data. We evaluate the classifier’s token-level accuracy tacc and sequand n the test data respectively, where . These two metrics correspond $\\begin{array} { r } { t a c c = \\frac { \\sum _ { i = 1 } ^ { N _ { t e s t } } \\sum _ { t = 1 } ^ { T } \\mathbb { I } ( h ( \\pmb { x } _ { i } ) ^ { t } = \\pmb { y } _ { i } ^ { t } ) } { T \\times N _ { t e s t } } } \\end{array}$ $\\begin{array} { r } { s a c c \\ = \\ \\frac { \\sum _ { i = 1 } ^ { N _ { t e s t } } { \\mathbb { I } \\left( { h ( { \\bf { x } } _ { i } ) = y _ { i } } \\right) } } { N _ { t e s t } } } \\end{array}$ $L _ { t o k }$ sequence-level loss $L _ { s e q }$ on each data point of the test data. ",
|
| 1928 |
+
"bbox": [
|
| 1929 |
+
173,
|
| 1930 |
+
492,
|
| 1931 |
+
825,
|
| 1932 |
+
593
|
| 1933 |
+
],
|
| 1934 |
+
"page_idx": 15
|
| 1935 |
+
},
|
| 1936 |
+
{
|
| 1937 |
+
"type": "text",
|
| 1938 |
+
"text": "First, we use $h _ { s e q } ^ { * } ( { \\pmb x } )$ to generate the distillation labels $\\boldsymbol { y } ^ { \\prime }$ from the true HMM, which corresponds to applying the Viterbi decoding to each $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { i } }$ in $D _ { r e a l }$ . The training data set $D _ { s e q }$ is created with $( { \\pmb x } _ { i }$ , $\\pmb { y } _ { i } ^ { \\prime } )$ . Next, we use $h _ { t o k } ^ { * } ( x )$ to generate the distillation labels $\\hat { y }$ and create the training data $D _ { t o k }$ of $( \\dot { \\pmb x } _ { i } , \\hat { \\pmb y } _ { i } )$ . To generate $\\hat { y }$ , we apply the forward-backward algorithm to each $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { i } }$ in $D _ { r e a l }$ and obtain $P ( y _ { i } ^ { t } | \\mathbf { x } _ { i } )$ . We take arg max over the label space $\\mathcal { L }$ : $\\hat { y } _ { i } ^ { t } = \\underset { y _ { i } ^ { t } \\in \\mathcal { L } } { \\operatorname { a r g m a x } } P ( y _ { i } ^ { t } | \\mathbf { x } _ { i } )$ . ",
|
| 1939 |
+
"bbox": [
|
| 1940 |
+
173,
|
| 1941 |
+
599,
|
| 1942 |
+
825,
|
| 1943 |
+
670
|
| 1944 |
+
],
|
| 1945 |
+
"page_idx": 15
|
| 1946 |
+
},
|
| 1947 |
+
{
|
| 1948 |
+
"type": "text",
|
| 1949 |
+
"text": "We use these three training data $( D _ { r e a l } , D _ { t o k } , D _ { s e q } )$ to train the Bi-LSTM classifier respectively. We repeat the experiment for 50 times by constructing 50 HMM models with different random seeds as the data generator. We find that when evaluating with the token-level accuracy tacc, models trained with $D _ { t o k }$ yields the best performance (Bi-LSTM trained with $D _ { t o k }$ win $9 7 . 6 \\%$ runs); when evaluating with the sequence-level accuracy sacc, models trained with $D _ { s e q }$ yields the best performance (Bi-LSTM trained with $D _ { s e q }$ win $9 8 . 5 \\%$ runs). This is because the Bi-LSTM classifier has difficulty modeling the true data distribution defined by an HMM. On the other hand, it is easier for the Bi-LSTM classifier to model the distributions of $D _ { s e q }$ and $D _ { t o k }$ . Data sets $D _ { s e q }$ and $D _ { t o k }$ define deterministic conditional distributions over the input data, which are much simpler than the real data distribution. By definition, $D _ { t o k }$ is created by the optimal Bayes classifier $\\bar { h } _ { t o k } ^ { * } ( { \\pmb x } )$ , this means that the Bi-LSTM classifier trained with $D _ { t o k }$ can better capture the distribution of $P ( y _ { t } | \\mathbf { x } ) = \\operatorname* { m a x } _ { u _ { t } } P ( u _ { t } | \\mathbf { x } )$ , which can generalize better to the test data when evaluated with the token-level accuracy. Similarly, Bi-LSTM trained with $D _ { s e q }$ performs better on the test data with the sequence-level metric. ",
|
| 1950 |
+
"bbox": [
|
| 1951 |
+
173,
|
| 1952 |
+
688,
|
| 1953 |
+
825,
|
| 1954 |
+
888
|
| 1955 |
+
],
|
| 1956 |
+
"page_idx": 15
|
| 1957 |
+
},
|
| 1958 |
+
{
|
| 1959 |
+
"type": "text",
|
| 1960 |
+
"text": "This corroborates our observation in machine translation task that NAT has difficulty in modeling the real conditional distribution of true sentence pairs. However, when using the distilled data translated from a pretrained autoregressive model with beam-search decoding, it performs better on the test set when evaluated with the BLEU score metric. ",
|
| 1961 |
+
"bbox": [
|
| 1962 |
+
174,
|
| 1963 |
+
895,
|
| 1964 |
+
823,
|
| 1965 |
+
924
|
| 1966 |
+
],
|
| 1967 |
+
"page_idx": 15
|
| 1968 |
+
},
|
| 1969 |
+
{
|
| 1970 |
+
"type": "text",
|
| 1971 |
+
"text": "",
|
| 1972 |
+
"bbox": [
|
| 1973 |
+
173,
|
| 1974 |
+
103,
|
| 1975 |
+
823,
|
| 1976 |
+
132
|
| 1977 |
+
],
|
| 1978 |
+
"page_idx": 16
|
| 1979 |
+
}
|
| 1980 |
+
]
|
parse/train/BygFVAEKDH/BygFVAEKDH_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/BygFVAEKDH/BygFVAEKDH_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/ByxkijC5FQ/ByxkijC5FQ.md
ADDED
|
@@ -0,0 +1,379 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NEURAL PERSISTENCE: A COMPLEXITY MEASURE FOR DEEP NEURAL NETWORKS USING ALGEBRAIC TOPOLOGY
|
| 2 |
+
|
| 3 |
+
Bastian Rieck1,2,†, Matteo Togninalli1,2,†, Christian $\mathbf { B o c k } ^ { 1 , 2 , \dagger }$ , Michael Moor1,2, Max Horn1,2, Thomas Gumbsch1,2, Karsten Borwardt1,2
|
| 4 |
+
|
| 5 |
+
1DEPARTMENT OF BIOSYSTEMS SCIENCE AND ENGINEERING, ETH ZURICH, SWITZERLAND
|
| 6 |
+
2SIB SWISS INSTITUTE OF BIOINFORMATICS, SWITZERLAND
|
| 7 |
+
†These authors contributed equally
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
While many approaches to make neural networks more fathomable have been proposed, they are restricted to interrogating the network with input data. Measures for characterizing and monitoring structural properties, however, have not been developed. In this work, we propose neural persistence, a complexity measure for neural network architectures based on topological data analysis on weighted stratified graphs. To demonstrate the usefulness of our approach, we show that neural persistence reflects best practices developed in the deep learning community such as dropout and batch normalization. Moreover, we derive a neural persistencebased stopping criterion that shortens the training process while achieving comparable accuracies as early stopping based on validation loss.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
The practical successes of deep learning in various fields such as image processing (Simonyan & Zisserman, 2015; He et al., 2016; Hu et al., 2018), biomedicine (Ching et al., 2018; Rajpurkar et al., 2017; Rajkomar et al., 2018), and language translation (Bahdanau et al., 2015; Sutskever et al., 2014; Wu et al., 2016) still outpace our theoretical understanding. While hyperparameter adjustment strategies exist (Bengio, 2012), formal measures for assessing the generalization capabilities of deep neural networks have yet to be identified (Zhang et al., 2017). Previous approaches for improving theoretical and practical comprehension focus on interrogating networks with input data. These methods include i) feature visualization of deep convolutional neural networks (Zeiler & Fergus, 2014; Springenberg et al., 2015), ii) sensitivity and relevance analysis of features (Montavon et al., 2017), iii) a descriptive analysis of the training process based on information theory (Tishby & Zaslavsky, 2015; Shwartz-Ziv & Tishby, 2017; Saxe et al., 2018; Achille & Soatto, 2018), and iv) a statistical analysis of interactions of the learned weights (Tsang et al., 2018). Additionally, Raghu et al. (2017) develop a measure of expressivity of a neural network and use it to explore the empirical success of batch normalization, as well as for the definition of a new regularization method. They note that one key challenge remains, namely to provide meaningful insights while maintaining theoretical generality. This paper presents a method for elucidating neural networks in light of both aspects.
|
| 16 |
+
|
| 17 |
+
We develop neural persistence, a novel measure for characterizing neural network structural complexity. In doing so, we adopt a new perspective that integrates both network weights and connectivity while not relying on interrogating networks through input data. Neural persistence builds on computational techniques from algebraic topology, specifically topological data analysis (TDA), which was already shown to be beneficial for feature extraction in deep learning (Hofer et al., 2017) and describing the complexity of GAN sample spaces (Khrulkov & Oseledets, 2018). More precisely, we rephrase deep networks with fully-connected layers into the language of algebraic topology and develop a measure for assessing the structural complexity of i) individual layers, and ii) the entire network. In this work, we present the following contributions:
|
| 18 |
+
|
| 19 |
+
- We introduce neural persistence, a novel measure for characterizing the structural complexity of neural networks that can be efficiently computed.
|
| 20 |
+
- We prove its theoretical properties, such as upper and lower bounds, thereby arriving at a normalization for comparing neural networks of varying sizes.
|
| 21 |
+
- We demonstrate the practical utility of neural persistence in two scenarios: i) it correctly captures the benefits of dropout and batch normalization during the training process, and ii) it can be easily used as a competitive early stopping criterion that does not require validation data.
|
| 22 |
+
|
| 23 |
+
# 2 BACKGROUND: TOPOLOGICAL DATA ANALYSIS
|
| 24 |
+
|
| 25 |
+
Topological data analysis (TDA) recently emerged as a field that provides computational tools for analysing complex data within a rigorous mathematical framework that is based on algebraic topology. This paper uses persistent homology, a theory that was developed to understand highdimensional manifolds (Edelsbrunner et al., 2002; Edelsbrunner & Harer, 2010), and has since been successfully employed in characterizing graphs (Sizemore et al., 2017; Rieck et al., 2018), finding relevant features in unstructured data (Lum et al., 2013), and analysing image manifolds (Carlsson et al., 2008). This section gives a brief summary of the key concepts; please refer to Edelsbrunner & Harer (2010) for an extensive introduction.
|
| 26 |
+
|
| 27 |
+
Simplicial homology The central object in algebraic topology is a simplicial complex K, i.e. a high-dimensional generalization of a graph, which is typically used to describe complex objects such as manifolds. Various notions to describe the connectivity of K exist, one of them being simplicial homology. Briefly put, simplicial homology uses matrix reduction algorithms (Munkres, 1996) to derive a set of groups, the homology groups, for a given simplicial complex K. Homology groups describe topological features—colloquially also referred to as holes—of a certain dimension $d$ , such as connected components $( d = 0$ ), tunnels $( d = 1 )$ , and voids $\ Q \ = \ 2$ ). The information from the dth homology group is summarized in a simple complexity measure, the dth Betti number $\beta _ { d }$ , which merely counts the number of $d$ -dimensional features: a circle, for example, has Betti numbers $( 1 , 1 )$ , i.e. one connected component and one tunnel, while a filled circle has Betti numbers $( 1 , 0 )$ , i.e. one connected component but no tunnel. In the context of analysing simple feedforward neural networks for two classes, Bianchini & Scarselli (2014) calculated bounds of Betti numbers of the decision region belonging to the positive class, and were thus able to show the implications of different activation functions. These ideas were extended by Guss & Salakhutdinov (2018) to obtain a measure of the topological complexity of decision boundaries.
|
| 28 |
+
|
| 29 |
+
Persistent homology For the analysis of real-world data sets, however, Betti numbers turn out to be of limited use because their representation is too coarse and unstable. This prompted the development of persistent homology. Given a simplicial complex $\mathrm { K }$ with an additional set of weights $a _ { 0 } ~ \leq ~ a _ { 1 } ~ \leq ~ \cdot ~ \cdot ~ \leq ~ a _ { m - 1 } ~ \leq ~ a _ { m }$ , which are commonly thought to represent the idea of a scale, it is possible to put K in a filtration, i.e. a nested sequence of simplicial complexes $\emptyset = \mathrm { K } _ { 0 } \subseteq \mathrm { K } _ { 1 } \subseteq \cdots \subseteq \mathrm { K } _ { m - 1 } \subseteq \mathrm { K } _ { m } = \mathrm { K }$ . This filtration is thought to represent the ‘growth’ of K as the scale is being changed. During this growth process, topological features can be created (new vertices may be added, for example, which creates a new connected component) or destroyed (two connected components may merge into one). Persistent homology tracks these changes and represents the creation and destruction of a feature as a point $( a _ { i } , a _ { j } ) \in \mathbb { R } ^ { 2 }$ for indices $i \leq j$ with respect to the filtration. The collection of all points corresponding to $d$ -dimensional topological features is called the dth persistence diagram $\mathcal { D } _ { d }$ . It can be seen as a collection of Betti numbers at multiple scales. Given a point $( x , y ) \in \mathcal { D } _ { d }$ , the quantity $\mathrm { p e r s } ( x , y ) : = | y - x |$ is referred to as its persistence. Typically, high persistence is considered to correspond to features, while low persistence is considered to indicate noise (Edelsbrunner et al., 2002).
|
| 30 |
+
|
| 31 |
+
# 3 A NOVEL MEASURE FOR NEURAL NETWORK COMPLEXITY
|
| 32 |
+
|
| 33 |
+
This section details neural persistence, our novel measure for assessing the structural complexity of neural networks. By exploiting both network structure and weight information through persistent homology, our measure captures network expressiveness and goes beyond mere connectivity properties. Subsequently, we describe its calculation, provide theorems for theoretical and empirical bounds, and show the existence of neural networks complexity regimes. To summarize this section, Figure 1 illustrates how our method treats a neural network.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Illustrating the neural persistence calculation of a network with two layers $( l _ { 0 }$ and $l _ { 1 } .$ ). Colours indicate connected components per layer. The filtration process is depicted by colouring connected components that are created or merged when the respective weights are greater than or equal to the threshold $w _ { i } ^ { \prime }$ . As $w _ { i } ^ { \prime }$ decreases, network connectivity increases. Creation and destruction thresholds are collected in one persistence diagram per layer (right), and summarized according to Equation 1 for calculating neural persistence.
|
| 37 |
+
|
| 38 |
+
# 3.1 NEURAL PERSISTENCE
|
| 39 |
+
|
| 40 |
+
Given a feedforward neural network with an arrangement of neurons and their connections $E$ , let $\mathcal { W }$ refer to the set of weights. Since $\mathcal { W }$ is typically changing during training, we require a function $\varphi \colon E \mathcal { W }$ that maps a specific edge to a weight. Fixing an activation function, the connections form a stratified graph.
|
| 41 |
+
|
| 42 |
+
Definition 1 (Stratified graph and layers). $A$ stratified graph is a multipartite graph $G = ( V , E )$ satisfying $V = V _ { 0 } \sqcup V _ { 1 } \sqcup \ldots ,$ , such that if $u \in V _ { i }$ , $v \in V _ { j }$ , and $( u , v ) \in E$ , we have $j = i + 1$ Hence, edges are only permitted between adjacent vertex sets. Given $k \in \mathbb N$ , the kth layer of $a$ stratified graph is the unique subgraph $G _ { k } : = ( V _ { k } \sqcup V _ { k + 1 } , E _ { k } : = E \cap \{ V _ { k } \times V _ { k + 1 } \} )$ .
|
| 43 |
+
|
| 44 |
+
This enables calculating the persistent homology of $G$ and each $G _ { k }$ , using the filtration induced by sorting all weights, which is common practice in topology-based network analysis (Carstens & Horadam, 2013; Horak et al., 2009) where weights often represent closeness or node similarity. However, our context requires a novel filtration because the weights arise from an incremental fitting procedure, namely the training, which could theoretically lead to unbounded values. When analysing geometrical data with persistent homology, one typically selects a filtration based on the (Euclidean) distance between data points (Bubenik, 2015). The filtration then connects points that are increasingly distant from each other, starting from points that are direct neighbours. Our network filtration aims to mimic this behaviour in the context of fully-connected neural networks. Our framework does not explicitly take activation functions into account; however, activation functions influence the evolution of weights during training.
|
| 45 |
+
|
| 46 |
+
Filtration Given the set of weights $\mathcal { W }$ for one training step, let $w _ { \mathrm { m a x } } : = \operatorname* { m a x } _ { w \in \mathcal { W } } | w |$ . Furthermore, let $\mathcal { W } ^ { \prime } : = \{ | w | / w _ { \operatorname* { m a x } } | w \bar { \in } \mathcal { W } \}$ be the set of transformed weights, indexed in non-ascending order, such that $G _ { k }$ $G _ { k } ^ { ( 0 ) } \subseteq G _ { k } ^ { ( 1 ) } \subseteq \cdot \cdot .$ $1 = w _ { 0 } ^ { \prime } \geq w _ { 1 } ^ { \prime } \geq \cdot \cdot \cdot \geq 0$ , where e trans $G _ { k } ^ { ( i ) } : = ( V _ { k } \sqcup V _ { k + 1 } , \{ ( u , v ) \mid ( u , v ) \in E _ { k } \land \varphi ^ { \prime } ( u , v ) \geq w _ { i } ^ { \prime } \} )$ . This permits us to define a filtration for the $k$ th layer ands the $\varphi ^ { \prime } ( u , v ) \ { \stackrel { } { \in } } \ \mathcal { W } ^ { \prime }$
|
| 47 |
+
analysis of neural networks, for which large (absolute) weights indicate that certain neurons exert a larger influence over the final activation of a layer. The strength of a connection is thus preserved by the filtration, and weaker weights with $| w | \approx \dot { 0 }$ remain close to 0. Moreover, since $w ^ { \prime } \in [ 0 , 1 ]$ holds for the transformed weights, this filtration makes the network invariant to scaling, which simplifies the comparison of different networks.
|
| 48 |
+
|
| 49 |
+
Persistence diagrams Having set up the filtration, we can calculate persistent homology for every layer $G _ { k }$ . As the filtration contains at most 1-simplices (edges), we capture zero-dimensional topological information, i.e. how connected components are created and merged during the filtration. These information are structurally equivalent to calculating a maximum spanning tree using the weights, or performing hierarchical clustering with a specific setup (Carlsson & Mémoli, 2010). While it would theoretically be possible to include higher-dimensional information about each layer $G _ { k }$ , for example in the form of cliques (Rieck et al., 2018), we focus on zero-dimensional information in this paper, because of the following advantages: i) the resulting values are easily interpretable as they essentially describe the clustering of the network at multiple weight thresholds, ii) previous research (Rieck & Leitte, 2016; Hofer et al., 2017) indicates that zero-dimensional topological information is already capturing a large amount of information, and iii) persistent homology calculations are highly efficient in this regime (see below). We thus calculate zero-dimensional persistent homology with this filtration. The resulting persistence diagrams have a special structure: since our filtration solely sorts edges, all vertices are present at the beginning of the filtration, i.e. they are already part of $G _ { k } ^ { ( 0 ) }$ for each $k$ . As a consequence, they are assigned a weight of 1, resulting in connected components. Hence, entries in the corresponding persistence diagram are of the form $( 1 , x )$ , with $x \in \mathcal { W } ^ { \prime }$ , and will be situated below the diagonal, similar to superlevel set filtrations (Bubenik, 2015; Cohen-Steiner et al., 2009). Using the $p$ -norm of a persistence diagram, as introduced by Cohen-Steiner et al. (2010), we obtain the following definition for neural persistence.
|
| 50 |
+
|
| 51 |
+
<table><tr><td colspan="2">Algorithm1Neural persistence calculation</td></tr><tr><td>Require: Neural network with l layers and weights W</td><td>Determine largest absolute weight</td></tr><tr><td>1: Wmax ← maxw∈w lwl 2: W' ← {lwl/wmax |w ∈W}</td><td>>Transform weights for filtration</td></tr><tr><td>3: for k ∈{0,...,l-1} do G 4: F↑ n n</td><td>>Establish filtration of kth layer</td></tr><tr><td>5: Dk ←PERSISTENTHOMOLOGY(Fε)</td><td> Calculate persistence diagram</td></tr><tr><td>end for 7: return{Dollp,...,|/Dt-1llp}</td><td>> Calculate neural persistence for each layer</td></tr></table>
|
| 52 |
+
|
| 53 |
+
Definition 2 (Neural persistence). The neural persistence of the kth layer $G _ { k }$ , denoted by $\mathrm { N P } ( G _ { k } )$ is the $p$ -norm of the persistence diagram $\mathcal { D } _ { k }$ resulting from our previously-introduced filtration, i.e.
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathrm { N P } ( G _ { k } ) : = \| \mathcal { D } _ { k } \| _ { p } : = \Big ( \sum _ { ( c , d ) \in \mathcal { D } _ { k } } \mathrm { p e r s } ( c , d ) ^ { p } \Big ) ^ { \frac { 1 } { p } } ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
which (for $p = 2$ ) captures the Euclidean distance of points in $\mathcal { D } _ { k }$ to the diagonal.
|
| 60 |
+
|
| 61 |
+
The $p$ -norm is known to be a stable summary (Cohen-Steiner et al., 2010) of topological features in a persistence diagram. For neural persistence to be a meaningful measure of structural complexity, it should increase as a neural network is learning. We evaluate this and other properties in Section 4.
|
| 62 |
+
|
| 63 |
+
Algorithm 1 provides pseudocode for the calculation process. It is highly efficient: the filtration (line 4) amounts to sorting all $n$ weights of a network, which has a computational complexity of ${ \mathcal { O } } ( n \log n )$ . Calculating persistent homology of this filtration (line 5) can be realized using an algorithm based on union–find data structures Edelsbrunner et al. (2002). This has a computational complexity of $O \left( n \cdot \alpha \left( n \right) \right)$ , where $\alpha ( \cdot )$ refers to the extremely slow-growing inverse of the Ackermann function (Cormen et al., 2009, Chapter 22). We make our implementation and experiments available under https://github.com/BorgwardtLab/Neural-Persistence.
|
| 64 |
+
|
| 65 |
+
# 3.2 PROPERTIES OF NEURAL PERSISTENCE
|
| 66 |
+
|
| 67 |
+
We elucidate properties about neural persistence to permit the comparison of networks with different architectures. As a first step, we derive bounds for the neural persistence of a single layer $G _ { k }$ .
|
| 68 |
+
|
| 69 |
+
Theorem 1. Let $G _ { k }$ be a layer of a neural network according to Definition 1. Furthermore, let $\varphi _ { k } \colon E _ { k } \to \mathcal { W } ^ { \prime }$ denote the function that assigns each edge of $G _ { k }$ a transformed weight. Using the filtration from Section 3.1 to calculate persistent homology, the neural persistence $\mathrm { N P } ( G _ { k } )$ of the kth layer satisfies
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
0 \leq \mathrm { N P } ( G _ { k } ) \leq \left( \operatorname* { m a x } _ { e \in E _ { k } } \varphi _ { k } ( e ) - \operatorname* { m i n } _ { e \in E _ { k } } \varphi _ { k } ( e ) \right) ( | V _ { k } \times V _ { k + 1 } | - 1 ) ^ { \frac { 1 } { p } } ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $| V _ { k } \times V _ { k + 1 } |$ denotes the cardinality of the vertex set, i.e. the number of neurons in the layer.
|
| 76 |
+
|
| 77 |
+
Proof. We prove this constructively and show that the bounds can be realized. For the lower bound, let $G _ { k } ^ { - }$ be a fully-connected layer with $| V _ { k } |$ vertices and, given $\theta \in [ 0 , 1 ]$ , let $\varphi _ { k } ( e ) : = \theta$ for every edge $e$ . Since a vertex $v$ is created before its incident edges, the filtration degenerates to a lexicographical ordering of vertices and edges, and all points in $\mathcal { D } _ { k }$ will be of the form $( \theta , \theta )$ . Thus, $\mathrm { N P } ( G _ { k } ^ { - } ) = 0$ . For the upper bound, let $G _ { k } ^ { + }$ again be a fully-connected layer with $| V _ { k } | \geq 3$ vertices and let $\dot { a } , b \in [ 0 , 1 ]$ with $a \ < \ b$ . Select one edge $e ^ { \prime }$ at random and define a weight function as $\varphi ( e ^ { \prime } ) : = b$ and $\varphi ( e ) : = a$ otherwise. In the filtration, the addition of the first edge will create a pair of the form $( b , b )$ , while all other pairs will be of the form $( b , a )$ . Consequently, we have
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r l } & { \mathrm { N P } ( G _ { k } ^ { + } ) = \Big ( \mathrm { p e r s } ( b , b ) ^ { p } + ( n - 1 ) \cdot \mathrm { p e r s } ( b , a ) ^ { p } \Big ) ^ { \frac { 1 } { p } } = ( b - a ) \cdot ( n - 1 ) ^ { \frac { 1 } { p } } } \\ & { \quad \quad \quad = \bigg ( \underset { e \in E _ { k } } { \operatorname* { m a x } } \varphi ( e ) - \underset { e \in E _ { k } } { \operatorname* { m i n } } \varphi ( e ) \bigg ) ( | V _ { k } | - 1 ) ^ { \frac { 1 } { p } } , } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
so our upper bound can be realized. To show that this term cannot be exceeded by $\mathrm { N P } ( G )$ for any $G$ , suppose we perturb the weight function $\widetilde { \varphi } ( e ) : = \varphi ( e ) + \epsilon \in [ 0 , 1 ]$ . This cannot increase NP, however, because each difference $b - a$ in Equation 3 is maximized by max $\varphi ( e ) - \operatorname* { m i n } \varphi ( e )$ .
|
| 84 |
+
|
| 85 |
+
We can use the upper bound of Theorem 1 to normalize the neural persistence of a layer, making it possible to compare layers (and neural networks) that feature different architectures, i.e. a different number of neurons.
|
| 86 |
+
|
| 87 |
+
Definition 3 (Normalized neural persistence). For a layer $G _ { k }$ following Definition $^ { l }$ , using the upper bound of Theorem 1, the normalized neural persistence $\widetilde { \mathrm { N P } } ( G _ { k } )$ is defined as the neural persistence of $G _ { k }$ divided by its upper bound, i.e. $\widetilde { \mathrm { N P } } ( G _ { k } ) : = \mathrm { N P } ( G _ { k } ) \cdot \mathrm { N P } ( G _ { k } ^ { + } ) ^ { - 1 }$ .
|
| 88 |
+
|
| 89 |
+
The normalized neural persistence of a layer permits us to extend the definition to an entire network. While this is more complex than using a single filtration for a neural network, this permits us to side-step the problem of different layers having different scales.
|
| 90 |
+
|
| 91 |
+
Definition 4 (Mean normalized neural persistence). Considering a network as a stratified graph $G$ according to Definition $^ { l }$ , we sum the neural persistence values per layer to obtain the mean normalized neural persistence, i.e. $\begin{array} { r } { \overline { { \mathrm { N P } } } ( G ) : = 1 / l \cdot \sum _ { k = 0 } ^ { l - 1 } \widetilde { \mathrm { N P } } ( G _ { k } ) } \end{array}$ .
|
| 92 |
+
|
| 93 |
+
While Theorem 1 gives a lower and upper bound in a general setting, it is possible to obtain empirical bounds when we consider the tuples that result from the computation of a persistence diagram. Recall that our filtration ensures that the persistence diagram of a layer contains tuples of the form $( 1 , w _ { i } )$ , with $w _ { i } \in [ 0 , 1 ]$ being a transformed weight. Exploiting this structure permits us to obtain bounds that could be used prior to calculating the actual neural persistence value in order to make the implementation more efficient.
|
| 94 |
+
|
| 95 |
+
Theorem 2. Let $G _ { k }$ be a layer of a neural network as in Theorem $^ { l }$ with n vertices and m edges whose edge weights are sorted in non-descending order, i.e. $w _ { 0 } \ \leq \ w _ { 2 } \ \leq \ \cdot \cdot \ \leq \ w _ { m - 1 }$ . Then $\mathrm { N P } ( G _ { k } )$ can be empirically bounded by
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\left\| \mathbb { 1 } - \mathbf { w } _ { \mathrm { m a x } } \right\| _ { p } \leq \mathrm { N P } ( G _ { k } ) \leq \left\| \mathbb { 1 } - \mathbf { w } _ { \mathrm { m i n } } \right\| _ { p } ,
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $\mathbf { w } _ { \mathrm { m a x } } = ( w _ { m - 1 } , w _ { m - 2 } , \ldots , w _ { m - n } ) ^ { T }$ and $\mathbf { w } _ { \mathrm { m i n } } = ( w _ { 0 } , w _ { 2 } , \ldots , w _ { n - 1 } ) ^ { T }$ are the vectors containing the n largest and $n$ smallest weights, respectively.
|
| 102 |
+
|
| 103 |
+
Proof. See Section A.2 in the appendix.
|
| 104 |
+
|
| 105 |
+
Complexity regimes in neural persistence As an application of the two theorems, we briefly take a look at how neural persistence changes for different classes of simple neural networks. To this end, we train a perceptron on the ‘MNIST’ data set. Since our measure uses the weight matrix of a perceptron, we can compare its neural persistence with the neural persistence of random weight matrices, drawn from different distributions. Moreover, we can compare trained networks with respect to their initial parameters. Figure 2 depicts the neural persistence values as well as the lower bounds according to Theorem 2 for different settings. We can see that a network in which the optimizer diverges (due to improperly selected parameters) is similar to a random Gaussian matrix.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 2: Neural persistence values of trained perceptrons (green), diverging ones (yellow), random Gaussian matrices (red), and random uniform matrices (black). We performed 100 runs per category; dots indicate neural persistence while crosses indicate the predicted lower bound according to Theorem 2. The bounds according to Theorem 1 are shown as dashed lines.
|
| 109 |
+
|
| 110 |
+
Trained networks, on the other hand, are clearly distinguished from all other networks. Uniform matrices have a significantly lower neural persistence than Gaussian ones. This is in line with the intuition that the latter type of networks induces functional sparsity because few neurons have large absolute weights. For clarity, we refrain from showing the empirical upper bounds because most weight distributions are highly right-tailed; the bound will not be as tight as the lower bound. These results are in line with a previous analysis (Sizemore et al., 2017) of small weighted networks, in which persistent homology is seen to outperform traditional graph-theoretical complexity measures such as the clustering coefficient (see also Section A.1 in the appendix). For deeper networks, additional experiments discuss the relation between validation accuracy and neural persistence (Section A.5), the impact of different data distributions, as well as the variability of neural persistence for architectures of varying depth (Section A.6).
|
| 111 |
+
|
| 112 |
+
# 4 EXPERIMENTS
|
| 113 |
+
|
| 114 |
+
This section demonstrates the utility and relevance of neural persistence for fully connected deep neural networks. We examine how commonly used regularization techniques (batch normalization and dropout) affect neural persistence of trained networks. Furthermore, we develop an early stopping criterion based on neural persistence and we compare it to the traditional criterion based on validation loss. We used different architectures with $R e L U$ activation functions across experiments. The brackets denote the number of units per hidden layer. In addition, the Adam optimizer with hyperparameters tuned via cross-validation was used unless noted otherwise. Please refer to Table A.1 in the appendix for further details about the experiments.
|
| 115 |
+
|
| 116 |
+
# 4.1 DEEP LEARNING BEST PRACTICES IN LIGHT OF NEURAL PERSISTENCE
|
| 117 |
+
|
| 118 |
+
We compare the mean normalized neural persistence (see Definition 4) of a two-layer (with an architecture of [650, 650]) neural network to two models where batch normalization (Ioffe & Szegedy, 2015) or dropout (Srivastava et al., 2014) are applied. Figure 3 shows that the networks designed according to best practices yield higher normalized neural persistence values on the ‘MNIST’ data set in comparison to an unmodified network. The effect of dropout on the mean normalized neural persistence is more pronounced and this trend is directly analogous to the observed accuracy on the test set. These results are consistent with expectations if we consider dropout to be similar to ensemble learning (Hara et al., 2016). As individual parts of the network are trained independently, a higher degree of per-layer redundancy is expected, resulting in a different structural complexity. Overall, these results indicate that for a fixed architecture approaches targeted at increasing the neural persistence during the training process may be of particular interest.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 3: Comparison of mean normalized neural persistence for trained networks without modifications (green), with batch normalization (yellow), and with $50 \%$ of the neurons dropped out during training (red) for the ‘MNIST’ data set (50 runs per setting).
|
| 122 |
+
|
| 123 |
+
# 4.2 EARLY STOPPING BASED ON NEURAL PERSISTENCE
|
| 124 |
+
|
| 125 |
+
Neural persistence can be used as an early stopping criterion that does not require a validation data set to prevent overfitting: if the mean normalized neural persistence does not increase by more than $\Delta _ { \mathrm { m i n } }$ during a certain number of epochs $g$ , the training process is stopped. This procedure is called ‘patience’ and Algorithm 2 describes it in detail. A similar variant of this algorithm, using validation loss instead of persistence, is the state-of-the-art for early stopping in training (Bengio, 2012; Chollet et al., 2015). To evaluate the efficacy of our measure, we compare it against validation loss in an extensive set of scenarios. More precisely, for a training process with at most $G$ epochs, we define a $G \times G$ parameter grid consisting of the ‘patience’ parameter $g$ and a burn-in rate $b$ (both measured in epochs). $b$ defines the number of epochs after which an early stopping criterion starts monitoring, thereby preventing underfitting. Subsequently, we set $\Delta _ { \operatorname* { m i n } } = 0$ for all measures to remain comparable and scale-invariant, as non-zero values could implicitly favour one of them due to scaling. For each data set, we perform 100 training runs of the same architecture, monitoring validation loss and mean normalized neural persistence every quarter epoch. The early stopping behaviour of both measures is simulated for each combination of $b$ and $g$ and their performance over all runs is summarized in terms of median test accuracy and median stopping epoch; if a criterion is not triggered for one run, we report the test accuracy at the end of the training and the number of training epochs. This results in a scatterplot, where each point (corresponding to a single parameter combination) shows the difference in epochs and the absolute difference in test accuracy (measured in percent). The quadrants permit an intuitive explanation: $Q _ { 2 }$ , for example, contains all configurations for which our measure stops earlier, while achieving a higher accuracy. Since $b$ and $g$ are typically chosen to be small in an early stopping scenario, we use grey points to indicate uncommon configurations for which $b$ or $g$ is larger than half of the total number of epochs. Furthermore, to summarize the performance of our measure, we calculate the barycentre of all configurations (green square).
|
| 126 |
+
|
| 127 |
+
Figure 4a depicts the comparison with validation loss for the ‘Fashion-MNIST’ (Xiao et al., 2017) data set; please refer to Section A.3 in the appendix for more data sets. Here, we observe that most common configurations are in $Q _ { 2 }$ or in $Q _ { 3 }$ , i.e our criterion stops earlier. The barycentre is at $( - 0 . 5 3 , - 0 . 0 8 )$ , showing that out of 625 configurations, on average we stop half an epoch earlier than validation loss, while losing virtually no accuracy $\left( 0 . 0 8 \% \right)$ . Figure 4c depicts detailed differences in accuracy and epoch for our measure when compared to validation loss; each cell in a heatmap corresponds to a single parameter configuration of $b$ and $g$ . In the heatmap of accuracy differences, blue, white, and red represent parameter combinations for which we obtain higher, equal, or lower accuracy, respectively, than with validation loss for the same parameters. Similarly, in the
|
| 128 |
+
|
| 129 |
+
Require: Weighted neural network $\mathcal { N }$ , patience $g$ , $\Delta _ { \mathrm { m i n } }$
|
| 130 |
+
1: $P 0$ , $G \gets 0$ $\triangleright$ Initialize highest observed value and patience counter
|
| 131 |
+
2: procedure EARLYSTOPPING $( \mathcal { N } , g , \Delta _ { \mathrm { m i n } } )$ $\triangleright$ Callback that monitors training at every epoch
|
| 132 |
+
3: $P ^ { \prime } \overline { { \mathrm { N P } } } ( \mathcal { N } )$
|
| 133 |
+
4: if $P ^ { \prime } > P + \Delta _ { \mathrm { m i n } }$ then ▷ Update mean normalized neural persistence and reset counter
|
| 134 |
+
5: $P P ^ { \prime }$ , $G 0$
|
| 135 |
+
6: else ▷ Update patience counter
|
| 136 |
+
7: $G G + 1$
|
| 137 |
+
8: end if
|
| 138 |
+
9: if $G \geq g$ then $\triangleright$ Patience criterion has been triggered
|
| 139 |
+
10: return $P$ $\triangleright$ Stop training and return highest observed value
|
| 140 |
+
11: end if
|
| 141 |
+
12: end procedure
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 4: The visualizations depict the differences in accuracy and epoch for all comparison scenarios of mean normalized neural persistence versus validation loss, while the table summarizes the results on other data sets. Final test accuracies are shown irrespectively of early stopping to put the accuracy differences into context.
|
| 145 |
+
|
| 146 |
+
heatmap of epoch differences, green represents parameter combinations for which we stop earlier than validation loss. For $b \leq 8$ , we stop earlier (0.62 epochs on average), while losing only $0 . 0 6 \%$ accuracy. Finally, Figure 4d shows how often each measure is triggered. Ideally, each measure should consist of a dark green triangle, as this would indicate that each configuration stops all the time. For this data set, we observe that our method stops for more parameter combinations than validation loss, but not as frequently for all of them. To ensure comparability across scenarios, we did not use the validation data as additional training data when stopping with neural persistence; we refer to Section A.7 for additional experiments in data scarcity scenarios. We observe that our method stops earlier when overfitting can occur, and it stops later when longer training is beneficial.
|
| 147 |
+
|
| 148 |
+
# 5 DISCUSSION
|
| 149 |
+
|
| 150 |
+
In this work, we presented neural persistence, a novel topological measure of the structural complexity of deep neural networks. We showed that this measure captures topological information that pertains to deep learning performance. Being rooted in a rich body of research, our measure is theoretically well-defined and, in contrast to previous work, generally applicable as well as computationally efficient. We showed that our measure correctly identifies networks that employ best practices such as dropout and batch normalization. Moreover, we developed an early stopping criterion that exhibits competitive performance while not relying on a separate validation data set. Thus, by saving valuable data for training, we managed to boost accuracy, which can be crucial for enabling deep learning in regimes of smaller sample sizes. Following Theorem 2, we also experimented with using the $p$ -norm of all weights of the neural network as a proxy for neural persistence. However, this did not yield an early stopping measure because it was never triggered, thereby suggesting that neural persistence captures salient information that would otherwise be hidden among all the weights of a network. We extended our framework to convolutional neural networks (see Section A.4) by deriving a closed-form approximation, and observed that an early stopping criterion based on neural persistence for convolutional layers will require additional work. Furthermore, we conjecture that assessing dissimilarities of networks by means of persistence diagrams (making use of higher-dimensional topological features), for example, will lead to further insights regarding their generalization and learning abilities. Another interesting avenue for future research would concern the analysis of the ‘function space’ learned by a neural network. On a more general level, neural persistence demonstrates the great potential of topological data analysis in machine learning.
|
| 151 |
+
|
| 152 |
+
# REFERENCES
|
| 153 |
+
|
| 154 |
+
Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems: Simple, end-to-end, LeNet-5-like convolutional MNIST model example, 2015. URL https://github.com/tensorflow/models/blob/master/ tutorials/image/mnist/convolutional.py.
|
| 155 |
+
|
| 156 |
+
Alessandro Achille and Stefano Soatto. Emergence of invariance and disentanglement in deep representations. Journal of Machine Learning Research, 18:1–34, 2018.
|
| 157 |
+
|
| 158 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In International Conference on Learning Representations (ICLR), 2015.
|
| 159 |
+
|
| 160 |
+
Yoshua Bengio. Practical recommendations for gradient-based training of deep architectures. In Grégoire Montavon, Geneviève B. Orr, and Klaus-Robert Müller (eds.), Neural Networks: Tricks of the Trade, volume 7700 of Lecture Notes in Computer Science, pp. 437–478. Springer, Heidelberg, Germany, 2012.
|
| 161 |
+
|
| 162 |
+
Monica Bianchini and Franco Scarselli. On the complexity of neural network classifiers: A comparison between shallow and deep architectures. IEEE Transactions on Neural Networks and Learning Systems, 25(8):1553–1565, 2014.
|
| 163 |
+
|
| 164 |
+
Peter Bubenik. Statistical topological data analysis using persistence landscapes. Journal of Machine Learning Research, 16:77–102, 2015.
|
| 165 |
+
|
| 166 |
+
Gunnar Carlsson and Facundo Mémoli. Characterization, stability and convergence of hierarchical clustering methods. Journal of Machine Learning Research, 11:1425–1470, 2010.
|
| 167 |
+
|
| 168 |
+
Gunnar Carlsson, Tigran Ishkhanov, Vin de Silva, and Afra Zomorodian. On the local behavior of spaces of natural images. International Journal of Computer Vision, 76(1):1–12, 2008.
|
| 169 |
+
|
| 170 |
+
Corrie J. Carstens and Kathy J. Horadam. Persistent homology of collaboration networks. Mathematical Problems in Engineering, 2013:815035, 2013.
|
| 171 |
+
|
| 172 |
+
Travers Ching, Daniel S. Himmelstein, Brett K. Beaulieu-Jones, Alexandr A. Kalinin, Brian T. Do, Gregory P. Way, Enrico Ferrero, Paul-Michael Agapow, Michael Zietz, Michael M. Hoffman, Weil Xie, Gail L. Rosen, Benjamin J. Lengerich, Johnny Israeli, Jack Lanchantin, Stephen Woloszynek, Anne E. Carpenter, Avanti Shrikumar, Jinbo Xu, Evan M. Cofer, Christopher A. Lavender, Srinivas C. Turaga, Amr M. Alexandri, Zhiyong Lu, David J. Harris, Dave DeCaprio, Yanjun Qi, Anshul Kundaje, Yifan Peng, Laura K. Wiley, Marwin H.S. Segler, Simina M. Boca, S. Joshua Swamidass, Austin Huang, Anthony Gitter, and Casey S. Greene. Opportunities and obstacles for deep learning in biology and medicine. Journal of The Royal Society Interface, 15 (141):20170387, 2018.
|
| 173 |
+
|
| 174 |
+
François Chollet et al. Keras. https://keras.io, 2015.
|
| 175 |
+
|
| 176 |
+
David Cohen-Steiner, Herbert Edelsbrunner, and John Harer. Extending persistence using Poincaré and Lefschetz duality. Foundations of Computational Mathematics, 9(1):79–103, 2009.
|
| 177 |
+
|
| 178 |
+
David Cohen-Steiner, Herbert Edelsbrunner, John Harer, and Yuriy Mileyko. Lipschitz functions have $\mathrm { L } _ { p }$ -stable persistence. Foundations of Computational Mathematics, 10(2):127–139, 2010.
|
| 179 |
+
|
| 180 |
+
Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to algorithms. MIT Press, Cambridge, MA, USA, 3rd edition, 2009.
|
| 181 |
+
|
| 182 |
+
Herbert Edelsbrunner and John Harer. Computational topology: An introduction. American Mathematical Society, Providence, RI, USA, 2010.
|
| 183 |
+
|
| 184 |
+
Herbert Edelsbrunner, David Letscher, and Afra J. Zomorodian. Topological persistence and simplification. Discrete & Computational Geometry, 28(4):511–533, 2002.
|
| 185 |
+
|
| 186 |
+
William H Guss and Ruslan Salakhutdinov. On characterizing the capacity of neural networks using algebraic topology. arXiv preprint arXiv:1802.04443, 2018.
|
| 187 |
+
|
| 188 |
+
Kazuyuki Hara, Daisuke Saitoh, and Hayaru Shouno. Analysis of dropout learning regarded as ensemble learning. In Alessandro E.P. Villa, Paolo Masulli, and Antonio Javier Pons Rivero (eds.), Artificial Neural Networks and Machine Learning (ICANN), number 9887 in Lecture Notes in Computer Science, pp. 72–79, Cham, Switzerland, 2016. Springer.
|
| 189 |
+
|
| 190 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 770–778, 2016.
|
| 191 |
+
|
| 192 |
+
Christoph Hofer, Roland Kwitt, Marc Niethammer, and Andreas Uhl. Deep learning with topological signatures. In Advances in Neural Information Processing Systems (NeurIPS), pp. 1633– 1643, 2017.
|
| 193 |
+
|
| 194 |
+
Danijela Horak, Slobodan Maletic, and Milan Rajkovi ´ c. Persistent homology of complex networks.´ Journal of Statistical Mechanics: Theory and Experiment, 2009(03):P03034, 2009.
|
| 195 |
+
|
| 196 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7132–7141, 2018.
|
| 197 |
+
|
| 198 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 448–456. PMLR, 2015.
|
| 199 |
+
|
| 200 |
+
Valentin Khrulkov and Ivan Oseledets. Geometry score: A method for comparing generative adversarial networks. In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 2621–2629. PMLR, 2018.
|
| 201 |
+
|
| 202 |
+
Pek Y. Lum, Gurjeet Singh, Alan Lehman, Tigran Ishkanov, Mikael Vejdemo-Johansson, Muthu Alagappan, John Carlsson, and Gunnar Carlsson. Extracting insights from the shape of complex data using topology. Scientific Reports, 3:1–8, 2013.
|
| 203 |
+
|
| 204 |
+
Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. Methods for interpreting and understanding deep neural networks. Digital Signal Processing, 73:1–15, 2017.
|
| 205 |
+
|
| 206 |
+
James R. Munkres. Elements of algebraic topology. CRC Press, Boca Raton, FL, USA, 1996.
|
| 207 |
+
|
| 208 |
+
Maithra Raghu, Ben Poole, Jon Kleinberg, Surya Ganguli, and Jascha Sohl-Dickstein. On the expressive power of deep neural networks. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 2847–2854. PMLR, 2017.
|
| 209 |
+
|
| 210 |
+
Alvin Rajkomar, Eyal Oren, Kai Chen, Andrew M. Dai, Nissan Hajaj, Michaela Hardt, Peter J Liu, Xiaobing Liu, Jake Marcus, Mimi Sun, et al. Scalable and accurate deep learning with electronic health records. npj Digital Medicine, 1(1):18, 2018.
|
| 211 |
+
|
| 212 |
+
Pranav Rajpurkar, Jeremy Irvin, Kaylie Zhu, Brandon Yang, Hershel Mehta, Tony Duan, Daisy Ding, Aarti Bagul, Curtis Langlotz, Katie Shpanskaya, Matthew Lungren, and Andrew Y. Ng. CheXNet: Radiologist-level pneumonia detection on chest X-rays with deep learning. arXiv preprint arXiv:1711.05225, 2017.
|
| 213 |
+
|
| 214 |
+
Bastian Rieck and Heike Leitte. Exploring and comparing clusterings of multivariate data sets using persistent homology. Computer Graphics Forum, 35(3):81–90, 2016.
|
| 215 |
+
|
| 216 |
+
Bastian Rieck, Ulderico Fugacci, Jonas Lukasczyk, and Heike Leitte. Clique community persistence: A topological visual analysis approach for complex networks. IEEE Transactions on Visualization and Computer Graphics, 24(1):822–831, 2018.
|
| 217 |
+
|
| 218 |
+
Andrew Michael Saxe, Yamini Bansal, Joel Dapello, Madhu Advani, Artemy Kolchinsky, Brendan Daniel Tracey, and David Daniel Cox. On the information bottleneck theory of deep learning. In International Conference on Learning Representations (ICLR), 2018.
|
| 219 |
+
|
| 220 |
+
Ravid Shwartz-Ziv and Naftali Tishby. Opening the black box of deep neural networks via information. arXiv preprint arXiv:1703.00810, 2017.
|
| 221 |
+
|
| 222 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
|
| 223 |
+
|
| 224 |
+
Ann Sizemore, Chad Giusti, and Danielle S. Bassett. Classification of weighted networks through mesoscale homological features. Journal of Complex Networks, 5(2):245–273, 2017.
|
| 225 |
+
|
| 226 |
+
Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin Riedmiller. Striving for simplicity: The all convolutional net. In Workshop Track of the International Conference on Learning Representations (ICLR), 2015.
|
| 227 |
+
|
| 228 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1):1929–1958, 2014.
|
| 229 |
+
|
| 230 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pp. 3104–3112, 2014.
|
| 231 |
+
|
| 232 |
+
Naftali Tishby and Noga Zaslavsky. Deep learning and the information bottleneck principle. In IEEE Information Theory Workshop (ITW), pp. 1–5, 2015.
|
| 233 |
+
|
| 234 |
+
Michael Tsang, Dehua Cheng, and Yan Liu. Detecting statistical interactions from neural network weights. In International Conference on Learning Representations (ICLR), 2018.
|
| 235 |
+
|
| 236 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V. Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 237 |
+
|
| 238 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: A novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
|
| 239 |
+
|
| 240 |
+
Matthew D. Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. In David Fleet, Tomas Pajdla, Bernt Schiele, and Tinne Tuytelaars (eds.), European Conference on Computer Vision (ECCV), volume 8689 of Lecture Notes in Computer Science, pp. 818–833, Cham, Switzerland, 2014. Springer.
|
| 241 |
+
|
| 242 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In International Conference on Learning Representations (ICLR), 2017.
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
Figure A.1: Traditional graph measures (top), such as the clustering coefficient, fail to detect differences in the complexity of neural networks. Our novel neural persistence measure (bottom), by contrast, shows that trained networks with $\eta = 0 . 5$ (green), which have an accuracy of $\approx 0 . 9 1$ , obey a different distribution than networks trained with $\bar { \eta = 1 \times 1 0 ^ { - 0 . 5 } }$ (yellow), which have accuracies ranging from 0.38–0.65.
|
| 246 |
+
|
| 247 |
+
# A APPENDIX
|
| 248 |
+
|
| 249 |
+
# A.1 COMPARISON WITH GRAPH-THEORETICAL MEASURES
|
| 250 |
+
|
| 251 |
+
Traditional complexity/structural measures from graph theory, such as the clustering coefficient, the average shortest path length, and global/local efficiency are already known to be insufficiently accurate to characterize different models of complex random networks Sizemore et al. (2017). Our experiments indicate that this holds true for (deep) neural networks, too. As a brief example, we trained a perceptron on the MNIST data set with batch stochastic gradient descent $\left( \eta = 0 . 5 \right)$ , achieving a test accuracy of $\approx 0 . 9 1$ . Moreover, we intentionally ‘sabotaged’ the training by setting $\eta = 1 \check { \times } 1 0 ^ { - 5 }$ such that SGD is unable to converge properly. This leads to networks with accuracies ranging from 0.38–0.65. A complexity measure should be capable of distinguishing both classes of networks. However, as Figure A.1 (top) shows, this is not the case for the clustering coefficient. Neural persistence (bottom), on the other hand, results in two regimes that can clearly be distinguished, with the trained networks having a significantly smaller variance.
|
| 252 |
+
|
| 253 |
+
# A.2 PROOF OF THEOREM 2
|
| 254 |
+
|
| 255 |
+
Proof. We may consider the filtration from Section 3.1 to be a subset selection problem with constraints, where we select $n$ out of $m$ weights. The neural persistence $\mathrm { N P } ( G _ { k } )$ of a layer thus only depends on the selected weights that appear as tuples of the form $( 1 , w _ { i } )$ in $\mathcal { D } _ { k }$ . Letting $\widetilde { \mathbf { w } }$ denote the vector of selected weights arising from the persistence diagram calculation, we can rewrite neural persistence as $\mathrm { N P } ( G _ { k } ) = \| \mathbf { 1 } - \mathbf { \bar { w } } \| _ { p }$ . Furthermore, $\widetilde { \mathbf { w } }$ satisfies $\left\| \mathbf { w } _ { \mathrm { m i n } } \right\| _ { p } \leq \left\| \widetilde { \mathbf { w } } \right\| _ { p } \leq \left\| \mathbf { w } _ { \mathrm { m a x } } \right\| _ { p }$ . Since all transformed weights are non-negative in our filtration, it follows that (note the reversal of the two terms)
|
| 256 |
+
|
| 257 |
+
$$
|
| 258 |
+
\left\| \mathbb { 1 } - \mathbf { w } _ { \mathrm { m a x } } \right\| _ { p } \leq \mathrm { N P } ( G _ { k } ) \leq \left\| \mathbb { 1 } - \mathbf { w } _ { \mathrm { m i n } } \right\| _ { p } ,
|
| 259 |
+
$$
|
| 260 |
+
|
| 261 |
+
and the claim follows.
|
| 262 |
+
|
| 263 |
+
# A.3 ADDITIONAL VISUALIZATIONS AND ANALYSES FOR EARLY STOPPING
|
| 264 |
+
|
| 265 |
+
Due to space constraints and the large number of configurations that we investigated for our early stopping experiments, this section contains additional plots that follow the same schematic: the top row shows the differences in accuracy and epoch for our measure when compared to the commonlyused validation loss. Each cell in the heatmap corresponds to a single configuration of $b$ and $g$ . In the heatmap of accuracy differences, blue represents parameter combinations for which we obtain a higher accuracy than validation loss for the same parameters; white indicates combinations for which we obtain the same accuracy, while red highlights combinations in which our accuracy decreases. Similarly, in the heatmap of epoch differences, green represents parameter combinations for which we stop earlier than validation loss for the same parameter. The scatterplots in
|
| 266 |
+
|
| 267 |
+
Section 4.2 show an ‘unrolled’ version of this heat map, making it possible to count how many parameter combinations result in early stops while also increasing accuracy, for example. The heatmaps, by contrast, make it possible to compare the behaviour of the two measures with respect to each parameter combination. Finally, the bottom row of every plot shows how many times each measure was triggered for every parameter combination. We consider a measure to be triggered if its stopping condition is satisfied prior to the last training epoch. Due to the way the parameter grid is set up, no configuration above the diagonal can stop, because $b + g$ would be larger than the total number of training epochs. This permits us to compare the ‘slopes’ of cells for each measure. Ideally, each measure should consist of a dark green triangle, as this would indicate that parameter configuration stops all the time.
|
| 268 |
+
|
| 269 |
+
MNIST Please refer to Figures A.2 and A.3. The colours in the difference matrix of the top row are slightly skewed because in a certain configuration, our measure loses $0 . 8 \%$ of accuracy when stopping. However, there are many other configurations in which virtually no accuracy is lost and in which we are able to stop more than four epochs earlier. The heatmaps in the bottom row again indicate that neural persistence is capable of stopping for more parameter combinations in general. We do not trigger as often for some of them, though.
|
| 270 |
+
|
| 271 |
+
CIFAR-10 Please refer to Figure A.4. In general, we observe that this data set is more sensitive with respect to the parameters for early stopping. While there are several configurations in which neural persistence stops with an increase of almost $1 0 \%$ in accuracy, there are also scenarios in which we cannot stop training earlier, or have to train longer (up to 15 epochs out of 80 epochs in total). The second row of plots shows our measure triggers reliably for more configurations than validation loss. Overall, the scatterplot of all scenarios (Figure A.5) shows that most practical configurations are again located in $Q _ { 2 }$ and $Q _ { 3 }$ . While we may thus find certain configurations in which we reliably outperform validation loss as an early stopping criterion, we also want to point out that our measures behaves correctly for many practical configurations. Points in $Q _ { 1 }$ , where we train longer and achieve a higher accuracy, are characterized by a high patience $g$ of approximately 40 epochs and a low burn-in rate $b$ , or vice versa. This is caused by the training for CIFAR-10, which does not reliably converge for FCNs. Figure A.6 demonstrates this by showing loss curves and the mean normalized neural persistence curves of five runs over training (loss curves have been averaged over all runs; standard deviations are shown in grey; we show the first half of the training to highlight the behaviour for practical early stopping conditions). For ‘Fashion-MNIST’, we observe that NP exhibits clear change points during the training process, which can be exploited for early stopping. For ‘CIFAR- $1 0 ^ { \circ }$ , we observe a rather incremental growth for some runs (with no clearlydefined maximum), making it harder to derive a generic early stopping criterion that does not depend on fine-tuned parameters. Hence, we hypothesize that neural persistence cannot be used reliably in scenarios where the architecture is incapable of learning the data set. In the future, we plan to experiment with deliberately selected ‘bad’ and ‘good’ architectures in order to evaluate to what extent our topological measure is capable of assessing their suitability for training, but this is beyond the scope of this paper.
|
| 272 |
+
|
| 273 |
+
IMDB Please refer to Figure A.7. For this data set, we observe that most parameter configurations result in earlier stopping (up to two epochs earlier than validation loss), with accuracy increases of up to $0 . 1 0 \%$ . This is also shown in the scatterplot A.8. Only a single configuration, viz. $g = 1$ and $b = 0$ , results in a severe loss of accuracy; we removed it from the scatterplot for reasons of clarity, as its accuracy difference of $- 2 1 \%$ would skew the display of the remaining configurations too much (this is also why the legends do not include this outlier).
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure A.2: Additional visualizations for the ‘MNIST’ data set.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure A.3: Scatterplot of epoch and accuracy differences for ‘MNIST’.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure A.4: Additional visualizations for the ‘CIFAR-10’ data set.
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Figure A.5: Scatterplot of epoch and accuracy differences for ‘CIFAR-10’.
|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
Figure A.6: A comparison of mean normalized neural persistence curves that we obtain during the training of ‘CIFAR- $1 0 ^ { \circ }$ and ‘Fashion-MNIST’.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
Figure A.7: Additional visualizations for the ‘IMDB’ data set.
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
Figure A.8: Scatterplot of epoch and accuracy differences for ‘IMDB’.
|
| 295 |
+
|
| 296 |
+
# A.4 NEURAL PERSISTENCE FOR CONVOLUTIONAL LAYERS
|
| 297 |
+
|
| 298 |
+
In principle, the proposed filtration process could be applied to any bipartite graph. Hence, we can directly apply our framework to convolutional layers, provided we represent them properly. Specifically, for layer $l$ we represent the convolution of its ith input feature map $a _ { i } ^ { ( l - 1 ) } \in \overline { { \mathbb { R } ^ { h _ { \mathrm { i n } } \times w _ { \mathrm { i n } } } } }$ with the $j$ th filter $H _ { j } \in \mathbb { R } ^ { p \times q }$ as one bipartite graph $G _ { i , j }$ parametrized by a sparse weight matrix $W _ { i , j } ^ { ( l ) } \ \in \ \mathbb { R } ^ { ( h _ { \mathrm { o u t } } \cdot w _ { \mathrm { o u t } } ) \times ( h _ { \mathrm { i n } } \cdot w _ { \mathrm { i n } } ) }$ , which in each row contains the $p \cdot q$ unrolled values of $H _ { j }$ on the diagonal, with $h _ { \mathrm { i n } } \ : - \ : p$ zeros padded in between after each $p$ values of $\mathrm { v e c } ( H _ { j } )$ . This way, the flattened pre-activation can be described as $\begin{array} { r } { \mathrm { v e c } ( z _ { i , j } ^ { ( l ) } ) = W _ { i , j } ^ { ( l ) } \cdot \mathrm { v e c } ( a _ { i } ^ { ( l - 1 ) } ) + b _ { i , j } ^ { l } \cdot \mathbb { 1 } _ { ( h _ { \mathrm { o u t } } \cdot w _ { \mathrm { o u t } } ) \times 1 } . } \end{array}$
|
| 299 |
+
|
| 300 |
+
Since flattening does not change the topology of our bipartite graph, we compute the normalized neural persistence on this sparse weight matrix W (l)i,j as the unrolled analogue of the fully-connected network’s weight matrix. Averaging over all filters then gives a per-layer measure, similar to the way we derived mean normalized neural persistence in the main paper.
|
| 301 |
+
|
| 302 |
+
When studying the unrolled adjacency matrix can be approximated in a closed form. Spe $W _ { i , j } ^ { ( l ) }$ , it becolly, for es cleand that the edge filtration processinput and output neurons we $m$ $n$
|
| 303 |
+
initialize $\tau = m + n$ connected components. When using zero padding, the additional dummy input
|
| 304 |
+
neurons have to included in $m$ . For all $\tau$ tuples in the persistence diagram the creation event $c = 1$ .
|
| 305 |
+
Notably, each output neuron shares the same set of edge weights.
|
| 306 |
+
|
| 307 |
+
Due to this, the destruction events—except for a few special cases—simplify to a list of length $\tau$ containing the largest filter values (each value is contained $n$ times) in descending order until the list is filled. This simplification of neural persistence of a convolution with one filter is shown as a closed expression in Equations 7–11, and our implementation is sketched in Algorithm 3. We thus obtain
|
| 308 |
+
|
| 309 |
+
where we use
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\begin{array} { r l } & { \mathrm { N P } ( G _ { i , j } ) = \| \mathbb { 1 } - \widetilde { \mathbf { w } } \| _ { p } , } \\ & { } \\ & { \| \widetilde { \mathbf { w } } \| _ { p } \leq \left\| \left( 0 , \mathbf { w } _ { c } ^ { T } , \mathbf { w } _ { \bar { c } , \phi } ^ { T } , \mathrm { v e c } ( A _ { \phi } ) ^ { T } , \mathrm { v e c } ( B _ { \phi } ) ^ { T } \right) ^ { T } \right\| _ { p } , } \end{array}
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
with
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array} { r l } & { \quad \phi = \tau - \dim ( \mathbf { w } _ { c } ) - 1 , } \\ & { \quad A _ { x } = \mathbf { w } _ { 1 : \left\lfloor \frac { x } { n } \right\rfloor } \otimes \mathbb { 1 } _ { n - 1 } , } \\ & { \quad B _ { y } = \mathbf { w } _ { \left\lfloor \frac { y } { n } \right\rfloor + 1 } \otimes \mathbb { 1 } _ { y \mathrm { ~ m o d ~ } n } , } \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
where $\mathbf { 1 } _ { 0 } : = 0$ . Following this notation, Equation 7 expresses neural persistence of the bipartite graph $G _ { i , j }$ , with $\widetilde { \mathbf { w } }$ denoting the vector of selected weights (i.e. the destruction events) when calculating the persistence diagram. We use w to denote the flattened and sorted weight values (in descending order) of the convolutional filter $H _ { j }$ , while ${ \bf w } _ { c }$ represents the vector of all weights that are located in a corner of $H _ { j }$ , whereas $\mathbf { w } _ { \bar { c } , \phi }$ is the vector of all weights which do not originate from the corner of the filter while still belonging to the first (and thus largest) $\textstyle { \left\lfloor { \frac { \phi } { n } } \right\rfloor }$ weights in w, which we denote by w1:⌊ ϕ ⌋.
|
| 322 |
+
|
| 323 |
+
For the subsequent experiments (see below), we use a simple CNN that employs $3 2 + 2 0 4 8$ filters. Hence, by using the shortcut described above, we do not have to unroll 2080 weight matrices explicitly, thereby gaining both in memory efficiency and run time, as compared to the naive approach: on average, a naive exact computation based on unrolling required 8.77 s per convolutional filter and evaluation step, whereas the approximation only took about 0.000 38 s while showing very similar behaviour up to a constant offset.
|
| 324 |
+
|
| 325 |
+
For our experiments, we used an off-the-shelf ‘LeNet-like’ CNN model architecture (two convolutional layers each with max pooling and ReLU, 1 fully-connected and softmax) as described in Abadi et al. (2015). We trained the model on ‘Fashion-MNIST’ and included this setup in the early stopping experiments (100 runs of 20 epochs). In Figure A.9, we observe that stopping based on the neural persistence of a convolutional layer typically only incurs a considerable loss of accuracy: given a final test accuracy of $9 1 . 7 3 { \pm } 0 . 1 3 $ , stopping with this naive extension of our measure reduces accuracy by up to $4 \%$ . Furthermore, in contrast to early stopping on a fully-connected architecture, we do not observe any parameter combinations that stop early and increase accuracy. In fact, there is no configuration that results in an increased accuracy. This empirically confirms our theoretical scepticism towards naively applying our edge-focused filtration scheme to CNNs.
|
| 326 |
+
|
| 327 |
+
<table><tr><td></td><td>Algorithm 3 Approximating Neural Persistence of Convolutions per filter</td></tr><tr><td>Require: filter H ∈ RpXq; number of input and output neurons as m, n 1:T←0</td><td>>Initialize set of tuples for persistence diagram</td></tr><tr><td>2:T↑m+n,t←0,i←0 3:hmax ←maXh∈H |hl</td><td>Initialize number of tuples, tuple counter, weight index Determine largest absolute weight</td></tr><tr><td>4:H'← {|h|/hmax|h∈H}</td><td>>Transform weights for filtration</td></tr><tr><td>5:s ← sort(vec(H'))</td><td> Sort weights in descending order</td></tr><tr><td></td><td>6: H' ← {h,o,h',q-1,hp-1,o,hp-1,q-1}DDetermine the set of all corner weights of flter H'</td></tr><tr><td>7:T←(1,0),t←t+1</td><td>Add tuple for surviving component</td></tr><tr><td>8:1 forh'∈H'do T←(1,h),t←t+1</td><td>>Each corner of H'merges components</td></tr><tr><td>9: 10: end for</td><td></td></tr><tr><td></td><td></td></tr><tr><td>11: while 1 do</td><td> Create the remaining tuples (Approximation step)</td></tr><tr><td>12: n' = n-Ind(s[i] ∈H')</td><td>>if current weight is a corner weight, write one less tuple</td></tr><tr><td>13: ift+n'≤τthen</td><td>√if there are at least n' more tuples, set their merge value to s[i]</td></tr><tr><td>14:</td><td>repeat n' times</td></tr><tr><td>15:</td><td></td></tr><tr><td></td><td>T ←(1,s[i])>approximative as s[i] does not always add n' merges due to loops</td></tr><tr><td>16:</td><td>t←t+n',i←𝑖+1</td></tr><tr><td>17: else</td><td>>otherwise,process the remaining tuples similarly</td></tr><tr><td>18:</td><td></td></tr><tr><td></td><td>repeat (T - t) times</td></tr><tr><td>19:</td><td></td></tr><tr><td></td><td>T←(1,s[])</td></tr><tr><td>20:</td><td>break</td></tr><tr><td>21:</td><td></td></tr><tr><td></td><td>end if</td></tr><tr><td>22: end while</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>23:1</td><td></td></tr><tr><td> return |/Tllp</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table>
|
| 328 |
+
|
| 329 |
+
# A.5 RELATIONSHIP BETWEEN NEURAL PERSISTENCE AND VALIDATION ACCURACY
|
| 330 |
+
|
| 331 |
+
Motivated by Figure 2, which shows the different ‘regimes’ of neural persistence for a perceptron network, we investigate a possible correlation of (high) neural persistence with (high) predictive accuracy. For deeper networks, we find that neural persistence measures structural properties that arise from different parameters (such as training procedures or initializations), and no correlation can be observed.
|
| 332 |
+
|
| 333 |
+
For our experiments, we constructed neural networks with a high neural persistence prior to training. More precisely, following the theorems in this paper, we initialized most weights of each layer with very low values and reserved high values for very few weights. This was achieved by sampling the weights from a beta distribution with $\alpha = 0 . 0 0 5$ and $\beta = 0 . 5$ . Using this procedure, we are able to initialize [20,20,20] networks with $\overline { { \mathrm { N P } } } \approx 0 . 9 0 \pm 0 . 0 0 3$ compared to the same networks that have $\overline { { \mathrm { N P } } } \approx 0 . 3 \bar { 8 } \pm 0 . 0 0 \bar { 4 }$ when initialized by Xavier initialization. The mean validation accuracy of these untrained networks on the ‘Fashion-MNIST’ data set is $0 . 1 0 \pm 0 . 0 1$ and $0 . 0 9 \pm 0 . 0 3$ , respectively.
|
| 334 |
+
|
| 335 |
+
Figure A.10 depicts how both types of networks converge to similar regimes of validation accuracy, while the mean normalized neural persistence achieved at the end of the training varies. For networks initialized with high $\overline { { \mathrm { N P } } }$ (Figure A.10, left) the validation accuracy of networks with final $0 . 9 \ \leq$ $\overline { { \mathrm { N P } } } \leq 0 . 9 5$ ranges from 0.098 (not shown) to 0.863. For Xavier initialization (Figure A.10, right), the lack of correlation can also be observed. Furthermore, comparing the two plots, there are no clear advantages in initializing networks with high $\overline { { \mathrm { N P } } }$ . This observation further motivates the proposed early stopping criterion, which checks for changes in the $\overline { { \mathrm { N P } } }$ value, and considers stagnating values to be indicative of a trained network.
|
| 336 |
+
|
| 337 |
+

|
| 338 |
+
Figure A.9: Additional visualizations for the ‘Fashion-MNIST’ data set, following the preliminary examination of convolutional layers. Here, the approximated neural persistence calculation for the first convolutional layer was used. However, we also ran few runs of the same experiment using the exact method which showed the same results. Employing the second convolutional layer or both did not improve this result.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure A.10: Each cluster of points represent the last two training epochs (sampled every quarter epoch) of a [20,20,20] network trained on the ‘Fashion-MNIST’ data set. We observe no correlation between validation accuracy and normalized total persistence
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure A.11: (left) Histogram of the final normalized neural persistence of a [50, 50, 20] network for 100 runs and 25 epochs of training. (right) Normalized neural persistence after 15 epochs of training on MNIST for different architectures with increasing depth. Deeper architectures are denoted as $[ n \times 2 0 ]$ where $n$ is the number of hidden layers.
|
| 345 |
+
|
| 346 |
+
# A.6 NEURAL PERSISTENCE FOR DIFFERENT DATA DISTRIBUTIONS AND DEEPER FCN ARCHITECTURES
|
| 347 |
+
|
| 348 |
+
Neural persistence captures information about different data distributions during training. The weights tuned via backpropagation are directly influenced by the input data (as well as their labels) and neural persistence tracks those changes. To demonstrate this, we trained the same architecture , i.e. [50, 50, 20], on two data sets with the same dimensions but different properties: MNIST and ‘Fashion-MNIST’. Each data set has the same image size $2 8 \times 2 8$ pixels, one channel) but lay on different manifolds. Figure A.11 (left) shows a histogram of the mean normalized neural persistence $( \overline { { \mathrm { N P } } } )$ after 25 epochs of training over 100 different runs. The distributions have a similar shape but are shifted, indicating that the two datasets lead the network to different topological regimes.
|
| 349 |
+
|
| 350 |
+
We also investigated the effect of depth on neural persistence. We selected a fixed layer size (20 hidden units) and increased the number of hidden layers. Figure A.11 (right) depicts the boxplots of mean $\overline { { \mathrm { N P } } }$ for multiple architectures after 15 epochs of training on MNIST. Adding layers initially increases the variability of $\overline { { \mathrm { N P } } }$ by enabling the network to converge to different regimes (essentially, there are many more valid configurations in which a trained neural network might end up in). However, this effect is reduced after a certain depth: networks with deeper architectures exhibit less variability in $\overline { { \mathrm { N P } } }$ .
|
| 351 |
+
|
| 352 |
+
# A.7 EARLY STOPPING IN DATA SCARCITY SCENARIOS
|
| 353 |
+
|
| 354 |
+
Labelled data is expensive in most domains of interest, which results in small data sets or low quality of the labels. We investigate the following experimental set-ups: (1) Reducing the training data set size and (2) Permuting a fraction of the training labels. We train a fully connected network ([500, 500, 200] architecture) on ‘MNIST’ and ‘Fashion-MNIST’. In the experiments, we compare the following measures for stopping the training: i) Stopping at the optimal test accuracy. ii) Fixed stopping after the burn in period. iii) Neural persistence patience criterion. iv) Training loss patience criterion. v) Validation loss patience criterion. For a description of the patience criterion, see Algorithm 2. All measures, except validation loss, include the validation datasets $( 2 0 \% )$ in the training process to simulate a larger data set when no cross-validation is required. We report the accuracy on the non-reduced, non-permuted test sets. The batch size is 32 training instances. The stopping measures are evaluated every quarter epoch.
|
| 355 |
+
|
| 356 |
+
Figure A.12 shows the results averaged over 10 runs (the error is the standard deviation). The difference between the top and the bottom panel is the data set and the patience parameters. The $x$ -axis depicts the fraction of the data set, which is warped for better accessibility. In each panel, the left-hand side subplots depict the results of the reduced data set experiment where the right-hand side subplots depict the result of the permutation experiments. The $y$ -axis of the top subplot shows the accuracy on the non-reduced, non-permuted test set. The $y$ -axis of the bottom subplot shows when the stopping criterion was triggered.
|
| 357 |
+
|
| 358 |
+
We note the following observations, which hold for both panels: More, non-permuted data yields higher test accuracy. Also, as expected, the optimal stopping gives the highest test accuracy. The fixed early stopping results in inferior test accuracy when only a fraction of the data is available. The neural persistence based stopping is triggered late when only a fraction of the data is available which results in a slightly better test accuracy compared to training and validation loss. The training loss stopping achieves similar test accuracies compared to the persistence based stopping (for all regimes except the very small data set) with shorter training, on average. We note that, it is generally not advisable to use training loss as a measure for stopping because the stability of this criterion also depends on the batch size. When only a fraction of the data is available, the validation loss based stopping stops on average after the same number of training epochs as the training loss, which results in inferior test accuracy because the network has seen in total fewer training samples. Most strikingly, validation loss based stopping is is triggered later (sometimes never) when most training and validation labels are randomly permuted which results in overfitting and poor test accuracy.
|
| 359 |
+
|
| 360 |
+
To conclude, the neural persistence based stopping achieves good performance without being affected by the batch size and noisy labels. The authors also note that the result is consistent for multiple architectures and most patience parameters.
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
Figure A.12: On MNIST and Fashion-MNIST $\overline { { \mathrm { N P } } }$ (in blue) stops later than validation and training loss when fewer training samples are available (left-hand side) which results in a higher test accuracy. For increasing noise in the training labels (right-hand side), the stopping of $\overline { { \mathrm { N P } } }$ remains stable, in contrast to the validation loss stopping, which leads to lower test accuracy after longer training at a high fraction of permuted labels. The patience and burn in parameters are reported in quarter epochs.
|
| 364 |
+
|
| 365 |
+
<table><tr><td rowspan="10">saaarrreirerg Thit rtrer iTrile sarelieg Jrrinti Aeeeetrect</td><td> 8-01 ×[=ə'666:0= °‘60= £0000 =น</td><td>8</td><td rowspan="11">-O1 x[=96660= °g60= g g-01×[=น 28 28 IMRR</td></tr><tr><td>90=u</td><td>8-01 ×[=ə666:0= °g 6'0= 1£0000=4</td></tr><tr><td>3</td><td>W4pa 44pa</td></tr><tr><td>[001000] 40</td><td>[008'000'008] [9149871] 25</td></tr><tr><td>1</td><td>8</td></tr><tr><td></td><td></td></tr><tr><td></td><td>5</td></tr><tr><td>[TILTINI(-UTIT0)</td><td>1 CIATIIIT</td></tr><tr><td></td><td></td></tr><tr><td rowspan="9">srprsg#sanr# Jateter</td><td>W4pa [0700005] [01000000]</td></tr><tr><td>rrndeeied</td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr><td></td></tr><tr></table>
|
| 366 |
+
|
| 367 |
+
|
| 368 |
+
= 0.0003
|
| 369 |
+
10 = 0.0003
|
| 370 |
+
10
|
| 371 |
+
= 0.0003
|
| 372 |
+
10 3 40
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure A.13: Comparison of test set accuracy for trained networks without modifications (green), with batch normalization (yellow), and with $50 \%$ of the neurons dropped out during training (red) for the MNIST data set.
|
| 376 |
+
|
| 377 |
+
# A.8 TESTING ACCURACY OF DIFFERENTLY REGULARIZED MODELS
|
| 378 |
+
|
| 379 |
+
We showed in the main text that neural persistence is capable of distinguishing between networks trained with/without batch normalization and/or dropout. Figure A.13 additionally shows test set accuracies.
|
parse/train/ByxkijC5FQ/ByxkijC5FQ_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/ByxkijC5FQ/ByxkijC5FQ_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/ByxkijC5FQ/ByxkijC5FQ_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/EsA9Nr9JHvy/EsA9Nr9JHvy.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/EsA9Nr9JHvy/EsA9Nr9JHvy_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/EsA9Nr9JHvy/EsA9Nr9JHvy_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/E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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SMOOTH LOSS FUNCTIONS FOR DEEP TOP-K CLASSIFICATION
|
| 2 |
+
|
| 3 |
+
Leonard Berrada1, Andrew Zisserman1 and M. Pawan Kumar1,2
|
| 4 |
+
|
| 5 |
+
1Department of Engineering Science
|
| 6 |
+
University of Oxford
|
| 7 |
+
2Alan Turing Institute
|
| 8 |
+
{lberrada,az,pawan}@robots.ox.ac.uk
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
The top- $k$ error is a common measure of performance in machine learning and computer vision. In practice, top- $k$ classification is typically performed with deep neural networks trained with the cross-entropy loss. Theoretical results indeed suggest that cross-entropy is an optimal learning objective for such a task in the limit of infinite data. In the context of limited and noisy data however, the use of a loss function that is specifically designed for top- $k$ classification can bring significant improvements. Our empirical evidence suggests that the loss function must be smooth and have non-sparse gradients in order to work well with deep neural networks. Consequently, we introduce a family of smoothed loss functions that are suited to top- $k$ optimization via deep learning. The widely used cross-entropy is a special case of our family. Evaluating our smooth loss functions is computationally challenging: a na¨ıve algorithm would require $\mathcal { O } ( { \textstyle \binom { n } { k } } )$ operations, where $n$ is the number of classes. Thanks to a connection to polynomial algebra and a divideand-conquer approach, we provide an algorithm with a time complexity of $\mathcal { O } ( k n )$ Furthermore, we present a novel approximation to obtain fast and stable algorithms on GPUs with single floating point precision. We compare the performance of the cross-entropy loss and our margin-based losses in various regimes of noise and data size, for the predominant use case of $k = 5$ . Our investigation reveals that our loss is more robust to noise and overfitting than cross-entropy.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
In machine learning many classification tasks present inherent label confusion. The confusion can originate from a variety of factors, such as incorrect labeling, incomplete annotation, or some fundamental ambiguities that obfuscate the ground truth label even to a human expert. For example, consider the images from the ImageNet data set (Russakovsky et al., 2015) in Figure 1, which illustrate the aforementioned factors. To mitigate these issues, one may require the model to predict the $k$ most likely labels, where $k$ is typically very small compared to the total number of labels. Then the prediction is considered incorrect if all of its $k$ labels differ from the ground truth, and correct otherwise. This is commonly referred to as the top- $k$ error. Learning such models is a longstanding task in machine learning, and many loss functions for top- $k$ error have been suggested in the literature.
|
| 17 |
+
|
| 18 |
+
In the context of correctly labeled large data, deep neural networks trained with cross-entropy have shown exemplary capacity to accurately approximate the data distribution. An illustration of this phenomenon is the performance attained by deep convolutional neural networks on the ImageNet challenge. Specifically, state-of-the-art models trained with cross-entropy yield remarkable success on the top-5 error, although cross-entropy is not tailored for top-5 error minimization. This phenomenon can be explained by the fact that cross-entropy is top- $k$ calibrated for any $k$ (Lapin et al., 2016), an asymptotic property which is verified in practice in the large data setting. However, in cases where only a limited amount of data is available, learning large models with cross-entropy can be prone to over-fitting on incomplete or noisy labels.
|
| 19 |
+
|
| 20 |
+
To alleviate the deficiency of cross-entropy, we present a new family of top- $k$ classification loss functions for deep neural networks. Taking inspiration from multi-class SVMs, our loss creates a margin between the correct top- $k$ predictions and the incorrect ones. Our empirical results show that traditional top- $k$ loss functions do not perform well in combination with deep neural networks. We believe that the reason for this is the lack of smoothness and the sparsity of the derivatives that are used in backpropagation. In order to overcome this difficulty, we smooth the loss with a temperature parameter. The evaluation of the smooth function and its gradient is challenging, as smoothing increases the na¨ıve time complexity from ${ \mathcal { O } } ( n )$ to $\mathcal { O } ( { \textstyle \binom { n } { k } } )$ . With a connection to polynomial algebra and a divide-and-conquer method, we present an algorithm with $\mathcal { O } ( k n )$ time complexity and training time comparable to cross-entropy in practice. We provide insights for numerical stability of the forward pass. To deal with instabilities of the backward pass, we derive a novel approximation. Our investigation reveals that our top- $k$ loss outperforms cross-entropy in the presence of noisy labels or in the absence of large amounts of data. We further confirm that the difference of performance reduces with large correctly labeled data, which is consistent with known theoretical results.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: Examples of images with label confusion, from the validation set of ImageNet. The top-left image is incorrectly labeled as “red panda”, instead of “giant panda”. The bottom-left image is labeled as “strawberry”, although the categories “apple”, “banana” and “pineapple” would be other valid labels. The center image is labeled as “indigo bunting”, which is only valid for the lower bird of the image. The right-most image is labeled as a cocktail shaker, yet could arguably be a part of a music instrument (for example with label “cornet, horn, trumpet, trump”). Such examples motivate the need to predict more than a single label per image.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
Top- $k$ Loss Functions. The majority of the work on top- $k$ loss functions has been applied to shallow models: Lapin et al. (2016) suggest a convex surrogate on the top- $k$ loss; Fan et al. (2017) select the $k$ largest individual losses in order to be robust to data outliers; Chang et al. (2017) formulate a truncated re-weighted top- $k$ loss as a difference-of-convex objective and optimize it with the Concave-Convex Procedure (Yuille & Rangarajan, 2002); and Yan et al. (2017) propose to use a combination of top- $k$ classifiers and to fuse their outputs.
|
| 28 |
+
|
| 29 |
+
Closest to our work is the extensive review of top- $k$ loss functions for computer vision by Lapin et al. (2017). The authors conduct a study of a number of top- $k$ loss functions derived from cross-entropy and hinge losses. Interestingly, they prove that for any $k$ , cross-entropy is top- $k$ calibrated, which is a necessary condition for the classifier to be consistent with regard to the theoretically optimal top- $k$ risk. In other words, cross-entropy satisfies an essential property to perform the optimal top- $k$ classification decision for any $k$ in the limit of infinite data. This may explain why cross-entropy performs well on top-5 error on large scale data sets. While thorough, the experiments are conducted on linear models, or pre-trained deep networks that are fine-tuned. For a more complete analysis, we wish to design loss functions that allow for the training of deep neural networks from a random initialization.
|
| 30 |
+
|
| 31 |
+
Smoothing. Smoothing is a helpful technique in optimization (Beck & Teboulle, 2012). In work closely related to ours, Lee & Mangasarian (2001) show that smoothing a binary SVM with a temperature parameter improves the theoretical convergence speed of their algorithm. Schwing et al. (2012) use a temperature parameter to smooth latent variables for structured prediction. Lapin et al. (2017) apply Moreau-Yosida regularization to smooth their top- $k$ surrogate losses.
|
| 32 |
+
|
| 33 |
+
Smoothing has also been applied in the context of deep neural networks. In particular, Zheng et al. (2015) and Clevert et al. (2016) both suggest modifying the non-smooth ReLU activation to improve the training. Gulcehre et al. (2017) suggest to introduce “mollifyers” to smooth the objective function by gradually increasing the difficulty of the optimization problem. Chaudhari et al. (2017) add a local entropy term to the loss to promote solutions with high local entropy. These smoothing techniques are used to speed up the optimization or improve generalization. In this work, we show that smoothing is necessary for the neural network to perform well in combination with our loss function. We hope that this insight can also help the design of losses for tasks other than top- $k$ error minimization.
|
| 34 |
+
|
| 35 |
+
# 3 TOP-K SVM
|
| 36 |
+
|
| 37 |
+
# 3.1 BACKGROUND: MULTI-CLASS SVM
|
| 38 |
+
|
| 39 |
+
In order to build an intuition about top- $k$ losses, we start with the simple case of $k = 1$ , namely multi-class classification, where the output space is defined as $\mathcal { Y } = \{ 1 , . . . , n \}$ . We suppose that a vector of scores per label $\mathbf { s } \in \mathbb { R } ^ { n }$ , and a ground truth label $y \in \mathcal { V }$ are both given. The vector s is the output of the model we wish to learn, for example a linear model or a deep neural network. The notation $\mathbb { 1 }$ will refer to the indicator function over Boolean statements (1 if true, 0 if false).
|
| 40 |
+
|
| 41 |
+
Prediction. The prediction is given by any index with maximal score:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
P ( \mathbf { s } ) \in \mathrm { a r g m a x } \mathbf { s } .
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Loss. The classification loss incurs a binary penalty by comparing the prediction to the ground truth label. Plugging in equation (1), this can also be written in terms of scores s as follows:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\Lambda ( \mathbf { s } , y ) \triangleq \mathbb { 1 } ( y \neq P ( \mathbf { s } ) ) = \mathbb { 1 } ( \operatorname* { m a x } _ { j \in \mathcal { Y } } s _ { j } > s _ { y } ) .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Surrogate. The loss in equation (2) is not amenable to optimization, as it is not even continuous in s. To overcome this difficulty, a typical approach in machine learning is to resort to a surrogate loss that provides a continuous upper bound on $\Lambda$ . Crammer & Singer (2001) suggest the following upper bound on the loss, known as the multi-class SVM loss:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
l ( \mathbf { s } , y ) = \operatorname* { m a x } \left\{ \operatorname* { m a x } _ { j \in \mathcal { V } \backslash \{ y \} } \left\{ s _ { j } + 1 \right\} - s _ { y } , 0 \right\} .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
In other words, the surrogate loss is zero if the ground truth score is higher than all other scores by a margin of at least one. Otherwise it incurs a penalty which is linear in the difference between the score of the ground truth and the highest score over all other classes.
|
| 60 |
+
|
| 61 |
+
Rescaling. Note that the value of 1 as a margin is an arbitrary choice, and can be changed to $\alpha$ for any $\alpha > 0$ . This simply entails that we consider the cost $\Lambda$ of a misclassification to be $\alpha$ instead of 1. Moreover, we show in Proposition 8 of Appendix D.2 how the choices of $\alpha$ and of the quadratic regularization hyper-parameter are interchangeable.
|
| 62 |
+
|
| 63 |
+
# 3.2 TOP-K CLASSIFICATION
|
| 64 |
+
|
| 65 |
+
We now generalize the above framework to top- $k$ classification, where $k \in \{ 1 , . . . , n - 1 \}$ . We use the following notation: for $p \in \{ 1 , . . . , n \}$ , $^ S [ p ]$ refers to the $p$ -th largest element of s, and ${ \mathbf { s } } _ { \backslash p }$ to the vector $( s _ { 1 } , . . . , s _ { p - 1 } , s _ { p + 1 } , . . . , s _ { n } ) \in \mathbb { R } ^ { n - 1 }$ (that is, the vector s with the $p$ -th element omitted). The term $\mathcal { V } ^ { ( k ) }$ denotes the set of $k$ -tuples with $k$ distinct elements of $\mathcal { V }$ . Note that we use a bold font for a tuple $\bar { \mathbf { y } } \in \mathcal { V } ^ { ( k ) }$ in order to distinguish it from a single label $\bar { y } \in \mathcal { V }$ .
|
| 66 |
+
|
| 67 |
+
Prediction. Given the scores $\mathbf { s } \in \mathbb { R } ^ { n }$ , the top- $k$ prediction consists of any set of labels corresponding to the $k$ largest scores:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
P _ { k } ( \mathbf { s } ) \in \left\{ \bar { \mathbf { y } } \in \mathcal { y } ^ { ( k ) } : \forall i \in \{ 1 , . . , k \} , s _ { \bar { y } _ { i } } \geq s _ { [ k ] } \right\} .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
Loss. The loss depends on whether $y$ is part of the top- $k$ prediction, which is equivalent to comparing the $k$ -largest score with the ground truth score:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\Lambda _ { k } ( \mathbf { s } , y ) \triangleq \mathbb { 1 } ( y \notin P _ { k } ( \mathbf { s } ) ) = \mathbb { 1 } ( s _ { [ k ] } > s _ { y } ) .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Again, such a binary loss is not suitable for optimization. Thus we introduce a surrogate loss.
|
| 80 |
+
|
| 81 |
+
Surrogate. As pointed out in Lapin et al. (2015), there is a natural extension of the previous multi-class case:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
l _ { k } ( { \bf s } , y ) \triangleq \operatorname* { m a x } \left\{ \left( { \bf s } _ { \backslash y } + { \bf 1 } \right) _ { [ k ] } - s _ { y } , 0 \right\} .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
This loss creates a margin between the ground truth and the $k$ -th largest score, irrespectively of the values of the $\left( k - 1 \right)$ -largest scores. Note that we retrieve the formulation of Crammer & Singer (2001) for $k = 1$ .
|
| 88 |
+
|
| 89 |
+
Difficulty of the Optimization. The surrogate loss $l _ { k }$ of equation (6) suffers from two disadvantages that make it difficult to optimize: (i) it is not a smooth function of s – it is continuous but not differentiable – and (ii) its weak derivatives have at most two non-zero elements. Indeed at most two elements of s are retained by the $( \cdot ) _ { [ k ] }$ and max operators in equation (6). All others are discarded and thus get zero derivatives. When $\bar { l _ { k } }$ is coupled with a deep neural network, the model typically yields poor performance, even on the training set. Similar difficulties to optimizing a piecewise linear loss have also been reported by Li et al. (2017) in the context of multi-label classification. We illustrate this in the next section.
|
| 90 |
+
|
| 91 |
+
We postulate that the difficulty of the optimization explains why there has been little work exploring the use of SVM losses in deep learning (even in the case $k = 1$ ), and that this work may help remedy it. We propose a smoothing that alleviates both issues (i) and (ii), and we present experimental evidence that the smooth surrogate loss offers better performance in practice.
|
| 92 |
+
|
| 93 |
+
# 3.3 SMOOTH SURROGATE LOSS
|
| 94 |
+
|
| 95 |
+
Reformulation. We introduce the following notation: given a label $\bar { y } \in \mathcal { V } , \mathcal { V } _ { \bar { y } } ^ { ( k ) }$ is the subset of tuples from $\mathcal { V } ^ { ( k ) }$ that include $\bar { y }$ as one of their elements. For $\bar { \mathbf { y } } \in \mathcal { V } ^ { ( k ) }$ and $y \in \mathcal { V }$ , we further define $\Delta _ { k } ( \bar { \mathbf { y } } , y ) \triangleq \mathbb { 1 } ( y \notin \bar { \mathbf { y } } )$ . Then, by adding and subtracting the $k - 1$ largest scores of ${ \mathbf { s } } _ { \backslash y }$ as well as $s _ { y }$ we obtain:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\begin{array} { l } { l _ { k } ( { \bf s } , y ) = \operatorname* { m a x } \left\{ \left( { \bf s } _ { \backslash y } + { \bf 1 } \right) _ { [ k ] } - s _ { y } , 0 \right\} , } \\ { = \displaystyle \operatorname* { m a x } _ { { \bar { \bf y } } \in \mathcal { Y } ^ { ( k ) } } \left\{ \Delta _ { k } ( { \bar { \bf y } } , y ) + \sum _ { j \in \bar { \bf y } } s _ { j } \right\} - \displaystyle \operatorname* { m a x } _ { { \bar { \bf y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \left\{ \sum _ { j \in \bar { \bf y } } s _ { j } \right\} . } \end{array}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
We give a more detailed proof of this in Appendix A.1. Since the margin can be rescaled without loss of generality, we rewrite $l _ { k }$ as:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
l _ { k } ( { \bf s } , y ) = \operatorname* { m a x } _ { \bar { \bf y } \in \mathcal { Y } ^ { ( k ) } } \left\{ \Delta _ { k } ( \bar { \bf y } , y ) + \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right\} - \operatorname* { m a x } _ { \bar { \bf y } \in \mathcal { Y } _ { y } ^ { ( k ) } } \left\{ \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right\} .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Smoothing. In the form of equation (8), the loss function can be smoothed with a temperature parameter $\tau > 0$ :
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\underline { { \hat { c } } } _ { k , \tau } ( \mathbf { s } , y ) = \tau \log \Bigg [ \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } ^ { ( k ) } } \exp \left( \frac { 1 } { \tau } \Big ( \Delta _ { k } ( \bar { \mathbf { y } } , y ) + \frac { 1 } { k } \sum _ { j \in \bar { \mathbf { y } } } s _ { j } \Big ) \right) \Bigg ] - \tau \log \Bigg [ \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \exp \Big ( \frac { 1 } { k \tau } \sum _ { j \in \bar { \mathbf { y } } } s _ { j } \Big ) \Bigg ] .
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
Note that we have changed the notation to use $L _ { k , \tau }$ to refer to the smooth loss. In what follows, we first outline the properties of $L _ { k , \tau }$ and its relationship with cross-entropy. Then we show the empirical advantage of $L _ { k , \tau }$ over its non-smooth counter-part $l _ { k }$ .
|
| 114 |
+
|
| 115 |
+
Properties of the Smooth Loss. The smooth loss $L _ { k , \tau }$ has a few interesting properties. First, for any $\tau > 0$ , $L _ { k , \tau }$ is infinitely differentiable and has non-sparse gradients. Second, under mild conditions, when $\tau \to 0 ^ { + }$ , the non-maximal terms become negligible, therefore the summations collapse to maximizations and $L _ { k , \tau } \to l _ { k }$ in a pointwise sense (Proposition 2 in Appendix A.2). Third, $L _ { k , \tau }$ is an upper bound on $l _ { k }$ if and only if $k = 1$ (Proposition 3 in Appendix A.3), but $L _ { k , \tau }$ is, up to a scaling factor, an upper bound on $\Lambda _ { k }$ (Proposition 4 in Appendix A.4). This makes it a valid surrogate loss for the minimization of $\Lambda _ { k }$ .
|
| 116 |
+
|
| 117 |
+
Relationship with Cross-Entropy. We have previously seen that the margin can be rescaled by a factor of $\alpha > 0$ . In particular, if we scale $\Delta$ by $\alpha 0 ^ { + }$ and choose a temperature $\tau = 1$ , it can be seen that $L _ { 1 , 1 }$ becomes exactly the cross-entropy loss for classification. In that sense, $L _ { k , \tau }$ is a generalization of the cross-entropy loss to: (i) different values of $k \geq 1$ , (ii) different values of temperature and (iii) higher margins with the scaling $\alpha$ of $\Delta$ . For simplicity purposes, we will keep $\alpha = 1$ in this work.
|
| 118 |
+
|
| 119 |
+
Experimental Validation. In order to show how smoothing helps the training, we train a DenseNet 40-12 on CIFAR-100 from Huang et al. (2017) with the same hyper-parameters and learning rate schedule. The only difference with Huang et al. (2017) is that we replace the cross-entropy loss with $L _ { 5 , \tau }$ for different values of $\tau$ . We plot the top-5 training error in Figure 2a (for each curve, the value of $\tau$ is held constant during training):
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
|
| 123 |
+
(a) Top-5 training error for different values of τ . The dashed line $y = 0 . 9 5$ represents the base error for random predictions. The successive drops in the curves correspond to the decreases of the learning rate at epochs 150 and 225.
|
| 124 |
+
|
| 125 |
+
(b) Proportion of non (numerically) zero elements in the loss derivatives for different values of $\tau$ . These values are obtained with the initial random weights of the neural network, and are averaged over the training set.
|
| 126 |
+
|
| 127 |
+
Figure 2: Influence of the temperature τ on the learning of a DenseNet 40-12 on CIFAR-100. We confirm that smoothing helps the training of a neural network in Figure 2a, where a large enough value of $\tau$ greatly helps the performance on the training set. In Figure 2b, we observe that such high temperatures yield gradients that are not sparse. In other words, with a high temperature, the gradient is informative about a greater number of labels, which helps the training of the model.
|
| 128 |
+
|
| 129 |
+
We remark that the network exhibits good accuracy when $\tau$ is high enough (0.01 or larger). For $\tau$ too small, the model fails to converge to a good critical point. When $\tau$ is positive but small, the function is smooth but the gradients are numerically sparse (see Figure 2b), which suggests that the smoothness property is not sufficient and that non-sparsity is a key factor here.
|
| 130 |
+
|
| 131 |
+
# 4 COMPUTATIONAL CHALLENGES AND EFFICIENT ALGORITHMS
|
| 132 |
+
|
| 133 |
+
# 4.1 CHALLENGE
|
| 134 |
+
|
| 135 |
+
Experimental evidence suggests that it is beneficial to use $L _ { k , \tau }$ rather than $l _ { k }$ to train a neural network. However, at first glance, $L _ { k , \tau }$ may appear prohibitively expensive to compute. Specifically, there are summations over $\mathcal { V } ^ { ( k ) }$ and ${ \mathcal { V } } _ { y } ^ { ( k ) }$ , which have a cardinality of $\binom { n } { k }$ and $\binom { n } { k - 1 }$ respectively. For instance for ImageNet, we have $k = 5$ and $n = 1 , 0 0 0$ , which amounts to $\binom { n } { k } \simeq 8 . 1 0 ^ { 1 2 }$ terms to compute and sum over for each single sample, thereby making the approach practically infeasible. This is in stark contrast with $l _ { k }$ , for which the most expensive operation is to compute the $k$ -th largest score of an array of size $n$ , which can be done in ${ \mathcal { O } } ( n )$ . To overcome this computational challenge, we will now reframe the problem and reveal its exploitable structure.
|
| 136 |
+
|
| 137 |
+
For a vector $\mathbf { e } \in \mathbb { R } ^ { n }$ and $i \in \{ 1 , . . , n \}$ , we define $\sigma _ { i } ( \mathbf { e } )$ as the sum of all products of $i$ distinct elements of e. Explicitly, $\sigma _ { i } ( \mathbf { e } )$ can be written as $\begin{array} { r } { \sigma _ { i } ( \mathbf { e } ) = \sum _ { 1 \leq j _ { 1 } < . . . < j _ { i } \leq n } \bar { e _ { j _ { 1 } } } . . . e _ { j _ { i } } } \end{array}$ . The terms $\sigma _ { i }$ are known as the elementary symmetric polynomials. We further define $\sigma _ { 0 } ( \mathbf { e } ) = 1$ for convenience.
|
| 138 |
+
|
| 139 |
+
We now re-write $L _ { k , \tau }$ using the elementary symmetric polynomials, which appear naturally when separating the terms that contain the ground truth from the ones that do not:
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array} { r l } { T _ { k , l ; c _ { l } } ( \mathbf { s } , y , y ) = \tau \log \Bigg [ \displaystyle \sum _ { y \in S _ { l } } \mathrm { e x p } ( \Delta _ { x } ( \bar { y } , y ) / \tau ) \prod _ { x \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) \Bigg ] } & { \mathrm { ~ f r o s t ~ } ( s _ { y } / k \tau ) \Bigg ] } \\ & { \quad \quad - \tau \log \Bigg [ \displaystyle \sum _ { y \in S _ { l } } \prod _ { x \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) \Bigg ] , } \\ & { = \tau \log \Bigg [ \displaystyle \sum _ { y \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) + \exp ( \mathrm { i } / \tau ) \displaystyle \sum _ { y \in S _ { l } } \prod _ { x \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) \Bigg ] } \\ & { \quad \quad - \tau \log \Bigg [ \displaystyle \sum _ { y \in S _ { l } } \mathrm { e x p } ( \sum _ { y \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) + \exp ( \mathrm { i } / \tau ) \displaystyle \sum _ { y \in S _ { l } \backslash \{ x \} _ { y } ^ { \infty } \land \neq y } \prod _ { x \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) ] } \\ & { \quad \quad \quad - \tau \log \Bigg [ \displaystyle \sum _ { y \in S _ { l } } \mathrm { e x p } ( s _ { y } / k \tau ) \Big ] , } \\ & { = \tau \log \Bigg [ \exp ( \delta _ { y } ( \mathcal { M } _ { y } / \tau ) \sigma _ { k - i } ( \mathrm { e x p } ( s _ { y } / k \tau ) ) + \exp ( \mathrm { i } / \tau ) \sigma _ { k } \Big ( \exp \{ \mathrm { e x p } ( s _ { y } / k \tau ) \} \Big ] } \\ & { \quad \quad \quad - \tau \log \Bigg [ \exp ( \mathrm { e x p } \{ \mathrm { e x p } / \mathrm { e x p } / \mathrm { e x p } / k \tau \} ) \Big ] . } \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Note that the application of exp to vectors is meant in an element-wise fashion. The last equality of equation (10) reveals that the challenge is to efficiently compute $\sigma _ { k - 1 }$ and $\sigma _ { k }$ , and their derivatives for the optimization.
|
| 146 |
+
|
| 147 |
+
While there are existing algorithms to evaluate the elementary symmetric polynomials, they have been designed for computations on CPU with double floating point precision. For the most recent work, see Jiang et al. (2016). To efficiently train deep neural networks with $L _ { k , \tau }$ , we need algorithms that are numerically stable with single floating point precision and that exploit GPU parallelization. In the next sections, we design algorithms that meet these requirements. The final performance is compared to the standard alternative algorithm in Appendix B.3.
|
| 148 |
+
|
| 149 |
+
# 4.2 FORWARD COMPUTATION
|
| 150 |
+
|
| 151 |
+
We consider the general problem of efficiently computing $( \sigma _ { k - 1 } , \sigma _ { k } )$ . Our goal is to compute $\sigma _ { k } ( \mathbf { e } )$ , where $\mathbf { e } \in \mathbb { R } ^ { n }$ and $k \ll n$ . Since this algorithm will be applied to $\mathbf { e } = \exp ( \mathbf { s } _ { \backslash y } / k \tau )$ (see equation (10)), we can safely assume $e _ { i } \neq 0$ for all $i \in [ [ 1 , n ] ]$ .
|
| 152 |
+
|
| 153 |
+
The main insight of our approach is the connection of $\sigma _ { i } ( \mathbf { e } )$ to the polynomial:
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
P \triangleq ( X + e _ { 1 } ) ( X + e _ { 2 } ) . . . ( X + e _ { n } ) .
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
Indeed, if we expand $P$ to $\alpha _ { 0 } + \alpha _ { 1 } X + \ldots + \alpha _ { n } X ^ { n }$ , Vieta’s formula gives the relationship:
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\forall i \in [ [ 0 , n ] ] , \quad \alpha _ { i } = \sigma _ { n - i } ( \mathbf { e } ) .
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
Therefore, it suffices to compute the coefficients $\alpha _ { n - k }$ to obtain the value of $\sigma _ { k } ( \mathbf { e } )$ . To compute the expansion of $P$ , we can use a divide-and-conquer approach with polynomial multiplications when merging two branches of the recursion.
|
| 166 |
+
|
| 167 |
+
This method computes all $( \sigma _ { i } ) _ { 1 \leq i \leq n }$ instead of the only $( \sigma _ { i } ) _ { k - 1 \leq i \leq k }$ that we require. Since we do not need $\sigma _ { i } ( \mathbf { e } )$ for $i > k$ , we can avoid computations of all coefficients for a degree higher than $n - k$ . However, typically $k \ll n$ . For example, in ImageNet, we have $k = 5$ and $n = 1 , 0 0 0$ , therefore we have to compute coefficients up to a degree 995 instead of 1,000, which is a negligible improvement. To turn $k \ll n$ to our advantage, we notice that $\sigma _ { i } ( \mathbf { e } ) = \sigma _ { n } ( \mathbf { e } ) \sigma _ { n - i } ( 1 / \mathbf { e } )$ . Moreover, $\sigma _ { n } ( \mathbf { e } ) = \prod _ { i = 1 } ^ { n } e _ { i }$ can be computed in ${ \mathcal { O } } ( n )$ . Therefore we introduce the polynomial:
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
Q \triangleq \sigma _ { n } ( \mathbf { e } ) ( X + { \frac { 1 } { e _ { 1 } } } ) ( X + { \frac { 1 } { e _ { 2 } } } ) \ldots ( X + { \frac { 1 } { e _ { n } } } ) .
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
Then if we expand $Q$ to $\beta _ { 0 } + \beta _ { 1 } X + . . . + \beta _ { n } X ^ { n }$ , we obtain with Vieta’s formula again:
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\forall i \in [ [ 0 , n ] ] , \quad \beta _ { i } = \sigma _ { n } ( \mathbf { e } ) \sigma _ { n - i } ( 1 / \mathbf { e } ) = \sigma _ { i } ( \mathbf { e } ) .
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
Subsequently, in order to compute $\sigma _ { k } ( \mathbf { e } )$ , we only require the $k$ first coefficients of $Q$ , which is very efficient when $k$ is small in comparison with $n$ . This results in a time complexity of $\mathcal { O } ( k n )$ (Proposition 5 in Appendix B.1). Moreover, there are only ${ \mathcal { O } } ( \log ( n ) )$ levels of recursion, and since every level can have its operations parallelized, the resulting algorithm scales very well with $n$ when implemented on a GPU (see Appendix B.3.2 for practical runtimes).
|
| 180 |
+
|
| 181 |
+
The algorithm is described in Algorithm 1: step 2 initializes the polynomials for the divide and conquer method. While the polynomial has not been fully expanded, steps 5-6 merge branches by performing the polynomial multiplications (which can be done in parallel). Step 10 adjusts the coefficients using equation (14). We point out that we could obtain an algorithm with a time complexity of $\mathcal { O } ( n \log ( \bar { k } ) ^ { 2 } )$ if we were using Fast Fourier Transform for polynomial multiplications in steps 5-6. Since we are interested in the case where $k$ is small (typically 5), such an improvement is negligible.
|
| 182 |
+
|
| 183 |
+
# Algorithm 1 Forward Pass
|
| 184 |
+
|
| 185 |
+
Require: $\mathbf { e } \in ( \mathbb { R } _ { + } ^ { * } ) ^ { n }$ , $k \in \mathbb { N } ^ { * }$
|
| 186 |
+
|
| 187 |
+
1: $t \gets 0$
|
| 188 |
+
2: $P _ { i } ^ { ( t ) } \gets ( 1 , 1 / e _ { i } )$ for $i \in [ [ 1 , n ] ]$ . Initialize $n$ polynomials to $\textstyle X + { \frac { 1 } { e _ { i } } }$ (encoded by coefficients)
|
| 189 |
+
3: $p \gets n$ . Number of polynomials
|
| 190 |
+
4: while $p > 1$ do . Merge branches with polynomial multiplications
|
| 191 |
+
5: $P _ { 1 } ^ { ( t + 1 ) } P _ { 1 } ^ { ( t ) } * P _ { 2 } ^ { ( t ) }$ . Polynomial multiplication up to degree $k$
|
| 192 |
+
6: ... $\begin{array} { l } { P _ { ( p - 1 ) / / 2 } ^ { ( t + 1 ) } P _ { p - 1 } ^ { ( t ) } * P _ { p } ^ { ( t ) } } \\ { t t + 1 } \\ { p ( p - 1 ) / / 2 } \end{array}$ . Polynomial multiplication up to degree $k$
|
| 193 |
+
7:
|
| 194 |
+
8: . Update number of polynomials
|
| 195 |
+
9: end while
|
| 196 |
+
$\begin{array} { l } { { \displaystyle 1 0 \colon P ^ { ( t + 1 ) } \gets P ^ { ( t ) } \times \prod _ { i = 1 } ^ { n } e _ { i } } } \\ { { \displaystyle 1 1 \colon \mathbf { r e t u r n } P ^ { ( t + 1 ) } } } \end{array}$ $\triangleright { \mathrm { R e c o v e r } } \sigma _ { i } ( { \mathbf { e } } ) = \sigma _ { n - i } ( 1 / { \mathbf { e } } ) \sigma _ { n } ( { \mathbf { e } } )$
|
| 197 |
+
|
| 198 |
+
Obtaining numerical stability in single floating point precision requires special attention: the use of exponentials with an arbitrarily small temperature parameter is fundamentally unstable. In Appendix B.2.1, we describe how operating in the log-space and using the log-sum-exp trick alleviates this issue. The stability of the resulting algorithm is empirically verified in Appendix B.3.3.
|
| 199 |
+
|
| 200 |
+
# 4.3 BACKWARD COMPUTATION
|
| 201 |
+
|
| 202 |
+
A side effect of using Algorithm 1 is that a large number of buffers are allocated for automatic differentiation: for each addition in log-space, we apply log and exp operations, each of which needs to store values for the backward pass. This results in a significant amount of time spent on memory allocations, which become the time bottleneck. To avoid this, we exploit the structure of the problem and design a backward algorithm that relies on the results of the forward pass. By avoiding the memory allocations and considerably reducing the number of operations, the backward pass is then sped up by one to two orders of magnitude and becomes negligible in comparison to the forward pass. We describe our efficient backward pass in more details below.
|
| 203 |
+
|
| 204 |
+
First, we introduce the notation for derivatives:
|
| 205 |
+
|
| 206 |
+
$$
|
| 207 |
+
\mathrm { F o r } i \in [ [ 1 , n ] ] , 1 \leq j \leq k , \quad \delta _ { j , i } \triangleq \frac { \partial \sigma _ { j } ( \mathbf { e } ) } { \partial e _ { i } } .
|
| 208 |
+
$$
|
| 209 |
+
|
| 210 |
+
We now observe that:
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
\delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } _ { \backslash i } ) .
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
In other words, equation (16) states that $\delta _ { j , i }$ , the derivative of $\sigma _ { j } ( \mathbf { e } )$ with respect to $e _ { i }$ , is the sum of product of all $( j - 1 )$ -tuples that do not include $e _ { i }$ . One way of obtaining $\sigma _ { j - 1 } ( \mathbf { e } _ { \backslash i } )$ is to compute a forward pass for ${ \mathbf { e } } _ { \backslash i }$ , which we would need to do for every $i \in [ [ 1 , n ] ]$ . To avoid such expensive computations, we remark that $\sigma _ { j } ( \mathbf { e } )$ can be split into two terms: the ones that contain $e _ { i }$ (which can expressed as $e _ { i } \sigma _ { j - 1 } ( \mathbf { e } _ { \backslash i } ) )$ and the ones that do not (which are equal to $\sigma _ { j } ( \mathbf { e } _ { \backslash i } )$ by definition). This gives the following relationship:
|
| 217 |
+
|
| 218 |
+
$$
|
| 219 |
+
\sigma _ { j } ( \mathbf { e } _ { \backslash i } ) = \sigma _ { j } ( \mathbf { e } ) - e _ { i } \sigma _ { j - 1 } ( \mathbf { e } _ { \backslash i } ) .
|
| 220 |
+
$$
|
| 221 |
+
|
| 222 |
+
Simplifying equation (17) using equation (16), we obtain the following recursive relationship:
|
| 223 |
+
|
| 224 |
+
$$
|
| 225 |
+
\delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } ) - e _ { i } \delta _ { j - 1 , i } .
|
| 226 |
+
$$
|
| 227 |
+
|
| 228 |
+
Since the $( \sigma _ { j } ( \mathbf { e } ) ) _ { 1 \leq i \leq k }$ have been computed during the forward pass, we can initialize the induction with $\delta _ { 1 , i } = \mathrm { 1 }$ and iteratively compute the derivatives $\delta _ { j , i }$ for $j \geq 2$ with equation (18). This is summarized in Algorithm 2.
|
| 229 |
+
|
| 230 |
+
# Algorithm 2 Backward Pass
|
| 231 |
+
|
| 232 |
+
Require: e, $( \sigma _ { j } ( \mathbf { e } ) ) _ { 1 \leq j \leq k }$ , k ∈ N ∗ . (σj(e))1≤j≤k have been computed in the forward pass
|
| 233 |
+
1: $\delta _ { 1 , i } = 1$ for $i \in [ [ 1 , n ] ]$
|
| 234 |
+
2: for $j \in [ [ 1 , k ] ]$ J do
|
| 235 |
+
3: $\delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } ) - e _ { i } \delta _ { j - 1 , i }$ for $i \in [ [ 1 , n ] ]$
|
| 236 |
+
4: end for
|
| 237 |
+
|
| 238 |
+
Algorithm 2 is subject to numerical instabilities (Observation 1 in Appendix B.2.2). In order to avoid these, one solution is to use equation (16) for each unstable element, which requires numerous forward passes. To avoid this inefficiency, we provide a novel approximation in Appendix B.2.2: the computation can be stabilized by an approximation with significantly smaller overhead.
|
| 239 |
+
|
| 240 |
+
# 5 EXPERIMENTS
|
| 241 |
+
|
| 242 |
+
Theoretical results suggest that Cross-Entropy (CE) is an optimal classifier in the limit of infinite data, by accurately approximating the data distribution. In practice, the presence of label noise makes the data distribution more complex to estimate when only a finite number of samples is available. For these reasons, we explore the behavior of CE and $L _ { k , \tau }$ when varying the amount of label noise and the training data size. For the former, we introduce label noise in the CIFAR-100 data set (Krizhevsky, 2009) in a manner that would not perturb the top-5 error of a perfect classifier. For the latter, we vary the training data size on subsets of the ImageNet data set (Russakovsky et al., 2015).
|
| 243 |
+
|
| 244 |
+
In all the following experiments, the temperature parameter is fixed throughout training. This choice is discussed in Appendix D.1. The algorithms are implemented in Pytorch (Paszke et al., 2017) and are publicly available at https://github.com/oval-group/smooth-topk. Experiments on CIFAR-100 and ImageNet are performed on respectively one and two Nvidia Titan Xp cards.
|
| 245 |
+
|
| 246 |
+
# 5.1 CIFAR-100 WITH NOISE
|
| 247 |
+
|
| 248 |
+
Data set. In this experiment, we investigate the impact of label noise on CE and $L _ { 5 , 1 }$ . The CIFAR100 data set contains 60,000 RGB images, with 50,000 samples for training-validation and 10,000 for testing. There are 20 “coarse” classes, each consisting of 5 “fine” labels. For example, the coarse class “people” is made up of the five fine labels “baby”, “boy”, “girl”, “man” and “woman”. In this set of experiments, the images are centered and normalized channel-wise before they are fed to the network. We use the standard data augmentation technique with random horizontal flips and random crops of size $3 2 \times 3 2$ on the images padded with 4 pixels on each side.
|
| 249 |
+
|
| 250 |
+
We introduce noise in the labels as follows: with probability $p$ , each fine label is replaced by a fine label from the same coarse class. This new label is chosen at random and may be identical to the original label. Note that all instances generated by data augmentation from a single image are assigned the same label. The case $p = 0$ corresponds to the original data set without noise, and $p = 1$ to the case where the label is completely random (within the fine labels of the coarse class). With this method, a perfect top-5 classifier would still be able to achieve $100 \%$ accuracy by systematically predicting the five fine labels of the unperturbed coarse label.
|
| 251 |
+
|
| 252 |
+
Methods. To evaluate our loss functions, we use the architecture DenseNet 40-40 from Huang et al. (2017), and we use the same hyper-parameters and learning rate schedule as in Huang et al. (2017). The temperature parameter is fixed to one. When the level of noise becomes non-negligible, we empirically find that CE suffers from over-fitting and significantly benefits from early stopping – which our loss does not need. Therefore we help the baseline and hold out a validation set of 5,000 images, on which we monitor the accuracy across epochs. Then we use the model with the best top-5 validation accuracy and report its performance on the test set. Results are averaged over three runs with different random seeds.
|
| 253 |
+
|
| 254 |
+
Table 1: Testing performance on CIFAR-100 with different levels of label noise. With noisy labels, $L _ { 5 , 1 }$ consistently outperforms CE on both top-5 and top-1 accuracies, with improvements increasingly significant with the level of noise. For reference, a model making random predictions would obtain $1 \%$ top-1 accuracy and $5 \%$ top-5 accuracy.
|
| 255 |
+
|
| 256 |
+
<table><tr><td>Noise Level</td><td>Top-1 Accuracy (%) CE</td><td>L5.1 CE</td><td>Top-5 Accuracy (%)</td></tr><tr><td>0.0</td><td>76.68 69.33</td><td>94.34</td><td>L5.1 94.29</td></tr><tr><td>0.2</td><td>68.20 71.30</td><td>87.89</td><td>90.59</td></tr><tr><td>0.4</td><td>61.18 70.02</td><td>83.04</td><td>87.39</td></tr><tr><td>0.6</td><td>52.50 67.97</td><td>79.59</td><td>83.86</td></tr><tr><td>0.8</td><td>35.53 55.85</td><td>74.80</td><td>79.32</td></tr><tr><td>1.0</td><td>14.06 15.28</td><td>67.70</td><td>72.93</td></tr></table>
|
| 257 |
+
|
| 258 |
+
Results. As seen in Table 1, $L _ { 5 , 1 }$ outperforms CE on the top-5 testing accuracy when the labels are noisy, with an improvement of over $5 \%$ in the case $p = 1$ . When there is no noise in the labels, CE provides better top-1 performance, as expected. It also obtains a better top-5 accuracy, although by a very small margin. Interestingly, $L _ { 5 , 1 }$ outperforms CE on the top-1 error when there is noise, although $L _ { 5 , 1 }$ is not a surrogate for the top-1 error. For example when $p = 0 . 8$ , $L _ { 5 , 1 }$ still yields an accuracy of $5 5 . 8 5 \%$ , as compared to $3 5 . 5 3 \%$ for CE. This suggests that when the provided label is only informative about top-5 predictions (because of noise or ambiguity), it is preferable to use ${ \cal L } _ { 5 , 1 }$ .
|
| 259 |
+
|
| 260 |
+
# 5.2 IMAGENET
|
| 261 |
+
|
| 262 |
+
Data set. As shown in Figure 1, the ImageNet data set presents different forms of ambiguity and noise in the labels. It also has a large number of training samples, which allows us to explore different regimes up to the large-scale setting. Out of the 1.28 million training samples, we use subsets of various sizes and always hold out a balanced validation set of 50,000 images. We then report results on the 50,000 images of the official validation set, which we use as our test set. Images are resized so that their smaller dimension is 256, and they are centered and normalized channel-wise. At training time, we take random crops of $2 2 4 \times 2 2 4$ and randomly flip the images horizontally. At test time, we use the standard ten-crop procedure (Krizhevsky et al., 2012).
|
| 263 |
+
|
| 264 |
+
We report results for the following subset sizes of the data: 64k images $( 5 \% )$ , 128k images $( 1 0 \% )$ , $3 2 0 \mathrm { k }$ images $( 2 5 \% )$ , $6 4 0 \mathrm { k }$ images $( 5 0 \% )$ and finally the whole data set $( 1 . 2 8 \mathrm { M } - 5 0 \mathrm { k } = 1 . 2 3 \mathrm { M }$ images for training). Each strict subset has all 1,000 classes and a balanced number of images per class. The largest subset has the same slight unbalance as the full ImageNet data set.
|
| 265 |
+
|
| 266 |
+
Methods. In all the following experiments, we train a ResNet-18 (He et al., 2016), adapting the protocol of the ImageNet experiment in Huang et al. (2017). In more details, we optimize the model with Stochastic Gradient Descent with a batch-size of 256, for a total of 120 epochs. We use a Nesterov momentum of 0.9. The temperature is set to 0.1 for the SVM loss (we discuss the choice of the temperature parameter in Appendix D.1). The learning rate is divided by ten at epochs 30, 60 and 90, and is set to an initial value of 0.1 for CE and 1 for $L _ { 5 , 0 . 1 }$ . The quadratic regularization hyper-parameter is set to 0.0001 for CE. For $L _ { 5 , 0 . 1 }$ , it is set to 0.000025 to preserve a similar relative weighting of the loss and the regularizer. For both methods, training on the whole data set takes about a day and a half (it is only $10 \%$ longer with $L _ { 5 , 0 . 1 }$ than with CE). As in the previous experiments, the validation top-5 accuracy is monitored at every epoch, and we use the model with best top-5 validation accuracy to report its test error.
|
| 267 |
+
|
| 268 |
+
Probabilities for Multiple Crops. Using multiple crops requires a probability distribution over labels for each crop. Then this probability is averaged over the crops to compute the final prediction. The standard method is to use a softmax activation over the scores. We believe that such an approach is only grounded to make top-1 predictions. The probability of a label $\bar { y }$ being part of the top-5 prediction should be marginalized over all combinations of 5 labels that include $\bar { y }$ as one of their elements. This can be directly computed with our algorithms to evaluate $\sigma _ { k }$ and its derivative. We refer the reader to Appendix C for details. All the reported results of top-5 error with multiple crops are computed with this method. This provides a systematic boost of at least $0 . 2 \%$ for all loss functions. In fact, it is more beneficial to the CE baseline, by up to $1 \%$ in the small data setting.
|
| 269 |
+
|
| 270 |
+
Table 2: Top-5 accuracy $( \% )$ on ImageNet using training sets of various sizes. Results are reported on the official validation set, which we use as our test set.
|
| 271 |
+
|
| 272 |
+
<table><tr><td>% Data Set</td><td>Number of Images</td><td>CE</td><td>L5,0.1</td></tr><tr><td>100%</td><td>1.23M</td><td>90.67</td><td>90.61</td></tr><tr><td>50%</td><td>640k</td><td>87.57</td><td>87.87</td></tr><tr><td>25%</td><td>320k</td><td>82.62</td><td>83.38</td></tr><tr><td>10%</td><td>128k</td><td>71.06</td><td>73.10</td></tr><tr><td>5%</td><td>64k</td><td>58.31</td><td>60.44</td></tr></table>
|
| 273 |
+
|
| 274 |
+
Results. The results of Table 2 confirm that $L _ { 5 , 0 . 1 }$ offers better top-5 error than CE when the amount of training data is restricted. As the data set size increases, the difference of performance becomes very small, and CE outperforms $L _ { 5 , 0 . 1 }$ by an insignificant amount in the full data setting.
|
| 275 |
+
|
| 276 |
+
# 6 CONCLUSION
|
| 277 |
+
|
| 278 |
+
This work has introduced a new family of loss functions for the direct minimization of the top- $k$ error (that is, without the need for fine-tuning). We have empirically shown that non-sparsity is essential for loss functions to work well with deep neural networks. Thanks to a connection to polynomial algebra and a novel approximation, we have presented efficient algorithms to compute the smooth loss and its gradient. The experimental results have demonstrated that our smooth top-5 loss function is more robust to noise and overfitting than cross-entropy when the amount of training data is limited.
|
| 279 |
+
|
| 280 |
+
We have argued that smoothing the surrogate loss function helps the training of deep neural networks. This insight is not specific to top- $k$ classification, and we hope that it will help the design of other surrogate loss functions. In particular, structured prediction problems could benefit from smoothed SVM losses. How to efficiently compute such smooth functions could open interesting research problems.
|
| 281 |
+
|
| 282 |
+
# ACKNOWLEDGMENTS
|
| 283 |
+
|
| 284 |
+
This work was supported by the EPSRC grants AIMS CDT EP/L015987/1, Seebibyte EP/M013774/1, EP/P020658/1 and TU/B/000048, and by Yougov. Many thanks to A. Desmaison and R. Bunel for the helpful discussions.
|
| 285 |
+
|
| 286 |
+
# REFERENCES
|
| 287 |
+
|
| 288 |
+
Amir Beck and Marc Teboulle. Smoothing and first order methods: A unified framework. SIAM Journal on Optimization, 2012.
|
| 289 |
+
|
| 290 |
+
Xiaojun Chang, Yao-Liang Yu, and Yi Yang. Robust top-k multiclass SVM for visual category recognition. International Conference on Knowledge Discovery and Data Mining, 2017.
|
| 291 |
+
|
| 292 |
+
Pratik Chaudhari, Anna Choromanska, Stefano Soatto, and Yann LeCun. Entropy-SGD: Biasing gradient descent into wide valleys. International Conference on Learning Representations, 2017.
|
| 293 |
+
|
| 294 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network ´ learning by exponential linear units (ELUs). International Conference on Learning Representations, 2016.
|
| 295 |
+
|
| 296 |
+
Koby Crammer and Yoram Singer. On the algorithmic implementation of multiclass kernel-based vector machines. Journal of Machine Learning Research, 2001.
|
| 297 |
+
|
| 298 |
+
Yanbo Fan, Siwei Lyu, Yiming Ying, and Bao-Gang Hu. Learning with average top- $\mathbf { \nabla } \cdot \mathbf { k }$ loss. Neural Information Processing Systems, 2017.
|
| 299 |
+
|
| 300 |
+
Caglar Gulcehre, Marcin Moczulski, Francesco Visin, and Yoshua Bengio. Mollifying networks. International Conference on Learning Representations, 2017.
|
| 301 |
+
|
| 302 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. Conference on Computer Vision and Pattern Recognition, 2016.
|
| 303 |
+
|
| 304 |
+
Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. Conference on Computer Vision and Pattern Recognition, 2017.
|
| 305 |
+
|
| 306 |
+
Hao Jiang, Stef Graillat, Roberto Barrio, and Canqun Yang. Accurate, validated and fast evaluation of elementary symmetric functions and its application. Applied Mathematics and Computation, 2016.
|
| 307 |
+
|
| 308 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images, 2009.
|
| 309 |
+
|
| 310 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Neural Information Processing Systems, 2012.
|
| 311 |
+
|
| 312 |
+
Maksim Lapin, Matthias Hein, and Bernt Schiele. Top-k multiclass SVM. Neural Information Processing Systems, 2015.
|
| 313 |
+
|
| 314 |
+
Maksim Lapin, Matthias Hein, and Bernt Schiele. Loss functions for top- $\mathbf { \nabla } \cdot \mathbf { k }$ error: Analysis and insights. Conference on Computer Vision and Pattern Recognition, 2016.
|
| 315 |
+
|
| 316 |
+
Maksim Lapin, Matthias Hein, and Bernt Schiele. Analysis and optimization of loss functions for multiclass, top-k, and multilabel classification. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017.
|
| 317 |
+
|
| 318 |
+
Yuh-Jye Lee and Olvi L Mangasarian. SSVM: A smooth support vector machine for classification. Computational optimization and Applications, 2001.
|
| 319 |
+
|
| 320 |
+
Yuncheng Li, Yale Song, and Jiebo Luo. Improving pairwise ranking for multi-label image classification. Conference on Computer Vision and Pattern Recognition, 2017.
|
| 321 |
+
|
| 322 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. NIPS Autodiff Workshop, 2017.
|
| 323 |
+
|
| 324 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision, 2015.
|
| 325 |
+
|
| 326 |
+
Alexander G. Schwing, Tamir Hazan, Marc Pollefeys, and Raquel Urtasun. Efficient structured prediction with latent variables for general graphical models. International Conference on Machine Learning, 2012.
|
| 327 |
+
|
| 328 |
+
Caixia Yan, Minnan Luo, Huan Liu, Zhihui Li, and Qinghua Zheng. Top-k multi-class svm using multiple features. Information Sciences, 2017.
|
| 329 |
+
|
| 330 |
+
Alan L. Yuille and Anand Rangarajan. The concave-convex procedure (CCCP). Neural Information Processing Systems, 2002.
|
| 331 |
+
|
| 332 |
+
Hao Zheng, Zhanlei Yang, Wenju Liu, Jizhong Liang, and Yanpeng Li. Improving deep neural networks using softplus units. International Joint Conference on Neural Networks, 2015.
|
| 333 |
+
|
| 334 |
+
# APPENDIX
|
| 335 |
+
|
| 336 |
+
# A Surrogate Losses: Properties 14
|
| 337 |
+
|
| 338 |
+
A.1 Reformulation . . 14
|
| 339 |
+
A.2 Point-wise Convergence 14
|
| 340 |
+
A.3 Bound on Non-Smooth Function 15
|
| 341 |
+
A.4 Bound on Prediction Loss . . . 16
|
| 342 |
+
|
| 343 |
+
# B Algorithms: Properties & Performance 18
|
| 344 |
+
|
| 345 |
+
B.1 Time Complexity 18
|
| 346 |
+
B.2 Numerical Stability 19
|
| 347 |
+
B.2.1 Forward Pass . . 19
|
| 348 |
+
B.2.2 Backward Pass 19
|
| 349 |
+
B.3 A Performance Comparison with the Summation Algorithm 20
|
| 350 |
+
B.3.1 Summation Algorithm 20
|
| 351 |
+
B.3.2 Speed . 21
|
| 352 |
+
B.3.3 Stability . . . 21
|
| 353 |
+
|
| 354 |
+
# C Top-k Prediction: Marginalization with the Elementary Symmetric Polynomials 22
|
| 355 |
+
|
| 356 |
+
# D Hyper-Parameters & Experimental Details 23
|
| 357 |
+
|
| 358 |
+
# D.1 The Temperature Parameter . 23
|
| 359 |
+
|
| 360 |
+
D.1.1 Optimization and Learning . 23
|
| 361 |
+
D.1.2 Illustration on CIFAR-100 23
|
| 362 |
+
D.1.3 To Anneal or Not To Anneal 23
|
| 363 |
+
D.1.4 Practical Methodology 23
|
| 364 |
+
|
| 365 |
+
# D.2 The Margin 24
|
| 366 |
+
|
| 367 |
+
D.2.1 Relationship with Squared Norm Regularization 24
|
| 368 |
+
D.2.2 Experiment on ImageNet . . 25
|
| 369 |
+
|
| 370 |
+
D.3 Supplementary Details 25
|
| 371 |
+
|
| 372 |
+
# A SURROGATE LOSSES: PROPERTIES
|
| 373 |
+
|
| 374 |
+
In this section, we fix $n$ the number of classes. We let $\tau > 0$ and $k \in \{ 1 , . . . , n - 1 \}$ . All following results are derived with a loss $l _ { k }$ defined as in equation (8):
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
l _ { k } ( \mathbf { s } , y ) \triangleq \operatorname* { m a x } \left\{ \left( \frac { 1 } { k } \mathbf { s } _ { \backslash y } + \mathbf { 1 } \right) _ { [ k ] } - \frac { 1 } { k } s _ { y } , 0 \right\} .
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
# A.1 REFORMULATION
|
| 381 |
+
|
| 382 |
+
Proposition 1. We can equivalently re-write $l _ { k }$ as:
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
l _ { k } ( { \bf s } , y ) = \operatorname* { m a x } _ { \bar { \bf y } \in \mathcal { Y } ^ { ( k ) } } \left\{ \Delta _ { k } ( \bar { \bf y } , y ) + \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right\} - \operatorname* { m a x } _ { \bar { \bf y } \in \mathcal { Y } _ { y } ^ { ( k ) } } \left\{ \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right\} .
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
Proof.
|
| 389 |
+
|
| 390 |
+
$$
|
| 391 |
+
\begin{array} { r l } & { h _ { k } ( s , y ) = \operatorname* { m a x } \Bigg \{ \bigg ( \displaystyle \frac { 1 } { k } s _ { \mathrm { w } } ( \mathbf { x } + \mathbf { y } ) \bigg | _ { \mathbb { H } } - \displaystyle \frac { 1 } { k } s _ { \mathrm { w } } , 0 \bigg \} , } \\ & { = \operatorname* { m a x } \Bigg \{ \bigg ( \displaystyle \frac { 1 } { k } s _ { \mathrm { w } } ( \mathbf { x } + \mathbf { y } ) \bigg | _ { \mathbb { H } } - \displaystyle \frac { 1 } { k } s _ { \mathrm { w } } , 0 \bigg \} + \bigg ( \displaystyle \frac { 1 } { k } \sum _ { j = 1 } ^ { k - 1 } s _ { j i } + \displaystyle \frac { 1 } { k } s _ { j i } \bigg ) - \bigg ( \displaystyle \frac { 1 } { k } \sum _ { j = 1 } ^ { k - 1 } s _ { j i } + \displaystyle \frac { 1 } { k } s _ { j i } \bigg ) , } \\ & { = \operatorname* { m a x } \Bigg \{ \bigg ( \displaystyle \frac { 1 } { k } s _ { \mathrm { w } } + \mathbf { y } \bigg ) _ { \mathbb { H } } + \displaystyle \frac { 1 } { k } \sum _ { j = 1 } ^ { k - 1 } s _ { j i } \displaystyle \frac { 1 } { k } \sum _ { j = 1 } ^ { k - 1 } s _ { j i } + \displaystyle \frac { 1 } { k } s _ { j i } \bigg \} - \bigg ( \displaystyle \frac { 1 } { k } \sum _ { j = 1 } ^ { k - 1 } s _ { j i } + \displaystyle \frac { 1 } { k } s _ { j i } \bigg ) , } \\ & { = \operatorname* { m a x } \Bigg \{ \displaystyle \operatorname* { m a x } _ { y \in \mathbb { S } ^ { ( 0 , 0 ) } \times \displaystyle \frac { 1 } { k } } \bigg \{ 1 + \displaystyle \frac { 1 } { k } \sum _ { j \in \mathcal { S } ^ { ( 0 , 0 ) } } \bigg \} , \ \operatorname* { m a x } _ { y \in \Phi ^ { ( 1 ) } } \bigg \{ \displaystyle \frac { 1 } { k } \sum _ { j \in \mathcal { S } ^ { ( 0 , 0 ) } } \Bigg \} - \operatorname* { m a x } _ { y \in \Phi ^ { ( 1 ) } } \Bigg \} , } \\ & = \operatorname* { m a x } _ { y \in \Phi ^ { ( 0 , 0 ) } } \Bigg \{ \Delta _ { k } ( \bar { y } , y ) + \displaystyle \frac { 1 } { k } \sum _ { j \in \mathcal { S } ^ { ( 0 , 0 ) } } \Bigg \} - \operatorname* { m a x } _ { y \in \Phi ^ { ( 0 , 0 ) } } \Bigg \{ \displaystyle \end{array}
|
| 392 |
+
$$
|
| 393 |
+
|
| 394 |
+
# A.2 POINT-WISE CONVERGENCE
|
| 395 |
+
|
| 396 |
+
Lemma 1. Let $n \geq 2$ and $\mathbf { e } \in \mathbb { R } ^ { n }$ . Assume that the largest element of e is greater than its second largest element: $e _ { [ 1 ] } > e _ { [ 2 ] }$ . Then $\operatorname* { l i m } _ { \tau \to 0 \atop \tau > 0 } \tau \log \left( \sum _ { i = 1 } ^ { n } \exp ( e _ { i } / \tau ) \right) = e _ { [ 1 ] } .$
|
| 397 |
+
|
| 398 |
+
Proof. For simplicity of notation, and without loss of generality, we suppose that the elements of $\mathbf { e }$ are sorted in descending order. Then for $i \in \{ 2 , . . n \}$ , we have $e _ { i } - e _ { 1 } \leq e _ { 2 } - e _ { 1 } < 0$ by assumption, and thus $\forall i \in \{ 2 , . . n \} , \operatorname* { l i m } _ { \tau \to 0 \atop \tau > 0 } \exp ( ( e _ { i } - e _ { 1 } ) / \tau ) = \bar { 0 }$ . Therefore:
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\operatorname* { l i m } _ { \tau \to 0 } \sum _ { i = 1 } ^ { n } \exp ( ( e _ { i } - e _ { 1 } ) / \tau ) = \sum _ { i = 1 } ^ { n } \operatorname* { l i m } _ { \tau \to 0 } \exp ( ( e _ { i } - e _ { 1 } ) / \tau ) = 1 .
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
And thus:
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\operatorname* { l i m } _ { \tau \to 0 \atop \tau > 0 } \tau \log \left( \sum _ { i = 1 } ^ { n } \exp ( ( e _ { i } - e _ { 1 } ) / \tau ) \right) = 0 .
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
The result follows by noting that:
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
\tau \log \left( \sum _ { i = 1 } ^ { n } \exp ( e _ { i } / \tau ) \right) = e _ { 1 } + \tau \log \left( \sum _ { i = 1 } ^ { n } \exp ( ( e _ { i } - e _ { 1 } ) / \tau ) \right) .
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
Proposition 2. Assume that $s _ { [ k - 1 ] } ~ > ~ s _ { [ k ] }$ and that $s _ { [ k ] } > s _ { [ k + 1 ] } o r \frac { 1 } { k } s _ { y } > 1 + \frac { 1 } { k } s _ { [ k ] }$ . Then $\operatorname* { l i m } _ { \tau 0 } L _ { k , \tau } ( \mathbf { s } , y ) = l _ { k } ( \mathbf { s } , y )$ .
|
| 417 |
+
|
| 418 |
+
Proof. From $s _ { [ k ] } > s _ { [ k + 1 ] }$ or $\frac { 1 } { k } s _ { y } > 1 + \frac { 1 } { k } s _ { [ k ] }$ + 1k s[k], one can see that max(k) $\left\{ \Delta _ { k } ( \bar { \bf y } , y ) + \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right\}$ is a strict maximum. Similarly, from $s _ { [ k - 1 ] } > s _ { [ k ] }$ , we have that $\operatorname* { m a x } _ { \bar { \mathbf { y } } \in \mathcal { y } _ { y } ^ { ( k ) } } \left\{ \frac { 1 } { k } \sum _ { j \in \bar { \mathbf { y } } } s _ { j } \right\}$ is a strict maximum. Since $L _ { k , \tau }$ can be written as:
|
| 419 |
+
|
| 420 |
+
$$
|
| 421 |
+
\begin{array} { l } { { \displaystyle { \cal L } _ { k , \tau } ( { \bf s } , y ) = \tau \log \left[ \sum _ { \bar { \bf y } \in \mathcal { Y } ^ { ( k ) } } \exp \left( \left( \Delta _ { k } ( \bar { \bf y } , y ) + \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right) / \tau \right) \right] } } \\ { { \displaystyle ~ - \tau \log \left[ \sum _ { \bar { \bf y } \in \mathcal { Y } _ { y } ^ { ( k ) } } \exp \left( \left( \frac { 1 } { k } \sum _ { j \in \bar { \bf y } } s _ { j } \right) / \tau \right) \right] , } } \end{array}
|
| 422 |
+
$$
|
| 423 |
+
|
| 424 |
+
the result follows by two applications of Lemma 1.
|
| 425 |
+
|
| 426 |
+
# A.3 BOUND ON NON-SMOOTH FUNCTION
|
| 427 |
+
|
| 428 |
+
Proposition 3. $L _ { k , \tau }$ is an upper bound on $l _ { k }$ if and only if $k = 1$ .
|
| 429 |
+
|
| 430 |
+
Proof. Suppose $k = 1$ . Let s $\in \mathbb { R } ^ { n }$ and $y \in \mathcal { V }$ . We introduce $y ^ { * } = \underset { \bar { y } \in \mathcal { V } } { \mathrm { a r g m a x } } \{ \Delta _ { 1 } ( \bar { y } , y ) + s _ { \bar { y } } \}$ . Then we have:
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
\begin{array} { r l } & { l _ { 1 } ( \mathbf { s } , y ) = \Delta _ { 1 } ( y ^ { * } , y ) + s _ { y ^ { * } } - s _ { y } , } \\ & { \qquad = \tau \log ( \exp ( ( \Delta _ { 1 } ( y ^ { * } , y ) + s _ { y ^ { * } } ) / \tau ) - \tau \log \exp ( s _ { y } / \tau ) , } \\ & { \qquad \leq \tau \log ( \displaystyle \sum _ { \bar { y } \in \mathcal { Y } } \exp ( ( \Delta _ { 1 } ( \bar { y } , y ) + s _ { \bar { y } } ) / \tau ) - \tau \log \exp ( s _ { y } / \tau ) = L _ { 1 , \tau } ( \mathbf { s } , y ) . } \end{array}
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
Now suppose $k \geq 2$ . We construct an example $( \mathbf { s } , y )$ such that $L _ { k , \tau } ( \mathbf { s } , y ) < l _ { k } ( \mathbf { s } , y )$ . For simplicity, we set $y = 1$ . Then let $s _ { 1 } = \alpha$ , $s _ { i } = \beta$ for $i \in \{ 2 , . . . , k + 1 \}$ and $s _ { i } = - \infty$ for $i \in \{ k + 2 , . . . , n \}$ . The variables $\alpha$ and $\beta$ are our degrees of freedom to construct the example. Assuming infinite values simplifies the analysis, and by continuity of $L _ { k , \tau }$ and $l _ { k }$ , the proof will hold for real values sufficiently small. We further assume that $\begin{array} { r } { 1 + \frac { 1 } { k } ( \beta - \alpha ) > 0 } \end{array}$ . Then can write $l _ { k } ( { \mathbf s } , y )$ as:
|
| 437 |
+
|
| 438 |
+
$$
|
| 439 |
+
l _ { k } ( \mathbf { s } , y ) = 1 + \frac { 1 } { k } ( \beta - \alpha ) .
|
| 440 |
+
$$
|
| 441 |
+
|
| 442 |
+
Exploiting the fact that $\exp ( { s _ { i } / \tau } ) = 0$ for $i \geq k + 2$ , we have:
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
\sum _ { \bar { \mathbf { y } } \in \mathcal { Y } ^ { ( k ) } \backslash \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } \exp ( ( 1 + s _ { j } ) / k \tau ) = \exp \left( \frac { 1 + \beta } { \tau } \right) ,
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
And:
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
\sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \exp \left( \Big ( \frac { 1 } { k } \sum _ { j \in \bar { \mathbf { y } } } s _ { j } \Big ) / \tau \right) = k \exp \left( \frac { \alpha + ( k - 1 ) \beta } { k \tau } \right) .
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
This allows us to write $L _ { k , \tau }$ as:
|
| 455 |
+
|
| 456 |
+
$$
|
| 457 |
+
\begin{array} { l } { \displaystyle \dot { \Sigma } _ { k , \tau } ( \mathbf { s } , y ) = \tau \log \left( k \exp \left( \frac { \alpha + ( k - 1 ) \beta } { k \tau } \right) + \exp \left( \frac { 1 + \beta } { \tau } \right) \right) - \tau \log \left( k \exp \left( \frac { \alpha + ( k - 1 ) \beta } { k \tau } \right) \right) , } \\ { \displaystyle = \tau \log \left( 1 + \frac { \exp \left( \frac { 1 + \beta } { \tau } \right) } { k \exp \left( \frac { \alpha + ( k - 1 ) \beta } { k \tau } \right) } \right) , } \\ { \displaystyle = \tau \log \left( 1 + \frac { \exp \left( \frac { 1 } { \tau } \right) } { k \exp \left( \frac { \alpha - \beta } { k \tau } \right) } \right) , } \\ { \displaystyle = \tau \log \left( 1 + \frac { 1 } { k } \exp \left( \frac { 1 } { \tau } ( 1 + \frac { 1 } { k } ( \beta - \alpha ) ) \right) \right) . } \end{array}
|
| 458 |
+
$$
|
| 459 |
+
|
| 460 |
+
We introduce $\begin{array} { r } { x = 1 + \frac { 1 } { k } ( \beta - \alpha ) } \end{array}$ . Then we have:
|
| 461 |
+
|
| 462 |
+
$$
|
| 463 |
+
L _ { k , \tau } ( \mathbf { s } , y ) = \tau \log \left( 1 + \frac { 1 } { k } \exp \left( \frac { x } { \tau } \right) \right) ,
|
| 464 |
+
$$
|
| 465 |
+
|
| 466 |
+
And:
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
l _ { k } ( \mathbf { s } , y ) = x .
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
For any value $x > 0$ , we can find $( \alpha , \beta ) \in \mathbb { R } ^ { 2 }$ such that $\begin{array} { r } { x = 1 + \frac { 1 } { k } ( \beta - \alpha ) } \end{array}$ and that all our hypotheses are verified. Consequently, we only have to prove that there exists $x > 0$ such that:
|
| 473 |
+
|
| 474 |
+
$$
|
| 475 |
+
\Delta ( x ) \triangleq \tau \log \left( 1 + \frac { 1 } { k } \exp \left( \frac { x } { \tau } \right) \right) - x < 0 .
|
| 476 |
+
$$
|
| 477 |
+
|
| 478 |
+
We show that $\operatorname* { l i m } _ { x \to \infty } \Delta ( x ) < 0$ , which will conclude the proof by continuity of $\Delta$ .
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
\begin{array} { r l r } { { \Delta ( x ) = \tau \log ( 1 + \frac { 1 } { k } \exp ( \frac { x } { \tau } ) ) - x , } } \\ & { } & \\ & { } & { = \tau \log ( 1 + \frac { 1 } { k } \exp ( \frac { x } { \tau } ) ) - \tau \log ( \exp ( \frac { x } { \tau } ) ) , ~ } \\ & { } & \\ & { } & { = \tau \log ( \exp ( \frac { - x } { \tau } ) + \frac { 1 } { k } ) \xrightarrow [ x \to \infty ] { } \tau \log ( \frac { 1 } { k } ) < 0 \quad \mathrm { s i n c e } k \geq 2 . } \end{array}
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
# A.4 BOUND ON PREDICTION LOSS
|
| 485 |
+
|
| 486 |
+
Lemma 2. Let $( p , q ) \in \mathbb { N } ^ { 2 }$ such that $p \leq q - 1$ and $q \geq 1$ . Then ${ \binom { q } { p } } \leq q { \binom { q } { p + 1 } }$ .
|
| 487 |
+
|
| 488 |
+
Proof.
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\begin{array} { c } { { \frac { \binom { q } { p } } { \binom { q } { p + 1 } } = \displaystyle \frac { ( q - p - 1 ) ! ( p + 1 ) ! } { ( q - p ) ! p ! } , \hfill } } \\ { { = \displaystyle \frac { ( p + 1 ) } { q - p } . \hfill } } \end{array}
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
This is a monotonically increasing function of $p \leq q - 1$ , therefore it is upper bounded by its maximal value at $p = q - 1$ :
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
{ \frac { { \binom { q } { p } } } { { \binom { q } { p + 1 } } } } = { \frac { ( p + 1 ) } { q - p } } \leq q .
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
Lemma 3. Assume that $y \notin P _ { k } ( \mathbf { s } )$ . Then we have:
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
\frac { 1 } { k } \sum _ { \bar { \mathbf { y } } \in \mathcal { y } _ { y } ^ { ( k ) } } \exp \left( \sum _ { j \in \bar { \mathbf { y } } } \frac { s _ { j } } { k \tau } \right) \leq \sum _ { \bar { \mathbf { y } } \in \mathcal { y } ^ { ( k ) } \setminus \mathcal { y } _ { y } ^ { ( k ) } } \exp \left( \sum _ { j \in \bar { \mathbf { y } } } \frac { s _ { j } } { k \tau } \right) .
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
Proof. Let $j \in [ [ 0 , k - 1 ]$ . We introduce the random variable $U _ { j }$ , whose probability distribution is uniform over the set $\mathcal { U } _ { j } \triangleq \{ \bar { \mathbf { y } } \in \mathcal { y } _ { y } ^ { ( k ) } : \bar { \mathbf { y } } \cap P _ { k } ( \mathbf { s } ) = j \}$ . Then $V _ { j }$ is the random variable such that $V _ { j } | U _ { j }$ replaces $y$ from $U _ { j }$ with a value drawn uniformly from $\breve { P } _ { k } ( { \bf s } )$ . We denote by $\nu _ { j }$ the set of values taken by $V _ { j }$ with non-zero probability. Since $V _ { j }$ replaces the ground truth score by one of the values of $P _ { k } ( { \bf s } )$ , it can be seen that:
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
{ \mathcal V } _ { j } = \{ \bar { \mathbf y } \in \mathcal { Y } ^ { ( k ) } \backslash \mathcal { Y } _ { y } ^ { ( k ) } : \bar { \mathbf y } \cap P _ { k } ( \mathbf s ) = j + 1 \} .
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+
Furthermore, we introduce the scoring function $f : \bar { \mathbf { y } } \in \mathcal { Y } ^ { ( k ) } \mapsto \exp ( \frac { 1 } { k \tau } \sum _ { j \in \bar { \mathbf { y } } } s _ { j } )$ . Since $P _ { k } ( { \bf s } )$ is the set of the $k$ largest scores and $y \notin P _ { k } ( \mathbf { s } )$ , we have that:
|
| 513 |
+
|
| 514 |
+
$$
|
| 515 |
+
f ( V _ { j } | U _ { j } ) \geq f ( U _ { j } ) \qquad \mathrm { w i t h ~ p r o b a b i l i t y ~ } 1 .
|
| 516 |
+
$$
|
| 517 |
+
|
| 518 |
+
Therefore we also have that:
|
| 519 |
+
|
| 520 |
+
$$
|
| 521 |
+
\mathbb { E } _ { V _ { j } | U _ { j } } f ( V _ { j } ) \geq f ( U _ { j } ) \qquad \mathrm { w i t h p r o b a b i l i t y ~ 1 . }
|
| 522 |
+
$$
|
| 523 |
+
|
| 524 |
+
This finally gives us:
|
| 525 |
+
|
| 526 |
+
$$
|
| 527 |
+
\begin{array} { r } { \mathbb { E } _ { U _ { j } } \mathbb { E } _ { V _ { j } | U _ { j } } f ( V _ { j } ) \geq \mathbb { E } _ { U _ { j } } f ( U _ { j } ) , } \\ { \mathbb { E } _ { V _ { j } } f ( V _ { j } ) \geq \mathbb { E } _ { U _ { j } } f ( U _ { j } ) . } \end{array}
|
| 528 |
+
$$
|
| 529 |
+
|
| 530 |
+
Making the (uniform) probabilities explicit, we obtain:
|
| 531 |
+
|
| 532 |
+
$$
|
| 533 |
+
\begin{array} { l } { \displaystyle \frac { 1 } { | \mathcal { V } _ { j } | } \sum _ { \mathbf { v } \in \mathcal { V } _ { j } } f ( \mathbf { v } ) \geq \frac { 1 } { | \mathcal { U } _ { j } | } \sum _ { \mathbf { u } \in \mathcal { U } _ { j } } f ( \mathbf { u } ) , } \\ { \displaystyle \frac { | \mathcal { U } _ { j } | } { | \mathcal { V } _ { j } | } \sum _ { \mathbf { v } \in \mathcal { V } _ { j } } f ( \mathbf { v } ) \geq \sum _ { \mathbf { u } \in \mathcal { U } _ { j } } f ( \mathbf { u } ) . } \end{array}
|
| 534 |
+
$$
|
| 535 |
+
|
| 536 |
+
To derive the set cardinalities, we rewrite $\mathcal { U } _ { j }$ and $\nu _ { j }$ as:
|
| 537 |
+
|
| 538 |
+
$$
|
| 539 |
+
\begin{array} { r l } & { \mathcal { U } _ { j } = \big \{ \bar { \bf y } \in \mathcal { Y } _ { y } ^ { ( k ) } : \bar { \bf y } \cap P _ { k } ( { \bf s } ) = j \big \} = \{ y \} \times P _ { k } ( { \bf s } ) ^ { ( j ) } \times ( \mathcal { V } \backslash ( \{ y \} \cup P _ { k } ( { \bf s } ) ) ^ { ( k - j - 1 ) } , } \\ & { \mathcal { V } _ { j } = \{ \bar { \bf y } \in \mathcal { Y } ^ { ( k ) } \backslash \mathcal { V } _ { y } ^ { ( k ) } : \bar { \bf y } \cap P _ { k } ( { \bf s } ) = j + 1 \} = P _ { k } ( { \bf s } ) ^ { ( j + 1 ) } \times ( \mathcal { V } \backslash ( \{ y \} \cup P _ { k } ( { \bf s } ) ) ^ { ( k - j - 1 ) } . } \end{array}
|
| 540 |
+
$$
|
| 541 |
+
|
| 542 |
+
Therefore we have that:
|
| 543 |
+
|
| 544 |
+
$$
|
| 545 |
+
\begin{array} { l } { { | \mathcal { U } _ { j } | = \left| \{ y \} \times P _ { k } ( \mathbf { s } ) ^ { ( j ) } \times ( \mathcal { V } \backslash ( \{ y \} \cup P _ { k } ( \mathbf { s } ) ) ^ { ( k - j - 1 ) } \right| , } } \\ { { \qquad = { \binom { k } { j } } { \binom { n - k - 1 } { k - j - 1 } } , } } \end{array}
|
| 546 |
+
$$
|
| 547 |
+
|
| 548 |
+
And:
|
| 549 |
+
|
| 550 |
+
$$
|
| 551 |
+
\begin{array} { c } { { | \mathcal { V } _ { j } | = \Big | P _ { k } ( \mathbf { s } ) ^ { ( j + 1 ) } \times ( \mathcal { V } \backslash ( \{ y \} \cup P _ { k } ( \mathbf { s } ) ) ^ { ( k - j - 1 ) } \Big | , } } \\ { { = \binom { k } { j + 1 } \binom { n - k - 1 } { k - j - 1 } . } } \end{array}
|
| 552 |
+
$$
|
| 553 |
+
|
| 554 |
+
Therefore:
|
| 555 |
+
|
| 556 |
+
$$
|
| 557 |
+
\frac { | \mathcal { U } _ { j } | } { | \mathcal { V } _ { j } | } = \frac { { \binom { k } { j } } { \binom { n - k - 1 } { k - j - 1 } } } { { \binom { k } { j + 1 } } { \binom { n - k - 1 } { k - j - 1 } } } = \frac { { \binom { k } { j } } } { { \binom { k } { j + 1 } } } \leq k \quad \mathrm { b y ~ L e m m a ~ } 2 .
|
| 558 |
+
$$
|
| 559 |
+
|
| 560 |
+
Combining with equation (42), we obtain:
|
| 561 |
+
|
| 562 |
+
$$
|
| 563 |
+
k \sum _ { \mathbf { v } \in \mathcal { V } _ { j } } f ( \mathbf { v } ) \geq \sum _ { \mathbf { u } \in \mathcal { U } _ { j } } f ( \mathbf { u } ) .
|
| 564 |
+
$$
|
| 565 |
+
|
| 566 |
+
We sum over $j \in [ [ 0 , k - 1 ]$ , which yields:
|
| 567 |
+
|
| 568 |
+
$$
|
| 569 |
+
k \sum _ { j = 0 } ^ { k - 1 } \sum _ { { \bf v } \in \mathcal { V } _ { j } } f ( { \bf v } ) \geq \sum _ { j = 0 } ^ { k - 1 } \sum _ { { \bf u } \in \mathcal { U } _ { j } } f ( { \bf u } ) .
|
| 570 |
+
$$
|
| 571 |
+
|
| 572 |
+
Finally, we note that $\{ \mathcal { U } _ { j } \} _ { 0 \le j \le k - 1 }$ and $\{ \mathcal { V } _ { j } \} _ { 0 \leq j \leq k - 1 }$ are respective partitions of ${ \mathcal { V } } _ { y } ^ { ( k ) }$ and ${ \mathcal { V } } ^ { ( k ) } \backslash { \mathcal { V } } _ { y } ^ { ( k ) }$ , which gives us the final result:
|
| 573 |
+
|
| 574 |
+
$$
|
| 575 |
+
k \sum _ { \mathbf { v } \in \mathcal { V } ^ { ( k ) } \backslash \mathcal { V } _ { y } ^ { ( k ) } } f ( \mathbf { v } ) \geq \sum _ { \mathbf { u } \in \mathcal { V } _ { y } ^ { ( k ) } } f ( \mathbf { u } ) .
|
| 576 |
+
$$
|
| 577 |
+
|
| 578 |
+
Proposition 4. $L _ { k , \tau }$ is, up to a scaling factor, an upper bound on the prediction loss $\Lambda _ { k }$ :
|
| 579 |
+
|
| 580 |
+
$$
|
| 581 |
+
L _ { k , \tau } ( \mathbf { s } , y ) \geq ( 1 - \tau \log ( k ) ) \Lambda _ { k } ( \mathbf { s } , y ) .
|
| 582 |
+
$$
|
| 583 |
+
|
| 584 |
+
Proof. Suppose that $\Lambda _ { k } ( \mathbf { s } , y ) = 0$ . Then the inequality is trivial because $L _ { k , \tau } ( \mathbf { s } , y ) \geq 0$ . We now assume that $\Lambda _ { k } ( \mathbf { s } , y ) = \mathrm { 1 }$ . Then there exist at least $k$ higher scores than $s _ { y }$ . To simplify indexing, we introduce $\mathcal { Z } _ { y } ^ { ( k ) } = \mathcal { V } ^ { ( k ) } \backslash \mathcal { V } _ { y } ^ { ( k ) }$ and $\mathcal { T } _ { k }$ the set of $k$ labels corresponding to the $k$ -largest scores. By assumption, $y \notin \mathcal { T } _ { k }$ since $y$ is misclassified. We then write:
|
| 585 |
+
|
| 586 |
+
$$
|
| 587 |
+
\sum _ { \bar { \mathbf { y } } \in \mathcal { Y } ^ { ( k ) } } \exp \left( \Delta ( \bar { \mathbf { y } } , y ) / \tau \right) \prod _ { j \in \bar { \mathbf { y } } } u _ { j } = \exp \left( 1 / \tau \right) \sum _ { \bar { \mathbf { y } } \in \mathcal { Z } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } u _ { j } + \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } u _ { j } .
|
| 588 |
+
$$
|
| 589 |
+
|
| 590 |
+
Thanks to Lemma 3, we have:
|
| 591 |
+
|
| 592 |
+
$$
|
| 593 |
+
\sum _ { \bar { \mathbf { y } } \in \mathcal { Z } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } u _ { j } \geq \frac { 1 } { k } \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } u _ { j } .
|
| 594 |
+
$$
|
| 595 |
+
|
| 596 |
+
Injecting this back into (51):
|
| 597 |
+
|
| 598 |
+
$$
|
| 599 |
+
\sum _ { \bar { \mathbf { y } } \in \mathcal { Y } ^ { ( k ) } } \exp \left( \Delta ( \bar { \mathbf { y } } , y ) / \tau \right) \prod _ { j \in \bar { \mathbf { y } } } u _ { j } \geq \big ( 1 + \frac { 1 } { k } \exp \left( 1 / \tau \right) \big ) \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { \mathbf { y } } } u _ { j } ,
|
| 600 |
+
$$
|
| 601 |
+
|
| 602 |
+
And back to the original loss:
|
| 603 |
+
|
| 604 |
+
$$
|
| 605 |
+
\begin{array} { l } { { \displaystyle { \cal L } _ { k , \tau } ( { \bf s } , y ) \geq \tau \log \left[ ( 1 + \frac { 1 } { k } \exp { ( 1 / \tau ) } ) \sum _ { \bar { y } \in \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { y } } u _ { j } \right] - \tau \log \left[ \sum _ { \bar { y } \in \mathcal { Y } _ { y } ^ { ( k ) } } \prod _ { j \in \bar { y } } u _ { j } \right] } , } \\ { { \displaystyle ~ \quad = \tau \log ( 1 + \frac { 1 } { k } \exp { ( 1 / \tau ) } ) \geq \tau \log ( \frac { 1 } { k } \exp { ( 1 / \tau ) } ) = \tau \log ( \frac { 1 } { k } ) + 1 = 1 - \tau \log ( k ) } . } \end{array}
|
| 606 |
+
$$
|
| 607 |
+
|
| 608 |
+
# B ALGORITHMS: PROPERTIES & PERFORMANCE
|
| 609 |
+
|
| 610 |
+
# B.1 TIME COMPLEXITY
|
| 611 |
+
|
| 612 |
+
Lemma 4. Let $P$ and $Q$ be two polynomials of degree $p$ and $q$ . The time complexity of obtaining the first r coefficients of $P Q$ is $\mathcal { O } ( \operatorname* { m i n } \{ r , p \} \operatorname* { m i n } \{ r , q \} )$ .
|
| 613 |
+
|
| 614 |
+
Proof. The multiplication of two polynomials can be written as the convolution of their coefficients, which can be truncated at degree $r$ for each polynomial. □
|
| 615 |
+
|
| 616 |
+
Proposition 5. The time complexity of Algorithm $I$ is $\mathcal { O } ( k n )$ .
|
| 617 |
+
|
| 618 |
+
Proof. Let $N = \log _ { 2 } ( n )$ , or equivalently $n = 2 ^ { N }$ . With the divide-and-conquer algorithm, the complexity of computing the $k$ first coefficients of $P$ can be written as:
|
| 619 |
+
|
| 620 |
+
$$
|
| 621 |
+
T ( k , n ) = 2 T ( k , \frac { n } { 2 } ) + \operatorname* { m i n } \{ k , n \} ^ { 2 } .
|
| 622 |
+
$$
|
| 623 |
+
|
| 624 |
+
Indeed we decompose $P = Q _ { 1 } Q _ { 2 }$ , with each $Q _ { i }$ of degree $n / 2$ , and for these we compute their $k$ first coefficients in $T ( \textstyle { \frac { n } { 2 } } )$ . Then given the $k$ first coefficients of $Q _ { 1 }$ and $Q _ { 2 }$ , the $k$ first coefficients of $P$ are computed in $\mathcal { O } ( \operatorname* { m i n } \{ k , n \} ^ { 2 } )$ by Lemma 4. Then we can write:
|
| 625 |
+
|
| 626 |
+
$$
|
| 627 |
+
\begin{array} { c } { { T ( k , n ) = 2 T ( k , \displaystyle \frac { n } { 2 } ) + \operatorname* { m i n } \{ k , n \} ^ { 2 } , } } \\ { { 2 T \big ( k , \displaystyle \frac { n } { 2 } \big ) = 4 T \big ( k , \displaystyle \frac { n } { 4 } \big ) + 2 \operatorname* { m i n } \bigg \{ k , \displaystyle \frac { n } { 2 } \bigg \} ^ { 2 } , } } \\ { { \cdots } } \\ { { 2 ^ { N - 1 } T \big ( k , \displaystyle \frac { n } { 2 ^ { N - 1 } } \big ) = \underbrace { 2 ^ { N } T ( k , 1 ) } _ { 2 ^ { N } \mathcal { O } ( 1 ) = \mathcal { O } ( n ) } + 2 ^ { N - 1 } \operatorname* { m i n } \bigg \{ k , \displaystyle \frac { n } { 2 ^ { N - 1 } } \bigg \} ^ { 2 } . } } \end{array}
|
| 628 |
+
$$
|
| 629 |
+
|
| 630 |
+
By summing these terms, we obtain $T ( k , n ) = 2 ^ { N } T ( k , 1 ) + \sum _ { j = 0 } ^ { N - 1 } 2 ^ { j } \operatorname* { m i n } \Big \{ k , \frac { n } { 2 ^ { j } } \Big \} ^ { 2 }$ . Let $n _ { 0 } \in \mathbb { N }$ such that $\frac { n } { 2 ^ { n _ { 0 } + 1 } } < k \leq \frac { n } { 2 ^ { n _ { 0 } } }$ . In loose notation, we have $k \frac { 2 ^ { n _ { 0 } } } { n } = \mathcal { O } ( 1 )$ . Then we can write:
|
| 631 |
+
|
| 632 |
+
$$
|
| 633 |
+
\begin{array} { l } { { \displaystyle \sum _ { j = 0 } ^ { N - 1 } 2 ^ { j } \operatorname* { m i n } \left\{ k , \frac { n } { 2 ^ { j } } \right\} ^ { 2 } = \sum _ { j = 0 } ^ { n _ { 0 } } 2 ^ { j } \operatorname* { m i n } \left\{ k , \frac { n } { 2 ^ { j } } \right\} ^ { 2 } + \sum _ { j = n _ { 0 } + 1 } ^ { N - 1 } 2 ^ { j } \operatorname* { m i n } \left\{ k , \frac { n } { 2 ^ { j } } \right\} ^ { 2 } } } \\ { { \displaystyle \qquad = \sum _ { j = 0 } ^ { n _ { 0 } } 2 ^ { j } k ^ { 2 } + \sum _ { j = n _ { 0 } + 1 } ^ { N - 1 } 2 ^ { j } \left( \frac { n } { 2 ^ { j } } \right) ^ { 2 } } , } \\ { { \displaystyle \qquad = ( 2 ^ { n _ { 0 } + 1 } - 1 ) k ^ { 2 } + n ^ { 2 } ( 2 ^ { - n _ { 0 } - 1 } - 2 ^ { - N } ) } , } \\ { { \displaystyle \qquad = \mathcal { O } ( k n ) . } } \end{array}
|
| 634 |
+
$$
|
| 635 |
+
|
| 636 |
+
Thus finally:
|
| 637 |
+
|
| 638 |
+
$$
|
| 639 |
+
\begin{array} { l } { { \displaystyle T ( k , n ) = 2 ^ { N } T ( k , 1 ) + \sum _ { j = 0 } ^ { N - 1 } 2 ^ { j } \operatorname* { m i n } \left\{ k , \frac { n } { 2 ^ { j } } \right\} ^ { 2 } } , } \\ { { \displaystyle \quad \quad = \mathcal { O } ( n ) + \mathcal { O } ( k n ) , } } \\ { { \displaystyle \quad = \mathcal { O } ( k n ) . } } \end{array}
|
| 640 |
+
$$
|
| 641 |
+
|
| 642 |
+
# B.2 NUMERICAL STABILITY
|
| 643 |
+
|
| 644 |
+
# B.2.1 FORWARD PASS
|
| 645 |
+
|
| 646 |
+
In order to ensure numerical stability of the computation, we maintain all computations in the log space: for a multiplication $\exp ( x _ { 1 } ) \exp ( x _ { 2 } )$ , we actually compute and store $x _ { 1 } + x _ { 2 }$ ; for an addition $\mathrm { { e x p } } ( x _ { 1 } ) + \exp ( \bar { x _ { 2 } } )$ we use the “log-sum-exp” trick: we compute $m = \operatorname* { m a x } \{ x _ { 1 } , x _ { 2 } \}$ , and store $m + \log ( \exp ( x _ { 1 } - m ) + \exp ( x _ { 2 } - m ) )$ , which guarantees stability of the result. These two operations suffice to describe the forward pass.
|
| 647 |
+
|
| 648 |
+
# B.2.2 BACKWARD PASS
|
| 649 |
+
|
| 650 |
+
Observation 1. The backward recursion of Algorithm 2 is unstable when $e _ { i } \gg 1$ and $e _ { i } \gg \operatorname* { m a x } _ { p \neq i } \{ e _ { p } \}$
|
| 651 |
+
|
| 652 |
+
Sketch of Proof. To see that, assume that when we compute $( \sum _ { p = 1 } ^ { n } e _ { p } ) - e _ { i }$ , we make a numerical error in the order of $\epsilon$ (e.g $\epsilon \simeq 1 0 ^ { - 5 }$ for single floating point precision). With the numerical errors, we
|
| 653 |
+
|
| 654 |
+
obtain approximate $\hat { \delta }$ as follows:
|
| 655 |
+
|
| 656 |
+
$$
|
| 657 |
+
\begin{array} { l } { { \displaystyle \hat { \delta } _ { 1 , i } = 1 , \qquad } } \\ { { \displaystyle \hat { \delta } _ { 2 , i } = \sigma _ { 1 } ( { \bf e } ) - e _ { i } \hat { \delta } _ { 1 , i } = \sum _ { p = 1 } ^ { n } e _ { p } - e _ { i } = \delta _ { 2 , i } + \mathcal { O } ( \epsilon ) , } } \\ { { \displaystyle \hat { \delta } _ { 3 , i } = \sigma _ { 2 } ( { \bf e } ) - e _ { i } \hat { \delta } _ { 2 , i } = \sigma _ { 2 } ( { \bf e } ) - e _ { i } \big ( \delta _ { 2 , i } + \mathcal { O } ( \epsilon ) \big ) = \delta _ { 3 , i } + \mathcal { O } ( e _ { i } \epsilon ) ) , } } \\ { { \displaystyle \dots } } \\ { { \displaystyle \hat { \delta } _ { k , i } = \sigma _ { k - 1 } ( { \bf e } ) - e _ { i } \hat { \delta } _ { k - 1 , i } = \dots = \delta _ { k , i } + \mathcal { O } ( e _ { i } ^ { k - 1 } \epsilon ) ) . } } \end{array}
|
| 658 |
+
$$
|
| 659 |
+
|
| 660 |
+
Since $e _ { i } \gg 1$ , we quickly obtain unstable results.
|
| 661 |
+
|
| 662 |
+
Definition 1. For $p \in \{ 0 , . . . , n - k \}$ , we define the $p$ -th order approximation to the gradient as:
|
| 663 |
+
|
| 664 |
+
$$
|
| 665 |
+
\tilde { \delta } _ { k , i } ^ { ( p ) } \triangleq \sum _ { j = 0 } ^ { p } ( - 1 ) ^ { j } \frac { \sigma _ { k + j } ( \mathbf { e } ) } { e _ { i } ^ { j } } .
|
| 666 |
+
$$
|
| 667 |
+
|
| 668 |
+
Proposition 6. If we approximate the gradient by its $p$ -th order approximation as defined in equation (60), the absolute error is:
|
| 669 |
+
|
| 670 |
+
$$
|
| 671 |
+
\Big | \delta _ { k , i } - \tilde { \delta } _ { k , i } ^ { ( p ) } \Big | = \frac { \sigma _ { k + p } ( \mathbf { e } _ { \backslash i } ) } { e _ { i } ^ { p + 1 } } .
|
| 672 |
+
$$
|
| 673 |
+
|
| 674 |
+
Proof. We remind equation (18), which gives a recursive relationship for the gradients:
|
| 675 |
+
|
| 676 |
+
$$
|
| 677 |
+
\delta _ { j , i } = \sigma _ { j - 1 } ( \mathbf { e } ) - e _ { i } \delta _ { j - 1 , i } .
|
| 678 |
+
$$
|
| 679 |
+
|
| 680 |
+
This can be re-written as:
|
| 681 |
+
|
| 682 |
+
$$
|
| 683 |
+
\delta _ { j - 1 , i } = \frac { 1 } { e _ { i } } \left( \sigma _ { j - 1 } ( \mathbf { e } ) - \delta _ { j , i } \right) .
|
| 684 |
+
$$
|
| 685 |
+
|
| 686 |
+
We write $\sigma _ { k + p } ( \mathbf { e } _ { \backslash i } ) = \delta _ { k + p + 1 , i }$ , and the result follows by repeated applications of equation (62) for $j \in \{ k + 1 , k + 2 , . . . , k + p + 1 \}$ . □
|
| 687 |
+
|
| 688 |
+
Intuition. We have seen in Observation 1 that the recursion tends to be unstable for $\delta _ { j , i }$ when $e _ { i }$ is among the largest elements. When that is the case, the ratio $\displaystyle \frac { \sigma _ { k + p } ( \mathbf { e } _ { \backslash i } ) } { e _ { i } ^ { p + 1 } }$ decreases quickly with $p$ . This has two consequences: (i) the sum of equation (60) is stable to compute because the summands have different orders of magnitude and (ii) the error becomes small. Unfortunately, it is difficult to upper-bound the error of equation (61) by a quantity that is both measurable at runtime (without expensive computations) and small enough to be informative. Therefore the approximation error is not controlled at runtime. In practice, we detect the instability of $\delta _ { k , i }$ : numerical issues arise if subtracted terms have a very small relative difference. For those unstable elements we use the $p$ -th order approximation (to choose the value of $p$ , a good rule of thumb is $p \simeq 0 . 2 k _ { \cdot }$ ). We have empirically found out that this heuristic works well in practice. Note that this changes the complexity of the forward pass to $O ( ( k + p ) n )$ since we need $p$ additional coefficients during the backward. If $p \simeq 0 . 2 k$ , this increases the running time of the forward pass by $20 \%$ , which is a moderate impact.
|
| 689 |
+
|
| 690 |
+
# B.3 A PERFORMANCE COMPARISON WITH THE SUMMATION ALGORITHM
|
| 691 |
+
|
| 692 |
+
# B.3.1 SUMMATION ALGORITHM
|
| 693 |
+
|
| 694 |
+
The Summation Algorithm (SA) is an alternative to the Divide-and-Conquer (DC) algorithm for the evaluation of the elementary symmetric polynomials. It is described for instance in (Jiang et al., 2016). The algorithm can be summarized as follows:
|
| 695 |
+
|
| 696 |
+
Implementation. Note that the inner loop can be parallelized, but the outer one is essentially sequential. In our implementation for speed comparisons, the inner loop is parallelized and a buffer is pre-allocated for the $\sigma _ { j , i }$ .
|
| 697 |
+
|
| 698 |
+
# Algorithm 3 Summation Algorithm
|
| 699 |
+
|
| 700 |
+
Require: $\mathbf { e } \in \mathbb { R } ^ { n }$ , k ∈ N ∗
|
| 701 |
+
1: $\sigma _ { 0 , i } \gets 1$ for $1 \leq i \leq n$
|
| 702 |
+
2: $\sigma _ { j , i } \gets 0$ for i < j
|
| 703 |
+
3: $\sigma _ { 1 , 1 } e _ { 1 }$
|
| 704 |
+
4: for $i \in [ [ 2 , n ]$ do
|
| 705 |
+
5: $m \bar { } \operatorname* { m a x } \{ 1 , i + k - n \}$
|
| 706 |
+
6: M ← min{i, k}
|
| 707 |
+
7: for i ∈ m, M do
|
| 708 |
+
8: $\sigma _ { j , i } \sigma _ { j , i - 1 } + e _ { i } \sigma _ { j - 1 , i - 1 }$
|
| 709 |
+
9: end for
|
| 710 |
+
10: end for
|
| 711 |
+
11: return $\sigma _ { k , n }$
|
| 712 |
+
|
| 713 |
+
$\triangleright \sigma _ { j , i } = \sigma _ { j } ( e _ { 1 } , \ldots , e _ { i } )$ . Do not define values for $i < j$ (meaningless) $\triangleright$ Initialize recursion
|
| 714 |
+
|
| 715 |
+
# B.3.2 SPEED
|
| 716 |
+
|
| 717 |
+
We compare the execution time of the DC and SA algorithms on a GPU (Nvidia Titan $\mathrm { X p }$ ). We use the following parameters: $k = 5$ , a batch size of 256 and a varying value of $n$ . The following timings are given in seconds, and are computed as the average of 50 runs. In Table 3, we compare the speed of Summation and DC for the evaluation of the forward pass. In Table 4, we compare the speed of the evaluation of the backward pass using Automatic Differentiation (AD) and our Custom Algorithm (CA) (see Algorithm 2).
|
| 718 |
+
|
| 719 |
+
Table 3: Execution time (s) of the forward pass. The Divide and Conquer (DC) algorithm offers nearly logarithmic scaling with n in practice, thanks to its parallelization. In contrast, the runtime of the Summation Algorithm (SA) scales linearly with $n$ .
|
| 720 |
+
|
| 721 |
+
$$
|
| 722 |
+
\begin{array} { r } { \frac { \mathrm { ~ n ~ } } { \mathrm { ~ S A ~ } } \left| \begin{array} { c c c c } { 1 0 0 } & { 1 , 0 0 0 } & { 1 0 , 0 0 0 } & { 1 0 0 , 0 0 0 } \\ { 0 . 0 0 6 } & { 0 . 0 6 2 } & { 0 . 6 2 7 } & { 6 . 2 5 8 } \\ { 0 . 0 1 1 } & { 0 . 0 1 8 } & { 0 . 0 2 4 } & { 0 . 1 4 6 } \end{array} \right. } \end{array}
|
| 723 |
+
$$
|
| 724 |
+
|
| 725 |
+
We remind that both algorithms have a time complexity of $\mathcal { O } ( k n )$ . SA provides little parallelization (the parallelizable inner loop is small for $k \ll n ,$ ), which is reflected in the runtimes. On the other hand, DC is a recursive algorithm with ${ \mathcal { O } } ( \log ( n ) )$ levels of recursion, and all operations are parallelized at each level of the recursion. This allows DC to have near-logarithmic effective scaling with $n$ , at least in the range $\{ 1 0 0 - 1 0 , 0 0 0 \}$ .
|
| 726 |
+
|
| 727 |
+
Table 4: Execution time $( s )$ of the backward pass. Our Custom Backward (CB) is faster than Automatic Differentiation $( A D )$ .
|
| 728 |
+
|
| 729 |
+
$$
|
| 730 |
+
\begin{array} { r } { \frac { \mathrm { n } } { \mathrm { D C \left( A D \right) } } \left| \begin{array} { l l l l } { 1 0 0 } & { 1 , 0 0 0 } & { 1 0 , 0 0 0 } & { 1 0 0 , 0 0 0 } \\ { 0 . 0 9 3 } & { 0 . 1 3 9 } & { 0 . 1 9 4 } & { 0 . 2 8 7 } \\ { 0 . 0 0 7 } & { 0 . 0 0 6 } & { 0 . 0 2 0 } & { 0 . 1 7 1 } \end{array} \right. } \end{array}
|
| 731 |
+
$$
|
| 732 |
+
|
| 733 |
+
These runtimes demonstrate the advantage of using Algorithm 2 instead of automatic differentiation. In particular, we see that in the use case of ImageNet $( n = 1 , 0 0 0 )$ , the backward computation changes from being ${ 8 } \mathbf { { x } }$ slower than the forward pass to being 3x faster.
|
| 734 |
+
|
| 735 |
+
# B.3.3 STABILITY
|
| 736 |
+
|
| 737 |
+
We now investigate the numerical stability of the algorithms. Here we only analyze the numerical stability, and not the precision of the algorithm. We point out that compensation algorithms are useful to improve the precision of SA but not its stability. Therefore they are not considered in this discussion.
|
| 738 |
+
|
| 739 |
+
Jiang et al. (2016) mention that SA is a stable algorithm, under the assumption that no overflow or underflow is encountered. However this assumption is not verified in our use case, as we demonstrate below. We consider that the algorithm is stable if no overflow occurs in the algorithm (underflows are not an issue for our use cases). We stress out that numerical stability is critical for our machine learning context: if an overflow occurs, the weights of the learning model inevitably diverge to infinite values.
|
| 740 |
+
|
| 741 |
+
To test numerical stability in a representative setting of our use cases, we take a random mini-batch of 128 images from the ImageNet data set and forward it through a pre-trained ResNet-18 to obtain a vector of scores per sample. Then we use the scores as an input to the SA and DC algorithms, for various values of the temperature parameter $\tau$ . We compare the algorithms with single (S) and double (D) floating point precision.
|
| 742 |
+
|
| 743 |
+
Table 5: Stability on forward pass. A setting is considered stable if no overflow has occurred.
|
| 744 |
+
|
| 745 |
+
$$
|
| 746 |
+
{ \begin{array} { l } { { \frac { \tau } { \mathrm { S A } \left( { \mathrm { S } } \right) } } } \\ { { \mathrm { S A } \left( { \mathrm { D } } \right) } } \\ { { \mathrm { D C l o g ~ ( S ) } } } \\ { { \mathrm { D C l o g ~ ( D ) } } } \end{array} } \left| \begin{array} { l l l l l l l l } { { 1 0 ^ { 1 } } } & { { 1 0 ^ { 0 } } } & { { 1 0 ^ { - 1 } } } & { { 1 0 ^ { - 2 } } } & { { 1 0 ^ { - 3 } } } & { { 1 0 ^ { - 4 } } } \\ { { \check { \checkmark } } } & { { \check { \check { \checkmark } } } } & { { \check { \check { \check { \check { \check { \check { \check { \check { \tau } } } } } } } } } } & { { \check { \pmb { \check { \check { \check { \check { \tau } } } } } } } } & { { \check { \pmb { \check { \check { \check { \tau } } } } } } } & { { \check { \pmb { \check { \check { \check { \tau } } } } } } } \\ { { \check { \check { \check { \check { \check { \check { \check } } } } } } } } & { { \check { \check { \check { \check { \check { \check { \check { \check { \check } } } } } } } } } } & { { \check { \check { \check { \check { \check { \check { \check { \check { \tau } } } } } } } } } } & { { \check { \check { \check { \check { \check { \check { \check { \tau } } } } } } } } } & { \check { \pmb { \check { \check { \check { \check { \check { \check } } } } } } } } \\ { { \check { \check { \check { \check { \check } { \check { \check } } } } } } } & { { \check { \check { \check { \check { \check { \check { \check } } } } } } } } & { { \check { \check { \check { \check { \check { \check { \check } } } } } } } & { { \check { \check { \check { \check { \check { \check } } } } } } } & { { \check { \check { \check { \check { \check { \check } } } } } } \end{array} } \right| }
|
| 747 |
+
$$
|
| 748 |
+
|
| 749 |
+
By operating in the log-space, DC is significantly more stable than SA. In this experimental setting, DC log is stable in single floating point precision until $\tau = 1 0 ^ { - 3 6 }$ .
|
| 750 |
+
|
| 751 |
+
# C TOP-K PREDICTION: MARGINALIZATION WITH THE ELEMENTARY SYMMETRIC POLYNOMIALS
|
| 752 |
+
|
| 753 |
+
We consider the probability of label $i$ being part of the final top- $k$ prediction. To that end, we marginalize over all $k$ -tuples that contain $i$ as one of their element. Then the probability of selecting label $i$ for the top- $k$ prediction can be written as:
|
| 754 |
+
|
| 755 |
+
$$
|
| 756 |
+
p _ { i } ^ { ( k ) } \propto \sum _ { \bar { \mathbf { y } } \in \mathcal { Y } _ { i } ^ { ( k ) } } \exp ( \sum _ { j \in \bar { \mathbf { y } } } s _ { j } ) .
|
| 757 |
+
$$
|
| 758 |
+
|
| 759 |
+
Proposition 7. The unnormalized probability can be computed as:
|
| 760 |
+
|
| 761 |
+
$$
|
| 762 |
+
p _ { i } ^ { ( k ) } \propto \frac { d \log \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } } .
|
| 763 |
+
$$
|
| 764 |
+
|
| 765 |
+
Proof.
|
| 766 |
+
|
| 767 |
+
$$
|
| 768 |
+
\begin{array} { l } { p _ { i } ^ { ( k ) } \propto \exp ( s _ { i } ) \sigma _ { k - 1 } ( \exp ( \mathbf { s } _ { \backslash i } ) ) , } \\ { \displaystyle \quad = \exp ( s _ { i } ) \frac { d \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d \exp ( s _ { i } ) } , } \\ { \displaystyle \quad = \frac { d \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } } . } \end{array}
|
| 769 |
+
$$
|
| 770 |
+
|
| 771 |
+
Finally we can rescale the unnormalized probability $p _ { i } ^ { ( k ) }$ by $\sigma _ { k } \big ( \exp ( \mathbf { s } ) \big )$ since the latter quantity is independent of $i$ . We obtain:
|
| 772 |
+
|
| 773 |
+
$$
|
| 774 |
+
\hat { p _ { i } } ^ { ( k ) } \propto \frac { 1 } { \sigma _ { k } ( \exp ( \mathbf { s } ) ) } \frac { d \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } } = \frac { d \log \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } } .
|
| 775 |
+
$$
|
| 776 |
+
|
| 777 |
+
NB. We prefer to use $\frac { d \log \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } }$ rather than $\frac { d \sigma _ { i } ( \exp ( \mathbf { s } ) ) } { d s _ { i } }$ for stability reasons. Once the unnormalized probabilities are computed, they can be normalized by simply dividing by their sum.
|
| 778 |
+
|
| 779 |
+
# D HYPER-PARAMETERS & EXPERIMENTAL DETAILS
|
| 780 |
+
|
| 781 |
+
# D.1 THE TEMPERATURE PARAMETER
|
| 782 |
+
|
| 783 |
+
In this section, we discuss the choice of the temperature parameter. Note that such insights are not necessarily confined to a top- $k$ minimization: we believe that these ideas generalize to any loss that is smoothed with a temperature parameter.
|
| 784 |
+
|
| 785 |
+
# D.1.1 OPTIMIZATION AND LEARNING
|
| 786 |
+
|
| 787 |
+
When the temperature $\tau$ has a low value, propositions 3 and 4 suggest that $L _ { k , \tau }$ is a sound learning objective. However, as shown in Figure 2a, optimization is difficult and can fail in practice. Conversely, optimization with a high value of the temperature is easy, but uninformative about the learning: then $L _ { k , \tau }$ is not representative of the task loss we wish to learn.
|
| 788 |
+
|
| 789 |
+
In other words, there is a trade-off between the ease of the optimization and the quality of the surrogate loss in terms of learning. Therefore, it makes sense to use a low temperature that still permits satisfactory optimization.
|
| 790 |
+
|
| 791 |
+
# D.1.2 ILLUSTRATION ON CIFAR-100
|
| 792 |
+
|
| 793 |
+
In Figure 2a, we have provided the plots of the training objective to illustrate the speed of convergence. In Table 6, we give the training and validation accuracies to show the influence of the temperature:
|
| 794 |
+
|
| 795 |
+
Table 6: Influence of the temperature parameter on the training accuracy and testing accuracy.
|
| 796 |
+
|
| 797 |
+
<table><tr><td rowspan=1 colspan=1>Temperature</td><td rowspan=1 colspan=1>Training Accuracy (%)</td><td rowspan=1 colspan=1>Testing Accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>10.01</td><td rowspan=1 colspan=1>10.38</td></tr><tr><td rowspan=1 colspan=1>10-3</td><td rowspan=1 colspan=1>17.40</td><td rowspan=1 colspan=1>18.19</td></tr><tr><td rowspan=1 colspan=1>10-2</td><td rowspan=1 colspan=1>98.95</td><td rowspan=1 colspan=1>91.35</td></tr><tr><td rowspan=1 colspan=1>10-1100</td><td rowspan=1 colspan=1>99.7399.78</td><td rowspan=1 colspan=1>91.7091.52</td></tr><tr><td rowspan=1 colspan=1>101</td><td rowspan=1 colspan=1>99.62</td><td rowspan=1 colspan=1>90.92</td></tr><tr><td rowspan=1 colspan=1>102</td><td rowspan=1 colspan=1>99.42</td><td rowspan=1 colspan=1>90.46</td></tr></table>
|
| 798 |
+
|
| 799 |
+
# D.1.3 TO ANNEAL OR NOT TO ANNEAL
|
| 800 |
+
|
| 801 |
+
The choice of temperature parameter can affect the scale of the loss function. In order to preserve a sensible trade-off between regularizer and loss, it is important to adjust the regularization hyperparameter(s) accordingly (the value of the quadratic regularization for instance). Similarly, the energy landscape may vary significantly for a different value of the temperature, and the learning rate may need to be adapted too.
|
| 802 |
+
|
| 803 |
+
Continuation methods usually rely on an annealing scheme to gradually improve the quality of the approximation. For this work, we have found that such an approach required heavy engineering and did not provide substantial improvement in our experiments. Indeed, we have mentioned that other hyper-parameters depend on the temperature, thus these need to be adapted dynamically too. This requires sensitive heuristics. Furthermore, we empirically find that setting the temperature to an appropriate fixed value yields the same performance as careful fine-tuning of a pre-trained network with temperature annealing.
|
| 804 |
+
|
| 805 |
+
# D.1.4 PRACTICAL METHODOLOGY
|
| 806 |
+
|
| 807 |
+
We summarize the methodology that reflects the previous insights and that we have found to work well during our experimental investigation. First, the temperature hyper-parameter is set to a low fixed value that allows for the model to learn on the training data set. Then other hyper-parameters, such as quadratic regularization and learning rate are adapted as usual by cross-validation on the validation set. We believe that the optimal value of the temperature is mostly independent of the architecture of the neural network, but is greatly influenced by the values of $k$ and $n$ (see how these impact the number of summands involved in $L _ { k , \tau }$ , and therefore its scale).
|
| 808 |
+
|
| 809 |
+
# D.2 THE MARGIN
|
| 810 |
+
|
| 811 |
+
# D.2.1 RELATIONSHIP WITH SQUARED NORM REGULARIZATION
|
| 812 |
+
|
| 813 |
+
In this subsection, we establish the relationship between hyper-parameters of the margin and of the regularization with a squared norm. Typically the regularizing norm is the Frobenius norm in deep learning, but the following results will follow for any norm $\| \cdot \|$ . Although we prove the result for our top- $k$ loss, we also point out that these results easily generalize to any linear latent structural SVM.
|
| 814 |
+
|
| 815 |
+
First, we make explicit the role of $\alpha$ in $l _ { k }$ with an overload of notation:
|
| 816 |
+
|
| 817 |
+
$$
|
| 818 |
+
l _ { k } ( \mathbf { s } , y , \alpha ) = \operatorname* { m a x } \left\{ \left( \mathbf { s } _ { \backslash y } + \alpha \mathbf { 1 } \right) _ { [ k ] } - s _ { y } , 0 \right\} ,
|
| 819 |
+
$$
|
| 820 |
+
|
| 821 |
+
where $\alpha$ is a non-negative real number. Now consider the problem of learning a linear top- $k$ SVM on a dataset $\left( \mathbf { x } _ { i } , y _ { i } \right) _ { 1 \leq i \leq N } \in \left( \mathbb { R } ^ { d } \times \{ 1 , . . . , n \} \right) ^ { N }$ . We (hyper-)parameterize this problem by $\lambda$ and $\alpha$ :
|
| 822 |
+
|
| 823 |
+
$$
|
| 824 |
+
( P _ { \lambda , \alpha } ) : \operatorname* { m i n } _ { \mathbf { w } \in \mathbb { R } ^ { d \times n } } \frac { \lambda } { 2 } \| \mathbf { w } \| ^ { 2 } + \frac { 1 } { N } \sum _ { i = 1 } ^ { N } l _ { k } ( \mathbf { w } ^ { T } \mathbf { x } _ { i } , y _ { i } , \alpha ) .
|
| 825 |
+
$$
|
| 826 |
+
|
| 827 |
+
Definition 2. Let $\lambda _ { 1 } , \lambda _ { 2 } , \alpha _ { 1 } , \alpha _ { 2 } \geq 0$ . We say that $\left( P _ { \lambda _ { 1 } , \alpha _ { 1 } } \right)$ and $\left( P _ { \lambda _ { 2 } , \alpha _ { 2 } } \right)$ are equivalent if there exists $\gamma > 0 , \nu \in \mathbb { R }$ such that:
|
| 828 |
+
|
| 829 |
+
Justification. This definition makes sense because for $\gamma > 0 , \nu \in \mathbb { R }$ , $( \gamma \mathbf { w } + \nu )$ has the same decision boundary as w. In other words, equivalent problems yield equivalent classifiers.
|
| 830 |
+
|
| 831 |
+
Proposition 8. Let $\lambda , \alpha \geq 0$ .
|
| 832 |
+
|
| 833 |
+
1. If $\alpha > 0$ and $\lambda > 0$ , then problem $( P _ { \lambda , \alpha } )$ is equivalent to problems $( P _ { \alpha \lambda , 1 } )$ and $\left( P _ { 1 , \alpha \lambda } \right)$ .
|
| 834 |
+
2. If $\alpha = 0$ or $\lambda = 0$ , then problem $( P _ { \lambda , \alpha } )$ is equivalent to problem $( P _ { 0 , 0 } )$ .
|
| 835 |
+
|
| 836 |
+
Proof. Let $\mathbf { w } \in \mathbb { R } ^ { d \times n }$ . We introduce a constant $\beta > 0$ . Then we can successively write:
|
| 837 |
+
|
| 838 |
+
$$
|
| 839 |
+
\begin{array} { r l } & { \iff \implies \mathbf { w } \mathrm { ~ i s ~ a s o l u i o n t o ~ t o ~ } \underset { \mathbf { w } \in \mathbb { R } ^ { d \times \times \cdots } } { \operatorname* { m i n } } \frac { \lambda } { 2 } \| \mathbf { w } \| ^ { 2 } + \frac { 1 } { N } \underset { i = 1 } { \overset { N } { \sum } } l _ { k } ( \mathbf { w } ^ { T } \mathbf { x } _ { \mathbf { x } } , y _ { \mathbf { x } } , \alpha ) , } \\ & { \implies \mathbf { w } \mathrm { ~ i s ~ a s o l u i o n ~ t o ~ } \underset { \mathbf { w } \in \mathbb { R } ^ { d \times \times \cdots } } { \operatorname* { m i n } } \frac { \lambda } { 2 } \| \mathbf { w } \| ^ { 2 } + \frac { 1 } { N } \underset { i = 1 } { \overset { N } { \sum } } \operatorname* { m a x } \{ ( \mathbf { w } _ { \mathbf { y } } ^ { T } \mathbf { x } _ { \mathbf { x } } + \alpha \mathbf { I } ) _ { \vert k \vert } - \mathbf { w } _ { \mathbf { y } } ^ { T } \mathbf { x } _ { \mathbf { x } } , 0 \} , } \\ & { \iff \mathbf { w } \mathrm { ~ i s ~ a s o l u i o n ~ t o ~ } \underset { \mathbf { w } \in \mathbb { R } ^ { d \times \times \times \cdots } } { \operatorname* { m i n } } \frac { \lambda } { 2 } \| \mathbf { w } \| ^ { 2 } + \frac { 1 } { N } \underset { i = 1 } { \overset { N } { \sum } } \operatorname* { m a x } \{ ( \frac { 1 } { \beta } \mathbf { w } _ { \mathbf { y } } ^ { T } \mathbf { x } _ { \mathbf { y } } + \frac { \alpha } { \beta } \mathbf { I } ) _ { \vert k \vert } - \frac { 1 } { \beta } \mathbf { w } _ { \mathbf { x } } ^ { T } \mathbf { x } _ { \mathbf { x } } , 0 \} , } \\ & \iff \mathbf { w } \mathrm { ~ i s ~ a s o l u i o n ~ t o ~ } \underset { \mathbf { w } \in \mathbb { R } ^ { d \times \times \times \cdots } } { \operatorname* { m i n } } \frac { \lambda } { 2 } \| \frac { 1 } { \beta } \mathbf { w } \| ^ { 2 } + \frac { 1 } { N } \underset { i = 1 } { \overset { N } { \sum } } \operatorname* { m a x } \{ ( \frac { 1 } { \beta } \mathbf { w } _ { \mathbf { y } } ^ { T } \mathbf { x } _ { \mathbf { y } } + \frac { \alpha } { \beta } \ \end{array}
|
| 840 |
+
$$
|
| 841 |
+
|
| 842 |
+
This holds for any $\beta > 0$ .
|
| 843 |
+
|
| 844 |
+
If $\alpha > 0$ and $\lambda > 0$ , we show equivalence with $\left( P _ { \alpha \lambda , 1 } \right)$ by setting $\beta$ to $\alpha$ and with $\left( P _ { 1 , \alpha \lambda } \right)$ by setting $\beta$ to $\textstyle { \frac { 1 } { \lambda } }$ . If $\alpha = 0$ , then $\begin{array} { r } { \frac { \alpha } { \beta } = 0 } \end{array}$ for any $\beta > 0$ and we can choose $\beta$ as small as needed to make $\beta \lambda$ arbitrarily
|
| 845 |
+
|
| 846 |
+
small.
|
| 847 |
+
|
| 848 |
+
If $\lambda = 0$ , $\beta \lambda = 0$ for any $\beta > 0$ and we can choose $\beta$ as large as needed to make $\frac { \alpha } { \beta }$ arbitrarily small.
|
| 849 |
+
|
| 850 |
+
Note that we do not need any hypothesis on the norm $\| \cdot \|$ , the result makes only use of the positive homogeneity property.
|
| 851 |
+
|
| 852 |
+
Consequence On Deep Networks. Proposition 8 shows that for a deep network trained with $l _ { k }$ , one can fix the value of $\alpha$ to 1, and treat the quadratic regularization of the last fully connected layer as an independent hyper-parameter. By doing this rather than tuning $\alpha$ , the loss keeps the same scale which may make it easier to find an appropriate learning rate.
|
| 853 |
+
|
| 854 |
+
When using the smooth loss, there is no direct equivalent to Proposition 8 because the log-sumexp function is not positively homogeneous. However one can consider that with a low enough temperature, the above insight can still be used in practice.
|
| 855 |
+
|
| 856 |
+
# D.2.2 EXPERIMENT ON IMAGENET
|
| 857 |
+
|
| 858 |
+
In this section, we provide experiments to qualitatively assess the importance of the margin by running experiments with a margin of either 0 or 1. The following results are obtained on our validation set, and do not make use of multiple crops.
|
| 859 |
+
|
| 860 |
+
Top-1 Error. As we have mentioned before, the case $( k , \tau , \alpha ) = ( 1 , 1 , 0 )$ corresponds exactly to Cross-Entropy. We compare this case against the same loss with a margin of 1: $( k , \bar { \tau } , \alpha ) = ( 1 , \ i , 1 )$ . We obtain the following results:
|
| 861 |
+
|
| 862 |
+
Table 7: Influence of the margin parameter on top-1 performance.
|
| 863 |
+
|
| 864 |
+
<table><tr><td>Margin</td><td>Top-1 Accuracy (%)</td></tr><tr><td>0</td><td>71.03</td></tr><tr><td>1</td><td>71.15</td></tr></table>
|
| 865 |
+
|
| 866 |
+
Top-5 Error. We now compare $( k , \tau , \alpha ) = ( 5 , 0 . 1 , 0 )$ and $( k , \tau , \alpha ) = ( 5 , 0 . 1 , 1 )$ :
|
| 867 |
+
|
| 868 |
+
Table 8: Influence of the margin parameter on top-5 performance.
|
| 869 |
+
|
| 870 |
+
<table><tr><td>Margin</td><td>Top-5 Accuracy (%)</td></tr><tr><td>0</td><td>89.12</td></tr><tr><td>1</td><td>89.45</td></tr></table>
|
| 871 |
+
|
| 872 |
+
# D.3 SUPPLEMENTARY DETAILS
|
| 873 |
+
|
| 874 |
+
In the main paper, we report the average of the scores on CIFAR-100 for clarity purposes. Here, we also detail the standard deviation of the scores for completeness.
|
| 875 |
+
|
| 876 |
+
Table 9: Testing performance on CIFAR-100 with different levels of label noise. We indicate the mean and standard deviation (in parenthesis) for each score.
|
| 877 |
+
|
| 878 |
+
<table><tr><td>Noise Level</td><td>Top-1 Accuracy (%) CE L5,1</td><td colspan="2">Top-5 Accuracy (%) CE</td><td></td></tr><tr><td>0.0</td><td>76.68 (0.38)</td><td></td><td></td><td>L5,1 94.29 (0.10)</td></tr><tr><td>0.2</td><td>68.20 (0.50)</td><td>69.33 (0.27) 71.30 (0.79)</td><td>94.34 (0.09) 87.89 (0.08)</td><td></td></tr><tr><td>0.4</td><td></td><td></td><td>83.04 (0.38)</td><td>90.59 (0.08)</td></tr><tr><td>0.6</td><td>61.18 (0.97)</td><td>70.02 (0.40) 67.97 (0.51)</td><td>79.59 (0.36)</td><td>87.39 (0.23)</td></tr><tr><td>0.8</td><td>52.50 (0.27) 35.53 (0.79)</td><td>55.85 (0.80)</td><td>74.80 (0.15)</td><td>83.86 (0.39)</td></tr><tr><td>1.0</td><td></td><td></td><td>67.70 (0.16)</td><td>79.32 (0.25)</td></tr><tr><td></td><td>14.06 (0.13)</td><td>15.28 (0.39)</td><td></td><td>72.93 (0.25)</td></tr></table>
|
parse/train/Hk5elxbRW/Hk5elxbRW_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/Hk5elxbRW/Hk5elxbRW_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/Hk5elxbRW/Hk5elxbRW_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/OItvP2-i9j/OItvP2-i9j_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/OItvP2-i9j/OItvP2-i9j_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/SJzSgnRcKX/SJzSgnRcKX.md
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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ONTEXT? PROBING FOR SENTENCE STRUCTURE IN CONTEXTUALIZED WORD REPRESENTATIONS
|
| 2 |
+
|
| 3 |
+
Ian Tenney,∗1 Patrick Xia,2 Berlin Chen,3 Alex Wang,4 Adam Poliak,2
|
| 4 |
+
R. Thomas McCoy,2 Najoung Kim,2 Benjamin Van Durme,2 Samuel R. Bowman,4
|
| 5 |
+
Dipanjan Das,1 and Ellie Pavlick1,5
|
| 6 |
+
1Google AI Language, 2Johns Hopkins University, 3Swarthmore College,
|
| 7 |
+
4New York University, 5Brown University
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Contextualized representation models such as ELMo (Peters et al., 2018a) and BERT (Devlin et al., 2018) have recently achieved state-of-the-art results on a diverse array of downstream NLP tasks. Building on recent token-level probing work, we introduce a novel edge probing task design and construct a broad suite of sub-sentence tasks derived from the traditional structured NLP pipeline. We probe word-level contextual representations from four recent models and investigate how they encode sentence structure across a range of syntactic, semantic, local, and long-range phenomena. We find that existing models trained on language modeling and translation produce strong representations for syntactic phenomena, but only offer comparably small improvements on semantic tasks over a non-contextual baseline.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION1
|
| 14 |
+
|
| 15 |
+
Pretrained word embeddings (Mikolov et al., 2013; Pennington et al., 2014) are a staple tool for NLP. These models provide continuous representations for word types, typically learned from cooccurrence statistics on unlabeled data, and improve generalization of downstream models across many domains. Recently, a number of models have been proposed for contextualized word embeddings. Instead of using a single, fixed vector per word type, these models run a pretrained encoder network over the sentence to produce contextual embeddings of each token. The encoder, usually an LSTM (Hochreiter & Schmidhuber, 1997) or a Transformer (Vaswani et al., 2017), can be trained on objectives like machine translation (McCann et al., 2017) or language modeling (Peters et al., 2018a; Radford et al., 2018; Howard & Ruder, 2018; Devlin et al., 2018), for which large amounts of data are available. The activations of this network–a collection of one vector per token–fit the same interface as conventional word embeddings, and can be used as a drop-in replacement input to any model. Applied to popular models, this technique has yielded significant improvements to the state-of-the-art on several tasks, including constituency parsing (Kitaev & Klein, 2018), semantic role labeling (He et al., 2018; Strubell et al., 2018), and coreference (Lee et al., 2018), and has outperformed competing techniques (Kiros et al., 2015; Conneau et al., 2017) that produce fixed-length representations for entire sentences.
|
| 16 |
+
|
| 17 |
+
Our goal in this work is to understand where these contextual representations improve over conventional word embeddings. Recent work has explored many token-level properties of these representations, such as their ability to capture part-of-speech tags (Blevins et al., 2018; Belinkov et al., 2017b; Shi et al., 2016), morphology (Belinkov et al., 2017a;b), or word-sense disambiguation (Peters et al., 2018a). Peters et al. (2018b) extends this to constituent phrases, and present a heuristic for unsupervised pronominal coreference. We expand on this even further and introduce a suite of edge probing tasks covering a broad range of syntactic, semantic, local, and long-range phenomena. In particular, we focus on asking what information is encoded at each position, and how well it encodes structural information about that word’s role in the sentence. Is this information primarily syntactic in nature, or do the representations also encode higher-level semantic relationships? Is this information local, or do the encoders also capture long-range structure?
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Probing model architecture (§ 3.1). All parameters inside the dashed line are fixed, while we train the span pooling and MLP classifiers to extract information from the contextual vectors. The example shown is for semantic role labeling, where $s ^ { ( 1 ) } = [ 1 , 2 )$ corresponds to the predicate (“eat”), while $s ^ { ( 2 ) } = [ 2 , 5 )$ is the argument (“strawberry ice cream”), and we predict label A1 as positive and others as negative. For entity and constituent labeling, only a single span is used.
|
| 21 |
+
|
| 22 |
+
We approach these questions with a probing model (Figure 1) that sees only the contextual embeddings from a fixed, pretrained encoder. The model can access only embeddings within given spans, such as a predicate-argument pair, and must predict properties, such as semantic roles, which typically require whole-sentence context. We use data derived from traditional structured NLP tasks: tagging, parsing, semantic roles, and coreference. Common corpora such as OntoNotes (Weischedel et al., 2013) provide a wealth of annotations for well-studied concepts which are both linguistically motivated and known to be useful intermediates for high-level language understanding. We refer to our technique as “edge probing”, as we decompose each structured task into a set of graph edges $( \ S 2 )$ which we can predict independently using a common classifier architecture $( \ S 3 . 1 ) ^ { \overline { { 2 } } }$ . We probe four popular contextual representation models $( \ S 3 . 2 )$ : CoVe (McCann et al., 2017), ELMo (Peters et al., 2018a), OpenAI GPT (Radford et al., 2018), and BERT (Devlin et al., 2018).
|
| 23 |
+
|
| 24 |
+
We focus on these models because their pretrained weights and code are available, since these are most likely to be used by researchers. We compare to word-level baselines to separate the contribution of context from lexical priors, and experiment with augmented baselines to better understand the role of pretraining and the ability of encoders to capture long-range dependencies.
|
| 25 |
+
|
| 26 |
+
# 2 EDGE PROBING
|
| 27 |
+
|
| 28 |
+
To carry out our experiments, we define a novel “edge probing” framework motivated by the need for a uniform set of metrics and architectures across tasks. Our framework is generic, and can be applied to any task that can be represented as a labeled graph anchored to spans in a sentence.
|
| 29 |
+
|
| 30 |
+
Formulation. Formally, we represent a sentence as a list of tokens $T = [ t _ { 0 } , t _ { 1 } , \dots , t _ { n } ]$ , and a labeled edge as $\{ s ^ { ( 1 ) } , s ^ { ( 2 ) } , L \}$ . We treat $s ^ { ( 1 ) } = [ i ^ { ( 1 ) } , j ^ { ( 1 ) } )$ and, optionally, $s ^ { ( 2 ) } = [ i ^ { ( 2 ) } , j ^ { ( 2 ) } )$ as (end-exclusive) spans. For unary edges such as constituent labels, $s ^ { ( 2 ) }$ is omitted. We take $L$ to be a set of zero or more targets from a task-specific label set $\mathcal { L }$ .
|
| 31 |
+
|
| 32 |
+
Table 1: Example sentence, spans, and target label for each task. $\mathrm { O } =$ OntoNotes, $\mathbf { W } =$ Winograd.
|
| 33 |
+
|
| 34 |
+
<table><tr><td>POS</td><td> The important thing about Disney is that it is a global [brand]1. -→ NN (Noun)</td></tr><tr><td></td><td>Constit.The important thing about Disney is that it [is a global brand]1.-→VP (Verb Phrase)</td></tr><tr><td></td><td>Depend.[Atmosphere]1 is always [fun]2 →nsubj (nominal subject)</td></tr><tr><td>Entities</td><td>The important thing about [Disneyli is that it is a global brand. -→ Organization</td></tr><tr><td>SRL</td><td>[The important thing about Disneyl2 [is]1 that it is a global brand. -→Argl (Agent)</td></tr><tr><td>SPR</td><td>[It]1 [endorsed]2 the White House strategy...→ {awareness, existed_after,...}</td></tr><tr><td>Coref.o</td><td>The important thing about [Disneyli is that [it]2 is a global brand. -→ True</td></tr><tr><td>Coref.W</td><td>[Charactersl2 entertain audiences because [theyli want people to be happy. -→ True Characters entertain [audiencesl2 because [theyli want people to be happy. -→ False</td></tr><tr><td>Rel.</td><td>The [burst]1 has been caused by water hammer [pressure]2. → Cause-Effect(ez,e1)</td></tr></table>
|
| 35 |
+
|
| 36 |
+
To cast all tasks into a common classification model, we focus on the labeling versions of each task. Spans (gold mentions, constituents, predicates, etc.) are given as inputs, and the model is trained to predict $L$ as a multi-label target. We note that this is only one component of the common pipelined (or end-to-end) approach to these tasks, and that in general our metrics are not comparable to models that jointly perform span identification and labeling. However, since our focus is on analysis rather than application, the labeling version is a better fit for our goals of isolating individual phenomena of interest, and giving a uniform metric – binary F1 score – across our probing suite.
|
| 37 |
+
|
| 38 |
+
# 2.1 TASKS
|
| 39 |
+
|
| 40 |
+
Our experiments focus on eight core NLP labeling tasks: part-of-speech, constituents, dependencies, named entities, semantic roles, coreference, semantic proto-roles, and relation classification. The tasks and their respective datasets are described below, and also detailed in Table 1 and Appendix B.
|
| 41 |
+
|
| 42 |
+
Part-of-speech tagging (POS) is the syntactic task of assigning tags such as noun, verb, adjective, etc. to individual tokens. We let $s _ { 1 } = [ \dot { i } , i + 1 )$ be a single token, and seek to predict the POS tag.
|
| 43 |
+
|
| 44 |
+
Constituent labeling is the more general task concerned with assigning a non-terminal label for a span of tokens within the phrase-structure parse of the sentence: e.g. is the span a noun phrase, a verb phrase, etc. We let $s _ { 1 } = [ i , j )$ be a known constituent, and seek to predict the constituent label.
|
| 45 |
+
|
| 46 |
+
Dependency labeling is similar to constituent labeling, except that rather than aiming to position a span of tokens within the phrase structure, dependency labeling seeks to predict the functional relationships of one token relative to another: e.g. is in a modifier-head relationship, a subjectobject relationship, etc. We take $s _ { 1 } = [ i , i + 1 )$ to be a single token and $s _ { 2 } = [ j , j \in \bar { 1 } )$ to be its syntactic head, and seek to predict the dependency relation between tokens $i$ and $j$ .
|
| 47 |
+
|
| 48 |
+
Named entity labeling is the task of predicting the category of an entity referred to by a given span, e.g. does the entity refer to a person, a location, an organization, etc. We let $s _ { 1 } = [ i , j )$ represent an entity span and seek to predict the entity type.
|
| 49 |
+
|
| 50 |
+
Semantic role labeling (SRL) is the task of imposing predicate-argument structure onto a natural language sentence: e.g. given a sentence like “Mary pushed John”, SRL is concerned with identifying “Mary” as the pusher and “John” as the pushee. We let $s _ { 1 } = [ i _ { 1 } , j _ { 1 } )$ represent a known predicate and $s _ { 2 } = [ i _ { 2 } , j _ { 2 } )$ represent a known argument of that predicate, and seek to predict the role that the argument $s _ { 2 }$ fills–e.g. ARG0 (agent, the pusher) vs. ARG1 (patient, the pushee).
|
| 51 |
+
|
| 52 |
+
Coreference is the task of determining whether two spans of tokens (“mentions”) refer to the same entity (or event): e.g. in a given context, do “Obama” and “the former president” refer to the same person, or do “New York City” and “there” refer to the same place. We let $s _ { 1 }$ and $s _ { 2 }$ represent known mentions, and seek to make a binary prediction of whether they co-refer.
|
| 53 |
+
|
| 54 |
+
Semantic proto-role (SPR) labeling is the task of annotating fine-grained, non-exclusive semantic attributes, such as change of state or awareness, over predicate-argument pairs. E.g.
|
| 55 |
+
|
| 56 |
+
given the sentence “Mary pushed John”, whereas SRL is concerned with identifying “Mary” as the pusher, SPR is concerned with identifying attributes such as awareness (whether the pusher is aware that they are doing the pushing). We let $s _ { 1 }$ represent a predicate span and $s _ { 2 }$ a known argument head, and perform a multi-label classification over potential attributes of the predicateargument relation.
|
| 57 |
+
|
| 58 |
+
Relation Classification (Rel.) is the task of predicting the real-world relation that holds between two entities, typically given an inventory of symbolic relation types (often from an ontology or database schema). For example, given a sentence like “Mary is walking to work”, relation classification is concerned with linking “Mary” to “work” via the Entity-Destination relation. We let $s _ { 1 }$ and $s _ { 2 }$ represent known mentions, and seek to predict the relation type.
|
| 59 |
+
|
| 60 |
+
# 2.2 DATASETS
|
| 61 |
+
|
| 62 |
+
We use the annotations in the OntoNotes 5.0 corpus (Weischedel et al., 2013) for five of the above eight tasks: POS tags, constituents, named entities, semantic roles, and coreference. In all cases, we simply cast the original annotation into our edge probing format. For POS tagging, we simply extract these labels from the constituency parse data in OntoNotes. For coreference, since OntoNotes only provides annotations for positive examples (pairs of mentions that corefer) we generate negative examples by generating all pairs of mentions that are not explicitly marked as coreferent.
|
| 63 |
+
|
| 64 |
+
The OntoNotes corpus does not contain annotations for dependencies, proto-roles, or semantic relations. Thus, for dependencies, we use the English Web Treebank portion of the Universal Dependencies 2.2 release (Silveira et al., 2014). For SPR, we use two datasets, one (SPR1; Teichert et al. (2017)) derived from Penn Treebank and one (SPR2; Rudinger et al. (2018)) derived from English Web Treebank. For relation classification, we use the SemEval 2010 Task 8 dataset (Hendrickx et al., 2009), which consists of sentences sampled from English web text, labeled with a set of 9 directional relation types.
|
| 65 |
+
|
| 66 |
+
In addition to the OntoNotes coreference examples, we include an extra “challenge” coreference dataset based on the Winograd schema (Levesque et al., 2012). Winograd schema problems focus on cases of pronoun resolution which are syntactically ambiguous and thus are intended to require subtler semantic inference in order to resolve correctly (see example in Table 1). We use the version of the Definite Pronoun Resolution (DPR) dataset (Rahman & Ng, 2012) employed by White et al. (2017), which contains balanced positive and negative pairs.
|
| 67 |
+
|
| 68 |
+
# 3 EXPERIMENTAL SET-UP
|
| 69 |
+
|
| 70 |
+
# 3.1 PROBING MODEL
|
| 71 |
+
|
| 72 |
+
Our probing architecture is illustrated in Figure 1. The model is designed to have limited expressive power on its own, as to focus on what information can be extracted from the contextual embeddings. We take a list of contextual vectors $[ e _ { 0 } , e _ { 1 } , \ldots , e _ { n } ]$ and integer spans $s ^ { ( 1 ) } = [ i ^ { ( 1 ) } , j ^ { ( 1 ) } )$ and (optionally) $s ^ { ( 2 ) } = [ i ^ { ( 2 ) } , j ^ { ( 2 ) } )$ as inputs, and use a projection layer followed by the self-attention pooling operator of Lee et al. (2017) to compute fixed-length span representations. Pooling is only within the bounds of a span, e.g. the vectors $[ e _ { i } , e _ { i + 1 } , \ldots , e _ { j - 1 } ]$ , which means that the only information our model can access about the rest of the sentence is that provided by the contextual embeddings.
|
| 73 |
+
|
| 74 |
+
The span representations are concatenated and fed into a two-layer MLP followed by a sigmoid output layer. We train by minimizing binary cross-entropy against the target label set $\bar { L ^ { \mathrm { ~ \in ~ } } } \{ 0 , \bar { 1 } \} ^ { | \mathcal { L } | }$ . Our code is implemented in PyTorch (Paszke et al., 2017) using the AllenNLP (Gardner et al., 2018) toolkit. For further details on training, see Appendix C.
|
| 75 |
+
|
| 76 |
+
# 3.2 SENTENCE REPRESENTATION MODELS
|
| 77 |
+
|
| 78 |
+
We explore four recent contextual encoder models: CoVe, ELMo, OpenAI GPT, and BERT. Each model takes tokens $[ t _ { 0 } , t _ { 1 } , \ldots , t _ { n } ]$ as input and produces a list of contextual vectors $[ e _ { 0 } , e _ { 1 } , \ldots , e _ { n } ]$ .
|
| 79 |
+
|
| 80 |
+
CoVe (McCann et al., 2017) uses the top-level activations of a two-layer biLSTM trained on EnglishGerman translation, concatenated with 300-dimensional GloVe vectors. The source data consists of
|
| 81 |
+
|
| 82 |
+
7 million sentences from web crawl, news, and government proceedings (WMT 2017; Bojar et al.
|
| 83 |
+
(2017)).
|
| 84 |
+
|
| 85 |
+
ELMo (Peters et al., 2018a) is a two-layer bidirectional LSTM language model, built over a contextindependent character CNN layer and trained on the Billion Word Benchmark dataset (Chelba et al., 2014), consisting primarily of newswire text. We follow standard usage and take a linear combination of the ELMo layers, using learned task-specific scalars (Equation 1 of Peters et al., 2018a).
|
| 86 |
+
|
| 87 |
+
GPT (Radford et al., 2018) is a 12-layer Transformer (Vaswani et al., 2017) encoder trained as a left-to-right language model on the Toronto Books Corpus (Zhu et al., 2015). Departing from the original authors, we do not fine-tune the encoder3.
|
| 88 |
+
|
| 89 |
+
BERT (Devlin et al., 2018) is a deep Transformer (Vaswani et al., 2017) encoder trained jointly as a masked language model and on next-sentence prediction, trained on the concatenation of the Toronto Books Corpus (Zhu et al., 2015) and English Wikipedia. As with GPT, we do not finetune the encoder weights. We probe the publicly released bert-base-uncased (12-layer) and bert-large-uncased (24-layer) models4.
|
| 90 |
+
|
| 91 |
+
For BERT and GPT, we compare two methods for yielding contextual vectors for each token: cat where we concatenate the subword embeddings with the activations of the top layer, similar to CoVe, and mix where we take a linear combination of layer activations (including embeddings) using learned task-specific scalars (Equation 1 of Peters et al., 2018a), similar to ELMo.
|
| 92 |
+
|
| 93 |
+
The resulting contextual vectors have dimension $d = 9 0 0$ for CoVe, $d = 1 0 2 4$ for ELMo, and $d = 1 5 3 6$ (cat) or $d = 7 6 8 ( \mathrm { m i x } )$ for GPT and BERT-base, and $d = 2 0 4 8$ (cat) or $d = 1 0 2 4$ (mix) for BERT-large5. The pretrained models expect different tokenizations and input processing. We use a heuristic alignment algorithm based on byte-level Levenshtein distance, explained in detail in Appendix E, in order to re-map spans from the source data to the tokenization expected by the above models.
|
| 94 |
+
|
| 95 |
+
# 4 EXPERIMENTS
|
| 96 |
+
|
| 97 |
+
Again, we want to answer: What do contextual representations encode that conventional word embeddings do not? Our experimental comparisons, described below, are intended to ablate various aspects of contextualized encoders in order to illuminate how the model captures different types of linguistic information.
|
| 98 |
+
|
| 99 |
+
Lexical Baselines. In order to probe the effect of each contextual encoder, we train a version of our probing model directly on the most closely related context-independent word representations. This baseline measures the performance that can be achieved from lexical priors alone, without any access to surrounding words. For CoVe, we compare to the embedding layer of that model, which consists of 300-dimensional GloVe vectors trained on 840 billion tokens of CommonCrawl (web) text. For ELMo, we use the activations of the context-independent character-CNN layer (layer 0) from the full model. For GPT and for BERT, we use the learned subword embeddings from the full model.
|
| 100 |
+
|
| 101 |
+
Randomized ELMo. Randomized neural networks have recently (Zhang & Bowman, 2018) shown surprisingly strong performance on many tasks, suggesting that architecture may play a significant role in learning useful feature functions. To help understand what is actually learned during the encoder pretraining, we compare with a version of the ELMo model in which all weights above the lexical layer (layer 0) are replaced with random orthonormal matrices6.
|
| 102 |
+
|
| 103 |
+
Word-Level CNN. To what extent do contextual encoders capture long-range dependencies, versus simply modeling local context? We extend our lexical baseline by introducing a fixed-width convolutional layer on top of the word representations. As comparing to the lexical baseline factors out word-level priors, comparing to this CNN baseline factors out local relationships, such as the presence of nearby function words, and allows us to see the contribution of long-range context to encoder performance. To implement this, we replace the projection layer in our probing model with a fully-connected CNN that sees $\pm 1$ or $\pm 2$ tokens around the center word (i.e. kernel width 3 or 5).
|
| 104 |
+
|
| 105 |
+
# 5 RESULTS
|
| 106 |
+
|
| 107 |
+
Using the above experimental design, we return to the central questions originally posed. That is, what types of syntactic and semantic information does each model encode at each position? And is the information captured primarily local, or do contextualized embeddings encode information about long-range sentential structure?
|
| 108 |
+
|
| 109 |
+
Comparison of representation models. We report F1 scores for ELMo, CoVe, GPT, and BERT in Table 2. We observe that ELMo and GPT (with mix features) have comparable performance, with ELMo slightly better on most tasks but the Transformer scoring higher on relation classification and OntoNotes coreference. Both models outperform CoVe by a significant margin (6.3 F1 points on average), meaning that the information in their word representations makes it easier to recover details of sentence structure. It is important to note that while ELMo, CoVe, and the GPT can be applied to the same problems, they differ in architecture, training objective, and both the quantity and genre of training data $( \ S \ 3 . 2 )$ . Furthermore, on all tasks except for Winograd coreference, the lexical representations used by the ELMo and GPT models outperform GloVe vectors (by 5.4 and 2.4 points on average, respectively). This is particularly pronounced on constituent and semantic role labeling, where the model may be benefiting from better handling of morphology by character-level or subword representations.
|
| 110 |
+
|
| 111 |
+
We observe that using ELMo-style scalar mixing (mix) instead of concatenation improves performance significantly (1-3 F1 points on average) on both deep Transformer models (BERT and GPT). We attribute this to the most relevant information being contained in intermediate layers, which agrees with observations by Blevins et al. (2018), Peters et al. (2018a), and Devlin et al. (2018), and with the finding of Peters et al. (2018b) that top layers may be overly specialized to perform next-word prediction.
|
| 112 |
+
|
| 113 |
+
When using scalar mixing $\left( \mathrm { m i x } \right)$ , we observe that the BERT-base model outperforms GPT, which has a similar 12-layer Transformer architecture, by approximately 2 F1 points on average. The 24- layer BERT-large model performs better still, besting BERT-base by 1.1 F1 points and ELMo by 2.7 F1 - a nearly $20 \%$ relative reduction in error on most tasks.
|
| 114 |
+
|
| 115 |
+
We find that the improvements of the BERT models are not uniform across tasks. In particular, BERT-large improves on ELMo by $7 . 4 \ \mathrm { F 1 }$ points on OntoNotes coreference, more than a $40 \%$ reduction in error and nearly as high as the improvement of the ELMo encoder over its lexical baseline. We also see a large improvement (7.8 F1 points)7 on Winograd-style coreference from BERT-large in particular, suggesting that deeper unsupervised models may yield further improvement on difficult semantic tasks.
|
| 116 |
+
|
| 117 |
+
Genre Effects. Our probing suite is drawn mostly from newswire and web text $( \ S \ 2 )$ . This is a good match for the Billion Word Benchmark (BWB) used to train the ELMo model, but a weaker match for the Books Corpus used to train the published GPT model. To control for this, we train a clone of the GPT model on the BWB, using the code and hyperparameters of Radford et al. (2018). We find that this model performs only slightly better $( + 0 . 1 5 \ \mathrm { F 1 }$ on average) on our probing suite than the Books Corpus-trained model, but still underperforms ELMo by nearly 1 F1 point.
|
| 118 |
+
|
| 119 |
+
Encoding of syntactic vs. semantic information. By comparing to lexical baselines, we can measure how much the contextual information from a particular encoder improves performance on each task. Note that in all cases, the contextual representation is strictly more expressive, since it includes access to the lexical representations either by concatenation or by scalar mixing.
|
| 120 |
+
|
| 121 |
+
Table 2: Comparison of representation models and their respective lexical baselines. Numbers reported are micro-averaged F1 score on respective test sets. Lex. denotes the lexical baseline $( \ S 4 )$ for each model, and bold denotes the best performance on each task. Lines in italics are subsets of the targets from a parent task; these are omitted in the macro average. SRL numbers consider core and non-core roles, but ignore references and continuations. Winograd (DPR) results are the average of five runs each using a random sample (without replacement) of $80 \%$ of the training data. $9 5 \%$ confidence intervals (normal approximation) are approximately $\pm 3$ ( $\pm 6$ with BERT-large) for Winograd, $\pm 1$ for SPR1 and SPR2, and $\pm 0 . 5$ or smaller for all other tasks.
|
| 122 |
+
|
| 123 |
+
<table><tr><td></td><td colspan="3">CoVe</td><td colspan="3">ELMo</td><td colspan="3">GPT</td></tr><tr><td></td><td>Lex.</td><td>Full</td><td>Abs.△</td><td>Lex.</td><td>Full</td><td>Abs. △</td><td>Lex.</td><td>cat</td><td>mix</td></tr><tr><td>Part-of-Speech</td><td>85.7</td><td>94.0</td><td>8.4</td><td>90.4</td><td>96.7</td><td>6.3</td><td>88.2</td><td>94.9</td><td>95.0</td></tr><tr><td>Constituents</td><td>56.1</td><td>81.6</td><td>25.4</td><td>69.1</td><td>84.6</td><td>15.4</td><td>65.1</td><td>81.3</td><td>84.6</td></tr><tr><td>Dependencies</td><td>75.0</td><td>83.6</td><td>8.6</td><td>80.4</td><td>93.9</td><td>13.6</td><td>77.7</td><td>92.1</td><td>94.1</td></tr><tr><td>Entities</td><td>88.4</td><td>90.3</td><td>1.9</td><td>92.0</td><td>95.6</td><td>3.5</td><td>88.6</td><td>92.9</td><td>92.5</td></tr><tr><td>SRL (all)</td><td>59.7</td><td>80.4</td><td>20.7</td><td>74.1</td><td>90.1</td><td>16.0</td><td>67.7</td><td>86.0</td><td>89.7</td></tr><tr><td>Core roles</td><td>56.2</td><td>81.0</td><td>24.7</td><td>73.6</td><td>92.6</td><td>19.0</td><td>65.1</td><td>88.0</td><td>92.0</td></tr><tr><td>Non-core roles</td><td>67.7</td><td>78.8</td><td>11.1</td><td>75.4</td><td>84.1</td><td>8.8</td><td>73.9</td><td>81.3</td><td>84.1</td></tr><tr><td>OntoNotes coref.</td><td>72.9</td><td>79.2</td><td>6.3</td><td>75.3</td><td>84.0</td><td>8.7</td><td>71.8</td><td>83.6</td><td>86.3</td></tr><tr><td>SPR1</td><td>73.7</td><td>77.1</td><td>3.4</td><td>80.1</td><td>84.8</td><td>4.7</td><td>79.2</td><td>83.5</td><td>83.1</td></tr><tr><td>SPR2</td><td>76.6</td><td>80.2</td><td>3.6</td><td>82.1</td><td>83.1</td><td>1.0</td><td>82.2</td><td>83.8</td><td>83.5</td></tr><tr><td>Winograd coref.</td><td>52.1</td><td>54.3</td><td>2.2</td><td>54.3</td><td>53.5</td><td>-0.8</td><td>51.7</td><td>52.6</td><td>53.8</td></tr><tr><td>Rel. (SemEval)</td><td>51.0</td><td>60.6</td><td>9.6</td><td>55.7</td><td>77.8</td><td>22.1</td><td>58.2</td><td>81.3</td><td>81.0</td></tr><tr><td>Macro Average</td><td>69.1</td><td>78.1</td><td>9.0</td><td>75.4</td><td>84.4</td><td>9.1</td><td>73.0</td><td>83.2</td><td>84.4</td></tr><tr><td></td><td colspan="3">BERT-base</td><td colspan="6">BERT-large</td></tr><tr><td></td><td>Lex.</td><td>F1 Score cat</td><td>mix</td><td>Abs.△ ELMo</td><td>Lex.</td><td>F1 Score</td><td></td><td>Abs.△ (base)</td><td>ELMo</td></tr><tr><td>Part-of-Speech</td><td></td><td></td><td>96.7</td><td>0.0</td><td></td><td>cat</td><td>mix</td><td>0.2</td><td>0.2</td></tr><tr><td>Constituents</td><td>88.4 68.4</td><td>97.0</td><td>86.7</td><td>2.1</td><td>88.1 69.0</td><td>96.5 80.1</td><td>96.9 87.0</td><td>0.4</td><td>2.5</td></tr><tr><td>Dependencies</td><td></td><td>83.7</td><td>95.1</td><td>1.1</td><td>80.2</td><td>91.5</td><td>95.4</td><td>0.3</td><td>1.4</td></tr><tr><td>Entities</td><td>80.1 90.9</td><td>93.0</td><td>96.2</td><td>0.6</td><td>91.8</td><td></td><td>96.5</td><td>0.3</td><td>0.9</td></tr><tr><td>SRL (all)</td><td>75.4</td><td>96.1</td><td>91.3</td><td>1.2</td><td>76.5</td><td>96.2 88.2</td><td>92.3</td><td>1.0</td><td>2.2</td></tr><tr><td>Core roles</td><td>74.9</td><td>89.4</td><td>93.6</td><td>1.0</td><td>76.3</td><td>89.9</td><td>94.6</td><td>1.0</td><td>2.0</td></tr><tr><td>Non-core roles</td><td>76.4</td><td>91.4</td><td>85.9</td><td>1.8</td><td>76.9</td><td>84.1</td><td>86.9</td><td>1.0</td><td></td></tr><tr><td>OntoNotes coref.</td><td>74.9</td><td>84.7 88.7</td><td>90.2</td><td>6.3</td><td>75.7</td><td>89.6</td><td>91.4</td><td>1.2</td><td>2.8 7.4</td></tr><tr><td>SPR1</td><td>79.2</td><td></td><td></td><td>1.3</td><td></td><td>85.1</td><td>85.8</td><td>-0.3</td><td></td></tr><tr><td>SPR2</td><td></td><td>84.7</td><td>86.1 83.8</td><td></td><td>79.6</td><td></td><td>84.1</td><td>0.3</td><td>1.0 1.0</td></tr><tr><td></td><td>81.7</td><td>83.0</td><td></td><td>0.7</td><td>81.6</td><td>83.2</td><td></td><td></td><td></td></tr><tr><td>Winograd coref. Rel. (SemEval)</td><td>54.3 57.4</td><td>53.6 78.3</td><td>54.9 82.0</td><td>1.4 4.2</td><td>53.0 56.2</td><td>53.8 77.6</td><td>61.4 82.4</td><td>6.5 0.5</td><td>7.8 4.6</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Macro Average</td><td>75.1</td><td>84.8</td><td>86.3</td><td>1.9</td><td>75.2</td><td>84.2</td><td>87.3</td><td>1.0</td><td>2.9</td></tr></table>
|
| 124 |
+
|
| 125 |
+
We observe that ELMo, CoVe, and GPT all follow a similar trend across our suite (Table 2), showing the largest gains on tasks which are considered to be largely syntactic, such as dependency and constituent labeling, and smaller gains on tasks which are considered to require more semantic reasoning, such as SPR and Winograd. We observe small absolute improvements $+ 6 . 3$ and $+ 3 . 5$ for ELMo Full vs. Lex.) on part-of-speech tagging and entity labeling, but note that this is likely due to the strength of word-level priors on these tasks. Relative reduction in error is much higher $+ 6 6 \%$ for Part-of-Speech and $+ 4 4 \%$ for Entities), suggesting that ELMo does encode local type information.
|
| 126 |
+
|
| 127 |
+
Semantic role labeling benefits greatly from contextual encoders overall, but this is predominantly due to better labeling of core roles $( + 1 9 . 0$ F1 for ELMo) which are known to be closely tied to syntax (e.g. Punyakanok et al. (2008); Gildea & Palmer (2002)). The lexical baseline performs similarly on core and non-core roles (74 and 75 F1 for ELMo), but the more semantically-oriented non-core role labels (such as purpose, cause, or negation) see only a smaller improvement from encoded context $( + 8 . 8$ F1 for ELMo). The semantic proto-role labeling task (SPR1, SPR2) looks at the same type of core predicate-argument pairs but tests for higher-level semantic properties (§ 2), which we find to be only weakly captured by the contextual encoder $+ 1 { - } 5 \operatorname { F } 1$ for ELMo).
|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
Figure 2: Additional baselines for ELMo, evaluated on the test sets. $\mathrm { C N N } k$ adds a convolutional layer that sees $\pm k$ tokens to each side of the center word. Lexical is the lexical baseline, equivalent to $k = 0$ . Orthonormal is the full ELMo architecture with random orthonormal LSTM and projection weights, but using the pretrained lexical layer. Full (pretrained) is the full ELMo model. Colored bands are $9 5 \%$ confidence intervals (normal approximation).
|
| 131 |
+
|
| 132 |
+
The SemEval relation classification task is designed to require semantic reasoning, but in this case we see a large improvement from contextual encoders, with ELMo improving by 22 F1 points on the lexical baseline $5 0 \%$ relative error reduction) and BERT-large improving by another 4.6 points. We attribute this partly to the poor performance (51-58 F1) of lexical priors on this task, and to the fact that many easy relations can be resolved simply by observing key words in the sentence (for example, “caused” suggests the presence of a Cause-Effect relation). To test this, we augment the lexical baseline with a bag-of-words feature, and find that for relation classification we capture more than $70 \%$ of the headroom from using the full ELMo model.8
|
| 133 |
+
|
| 134 |
+
Effects of architecture. Focusing on the ELMo model, we ask: how much of the model’s performance can be attributed to the architecture, rather than knowledge from pretraining? In Figure 2 we compare to an orthonormal encoder $( \ S 4 )$ which is structurally identical to ELMo but contains no information in the recurrent weights. It can be thought of as a randomized feature function over the sentence, and provides a baseline for how the architecture itself can encode useful contextual information. We find that the orthonormal encoder improves significantly on the lexical baseline, but that overall the learned weights account for over $70 \%$ of the improvements from full ELMo.
|
| 135 |
+
|
| 136 |
+
Encoding non-local context. How much information is carried over long distances (several tokens or more) in the sentence? To estimate this, we extend our lexical baseline with a convolutional layer, which allows the probing classifier to use local context. In Figure 2 we find that adding a CNN of width 3 $\pm 1$ token) closes $72 \%$ (macro average over tasks) of the gap between the lexical baseline and full ELMo; this extends to $79 \%$ if we use a CNN of width 5 $\pm 2$ tokens). On nonterminal constituents, we find that the CNN $\pm 2$ model matches ELMo performance, suggesting that while the ELMo encoder propagates a large amount of information about constituents $_ { + 1 5 . 4 }$ F1 vs. Lex., Table 2), most of it is local in nature. We see a similar trend on the other syntactic tasks, with 80- $90 \%$ of ELMo performance on dependencies, part-of-speech, and SRL core roles captured by CNN $\pm 2$ . Conversely, on more semantic tasks, such as coreference, SRL non-core roles, and SPR, the gap between full ELMo and the CNN baselines is larger. This suggests that while ELMo does not encode these phenomena as efficiently, the improvements it does bring are largely due to long-range information.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 3: Dependency labeling F1 score as a function of separating distance between the two spans. Distance 0 denotes adjacent tokens. Colored bands are $9 5 \%$ confidence intervals (normal approximation). Bars on the bottom show the number of targets (in the development set) with that distance. Lex., CNN1, CNN2, Ortho, and Full are as in Figure 2.
|
| 140 |
+
|
| 141 |
+
We can test this hypothesis by seeing how our probing model performs with distant spans. Figure 3 shows F1 score as a function of the distance (number of tokens) between a token and its head for the dependency labeling task. The CNN models and the orthonormal encoder perform best with nearby spans, but fall off rapidly as token distance increases. The full ELMo model holds up better, with performance dropping only 7 F1 points between $d = 0$ tokens and $d = 8$ , suggesting the pretrained encoder does encode useful long-distance dependencies.
|
| 142 |
+
|
| 143 |
+
# 6 RELATED WORK
|
| 144 |
+
|
| 145 |
+
Recent work has consistently demonstrated the strong empirical performance of contextualized word representations, including CoVe (McCann et al., 2017), ULMFit (Howard & Ruder, 2018), ELMo (Peters et al., 2018a; Lee et al., 2018; Strubell et al., 2018; Kitaev & Klein, 2018). In response to the impressive results on downstream tasks, a line of work has emerged with the goal of understanding and comparing such pretrained representations. SentEval (Conneau & Kiela, 2018) and GLUE (Wang et al., 2018) offer suites of application-oriented benchmark tasks, such as sentiment analysis or textual entailment, which combine many types of reasoning and provide valuable aggregate metrics which are indicative of practical performance. A parallel effort, to which this work contributes, seeks to understand what is driving (or hindering) performance gains by using “probing tasks,” i.e. tasks which attempt to isolate specific phenomena for the purpose of finer-grained analysis rather than application, as discussed below.
|
| 146 |
+
|
| 147 |
+
Much work has focused on probing fixed-length sentence encoders, such as InferSent (Conneau et al., 2017), specifically their ability to capture surface properties of sentences such as length, word content, and word order (Adi et al., 2017), as well as a broader set of syntactic features, such as tree depth and tense (Conneau et al., 2018). Other related work uses perplexity scores to test whether language models learn to encode properties such as subject-verb agreement (Linzen et al., 2016; Gulordava et al., 2018; Marvin & Linzen, 2018; Kuncoro et al., 2018).
|
| 148 |
+
|
| 149 |
+
Often, probing tasks take the form of “challenge sets”, or test sets which are generated using templates and/or perturbations of existing test sets in order to isolate particular linguistic phenomena, e.g. compositional reasoning (Dasgupta et al., 2018; Ettinger et al., 2018). This approach is exemplified by the recently-released Diverse Natural Language Collection (DNC) (Poliak et al., 2018b), which introduces a suite of 11 tasks targeting different semantic phenomena. In the DNC, these tasks are all recast into natural language inference (NLI) format (White et al., 2017), i.e. systems must understand the targeted semantic phenomenon in order to make correct inferences about entailment. Poliak et al. (2018a) used an earlier version of recast NLI to test NMT encoders’ ability to understand coreference, SPR, and paraphrastic inference.
|
| 150 |
+
|
| 151 |
+
Challenge sets which operate on full sentence encodings introduce confounds into the analysis, since sentence representation models must pool word-level representations over the entire sequence. This makes it difficult to infer whether the relevant information is encoded within the span of interest or rather inferred from diffuse information elsewhere in the sentence. One strategy to control for this is the use of minimally-differing sentence pairs (Poliak et al., 2018b; Ettinger et al., 2018). An alternative approach, which we adopt in this paper, is to directly probe the token representations for word- and phrase-level properties. This approach has been used previously to show that the representations learned by neural machine translation systems encode token-level properties like part-of-speech, semantic tags, and morphology (Shi et al., 2016; Belinkov et al., 2017a;b), as well as pairwise dependency relations (Belinkov, 2018). Blevins et al. (2018) goes further to explore how part-of-speech and hierarchical constituent structure are encoded by different pretraining objectives and at different layers of the model. Peters et al. (2018b) presents similar results for ELMo and architectural variants.
|
| 152 |
+
|
| 153 |
+
Compared to existing work, we extend sub-sentence probing to a broader range of syntactic and semantic tasks, including long-range and high-level relations such as predicate-argument structure. Our approach can incorporate existing annotated datasets without the need for templated data generation, and admits fine-grained analysis by label and by metadata such as span distance. We note that some of the tasks we explore overlap with those included in the DNC, in particular, named entities, SPR and Winograd. However, our focus on probing token-level representations directly, rather than pooling over the whole sentence, provides a complementary means for analyzing these representations and diagnosing the particular advantages of contextualized vs. conventional word embeddings.
|
| 154 |
+
|
| 155 |
+
# 7 CONCLUSION
|
| 156 |
+
|
| 157 |
+
We introduce a suite of “edge probing” tasks designed to probe the sub-sentential structure of contextualized word embeddings. These tasks are derived from core NLP tasks and encompass a range of syntactic and semantic phenomena. We use these tasks to explore how contextual embeddings improve on their lexical (context-independent) baselines. We focus on four recent models for contextualized word embeddings–CoVe, ELMo, OpenAI GPT, and BERT.
|
| 158 |
+
|
| 159 |
+
Based on our analysis, we find evidence suggesting the following trends. First, in general, contextualized embeddings improve over their non-contextualized counterparts largely on syntactic tasks (e.g. constituent labeling) in comparison to semantic tasks (e.g. coreference), suggesting that these embeddings encode syntax more so than higher-level semantics. Second, the performance of ELMo cannot be fully explained by a model with access to local context, suggesting that the contextualized representations do encode distant linguistic information, which can help disambiguate longer-range dependency relations and higher-level syntactic structures.
|
| 160 |
+
|
| 161 |
+
We release our data processing and model code, and hope that this can be a useful tool to facilitate understanding of, and improvements in, contextualized word embedding models.
|
| 162 |
+
|
| 163 |
+
# ACKNOWLEDGMENTS
|
| 164 |
+
|
| 165 |
+
This work was conducted in part at the 2018 Frederick Jelinek Memorial Summer Workshop on Speech and Language Technologies, and supported by Johns Hopkins University with unrestricted gifts from Amazon, Facebook, Google, Microsoft and Mitsubishi Electric Research Laboratories, as well as a team-specific donation of computing resources from Google. PX, AP, and BVD were supported by DARPA AIDA and LORELEI. Special thanks to Jacob Devlin for providing checkpoints of GPT model trained on the BWB corpus, and to the members of the Google AI Language team for many productive discussions.
|
| 166 |
+
|
| 167 |
+
# REFERENCES
|
| 168 |
+
|
| 169 |
+
Yossi Adi, Einat Kermany, Yonatan Belinkov, Ofer Lavi, and Yoav Goldberg. Fine-grained analysis of sentence embeddings using auxiliary prediction tasks. In Proceedings of ICLR, 2017.
|
| 170 |
+
|
| 171 |
+
Yonatan Belinkov. On internal language representations in deep learning: An analysis of machine translation and speech recognition. PhD thesis, Massachusetts Institute of Technology, 2018.
|
| 172 |
+
|
| 173 |
+
Yonatan Belinkov, Nadir Durrani, Fahim Dalvi, Hassan Sajjad, and James Glass. What do neural machine translation models learn about morphology? In Proceedings of EMNLP, 2017a.
|
| 174 |
+
|
| 175 |
+
Yonatan Belinkov, Llu´ıs Marquez, Hassan Sajjad, Nadir Durrani, Fahim Dalvi, and James Glass. \` Evaluating layers of representation in neural machine translation on part-of-speech and semantic tagging tasks. In Proceedings of IJCNLP, 2017b.
|
| 176 |
+
|
| 177 |
+
Terra Blevins, Omer Levy, and Luke Zettlemoyer. Deep RNNs encode soft hierarchical syntax. In Proceedings of ACL, 2018.
|
| 178 |
+
|
| 179 |
+
Ondˇrej Bojar, Christian Buck, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, and Julia Kreutzer (eds.). Proceedings of the Second Conference on Machine Translation. 2017.
|
| 180 |
+
|
| 181 |
+
Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One billion word benchmark for measuring progress in statistical language modeling. In Proceedings of Interspeech, 2014.
|
| 182 |
+
|
| 183 |
+
Alexis Conneau and Douwe Kiela. SentEval: An evaluation toolkit for universal sentence representations. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation, 2018.
|
| 184 |
+
|
| 185 |
+
Alexis Conneau, Douwe Kiela, Holger Schwenk, Lo¨ıc Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. In Proceedings of EMNLP, 2017.
|
| 186 |
+
|
| 187 |
+
Alexis Conneau, German Kruszewski, Guillaume Lample, Lo ´ ¨ıc Barrault, and Marco Baroni. What you can cram into a single $\$ 8#$ vector: Probing sentence embeddings for linguistic properties. In Proceedings of ACL, 2018.
|
| 188 |
+
|
| 189 |
+
Ishita Dasgupta, Demi Guo, Andreas Stuhlmuller, Samuel J Gershman, and Noah D Goodman. ¨ Evaluating compositionality in sentence embeddings. arXiv preprint 1802.04302, 2018.
|
| 190 |
+
|
| 191 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint 1810.04805, 2018.
|
| 192 |
+
|
| 193 |
+
Allyson Ettinger, Ahmed Elgohary, Colin Phillips, and Philip Resnik. Assessing composition in sentence vector representations. In Proceedings of COLING, 2018.
|
| 194 |
+
|
| 195 |
+
Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F Liu, Matthew Peters, Michael Schmitz, and Luke Zettlemoyer. AllenNLP: A deep semantic natural language processing platform. In Proceedings of Workshop for NLP Open Source Software (NLP-OSS), 2018.
|
| 196 |
+
|
| 197 |
+
Daniel Gildea and Martha Palmer. The necessity of parsing for predicate argument recognition. In Proceedings of ACL, 2002.
|
| 198 |
+
|
| 199 |
+
Kristina Gulordava, Piotr Bojanowski, Edouard Grave, Tal Linzen, and Marco Baroni. Colorless green recurrent networks dream hierarchically. In Proceedings of NAACL, 2018.
|
| 200 |
+
|
| 201 |
+
Luheng He, Kenton Lee, Omer Levy, and Luke Zettlemoyer. Jointly predicting predicates and arguments in neural semantic role labeling. In Proceedings of ACL, 2018.
|
| 202 |
+
|
| 203 |
+
Iris Hendrickx, Su Nam Kim, Zornitsa Kozareva, Preslav Nakov, Diarmuid O S ´ eaghdha, Sebas- ´ tian Pado, Marco Pennacchiotti, Lorenza Romano, and Stan Szpakowicz. SemEval-2010 task 8: ´ Multi-way classification of semantic relations between pairs of nominals. In Proceedings of the Workshop on Semantic Evaluations: Recent Achievements and Future Directions, 2009.
|
| 204 |
+
|
| 205 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 1997.
|
| 206 |
+
|
| 207 |
+
Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In Proceedings of ACL, 2018.
|
| 208 |
+
|
| 209 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of ICLR, 2015.
|
| 210 |
+
|
| 211 |
+
Ryan Kiros, Yukun Zhu, Ruslan R. Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In Proceedings of NIPS, 2015.
|
| 212 |
+
|
| 213 |
+
Nikita Kitaev and Dan Klein. Constituency parsing with a self-attentive encoder. In Proceedings of ACL, July 2018.
|
| 214 |
+
|
| 215 |
+
Adhiguna Kuncoro, Chris Dyer, John Hale, Dani Yogatama, Stephen Clark, and Phil Blunsom. LSTMs can learn syntax-sensitive dependencies well, but modeling structure makes them better. In Proceedings of ACL, 2018.
|
| 216 |
+
|
| 217 |
+
Kenton Lee, Luheng He, Mike Lewis, and Luke Zettlemoyer. End-to-end neural coreference resolution. In Proceedings of EMNLP, 2017.
|
| 218 |
+
|
| 219 |
+
Kenton Lee, Luheng He, and Luke Zettlemoyer. Higher-order coreference resolution with coarseto-fine inference. In Proceedings of NAACL, 2018.
|
| 220 |
+
|
| 221 |
+
Hector J. Levesque, Ernest Davis, and Leora Morgenstern. The winograd schema challenge. In Proceedings of the Thirteenth International Conference on Principles of Knowledge Representation and Reasoning, 2012.
|
| 222 |
+
|
| 223 |
+
Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. Assessing the ability of LSTMs to learn syntaxsensitive dependencies. Transactions of the ACL, 2016.
|
| 224 |
+
|
| 225 |
+
Rebecca Marvin and Tal Linzen. Targeted syntactic evaluation of language models. In Proceedings of EMNLP, 2018.
|
| 226 |
+
|
| 227 |
+
Bryan McCann, James Bradbury, Caiming Xiong, and Richard Socher. Learned in translation: Contextualized word vectors. In Proceedings of NIPS, 2017.
|
| 228 |
+
|
| 229 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S. Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Proceedings of NIPS, 2013.
|
| 230 |
+
|
| 231 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In Proceedings of NIPS, 2017.
|
| 232 |
+
|
| 233 |
+
Jeffrey Pennington, Richard Socher, and Christopher Manning. GloVe: Global vectors for word representation. In Proceedings of EMNLP, 2014.
|
| 234 |
+
|
| 235 |
+
Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of NAACL, 2018a.
|
| 236 |
+
|
| 237 |
+
Matthew Peters, Mark Neumann, Luke Zettlemoyer, and Wen-tau Yih. Dissecting contextual word embeddings: Architecture and representation. In Proceedings of EMNLP, 2018b.
|
| 238 |
+
|
| 239 |
+
Adam Poliak, Yonatan Belinkov, James Glass, and Benjamin Van Durme. On the evaluation of semantic phenomena in neural machine translation using natural language inference. In Proceedings of NAACL, 2018a.
|
| 240 |
+
|
| 241 |
+
Adam Poliak, Aparajita Haldar, Rachel Rudinger, J. Edward Hu, Ellie Pavlick, Aaron Steven White, and Benjamin Van Durme. Collecting diverse natural language inference problems for sentence representation evaluation. In Proceedings of EMNLP, 2018b.
|
| 242 |
+
|
| 243 |
+
Vasin Punyakanok, Dan Roth, and Wen-tau Yih. The importance of syntactic parsing and inference in semantic role labeling. Computational Linguistics, 34(2):257–287, 2008.
|
| 244 |
+
|
| 245 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. https://blog.openai.com/language-unsupervised, 2018.
|
| 246 |
+
|
| 247 |
+
Altaf Rahman and Vincent Ng. Resolving complex cases of definite pronouns: The Winograd schema challenge. In Proceedings of EMNLP, 2012.
|
| 248 |
+
|
| 249 |
+
Rachel Rudinger, Adam Teichert, Ryan Culkin, Sheng Zhang, and Benjamin Van Durme. Neural Davidsonian semantic proto-role labeling. In Proceedings of EMNLP, 2018.
|
| 250 |
+
|
| 251 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of ACL, 2016.
|
| 252 |
+
|
| 253 |
+
Xing Shi, Inkit Padhi, and Kevin Knight. Does string-based neural MT learn source syntax? In Proceedings of EMNLP, 2016.
|
| 254 |
+
|
| 255 |
+
Natalia Silveira, Timothy Dozat, Marie-Catherine de Marneffe, Samuel Bowman, Miriam Connor, John Bauer, and Christopher D. Manning. A gold standard dependency corpus for English. In Proceedings of the Ninth International Conference on Language Resources and Evaluation, 2014.
|
| 256 |
+
|
| 257 |
+
Emma Strubell, Patrick Verga, Daniel Andor, David Weiss, and Andrew McCallum. Linguisticallyinformed self-attention for semantic role labeling. In Proceedings of EMNLP, 2018.
|
| 258 |
+
|
| 259 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Proceedings of NIPS, 2014.
|
| 260 |
+
|
| 261 |
+
Adam Teichert, Adam Poliak, Benjamin Van Durme, and Matthew Gormley. Semantic proto-role labeling. In Proceedings of AAAI, 2017.
|
| 262 |
+
|
| 263 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of NIPS, 2017.
|
| 264 |
+
|
| 265 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, 2018.
|
| 266 |
+
|
| 267 |
+
Ralph Weischedel, Martha Palmer, Mitchell Marcus, Eduard Hovy, Sameer Pradhan, Lance Ramshaw, Nianwen Xue, Ann Taylor, Jeff Kaufman, Michelle Franchini, et al. OntoNotes release 5.0 LDC2013T19. Linguistic Data Consortium, Philadelphia, PA, 2013.
|
| 268 |
+
|
| 269 |
+
Aaron Steven White, Pushpendre Rastogi, Kevin Duh, and Benjamin Van Durme. Inference is everything: Recasting semantic resources into a unified evaluation framework. In Proceedings of IJCNLP, 2017.
|
| 270 |
+
|
| 271 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint 1609.08144, 2016.
|
| 272 |
+
|
| 273 |
+
Kelly Zhang and Samuel Bowman. Language modeling teaches you more than translation does: Lessons learned through auxiliary syntactic task analysis. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, 2018.
|
| 274 |
+
|
| 275 |
+
Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of ICCV, 2015.
|
| 276 |
+
|
| 277 |
+
# A CHANGES FROM ORIGINAL VERSION
|
| 278 |
+
|
| 279 |
+
This version of the paper has been updated to include probing results on the popular BERT (Devlin et al., 2018) model, which was released after our original submission. Aside from formatting and minor re-wording, the following changes have been made:
|
| 280 |
+
|
| 281 |
+
• We include probing results on the BERT-base and BERT-large models (Devlin et al., 2018).
|
| 282 |
+
• We add one additional task to Table 2, relation classification on SemEval 2010 Task 8 (Hendrickx et al., 2009), in order to better explore how pre-trained encoders capture semantic information.
|
| 283 |
+
• We refer to the OpenAI Transformer LM (Radford et al., 2018) as “GPT” to better reflect common usage.
|
| 284 |
+
• We add experiments with ELMo-style scalar mixing (Section 3.2) on the OpenAI GPT model. This improves performance slightly, and changes our conclusion that ELMo was overall superior to GPT; the two are approximately equal on average, with slight differences on some tasks.
|
| 285 |
+
• To reduce noise, we report the average over five runs for experiments on Winograd coreference (DPR).
|
| 286 |
+
|
| 287 |
+
# B DATASET STATISTICS
|
| 288 |
+
|
| 289 |
+
Table 3: For each probing task, corpus summary statistics of the number of labels, examples, tokens and targets (split by train/dev/test). Examples generally refer to sentences. For semantic role labeling, they instead refer to the total number of frames. Targets refer to the total number of classification targets (edges or spans, as described in Table 1 and Section 2). For SemEval relation classification there is no standard development split, so we use a fixed subset of $15 \%$ of the training data and use the remaining $85 \%$ to train.
|
| 290 |
+
|
| 291 |
+
<table><tr><td>Task</td><td>|L|</td><td>Examples</td><td>Tokens</td><td>Total Targets</td></tr><tr><td>Part-of-Speech</td><td>48</td><td>116K/16K/12K</td><td>2.2M/305K/230K</td><td>2.1M/290K/212K</td></tr><tr><td>Constituents</td><td>30</td><td>116K/16K/12K</td><td>2.2M/305K/230K</td><td>1.9M/255K/191K</td></tr><tr><td>Dependencies</td><td>49</td><td>13K/2.0K/2.1K</td><td>204K/25K/25K</td><td>204K/25K/25K</td></tr><tr><td>Entities</td><td>18</td><td>116K/16K/12K</td><td>2.2M/305K/230K</td><td>128K/20K/13K</td></tr><tr><td>SRL (all)</td><td>66</td><td>253K/35K/24K</td><td>6.6M/934K/640K</td><td>599K/83K/56K</td></tr><tr><td>Core roles</td><td>6</td><td>253K/35K/24K</td><td>6.6M/934K/640K</td><td>411K/57K/38K</td></tr><tr><td>Non-core roles</td><td>21</td><td>253K/35K/24K</td><td>6.6M/934K/640K</td><td>170K/24K/16K</td></tr><tr><td>OntoNotes coref.</td><td>2</td><td>116K/16K/12K</td><td>2.2M/305K/230K</td><td>248K/43K/40K</td></tr><tr><td>SPR1</td><td>18</td><td>3.8K/513/551</td><td>81K/11K/12K</td><td>7.6K/1.1k/1.1K</td></tr><tr><td>SPR2</td><td>20</td><td>2.2K/291/276</td><td>47K /4.9K /5.6K</td><td>4.9K/630 / 582</td></tr><tr><td>Winograd coref.</td><td>2</td><td>1.0K /2.0K/2.1K</td><td>14K/8.0K/14K</td><td>1.8K/949 /379</td></tr><tr><td>Rel. (SemEval)</td><td>19</td><td>6.9K/1.1K/2.7K</td><td>117K/20K/47K</td><td>6.9K/1.1K/2.7K</td></tr></table>
|
| 292 |
+
|
| 293 |
+
# C MODEL DETAILS
|
| 294 |
+
|
| 295 |
+
Because the vectors have varying dimension across probed models, and to improve performance we first project the vectors down to 256 dimensions:
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
e _ { i } ^ { ( k ) } = A ^ { ( k ) } e _ { i } + b ^ { ( k ) }
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
We use separate projections $( k = 1 , 2$ ) so that the model can extract different information from $s ^ { ( 1 ) }$ (for example, a predicate) and $s ^ { ( 2 ) }$ (for example, an argument). We then apply a pooling operator over the representations within a span to yield a fixed-length representation:
|
| 302 |
+
|
| 303 |
+
$$
|
| 304 |
+
r ^ { ( k ) } ( s _ { k } ) = r ^ { ( k ) } ( i _ { k } , j _ { k } ) = \mathrm { P o o l } ( e _ { i _ { k } } ^ { ( k ) } , e _ { i _ { k } + 1 } ^ { ( k ) } , \dots , e _ { j _ { k } - 1 } ^ { ( k ) } )
|
| 305 |
+
$$
|
| 306 |
+
|
| 307 |
+
We use the sellearns a weight ng operator from Lee et al. (2017) andfor each token, then represents the span $\mathrm { H e }$ et al. (2018). Thisa sum of the vectors $z _ { i } ^ { ( k ) } = W _ { a t t } ^ { ( k ) } e _ { i } ^ { ( k ) }$
|
| 308 |
+
$e _ { i _ { k } } ^ { ( k ) } , e _ { i _ { k } + 1 } ^ { ( k ) } , \ldots , e _ { j _ { k } - 1 } ^ { ( k ) }$ weighted by $a _ { i } ^ { ( k ) } = \mathrm { s o f t m a x } ( \mathbf { z } ^ { ( k ) } ) _ { i }$ .
|
| 309 |
+
|
| 310 |
+
Finally, the pooled span representations are fed into a two-layer MLP followed by a sigmoid output layer:
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\begin{array} { c } { { h = M L P ( [ r ^ { ( 1 ) } ( s ^ { ( 1 ) } ) , r ^ { ( 2 ) } ( s ^ { ( 2 ) } ) ] ) } } \\ { { P ( \mathrm { l a b e l } _ { \ell } = 1 ) = \sigma ( W h + b ) _ { \ell } \quad \mathrm { f o r } \quad \ell = 0 , \ldots , | { \mathcal L } | } } \end{array}
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
We train by minimizing binary cross entropy against the set of true labels. While convention on many tasks (e.g. SRL) is to use a softmax loss, this enforces an exclusivity constraint. By using a per-label sigmoid our model can estimate each label independently, which allows us to stratify our analysis (see $\ S 5$ ) to individual labels or groups of labels within a task.
|
| 317 |
+
|
| 318 |
+
With the exception of ELMo scalars, we hold the weights of the sentence encoder (§ 3.2) fixed while we train our probing classifier. We train using the Adam optimizer (Kingma $\&$ Ba, 2015) with a batch $\mathrm { s i z e ^ { 9 } }$ of 32, an initial learning rate of 1e-4, and gradient clipping with max $L _ { 2 }$ norm of 5.0. We evaluate on the validation set every 1000 steps (or every 100 for SPR1, SPR2, and Winograd), halve the learning rate if no improvement is seen in 5 validations, and stop training if no improvement is seen in 20 validations.
|
| 319 |
+
|
| 320 |
+
# D CONTEXTUAL REPRESENTATION MODELS
|
| 321 |
+
|
| 322 |
+
CoVe The CoVe model (McCann et al., 2017) is a two-layer biLSTM trained as the encoder side of a sequence-to-sequence(Sutskever et al., 2014) English-German machine translation model. We use the original authors’ implementation and the best released pre-trained model 10. This model is trained on the WMT2017 dataset Bojar et al. (2017) which contains approximately 7 million sentences of English text. Following McCann et al. (2017), we concatenate the activations of the top-layer forward and backward LSTMs ( $\mathit { d } = 3 0 0$ each) with the pre-trained GloVe (Pennington et al., 2014) embedding11 $\angle d = 3 0 0$ ) of each token, for a total representation dimension of $d = 9 0 0$ .
|
| 323 |
+
|
| 324 |
+
ELMo The ELMo model (Peters et al., 2018a) is a two layer LSTM trained as the concatenation of a forward and a backward language model, and built over a context-independent character CNN layer. We use the original authors’ implementation as provided in the AllenNLP (Gardner et al., 2018) toolkit12 and the standard pre-trained model trained on the Billion Word Benchmark (BWB) (Chelba et al., 2014)We take the (fixed, contextual) representation of token $i$ to be the set of three vectors $h _ { 0 , i } , h _ { 1 , i }$ , and $h _ { 2 , i }$ containing the activations of each layer of the ELMo model. Following Equation 1 of Peters et al. (2018a), we learn task-specific scalar parameters and take a weighted sum:
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
e _ { i } = \gamma \left( s _ { 0 } h _ { 0 , i } + s _ { 1 } h _ { 1 , i } + s _ { 2 } h _ { 2 , i } \right) \quad \mathrm { f o r } i = 0 , 1 , \ldots , n
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+
to give 1024-dimensional representations for each token.
|
| 331 |
+
|
| 332 |
+
OpenAI GPT The GPT model (Radford et al., 2018) was recently shown to outperform ELMo on a number of downstream tasks, and as of submission holds the highest score on the GLUE benchmark (Wang et al., 2018). It consists of a 12-layer Transformer (Vaswani et al., 2017) model, trained as a left-to-right language model using masked attention. We use a PyTorch reimplementation of the model13, and the pre-trained weights14 trained on the Toronto Book Corpus (Zhu et al., 2015) Unlike Radford et al. (2018), we hold the Transformer weights fixed while training our probing model in order to better understand what information is available from the pre-training procedure alone. To facilitate more direct comparison with ELMo and CoVe we concatenate (cat) the activations of the final Transformer layer $\zeta d = 7 6 8 )$ with the context-independent subword embeddings $\zeta d = 7 6 8 )$ ) to give contextual vectors of $d = 1 5 3 6$ for each (sub)-token. We also experiment with ELMo-style scalar mixing $\left( \mathrm { m i x } \right)$ , which uses additional weight parameters for each layer (embeddings plus layers 1 − 12) learned for each probing task to give a contextual vector of $d = 7 6 8$ for each (sub)-token.
|
| 333 |
+
|
| 334 |
+
BERT The BERT model of Devlin et al. (2018) has recently shown state-of-the-art performance on a broad set of NLP tasks, outperforming ELMo and the OpenAI Transformer LM. It consists of a stack of Transformer (Vaswani et al., 2017) layers trained jointly as a masked language model and on a next-sentence prediction task. We use a PyTorch reimplementation of the model via the pytorch pretrained bert package15, and the pre-trained bert-base-uncased (12- layer) and bert-large-uncased (24-layer) models trained on the concatenation of the Toronto Books Corpus (Zhu et al., 2015, 800M words of fiction books) and English Wikipedia (2.5B words). Unlike standard usage of the BERT model (Devlin et al., 2018), we hold the Transformer weights fixed while training our probing model. We produce cat and mix representations with dimensionality $d = 1 5 3 6$ and $d = 7 6 8$ , respectively for BERT-base and $d = 2 0 4 8$ and $d = 1 0 2 4$ for BERT-large.
|
| 335 |
+
|
| 336 |
+
# E RETOKENIZATION
|
| 337 |
+
|
| 338 |
+
The pre-trained encoder models expect a particular tokenization of the input string, which does not always match the original tokenization of each probing set. To correct this we retokenize the probing data to match the tokenization of each encoder, which for CoVe is Moses tokenization, and for GPT and BERT is a custom subword model (Sennrich et al., 2016; Wu et al., 2016). We then align the spans to the new tokenization using a heuristic projection based on byte-level Levenshtein distance.
|
| 339 |
+
|
| 340 |
+
The source data for our probing tasks is annotated with respect to a particular tokenization, typically the conventions of the source treebanks (Penn Treebank, Universal Dependencies, and OntoNotes 5.0). This does not always align to the tokenization of the pre-trained representation models. Consider a dummy sentence:
|
| 341 |
+
|
| 342 |
+
• Text: I don’t like pineapples. • Native: [I do n’t like pineapples .] • Moses: [I do n \'t like pineapples .] • Subword: [_i _do _n’t _like _pinea pples .]
|
| 343 |
+
|
| 344 |
+
An annotation on the word ”pineapples” might be expressed as $s \ = \ [ 4 , 5 )$ in the original (”native”) tokenization, but the corresponding text is span $s _ { \mathrm { M o s e s } } = [ 5 , 6 )$ under Moses tokenization and $s _ { \mathrm { s u b w o r d } } = [ 5 , 7 )$ under the particular subword model above.
|
| 345 |
+
|
| 346 |
+
We resolve this by aligning the source and target tokenization using Levenshtein distance. We take the source tokenization $\left[ s _ { 0 } , s _ { 1 } , \ldots , s _ { m } \right]$ as given, and treat the target tokenizer as a black-box function from a string $\tilde { S }$ to a list of tokens $[ t _ { 0 } , t _ { 1 } , \ldots , t _ { n } ]$ (note that in general, $n \ne m$ ). Let $\tilde { S }$ be the source string. We create a target string $\tilde { T }$ by joining $[ t _ { 0 } , t _ { 1 } , \ldots , t _ { n } ]$ with spaces, and then compute a byte-level Levenshtein alignment16 $\tilde { A } = \mathrm { A l i g n } ( \tilde { T } , \tilde { S } )$ . We then compute token-tobyte alignments $U = \mathrm { A l i g n } ( [ t _ { 0 } , t _ { 1 } , \dots , t _ { n } ] , \tilde { { \cal T } } )$ and $V = \mathrm { A l i g n } ( [ s _ { 0 } , s _ { 1 } , \ldots , s _ { m } ] , \tilde { S } )$ . Representing the alignments as boolean adjacency matricies, we can compose them to form a token-to-token alignment $\boldsymbol { A } = \boldsymbol { U } \tilde { \boldsymbol { A } } \boldsymbol { V } ^ { T }$ .
|
| 347 |
+
|
| 348 |
+
We then represent each source span as a boolean vector with 1s inside the span and 0s outside, e.g. $[ 2 , 4 ) = [ 0 , 0 , 1 , 1 , 0 , 0 , . . . ] \in \{ 0 , 1 \} ^ { m }$ , and project through the alignment $A$ to the target side. We recover a target-side span from the minimum and maximum nonzero indices.
|
parse/train/SJzSgnRcKX/SJzSgnRcKX_content_list.json
ADDED
|
@@ -0,0 +1,1925 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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TURE IN CONTEXTUALIZED WORD REPRESENTATIONS ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
174,
|
| 8 |
+
99,
|
| 9 |
+
823,
|
| 10 |
+
171
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Ian Tenney,∗1 Patrick Xia,2 Berlin Chen,3 Alex Wang,4 Adam Poliak,2 \nR. Thomas McCoy,2 Najoung Kim,2 Benjamin Van Durme,2 Samuel R. Bowman,4 \nDipanjan Das,1 and Ellie Pavlick1,5 \n1Google AI Language, 2Johns Hopkins University, 3Swarthmore College, \n4New York University, 5Brown University ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
184,
|
| 19 |
+
194,
|
| 20 |
+
758,
|
| 21 |
+
238
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "",
|
| 28 |
+
"bbox": [
|
| 29 |
+
186,
|
| 30 |
+
251,
|
| 31 |
+
666,
|
| 32 |
+
281
|
| 33 |
+
],
|
| 34 |
+
"page_idx": 0
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"type": "text",
|
| 38 |
+
"text": "ABSTRACT ",
|
| 39 |
+
"text_level": 1,
|
| 40 |
+
"bbox": [
|
| 41 |
+
454,
|
| 42 |
+
318,
|
| 43 |
+
544,
|
| 44 |
+
333
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "Contextualized representation models such as ELMo (Peters et al., 2018a) and BERT (Devlin et al., 2018) have recently achieved state-of-the-art results on a diverse array of downstream NLP tasks. Building on recent token-level probing work, we introduce a novel edge probing task design and construct a broad suite of sub-sentence tasks derived from the traditional structured NLP pipeline. We probe word-level contextual representations from four recent models and investigate how they encode sentence structure across a range of syntactic, semantic, local, and long-range phenomena. We find that existing models trained on language modeling and translation produce strong representations for syntactic phenomena, but only offer comparably small improvements on semantic tasks over a non-contextual baseline. ",
|
| 51 |
+
"bbox": [
|
| 52 |
+
233,
|
| 53 |
+
349,
|
| 54 |
+
764,
|
| 55 |
+
502
|
| 56 |
+
],
|
| 57 |
+
"page_idx": 0
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"type": "text",
|
| 61 |
+
"text": "1 INTRODUCTION1 ",
|
| 62 |
+
"text_level": 1,
|
| 63 |
+
"bbox": [
|
| 64 |
+
176,
|
| 65 |
+
529,
|
| 66 |
+
341,
|
| 67 |
+
546
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "Pretrained word embeddings (Mikolov et al., 2013; Pennington et al., 2014) are a staple tool for NLP. These models provide continuous representations for word types, typically learned from cooccurrence statistics on unlabeled data, and improve generalization of downstream models across many domains. Recently, a number of models have been proposed for contextualized word embeddings. Instead of using a single, fixed vector per word type, these models run a pretrained encoder network over the sentence to produce contextual embeddings of each token. The encoder, usually an LSTM (Hochreiter & Schmidhuber, 1997) or a Transformer (Vaswani et al., 2017), can be trained on objectives like machine translation (McCann et al., 2017) or language modeling (Peters et al., 2018a; Radford et al., 2018; Howard & Ruder, 2018; Devlin et al., 2018), for which large amounts of data are available. The activations of this network–a collection of one vector per token–fit the same interface as conventional word embeddings, and can be used as a drop-in replacement input to any model. Applied to popular models, this technique has yielded significant improvements to the state-of-the-art on several tasks, including constituency parsing (Kitaev & Klein, 2018), semantic role labeling (He et al., 2018; Strubell et al., 2018), and coreference (Lee et al., 2018), and has outperformed competing techniques (Kiros et al., 2015; Conneau et al., 2017) that produce fixed-length representations for entire sentences. ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
563,
|
| 77 |
+
825,
|
| 78 |
+
784
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "Our goal in this work is to understand where these contextual representations improve over conventional word embeddings. Recent work has explored many token-level properties of these representations, such as their ability to capture part-of-speech tags (Blevins et al., 2018; Belinkov et al., 2017b; Shi et al., 2016), morphology (Belinkov et al., 2017a;b), or word-sense disambiguation (Peters et al., 2018a). Peters et al. (2018b) extends this to constituent phrases, and present a heuristic for unsupervised pronominal coreference. We expand on this even further and introduce a suite of edge probing tasks covering a broad range of syntactic, semantic, local, and long-range phenomena. In particular, we focus on asking what information is encoded at each position, and how well it encodes structural information about that word’s role in the sentence. Is this information primarily syntactic in nature, or do the representations also encode higher-level semantic relationships? Is this information local, or do the encoders also capture long-range structure? ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
174,
|
| 87 |
+
791,
|
| 88 |
+
823,
|
| 89 |
+
861
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "image",
|
| 95 |
+
"img_path": "images/c0cd983f52ba2e3bc69ca6f26bfb54afb946834e3c20b9aa60eb08d004115520.jpg",
|
| 96 |
+
"image_caption": [
|
| 97 |
+
"Figure 1: Probing model architecture (§ 3.1). All parameters inside the dashed line are fixed, while we train the span pooling and MLP classifiers to extract information from the contextual vectors. The example shown is for semantic role labeling, where $s ^ { ( 1 ) } = [ 1 , 2 )$ corresponds to the predicate (“eat”), while $s ^ { ( 2 ) } = [ 2 , 5 )$ is the argument (“strawberry ice cream”), and we predict label A1 as positive and others as negative. For entity and constituent labeling, only a single span is used. "
|
| 98 |
+
],
|
| 99 |
+
"image_footnote": [],
|
| 100 |
+
"bbox": [
|
| 101 |
+
269,
|
| 102 |
+
99,
|
| 103 |
+
720,
|
| 104 |
+
324
|
| 105 |
+
],
|
| 106 |
+
"page_idx": 1
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"type": "text",
|
| 110 |
+
"text": "",
|
| 111 |
+
"bbox": [
|
| 112 |
+
174,
|
| 113 |
+
421,
|
| 114 |
+
825,
|
| 115 |
+
506
|
| 116 |
+
],
|
| 117 |
+
"page_idx": 1
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
"type": "text",
|
| 121 |
+
"text": "We approach these questions with a probing model (Figure 1) that sees only the contextual embeddings from a fixed, pretrained encoder. The model can access only embeddings within given spans, such as a predicate-argument pair, and must predict properties, such as semantic roles, which typically require whole-sentence context. We use data derived from traditional structured NLP tasks: tagging, parsing, semantic roles, and coreference. Common corpora such as OntoNotes (Weischedel et al., 2013) provide a wealth of annotations for well-studied concepts which are both linguistically motivated and known to be useful intermediates for high-level language understanding. We refer to our technique as “edge probing”, as we decompose each structured task into a set of graph edges $( \\ S 2 )$ which we can predict independently using a common classifier architecture $( \\ S 3 . 1 ) ^ { \\overline { { 2 } } }$ . We probe four popular contextual representation models $( \\ S 3 . 2 )$ : CoVe (McCann et al., 2017), ELMo (Peters et al., 2018a), OpenAI GPT (Radford et al., 2018), and BERT (Devlin et al., 2018). ",
|
| 122 |
+
"bbox": [
|
| 123 |
+
173,
|
| 124 |
+
512,
|
| 125 |
+
825,
|
| 126 |
+
665
|
| 127 |
+
],
|
| 128 |
+
"page_idx": 1
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"type": "text",
|
| 132 |
+
"text": "We focus on these models because their pretrained weights and code are available, since these are most likely to be used by researchers. We compare to word-level baselines to separate the contribution of context from lexical priors, and experiment with augmented baselines to better understand the role of pretraining and the ability of encoders to capture long-range dependencies. ",
|
| 133 |
+
"bbox": [
|
| 134 |
+
174,
|
| 135 |
+
671,
|
| 136 |
+
825,
|
| 137 |
+
728
|
| 138 |
+
],
|
| 139 |
+
"page_idx": 1
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"type": "text",
|
| 143 |
+
"text": "2 EDGE PROBING ",
|
| 144 |
+
"text_level": 1,
|
| 145 |
+
"bbox": [
|
| 146 |
+
176,
|
| 147 |
+
748,
|
| 148 |
+
336,
|
| 149 |
+
765
|
| 150 |
+
],
|
| 151 |
+
"page_idx": 1
|
| 152 |
+
},
|
| 153 |
+
{
|
| 154 |
+
"type": "text",
|
| 155 |
+
"text": "To carry out our experiments, we define a novel “edge probing” framework motivated by the need for a uniform set of metrics and architectures across tasks. Our framework is generic, and can be applied to any task that can be represented as a labeled graph anchored to spans in a sentence. ",
|
| 156 |
+
"bbox": [
|
| 157 |
+
174,
|
| 158 |
+
781,
|
| 159 |
+
825,
|
| 160 |
+
823
|
| 161 |
+
],
|
| 162 |
+
"page_idx": 1
|
| 163 |
+
},
|
| 164 |
+
{
|
| 165 |
+
"type": "text",
|
| 166 |
+
"text": "Formulation. Formally, we represent a sentence as a list of tokens $T = [ t _ { 0 } , t _ { 1 } , \\dots , t _ { n } ]$ , and a labeled edge as $\\{ s ^ { ( 1 ) } , s ^ { ( 2 ) } , L \\}$ . We treat $s ^ { ( 1 ) } = [ i ^ { ( 1 ) } , j ^ { ( 1 ) } )$ and, optionally, $s ^ { ( 2 ) } = [ i ^ { ( 2 ) } , j ^ { ( 2 ) } )$ as (end-exclusive) spans. For unary edges such as constituent labels, $s ^ { ( 2 ) }$ is omitted. We take $L$ to be a set of zero or more targets from a task-specific label set $\\mathcal { L }$ . ",
|
| 167 |
+
"bbox": [
|
| 168 |
+
174,
|
| 169 |
+
838,
|
| 170 |
+
825,
|
| 171 |
+
898
|
| 172 |
+
],
|
| 173 |
+
"page_idx": 1
|
| 174 |
+
},
|
| 175 |
+
{
|
| 176 |
+
"type": "table",
|
| 177 |
+
"img_path": "images/f2b1604b1decad9ab24c89fecc3c7f50f5440c85afba219f4cd70ace4c9f8a67.jpg",
|
| 178 |
+
"table_caption": [
|
| 179 |
+
"Table 1: Example sentence, spans, and target label for each task. $\\mathrm { O } =$ OntoNotes, $\\mathbf { W } =$ Winograd. "
|
| 180 |
+
],
|
| 181 |
+
"table_footnote": [],
|
| 182 |
+
"table_body": "<table><tr><td>POS</td><td> The important thing about Disney is that it is a global [brand]1. -→ NN (Noun)</td></tr><tr><td></td><td>Constit.The important thing about Disney is that it [is a global brand]1.-→VP (Verb Phrase)</td></tr><tr><td></td><td>Depend.[Atmosphere]1 is always [fun]2 →nsubj (nominal subject)</td></tr><tr><td>Entities</td><td>The important thing about [Disneyli is that it is a global brand. -→ Organization</td></tr><tr><td>SRL</td><td>[The important thing about Disneyl2 [is]1 that it is a global brand. -→Argl (Agent)</td></tr><tr><td>SPR</td><td>[It]1 [endorsed]2 the White House strategy...→ {awareness, existed_after,...}</td></tr><tr><td>Coref.o</td><td>The important thing about [Disneyli is that [it]2 is a global brand. -→ True</td></tr><tr><td>Coref.W</td><td>[Charactersl2 entertain audiences because [theyli want people to be happy. -→ True Characters entertain [audiencesl2 because [theyli want people to be happy. -→ False</td></tr><tr><td>Rel.</td><td>The [burst]1 has been caused by water hammer [pressure]2. → Cause-Effect(ez,e1)</td></tr></table>",
|
| 183 |
+
"bbox": [
|
| 184 |
+
173,
|
| 185 |
+
101,
|
| 186 |
+
825,
|
| 187 |
+
303
|
| 188 |
+
],
|
| 189 |
+
"page_idx": 2
|
| 190 |
+
},
|
| 191 |
+
{
|
| 192 |
+
"type": "text",
|
| 193 |
+
"text": "To cast all tasks into a common classification model, we focus on the labeling versions of each task. Spans (gold mentions, constituents, predicates, etc.) are given as inputs, and the model is trained to predict $L$ as a multi-label target. We note that this is only one component of the common pipelined (or end-to-end) approach to these tasks, and that in general our metrics are not comparable to models that jointly perform span identification and labeling. However, since our focus is on analysis rather than application, the labeling version is a better fit for our goals of isolating individual phenomena of interest, and giving a uniform metric – binary F1 score – across our probing suite. ",
|
| 194 |
+
"bbox": [
|
| 195 |
+
174,
|
| 196 |
+
349,
|
| 197 |
+
825,
|
| 198 |
+
449
|
| 199 |
+
],
|
| 200 |
+
"page_idx": 2
|
| 201 |
+
},
|
| 202 |
+
{
|
| 203 |
+
"type": "text",
|
| 204 |
+
"text": "2.1 TASKS ",
|
| 205 |
+
"text_level": 1,
|
| 206 |
+
"bbox": [
|
| 207 |
+
174,
|
| 208 |
+
468,
|
| 209 |
+
261,
|
| 210 |
+
483
|
| 211 |
+
],
|
| 212 |
+
"page_idx": 2
|
| 213 |
+
},
|
| 214 |
+
{
|
| 215 |
+
"type": "text",
|
| 216 |
+
"text": "Our experiments focus on eight core NLP labeling tasks: part-of-speech, constituents, dependencies, named entities, semantic roles, coreference, semantic proto-roles, and relation classification. The tasks and their respective datasets are described below, and also detailed in Table 1 and Appendix B. ",
|
| 217 |
+
"bbox": [
|
| 218 |
+
174,
|
| 219 |
+
496,
|
| 220 |
+
825,
|
| 221 |
+
539
|
| 222 |
+
],
|
| 223 |
+
"page_idx": 2
|
| 224 |
+
},
|
| 225 |
+
{
|
| 226 |
+
"type": "text",
|
| 227 |
+
"text": "Part-of-speech tagging (POS) is the syntactic task of assigning tags such as noun, verb, adjective, etc. to individual tokens. We let $s _ { 1 } = [ \\dot { i } , i + 1 )$ be a single token, and seek to predict the POS tag. ",
|
| 228 |
+
"bbox": [
|
| 229 |
+
176,
|
| 230 |
+
545,
|
| 231 |
+
821,
|
| 232 |
+
574
|
| 233 |
+
],
|
| 234 |
+
"page_idx": 2
|
| 235 |
+
},
|
| 236 |
+
{
|
| 237 |
+
"type": "text",
|
| 238 |
+
"text": "Constituent labeling is the more general task concerned with assigning a non-terminal label for a span of tokens within the phrase-structure parse of the sentence: e.g. is the span a noun phrase, a verb phrase, etc. We let $s _ { 1 } = [ i , j )$ be a known constituent, and seek to predict the constituent label. ",
|
| 239 |
+
"bbox": [
|
| 240 |
+
174,
|
| 241 |
+
580,
|
| 242 |
+
825,
|
| 243 |
+
623
|
| 244 |
+
],
|
| 245 |
+
"page_idx": 2
|
| 246 |
+
},
|
| 247 |
+
{
|
| 248 |
+
"type": "text",
|
| 249 |
+
"text": "Dependency labeling is similar to constituent labeling, except that rather than aiming to position a span of tokens within the phrase structure, dependency labeling seeks to predict the functional relationships of one token relative to another: e.g. is in a modifier-head relationship, a subjectobject relationship, etc. We take $s _ { 1 } = [ i , i + 1 )$ to be a single token and $s _ { 2 } = [ j , j \\in \\bar { 1 } )$ to be its syntactic head, and seek to predict the dependency relation between tokens $i$ and $j$ . ",
|
| 250 |
+
"bbox": [
|
| 251 |
+
174,
|
| 252 |
+
630,
|
| 253 |
+
825,
|
| 254 |
+
700
|
| 255 |
+
],
|
| 256 |
+
"page_idx": 2
|
| 257 |
+
},
|
| 258 |
+
{
|
| 259 |
+
"type": "text",
|
| 260 |
+
"text": "Named entity labeling is the task of predicting the category of an entity referred to by a given span, e.g. does the entity refer to a person, a location, an organization, etc. We let $s _ { 1 } = [ i , j )$ represent an entity span and seek to predict the entity type. ",
|
| 261 |
+
"bbox": [
|
| 262 |
+
174,
|
| 263 |
+
707,
|
| 264 |
+
823,
|
| 265 |
+
750
|
| 266 |
+
],
|
| 267 |
+
"page_idx": 2
|
| 268 |
+
},
|
| 269 |
+
{
|
| 270 |
+
"type": "text",
|
| 271 |
+
"text": "Semantic role labeling (SRL) is the task of imposing predicate-argument structure onto a natural language sentence: e.g. given a sentence like “Mary pushed John”, SRL is concerned with identifying “Mary” as the pusher and “John” as the pushee. We let $s _ { 1 } = [ i _ { 1 } , j _ { 1 } )$ represent a known predicate and $s _ { 2 } = [ i _ { 2 } , j _ { 2 } )$ represent a known argument of that predicate, and seek to predict the role that the argument $s _ { 2 }$ fills–e.g. ARG0 (agent, the pusher) vs. ARG1 (patient, the pushee). ",
|
| 272 |
+
"bbox": [
|
| 273 |
+
174,
|
| 274 |
+
756,
|
| 275 |
+
823,
|
| 276 |
+
825
|
| 277 |
+
],
|
| 278 |
+
"page_idx": 2
|
| 279 |
+
},
|
| 280 |
+
{
|
| 281 |
+
"type": "text",
|
| 282 |
+
"text": "Coreference is the task of determining whether two spans of tokens (“mentions”) refer to the same entity (or event): e.g. in a given context, do “Obama” and “the former president” refer to the same person, or do “New York City” and “there” refer to the same place. We let $s _ { 1 }$ and $s _ { 2 }$ represent known mentions, and seek to make a binary prediction of whether they co-refer. ",
|
| 283 |
+
"bbox": [
|
| 284 |
+
174,
|
| 285 |
+
833,
|
| 286 |
+
823,
|
| 287 |
+
888
|
| 288 |
+
],
|
| 289 |
+
"page_idx": 2
|
| 290 |
+
},
|
| 291 |
+
{
|
| 292 |
+
"type": "text",
|
| 293 |
+
"text": "Semantic proto-role (SPR) labeling is the task of annotating fine-grained, non-exclusive semantic attributes, such as change of state or awareness, over predicate-argument pairs. E.g. ",
|
| 294 |
+
"bbox": [
|
| 295 |
+
173,
|
| 296 |
+
895,
|
| 297 |
+
820,
|
| 298 |
+
924
|
| 299 |
+
],
|
| 300 |
+
"page_idx": 2
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"type": "text",
|
| 304 |
+
"text": "given the sentence “Mary pushed John”, whereas SRL is concerned with identifying “Mary” as the pusher, SPR is concerned with identifying attributes such as awareness (whether the pusher is aware that they are doing the pushing). We let $s _ { 1 }$ represent a predicate span and $s _ { 2 }$ a known argument head, and perform a multi-label classification over potential attributes of the predicateargument relation. ",
|
| 305 |
+
"bbox": [
|
| 306 |
+
174,
|
| 307 |
+
103,
|
| 308 |
+
825,
|
| 309 |
+
172
|
| 310 |
+
],
|
| 311 |
+
"page_idx": 3
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"type": "text",
|
| 315 |
+
"text": "Relation Classification (Rel.) is the task of predicting the real-world relation that holds between two entities, typically given an inventory of symbolic relation types (often from an ontology or database schema). For example, given a sentence like “Mary is walking to work”, relation classification is concerned with linking “Mary” to “work” via the Entity-Destination relation. We let $s _ { 1 }$ and $s _ { 2 }$ represent known mentions, and seek to predict the relation type. ",
|
| 316 |
+
"bbox": [
|
| 317 |
+
174,
|
| 318 |
+
180,
|
| 319 |
+
825,
|
| 320 |
+
251
|
| 321 |
+
],
|
| 322 |
+
"page_idx": 3
|
| 323 |
+
},
|
| 324 |
+
{
|
| 325 |
+
"type": "text",
|
| 326 |
+
"text": "2.2 DATASETS ",
|
| 327 |
+
"text_level": 1,
|
| 328 |
+
"bbox": [
|
| 329 |
+
174,
|
| 330 |
+
267,
|
| 331 |
+
287,
|
| 332 |
+
281
|
| 333 |
+
],
|
| 334 |
+
"page_idx": 3
|
| 335 |
+
},
|
| 336 |
+
{
|
| 337 |
+
"type": "text",
|
| 338 |
+
"text": "We use the annotations in the OntoNotes 5.0 corpus (Weischedel et al., 2013) for five of the above eight tasks: POS tags, constituents, named entities, semantic roles, and coreference. In all cases, we simply cast the original annotation into our edge probing format. For POS tagging, we simply extract these labels from the constituency parse data in OntoNotes. For coreference, since OntoNotes only provides annotations for positive examples (pairs of mentions that corefer) we generate negative examples by generating all pairs of mentions that are not explicitly marked as coreferent. ",
|
| 339 |
+
"bbox": [
|
| 340 |
+
174,
|
| 341 |
+
294,
|
| 342 |
+
825,
|
| 343 |
+
377
|
| 344 |
+
],
|
| 345 |
+
"page_idx": 3
|
| 346 |
+
},
|
| 347 |
+
{
|
| 348 |
+
"type": "text",
|
| 349 |
+
"text": "The OntoNotes corpus does not contain annotations for dependencies, proto-roles, or semantic relations. Thus, for dependencies, we use the English Web Treebank portion of the Universal Dependencies 2.2 release (Silveira et al., 2014). For SPR, we use two datasets, one (SPR1; Teichert et al. (2017)) derived from Penn Treebank and one (SPR2; Rudinger et al. (2018)) derived from English Web Treebank. For relation classification, we use the SemEval 2010 Task 8 dataset (Hendrickx et al., 2009), which consists of sentences sampled from English web text, labeled with a set of 9 directional relation types. ",
|
| 350 |
+
"bbox": [
|
| 351 |
+
174,
|
| 352 |
+
385,
|
| 353 |
+
825,
|
| 354 |
+
482
|
| 355 |
+
],
|
| 356 |
+
"page_idx": 3
|
| 357 |
+
},
|
| 358 |
+
{
|
| 359 |
+
"type": "text",
|
| 360 |
+
"text": "In addition to the OntoNotes coreference examples, we include an extra “challenge” coreference dataset based on the Winograd schema (Levesque et al., 2012). Winograd schema problems focus on cases of pronoun resolution which are syntactically ambiguous and thus are intended to require subtler semantic inference in order to resolve correctly (see example in Table 1). We use the version of the Definite Pronoun Resolution (DPR) dataset (Rahman & Ng, 2012) employed by White et al. (2017), which contains balanced positive and negative pairs. ",
|
| 361 |
+
"bbox": [
|
| 362 |
+
174,
|
| 363 |
+
489,
|
| 364 |
+
825,
|
| 365 |
+
573
|
| 366 |
+
],
|
| 367 |
+
"page_idx": 3
|
| 368 |
+
},
|
| 369 |
+
{
|
| 370 |
+
"type": "text",
|
| 371 |
+
"text": "3 EXPERIMENTAL SET-UP ",
|
| 372 |
+
"text_level": 1,
|
| 373 |
+
"bbox": [
|
| 374 |
+
176,
|
| 375 |
+
593,
|
| 376 |
+
406,
|
| 377 |
+
609
|
| 378 |
+
],
|
| 379 |
+
"page_idx": 3
|
| 380 |
+
},
|
| 381 |
+
{
|
| 382 |
+
"type": "text",
|
| 383 |
+
"text": "3.1 PROBING MODEL ",
|
| 384 |
+
"text_level": 1,
|
| 385 |
+
"bbox": [
|
| 386 |
+
176,
|
| 387 |
+
625,
|
| 388 |
+
334,
|
| 389 |
+
638
|
| 390 |
+
],
|
| 391 |
+
"page_idx": 3
|
| 392 |
+
},
|
| 393 |
+
{
|
| 394 |
+
"type": "text",
|
| 395 |
+
"text": "Our probing architecture is illustrated in Figure 1. The model is designed to have limited expressive power on its own, as to focus on what information can be extracted from the contextual embeddings. We take a list of contextual vectors $[ e _ { 0 } , e _ { 1 } , \\ldots , e _ { n } ]$ and integer spans $s ^ { ( 1 ) } = [ i ^ { ( 1 ) } , j ^ { ( 1 ) } )$ and (optionally) $s ^ { ( 2 ) } = [ i ^ { ( 2 ) } , j ^ { ( 2 ) } )$ as inputs, and use a projection layer followed by the self-attention pooling operator of Lee et al. (2017) to compute fixed-length span representations. Pooling is only within the bounds of a span, e.g. the vectors $[ e _ { i } , e _ { i + 1 } , \\ldots , e _ { j - 1 } ]$ , which means that the only information our model can access about the rest of the sentence is that provided by the contextual embeddings. ",
|
| 396 |
+
"bbox": [
|
| 397 |
+
174,
|
| 398 |
+
651,
|
| 399 |
+
825,
|
| 400 |
+
752
|
| 401 |
+
],
|
| 402 |
+
"page_idx": 3
|
| 403 |
+
},
|
| 404 |
+
{
|
| 405 |
+
"type": "text",
|
| 406 |
+
"text": "The span representations are concatenated and fed into a two-layer MLP followed by a sigmoid output layer. We train by minimizing binary cross-entropy against the target label set $\\bar { L ^ { \\mathrm { ~ \\in ~ } } } \\{ 0 , \\bar { 1 } \\} ^ { | \\mathcal { L } | }$ . Our code is implemented in PyTorch (Paszke et al., 2017) using the AllenNLP (Gardner et al., 2018) toolkit. For further details on training, see Appendix C. ",
|
| 407 |
+
"bbox": [
|
| 408 |
+
176,
|
| 409 |
+
758,
|
| 410 |
+
825,
|
| 411 |
+
816
|
| 412 |
+
],
|
| 413 |
+
"page_idx": 3
|
| 414 |
+
},
|
| 415 |
+
{
|
| 416 |
+
"type": "text",
|
| 417 |
+
"text": "3.2 SENTENCE REPRESENTATION MODELS ",
|
| 418 |
+
"text_level": 1,
|
| 419 |
+
"bbox": [
|
| 420 |
+
176,
|
| 421 |
+
833,
|
| 422 |
+
482,
|
| 423 |
+
848
|
| 424 |
+
],
|
| 425 |
+
"page_idx": 3
|
| 426 |
+
},
|
| 427 |
+
{
|
| 428 |
+
"type": "text",
|
| 429 |
+
"text": "We explore four recent contextual encoder models: CoVe, ELMo, OpenAI GPT, and BERT. Each model takes tokens $[ t _ { 0 } , t _ { 1 } , \\ldots , t _ { n } ]$ as input and produces a list of contextual vectors $[ e _ { 0 } , e _ { 1 } , \\ldots , e _ { n } ]$ . ",
|
| 430 |
+
"bbox": [
|
| 431 |
+
176,
|
| 432 |
+
859,
|
| 433 |
+
823,
|
| 434 |
+
890
|
| 435 |
+
],
|
| 436 |
+
"page_idx": 3
|
| 437 |
+
},
|
| 438 |
+
{
|
| 439 |
+
"type": "text",
|
| 440 |
+
"text": "CoVe (McCann et al., 2017) uses the top-level activations of a two-layer biLSTM trained on EnglishGerman translation, concatenated with 300-dimensional GloVe vectors. The source data consists of ",
|
| 441 |
+
"bbox": [
|
| 442 |
+
174,
|
| 443 |
+
895,
|
| 444 |
+
823,
|
| 445 |
+
922
|
| 446 |
+
],
|
| 447 |
+
"page_idx": 3
|
| 448 |
+
},
|
| 449 |
+
{
|
| 450 |
+
"type": "text",
|
| 451 |
+
"text": "7 million sentences from web crawl, news, and government proceedings (WMT 2017; Bojar et al. \n(2017)). ",
|
| 452 |
+
"bbox": [
|
| 453 |
+
173,
|
| 454 |
+
103,
|
| 455 |
+
821,
|
| 456 |
+
132
|
| 457 |
+
],
|
| 458 |
+
"page_idx": 4
|
| 459 |
+
},
|
| 460 |
+
{
|
| 461 |
+
"type": "text",
|
| 462 |
+
"text": "ELMo (Peters et al., 2018a) is a two-layer bidirectional LSTM language model, built over a contextindependent character CNN layer and trained on the Billion Word Benchmark dataset (Chelba et al., 2014), consisting primarily of newswire text. We follow standard usage and take a linear combination of the ELMo layers, using learned task-specific scalars (Equation 1 of Peters et al., 2018a). ",
|
| 463 |
+
"bbox": [
|
| 464 |
+
174,
|
| 465 |
+
138,
|
| 466 |
+
823,
|
| 467 |
+
194
|
| 468 |
+
],
|
| 469 |
+
"page_idx": 4
|
| 470 |
+
},
|
| 471 |
+
{
|
| 472 |
+
"type": "text",
|
| 473 |
+
"text": "GPT (Radford et al., 2018) is a 12-layer Transformer (Vaswani et al., 2017) encoder trained as a left-to-right language model on the Toronto Books Corpus (Zhu et al., 2015). Departing from the original authors, we do not fine-tune the encoder3. ",
|
| 474 |
+
"bbox": [
|
| 475 |
+
174,
|
| 476 |
+
202,
|
| 477 |
+
820,
|
| 478 |
+
243
|
| 479 |
+
],
|
| 480 |
+
"page_idx": 4
|
| 481 |
+
},
|
| 482 |
+
{
|
| 483 |
+
"type": "text",
|
| 484 |
+
"text": "BERT (Devlin et al., 2018) is a deep Transformer (Vaswani et al., 2017) encoder trained jointly as a masked language model and on next-sentence prediction, trained on the concatenation of the Toronto Books Corpus (Zhu et al., 2015) and English Wikipedia. As with GPT, we do not finetune the encoder weights. We probe the publicly released bert-base-uncased (12-layer) and bert-large-uncased (24-layer) models4. ",
|
| 485 |
+
"bbox": [
|
| 486 |
+
174,
|
| 487 |
+
251,
|
| 488 |
+
825,
|
| 489 |
+
320
|
| 490 |
+
],
|
| 491 |
+
"page_idx": 4
|
| 492 |
+
},
|
| 493 |
+
{
|
| 494 |
+
"type": "text",
|
| 495 |
+
"text": "For BERT and GPT, we compare two methods for yielding contextual vectors for each token: cat where we concatenate the subword embeddings with the activations of the top layer, similar to CoVe, and mix where we take a linear combination of layer activations (including embeddings) using learned task-specific scalars (Equation 1 of Peters et al., 2018a), similar to ELMo. ",
|
| 496 |
+
"bbox": [
|
| 497 |
+
174,
|
| 498 |
+
328,
|
| 499 |
+
823,
|
| 500 |
+
383
|
| 501 |
+
],
|
| 502 |
+
"page_idx": 4
|
| 503 |
+
},
|
| 504 |
+
{
|
| 505 |
+
"type": "text",
|
| 506 |
+
"text": "The resulting contextual vectors have dimension $d = 9 0 0$ for CoVe, $d = 1 0 2 4$ for ELMo, and $d = 1 5 3 6$ (cat) or $d = 7 6 8 ( \\mathrm { m i x } )$ for GPT and BERT-base, and $d = 2 0 4 8$ (cat) or $d = 1 0 2 4$ (mix) for BERT-large5. The pretrained models expect different tokenizations and input processing. We use a heuristic alignment algorithm based on byte-level Levenshtein distance, explained in detail in Appendix E, in order to re-map spans from the source data to the tokenization expected by the above models. ",
|
| 507 |
+
"bbox": [
|
| 508 |
+
174,
|
| 509 |
+
390,
|
| 510 |
+
825,
|
| 511 |
+
473
|
| 512 |
+
],
|
| 513 |
+
"page_idx": 4
|
| 514 |
+
},
|
| 515 |
+
{
|
| 516 |
+
"type": "text",
|
| 517 |
+
"text": "4 EXPERIMENTS ",
|
| 518 |
+
"text_level": 1,
|
| 519 |
+
"bbox": [
|
| 520 |
+
176,
|
| 521 |
+
494,
|
| 522 |
+
326,
|
| 523 |
+
510
|
| 524 |
+
],
|
| 525 |
+
"page_idx": 4
|
| 526 |
+
},
|
| 527 |
+
{
|
| 528 |
+
"type": "text",
|
| 529 |
+
"text": "Again, we want to answer: What do contextual representations encode that conventional word embeddings do not? Our experimental comparisons, described below, are intended to ablate various aspects of contextualized encoders in order to illuminate how the model captures different types of linguistic information. ",
|
| 530 |
+
"bbox": [
|
| 531 |
+
174,
|
| 532 |
+
526,
|
| 533 |
+
825,
|
| 534 |
+
582
|
| 535 |
+
],
|
| 536 |
+
"page_idx": 4
|
| 537 |
+
},
|
| 538 |
+
{
|
| 539 |
+
"type": "text",
|
| 540 |
+
"text": "Lexical Baselines. In order to probe the effect of each contextual encoder, we train a version of our probing model directly on the most closely related context-independent word representations. This baseline measures the performance that can be achieved from lexical priors alone, without any access to surrounding words. For CoVe, we compare to the embedding layer of that model, which consists of 300-dimensional GloVe vectors trained on 840 billion tokens of CommonCrawl (web) text. For ELMo, we use the activations of the context-independent character-CNN layer (layer 0) from the full model. For GPT and for BERT, we use the learned subword embeddings from the full model. ",
|
| 541 |
+
"bbox": [
|
| 542 |
+
173,
|
| 543 |
+
598,
|
| 544 |
+
825,
|
| 545 |
+
709
|
| 546 |
+
],
|
| 547 |
+
"page_idx": 4
|
| 548 |
+
},
|
| 549 |
+
{
|
| 550 |
+
"type": "text",
|
| 551 |
+
"text": "Randomized ELMo. Randomized neural networks have recently (Zhang & Bowman, 2018) shown surprisingly strong performance on many tasks, suggesting that architecture may play a significant role in learning useful feature functions. To help understand what is actually learned during the encoder pretraining, we compare with a version of the ELMo model in which all weights above the lexical layer (layer 0) are replaced with random orthonormal matrices6. ",
|
| 552 |
+
"bbox": [
|
| 553 |
+
174,
|
| 554 |
+
726,
|
| 555 |
+
825,
|
| 556 |
+
795
|
| 557 |
+
],
|
| 558 |
+
"page_idx": 4
|
| 559 |
+
},
|
| 560 |
+
{
|
| 561 |
+
"type": "text",
|
| 562 |
+
"text": "Word-Level CNN. To what extent do contextual encoders capture long-range dependencies, versus simply modeling local context? We extend our lexical baseline by introducing a fixed-width convolutional layer on top of the word representations. As comparing to the lexical baseline factors out word-level priors, comparing to this CNN baseline factors out local relationships, such as the presence of nearby function words, and allows us to see the contribution of long-range context to encoder performance. To implement this, we replace the projection layer in our probing model with a fully-connected CNN that sees $\\pm 1$ or $\\pm 2$ tokens around the center word (i.e. kernel width 3 or 5). ",
|
| 563 |
+
"bbox": [
|
| 564 |
+
174,
|
| 565 |
+
103,
|
| 566 |
+
825,
|
| 567 |
+
200
|
| 568 |
+
],
|
| 569 |
+
"page_idx": 5
|
| 570 |
+
},
|
| 571 |
+
{
|
| 572 |
+
"type": "text",
|
| 573 |
+
"text": "5 RESULTS ",
|
| 574 |
+
"text_level": 1,
|
| 575 |
+
"bbox": [
|
| 576 |
+
176,
|
| 577 |
+
222,
|
| 578 |
+
281,
|
| 579 |
+
238
|
| 580 |
+
],
|
| 581 |
+
"page_idx": 5
|
| 582 |
+
},
|
| 583 |
+
{
|
| 584 |
+
"type": "text",
|
| 585 |
+
"text": "Using the above experimental design, we return to the central questions originally posed. That is, what types of syntactic and semantic information does each model encode at each position? And is the information captured primarily local, or do contextualized embeddings encode information about long-range sentential structure? ",
|
| 586 |
+
"bbox": [
|
| 587 |
+
174,
|
| 588 |
+
256,
|
| 589 |
+
825,
|
| 590 |
+
310
|
| 591 |
+
],
|
| 592 |
+
"page_idx": 5
|
| 593 |
+
},
|
| 594 |
+
{
|
| 595 |
+
"type": "text",
|
| 596 |
+
"text": "Comparison of representation models. We report F1 scores for ELMo, CoVe, GPT, and BERT in Table 2. We observe that ELMo and GPT (with mix features) have comparable performance, with ELMo slightly better on most tasks but the Transformer scoring higher on relation classification and OntoNotes coreference. Both models outperform CoVe by a significant margin (6.3 F1 points on average), meaning that the information in their word representations makes it easier to recover details of sentence structure. It is important to note that while ELMo, CoVe, and the GPT can be applied to the same problems, they differ in architecture, training objective, and both the quantity and genre of training data $( \\ S \\ 3 . 2 )$ . Furthermore, on all tasks except for Winograd coreference, the lexical representations used by the ELMo and GPT models outperform GloVe vectors (by 5.4 and 2.4 points on average, respectively). This is particularly pronounced on constituent and semantic role labeling, where the model may be benefiting from better handling of morphology by character-level or subword representations. ",
|
| 597 |
+
"bbox": [
|
| 598 |
+
174,
|
| 599 |
+
328,
|
| 600 |
+
825,
|
| 601 |
+
494
|
| 602 |
+
],
|
| 603 |
+
"page_idx": 5
|
| 604 |
+
},
|
| 605 |
+
{
|
| 606 |
+
"type": "text",
|
| 607 |
+
"text": "We observe that using ELMo-style scalar mixing (mix) instead of concatenation improves performance significantly (1-3 F1 points on average) on both deep Transformer models (BERT and GPT). We attribute this to the most relevant information being contained in intermediate layers, which agrees with observations by Blevins et al. (2018), Peters et al. (2018a), and Devlin et al. (2018), and with the finding of Peters et al. (2018b) that top layers may be overly specialized to perform next-word prediction. ",
|
| 608 |
+
"bbox": [
|
| 609 |
+
174,
|
| 610 |
+
502,
|
| 611 |
+
825,
|
| 612 |
+
585
|
| 613 |
+
],
|
| 614 |
+
"page_idx": 5
|
| 615 |
+
},
|
| 616 |
+
{
|
| 617 |
+
"type": "text",
|
| 618 |
+
"text": "When using scalar mixing $\\left( \\mathrm { m i x } \\right)$ , we observe that the BERT-base model outperforms GPT, which has a similar 12-layer Transformer architecture, by approximately 2 F1 points on average. The 24- layer BERT-large model performs better still, besting BERT-base by 1.1 F1 points and ELMo by 2.7 F1 - a nearly $20 \\%$ relative reduction in error on most tasks. ",
|
| 619 |
+
"bbox": [
|
| 620 |
+
174,
|
| 621 |
+
592,
|
| 622 |
+
823,
|
| 623 |
+
648
|
| 624 |
+
],
|
| 625 |
+
"page_idx": 5
|
| 626 |
+
},
|
| 627 |
+
{
|
| 628 |
+
"type": "text",
|
| 629 |
+
"text": "We find that the improvements of the BERT models are not uniform across tasks. In particular, BERT-large improves on ELMo by $7 . 4 \\ \\mathrm { F 1 }$ points on OntoNotes coreference, more than a $40 \\%$ reduction in error and nearly as high as the improvement of the ELMo encoder over its lexical baseline. We also see a large improvement (7.8 F1 points)7 on Winograd-style coreference from BERT-large in particular, suggesting that deeper unsupervised models may yield further improvement on difficult semantic tasks. ",
|
| 630 |
+
"bbox": [
|
| 631 |
+
174,
|
| 632 |
+
655,
|
| 633 |
+
825,
|
| 634 |
+
738
|
| 635 |
+
],
|
| 636 |
+
"page_idx": 5
|
| 637 |
+
},
|
| 638 |
+
{
|
| 639 |
+
"type": "text",
|
| 640 |
+
"text": "Genre Effects. Our probing suite is drawn mostly from newswire and web text $( \\ S \\ 2 )$ . This is a good match for the Billion Word Benchmark (BWB) used to train the ELMo model, but a weaker match for the Books Corpus used to train the published GPT model. To control for this, we train a clone of the GPT model on the BWB, using the code and hyperparameters of Radford et al. (2018). We find that this model performs only slightly better $( + 0 . 1 5 \\ \\mathrm { F 1 }$ on average) on our probing suite than the Books Corpus-trained model, but still underperforms ELMo by nearly 1 F1 point. ",
|
| 641 |
+
"bbox": [
|
| 642 |
+
174,
|
| 643 |
+
756,
|
| 644 |
+
825,
|
| 645 |
+
839
|
| 646 |
+
],
|
| 647 |
+
"page_idx": 5
|
| 648 |
+
},
|
| 649 |
+
{
|
| 650 |
+
"type": "text",
|
| 651 |
+
"text": "Encoding of syntactic vs. semantic information. By comparing to lexical baselines, we can measure how much the contextual information from a particular encoder improves performance on each task. Note that in all cases, the contextual representation is strictly more expressive, since it includes access to the lexical representations either by concatenation or by scalar mixing. ",
|
| 652 |
+
"bbox": [
|
| 653 |
+
176,
|
| 654 |
+
856,
|
| 655 |
+
823,
|
| 656 |
+
885
|
| 657 |
+
],
|
| 658 |
+
"page_idx": 5
|
| 659 |
+
},
|
| 660 |
+
{
|
| 661 |
+
"type": "table",
|
| 662 |
+
"img_path": "images/0e8d542e9426035c60993acaec67a2c0901ef9dee886ac2d94d206cf77d26584.jpg",
|
| 663 |
+
"table_caption": [
|
| 664 |
+
"Table 2: Comparison of representation models and their respective lexical baselines. Numbers reported are micro-averaged F1 score on respective test sets. Lex. denotes the lexical baseline $( \\ S 4 )$ for each model, and bold denotes the best performance on each task. Lines in italics are subsets of the targets from a parent task; these are omitted in the macro average. SRL numbers consider core and non-core roles, but ignore references and continuations. Winograd (DPR) results are the average of five runs each using a random sample (without replacement) of $80 \\%$ of the training data. $9 5 \\%$ confidence intervals (normal approximation) are approximately $\\pm 3$ ( $\\pm 6$ with BERT-large) for Winograd, $\\pm 1$ for SPR1 and SPR2, and $\\pm 0 . 5$ or smaller for all other tasks. "
|
| 665 |
+
],
|
| 666 |
+
"table_footnote": [],
|
| 667 |
+
"table_body": "<table><tr><td></td><td colspan=\"3\">CoVe</td><td colspan=\"3\">ELMo</td><td colspan=\"3\">GPT</td></tr><tr><td></td><td>Lex.</td><td>Full</td><td>Abs.△</td><td>Lex.</td><td>Full</td><td>Abs. △</td><td>Lex.</td><td>cat</td><td>mix</td></tr><tr><td>Part-of-Speech</td><td>85.7</td><td>94.0</td><td>8.4</td><td>90.4</td><td>96.7</td><td>6.3</td><td>88.2</td><td>94.9</td><td>95.0</td></tr><tr><td>Constituents</td><td>56.1</td><td>81.6</td><td>25.4</td><td>69.1</td><td>84.6</td><td>15.4</td><td>65.1</td><td>81.3</td><td>84.6</td></tr><tr><td>Dependencies</td><td>75.0</td><td>83.6</td><td>8.6</td><td>80.4</td><td>93.9</td><td>13.6</td><td>77.7</td><td>92.1</td><td>94.1</td></tr><tr><td>Entities</td><td>88.4</td><td>90.3</td><td>1.9</td><td>92.0</td><td>95.6</td><td>3.5</td><td>88.6</td><td>92.9</td><td>92.5</td></tr><tr><td>SRL (all)</td><td>59.7</td><td>80.4</td><td>20.7</td><td>74.1</td><td>90.1</td><td>16.0</td><td>67.7</td><td>86.0</td><td>89.7</td></tr><tr><td>Core roles</td><td>56.2</td><td>81.0</td><td>24.7</td><td>73.6</td><td>92.6</td><td>19.0</td><td>65.1</td><td>88.0</td><td>92.0</td></tr><tr><td>Non-core roles</td><td>67.7</td><td>78.8</td><td>11.1</td><td>75.4</td><td>84.1</td><td>8.8</td><td>73.9</td><td>81.3</td><td>84.1</td></tr><tr><td>OntoNotes coref.</td><td>72.9</td><td>79.2</td><td>6.3</td><td>75.3</td><td>84.0</td><td>8.7</td><td>71.8</td><td>83.6</td><td>86.3</td></tr><tr><td>SPR1</td><td>73.7</td><td>77.1</td><td>3.4</td><td>80.1</td><td>84.8</td><td>4.7</td><td>79.2</td><td>83.5</td><td>83.1</td></tr><tr><td>SPR2</td><td>76.6</td><td>80.2</td><td>3.6</td><td>82.1</td><td>83.1</td><td>1.0</td><td>82.2</td><td>83.8</td><td>83.5</td></tr><tr><td>Winograd coref.</td><td>52.1</td><td>54.3</td><td>2.2</td><td>54.3</td><td>53.5</td><td>-0.8</td><td>51.7</td><td>52.6</td><td>53.8</td></tr><tr><td>Rel. (SemEval)</td><td>51.0</td><td>60.6</td><td>9.6</td><td>55.7</td><td>77.8</td><td>22.1</td><td>58.2</td><td>81.3</td><td>81.0</td></tr><tr><td>Macro Average</td><td>69.1</td><td>78.1</td><td>9.0</td><td>75.4</td><td>84.4</td><td>9.1</td><td>73.0</td><td>83.2</td><td>84.4</td></tr><tr><td></td><td colspan=\"3\">BERT-base</td><td colspan=\"6\">BERT-large</td></tr><tr><td></td><td>Lex.</td><td>F1 Score cat</td><td>mix</td><td>Abs.△ ELMo</td><td>Lex.</td><td>F1 Score</td><td></td><td>Abs.△ (base)</td><td>ELMo</td></tr><tr><td>Part-of-Speech</td><td></td><td></td><td>96.7</td><td>0.0</td><td></td><td>cat</td><td>mix</td><td>0.2</td><td>0.2</td></tr><tr><td>Constituents</td><td>88.4 68.4</td><td>97.0</td><td>86.7</td><td>2.1</td><td>88.1 69.0</td><td>96.5 80.1</td><td>96.9 87.0</td><td>0.4</td><td>2.5</td></tr><tr><td>Dependencies</td><td></td><td>83.7</td><td>95.1</td><td>1.1</td><td>80.2</td><td>91.5</td><td>95.4</td><td>0.3</td><td>1.4</td></tr><tr><td>Entities</td><td>80.1 90.9</td><td>93.0</td><td>96.2</td><td>0.6</td><td>91.8</td><td></td><td>96.5</td><td>0.3</td><td>0.9</td></tr><tr><td>SRL (all)</td><td>75.4</td><td>96.1</td><td>91.3</td><td>1.2</td><td>76.5</td><td>96.2 88.2</td><td>92.3</td><td>1.0</td><td>2.2</td></tr><tr><td>Core roles</td><td>74.9</td><td>89.4</td><td>93.6</td><td>1.0</td><td>76.3</td><td>89.9</td><td>94.6</td><td>1.0</td><td>2.0</td></tr><tr><td>Non-core roles</td><td>76.4</td><td>91.4</td><td>85.9</td><td>1.8</td><td>76.9</td><td>84.1</td><td>86.9</td><td>1.0</td><td></td></tr><tr><td>OntoNotes coref.</td><td>74.9</td><td>84.7 88.7</td><td>90.2</td><td>6.3</td><td>75.7</td><td>89.6</td><td>91.4</td><td>1.2</td><td>2.8 7.4</td></tr><tr><td>SPR1</td><td>79.2</td><td></td><td></td><td>1.3</td><td></td><td>85.1</td><td>85.8</td><td>-0.3</td><td></td></tr><tr><td>SPR2</td><td></td><td>84.7</td><td>86.1 83.8</td><td></td><td>79.6</td><td></td><td>84.1</td><td>0.3</td><td>1.0 1.0</td></tr><tr><td></td><td>81.7</td><td>83.0</td><td></td><td>0.7</td><td>81.6</td><td>83.2</td><td></td><td></td><td></td></tr><tr><td>Winograd coref. Rel. (SemEval)</td><td>54.3 57.4</td><td>53.6 78.3</td><td>54.9 82.0</td><td>1.4 4.2</td><td>53.0 56.2</td><td>53.8 77.6</td><td>61.4 82.4</td><td>6.5 0.5</td><td>7.8 4.6</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Macro Average</td><td>75.1</td><td>84.8</td><td>86.3</td><td>1.9</td><td>75.2</td><td>84.2</td><td>87.3</td><td>1.0</td><td>2.9</td></tr></table>",
|
| 668 |
+
"bbox": [
|
| 669 |
+
176,
|
| 670 |
+
99,
|
| 671 |
+
823,
|
| 672 |
+
574
|
| 673 |
+
],
|
| 674 |
+
"page_idx": 6
|
| 675 |
+
},
|
| 676 |
+
{
|
| 677 |
+
"type": "text",
|
| 678 |
+
"text": "",
|
| 679 |
+
"bbox": [
|
| 680 |
+
173,
|
| 681 |
+
728,
|
| 682 |
+
821,
|
| 683 |
+
756
|
| 684 |
+
],
|
| 685 |
+
"page_idx": 6
|
| 686 |
+
},
|
| 687 |
+
{
|
| 688 |
+
"type": "text",
|
| 689 |
+
"text": "We observe that ELMo, CoVe, and GPT all follow a similar trend across our suite (Table 2), showing the largest gains on tasks which are considered to be largely syntactic, such as dependency and constituent labeling, and smaller gains on tasks which are considered to require more semantic reasoning, such as SPR and Winograd. We observe small absolute improvements $+ 6 . 3$ and $+ 3 . 5$ for ELMo Full vs. Lex.) on part-of-speech tagging and entity labeling, but note that this is likely due to the strength of word-level priors on these tasks. Relative reduction in error is much higher $+ 6 6 \\%$ for Part-of-Speech and $+ 4 4 \\%$ for Entities), suggesting that ELMo does encode local type information. ",
|
| 690 |
+
"bbox": [
|
| 691 |
+
174,
|
| 692 |
+
762,
|
| 693 |
+
825,
|
| 694 |
+
861
|
| 695 |
+
],
|
| 696 |
+
"page_idx": 6
|
| 697 |
+
},
|
| 698 |
+
{
|
| 699 |
+
"type": "text",
|
| 700 |
+
"text": "Semantic role labeling benefits greatly from contextual encoders overall, but this is predominantly due to better labeling of core roles $( + 1 9 . 0$ F1 for ELMo) which are known to be closely tied to syntax (e.g. Punyakanok et al. (2008); Gildea & Palmer (2002)). The lexical baseline performs similarly on core and non-core roles (74 and 75 F1 for ELMo), but the more semantically-oriented non-core role labels (such as purpose, cause, or negation) see only a smaller improvement from encoded context $( + 8 . 8$ F1 for ELMo). The semantic proto-role labeling task (SPR1, SPR2) looks at the same type of core predicate-argument pairs but tests for higher-level semantic properties (§ 2), which we find to be only weakly captured by the contextual encoder $+ 1 { - } 5 \\operatorname { F } 1$ for ELMo). ",
|
| 701 |
+
"bbox": [
|
| 702 |
+
174,
|
| 703 |
+
867,
|
| 704 |
+
823,
|
| 705 |
+
924
|
| 706 |
+
],
|
| 707 |
+
"page_idx": 6
|
| 708 |
+
},
|
| 709 |
+
{
|
| 710 |
+
"type": "image",
|
| 711 |
+
"img_path": "images/d01023222939b810884a08093025bf47d68a0d56f879e5ef179963ec3406bc0b.jpg",
|
| 712 |
+
"image_caption": [
|
| 713 |
+
"Figure 2: Additional baselines for ELMo, evaluated on the test sets. $\\mathrm { C N N } k$ adds a convolutional layer that sees $\\pm k$ tokens to each side of the center word. Lexical is the lexical baseline, equivalent to $k = 0$ . Orthonormal is the full ELMo architecture with random orthonormal LSTM and projection weights, but using the pretrained lexical layer. Full (pretrained) is the full ELMo model. Colored bands are $9 5 \\%$ confidence intervals (normal approximation). "
|
| 714 |
+
],
|
| 715 |
+
"image_footnote": [],
|
| 716 |
+
"bbox": [
|
| 717 |
+
181,
|
| 718 |
+
99,
|
| 719 |
+
815,
|
| 720 |
+
330
|
| 721 |
+
],
|
| 722 |
+
"page_idx": 7
|
| 723 |
+
},
|
| 724 |
+
{
|
| 725 |
+
"type": "text",
|
| 726 |
+
"text": "",
|
| 727 |
+
"bbox": [
|
| 728 |
+
174,
|
| 729 |
+
428,
|
| 730 |
+
825,
|
| 731 |
+
484
|
| 732 |
+
],
|
| 733 |
+
"page_idx": 7
|
| 734 |
+
},
|
| 735 |
+
{
|
| 736 |
+
"type": "text",
|
| 737 |
+
"text": "The SemEval relation classification task is designed to require semantic reasoning, but in this case we see a large improvement from contextual encoders, with ELMo improving by 22 F1 points on the lexical baseline $5 0 \\%$ relative error reduction) and BERT-large improving by another 4.6 points. We attribute this partly to the poor performance (51-58 F1) of lexical priors on this task, and to the fact that many easy relations can be resolved simply by observing key words in the sentence (for example, “caused” suggests the presence of a Cause-Effect relation). To test this, we augment the lexical baseline with a bag-of-words feature, and find that for relation classification we capture more than $70 \\%$ of the headroom from using the full ELMo model.8 ",
|
| 738 |
+
"bbox": [
|
| 739 |
+
173,
|
| 740 |
+
491,
|
| 741 |
+
825,
|
| 742 |
+
603
|
| 743 |
+
],
|
| 744 |
+
"page_idx": 7
|
| 745 |
+
},
|
| 746 |
+
{
|
| 747 |
+
"type": "text",
|
| 748 |
+
"text": "Effects of architecture. Focusing on the ELMo model, we ask: how much of the model’s performance can be attributed to the architecture, rather than knowledge from pretraining? In Figure 2 we compare to an orthonormal encoder $( \\ S 4 )$ which is structurally identical to ELMo but contains no information in the recurrent weights. It can be thought of as a randomized feature function over the sentence, and provides a baseline for how the architecture itself can encode useful contextual information. We find that the orthonormal encoder improves significantly on the lexical baseline, but that overall the learned weights account for over $70 \\%$ of the improvements from full ELMo. ",
|
| 749 |
+
"bbox": [
|
| 750 |
+
173,
|
| 751 |
+
619,
|
| 752 |
+
825,
|
| 753 |
+
717
|
| 754 |
+
],
|
| 755 |
+
"page_idx": 7
|
| 756 |
+
},
|
| 757 |
+
{
|
| 758 |
+
"type": "text",
|
| 759 |
+
"text": "Encoding non-local context. How much information is carried over long distances (several tokens or more) in the sentence? To estimate this, we extend our lexical baseline with a convolutional layer, which allows the probing classifier to use local context. In Figure 2 we find that adding a CNN of width 3 $\\pm 1$ token) closes $72 \\%$ (macro average over tasks) of the gap between the lexical baseline and full ELMo; this extends to $79 \\%$ if we use a CNN of width 5 $\\pm 2$ tokens). On nonterminal constituents, we find that the CNN $\\pm 2$ model matches ELMo performance, suggesting that while the ELMo encoder propagates a large amount of information about constituents $_ { + 1 5 . 4 }$ F1 vs. Lex., Table 2), most of it is local in nature. We see a similar trend on the other syntactic tasks, with 80- $90 \\%$ of ELMo performance on dependencies, part-of-speech, and SRL core roles captured by CNN $\\pm 2$ . Conversely, on more semantic tasks, such as coreference, SRL non-core roles, and SPR, the gap between full ELMo and the CNN baselines is larger. This suggests that while ELMo does not encode these phenomena as efficiently, the improvements it does bring are largely due to long-range information. ",
|
| 760 |
+
"bbox": [
|
| 761 |
+
173,
|
| 762 |
+
733,
|
| 763 |
+
825,
|
| 764 |
+
872
|
| 765 |
+
],
|
| 766 |
+
"page_idx": 7
|
| 767 |
+
},
|
| 768 |
+
{
|
| 769 |
+
"type": "image",
|
| 770 |
+
"img_path": "images/4d6bb67885b8554e9597786f718d8e832f6cb1658290088a08ca3a1ee9519365.jpg",
|
| 771 |
+
"image_caption": [
|
| 772 |
+
"Figure 3: Dependency labeling F1 score as a function of separating distance between the two spans. Distance 0 denotes adjacent tokens. Colored bands are $9 5 \\%$ confidence intervals (normal approximation). Bars on the bottom show the number of targets (in the development set) with that distance. Lex., CNN1, CNN2, Ortho, and Full are as in Figure 2. "
|
| 773 |
+
],
|
| 774 |
+
"image_footnote": [],
|
| 775 |
+
"bbox": [
|
| 776 |
+
210,
|
| 777 |
+
99,
|
| 778 |
+
774,
|
| 779 |
+
301
|
| 780 |
+
],
|
| 781 |
+
"page_idx": 8
|
| 782 |
+
},
|
| 783 |
+
{
|
| 784 |
+
"type": "text",
|
| 785 |
+
"text": "",
|
| 786 |
+
"bbox": [
|
| 787 |
+
174,
|
| 788 |
+
387,
|
| 789 |
+
825,
|
| 790 |
+
429
|
| 791 |
+
],
|
| 792 |
+
"page_idx": 8
|
| 793 |
+
},
|
| 794 |
+
{
|
| 795 |
+
"type": "text",
|
| 796 |
+
"text": "We can test this hypothesis by seeing how our probing model performs with distant spans. Figure 3 shows F1 score as a function of the distance (number of tokens) between a token and its head for the dependency labeling task. The CNN models and the orthonormal encoder perform best with nearby spans, but fall off rapidly as token distance increases. The full ELMo model holds up better, with performance dropping only 7 F1 points between $d = 0$ tokens and $d = 8$ , suggesting the pretrained encoder does encode useful long-distance dependencies. ",
|
| 797 |
+
"bbox": [
|
| 798 |
+
174,
|
| 799 |
+
435,
|
| 800 |
+
825,
|
| 801 |
+
520
|
| 802 |
+
],
|
| 803 |
+
"page_idx": 8
|
| 804 |
+
},
|
| 805 |
+
{
|
| 806 |
+
"type": "text",
|
| 807 |
+
"text": "6 RELATED WORK ",
|
| 808 |
+
"text_level": 1,
|
| 809 |
+
"bbox": [
|
| 810 |
+
176,
|
| 811 |
+
542,
|
| 812 |
+
344,
|
| 813 |
+
559
|
| 814 |
+
],
|
| 815 |
+
"page_idx": 8
|
| 816 |
+
},
|
| 817 |
+
{
|
| 818 |
+
"type": "text",
|
| 819 |
+
"text": "Recent work has consistently demonstrated the strong empirical performance of contextualized word representations, including CoVe (McCann et al., 2017), ULMFit (Howard & Ruder, 2018), ELMo (Peters et al., 2018a; Lee et al., 2018; Strubell et al., 2018; Kitaev & Klein, 2018). In response to the impressive results on downstream tasks, a line of work has emerged with the goal of understanding and comparing such pretrained representations. SentEval (Conneau & Kiela, 2018) and GLUE (Wang et al., 2018) offer suites of application-oriented benchmark tasks, such as sentiment analysis or textual entailment, which combine many types of reasoning and provide valuable aggregate metrics which are indicative of practical performance. A parallel effort, to which this work contributes, seeks to understand what is driving (or hindering) performance gains by using “probing tasks,” i.e. tasks which attempt to isolate specific phenomena for the purpose of finer-grained analysis rather than application, as discussed below. ",
|
| 820 |
+
"bbox": [
|
| 821 |
+
173,
|
| 822 |
+
575,
|
| 823 |
+
825,
|
| 824 |
+
728
|
| 825 |
+
],
|
| 826 |
+
"page_idx": 8
|
| 827 |
+
},
|
| 828 |
+
{
|
| 829 |
+
"type": "text",
|
| 830 |
+
"text": "Much work has focused on probing fixed-length sentence encoders, such as InferSent (Conneau et al., 2017), specifically their ability to capture surface properties of sentences such as length, word content, and word order (Adi et al., 2017), as well as a broader set of syntactic features, such as tree depth and tense (Conneau et al., 2018). Other related work uses perplexity scores to test whether language models learn to encode properties such as subject-verb agreement (Linzen et al., 2016; Gulordava et al., 2018; Marvin & Linzen, 2018; Kuncoro et al., 2018). ",
|
| 831 |
+
"bbox": [
|
| 832 |
+
174,
|
| 833 |
+
736,
|
| 834 |
+
825,
|
| 835 |
+
819
|
| 836 |
+
],
|
| 837 |
+
"page_idx": 8
|
| 838 |
+
},
|
| 839 |
+
{
|
| 840 |
+
"type": "text",
|
| 841 |
+
"text": "Often, probing tasks take the form of “challenge sets”, or test sets which are generated using templates and/or perturbations of existing test sets in order to isolate particular linguistic phenomena, e.g. compositional reasoning (Dasgupta et al., 2018; Ettinger et al., 2018). This approach is exemplified by the recently-released Diverse Natural Language Collection (DNC) (Poliak et al., 2018b), which introduces a suite of 11 tasks targeting different semantic phenomena. In the DNC, these tasks are all recast into natural language inference (NLI) format (White et al., 2017), i.e. systems must understand the targeted semantic phenomenon in order to make correct inferences about entailment. Poliak et al. (2018a) used an earlier version of recast NLI to test NMT encoders’ ability to understand coreference, SPR, and paraphrastic inference. ",
|
| 842 |
+
"bbox": [
|
| 843 |
+
173,
|
| 844 |
+
825,
|
| 845 |
+
825,
|
| 846 |
+
924
|
| 847 |
+
],
|
| 848 |
+
"page_idx": 8
|
| 849 |
+
},
|
| 850 |
+
{
|
| 851 |
+
"type": "text",
|
| 852 |
+
"text": "",
|
| 853 |
+
"bbox": [
|
| 854 |
+
173,
|
| 855 |
+
103,
|
| 856 |
+
823,
|
| 857 |
+
132
|
| 858 |
+
],
|
| 859 |
+
"page_idx": 9
|
| 860 |
+
},
|
| 861 |
+
{
|
| 862 |
+
"type": "text",
|
| 863 |
+
"text": "Challenge sets which operate on full sentence encodings introduce confounds into the analysis, since sentence representation models must pool word-level representations over the entire sequence. This makes it difficult to infer whether the relevant information is encoded within the span of interest or rather inferred from diffuse information elsewhere in the sentence. One strategy to control for this is the use of minimally-differing sentence pairs (Poliak et al., 2018b; Ettinger et al., 2018). An alternative approach, which we adopt in this paper, is to directly probe the token representations for word- and phrase-level properties. This approach has been used previously to show that the representations learned by neural machine translation systems encode token-level properties like part-of-speech, semantic tags, and morphology (Shi et al., 2016; Belinkov et al., 2017a;b), as well as pairwise dependency relations (Belinkov, 2018). Blevins et al. (2018) goes further to explore how part-of-speech and hierarchical constituent structure are encoded by different pretraining objectives and at different layers of the model. Peters et al. (2018b) presents similar results for ELMo and architectural variants. ",
|
| 864 |
+
"bbox": [
|
| 865 |
+
174,
|
| 866 |
+
138,
|
| 867 |
+
825,
|
| 868 |
+
319
|
| 869 |
+
],
|
| 870 |
+
"page_idx": 9
|
| 871 |
+
},
|
| 872 |
+
{
|
| 873 |
+
"type": "text",
|
| 874 |
+
"text": "Compared to existing work, we extend sub-sentence probing to a broader range of syntactic and semantic tasks, including long-range and high-level relations such as predicate-argument structure. Our approach can incorporate existing annotated datasets without the need for templated data generation, and admits fine-grained analysis by label and by metadata such as span distance. We note that some of the tasks we explore overlap with those included in the DNC, in particular, named entities, SPR and Winograd. However, our focus on probing token-level representations directly, rather than pooling over the whole sentence, provides a complementary means for analyzing these representations and diagnosing the particular advantages of contextualized vs. conventional word embeddings. ",
|
| 875 |
+
"bbox": [
|
| 876 |
+
174,
|
| 877 |
+
327,
|
| 878 |
+
825,
|
| 879 |
+
452
|
| 880 |
+
],
|
| 881 |
+
"page_idx": 9
|
| 882 |
+
},
|
| 883 |
+
{
|
| 884 |
+
"type": "text",
|
| 885 |
+
"text": "7 CONCLUSION ",
|
| 886 |
+
"text_level": 1,
|
| 887 |
+
"bbox": [
|
| 888 |
+
176,
|
| 889 |
+
472,
|
| 890 |
+
318,
|
| 891 |
+
488
|
| 892 |
+
],
|
| 893 |
+
"page_idx": 9
|
| 894 |
+
},
|
| 895 |
+
{
|
| 896 |
+
"type": "text",
|
| 897 |
+
"text": "We introduce a suite of “edge probing” tasks designed to probe the sub-sentential structure of contextualized word embeddings. These tasks are derived from core NLP tasks and encompass a range of syntactic and semantic phenomena. We use these tasks to explore how contextual embeddings improve on their lexical (context-independent) baselines. We focus on four recent models for contextualized word embeddings–CoVe, ELMo, OpenAI GPT, and BERT. ",
|
| 898 |
+
"bbox": [
|
| 899 |
+
174,
|
| 900 |
+
503,
|
| 901 |
+
823,
|
| 902 |
+
573
|
| 903 |
+
],
|
| 904 |
+
"page_idx": 9
|
| 905 |
+
},
|
| 906 |
+
{
|
| 907 |
+
"type": "text",
|
| 908 |
+
"text": "Based on our analysis, we find evidence suggesting the following trends. First, in general, contextualized embeddings improve over their non-contextualized counterparts largely on syntactic tasks (e.g. constituent labeling) in comparison to semantic tasks (e.g. coreference), suggesting that these embeddings encode syntax more so than higher-level semantics. Second, the performance of ELMo cannot be fully explained by a model with access to local context, suggesting that the contextualized representations do encode distant linguistic information, which can help disambiguate longer-range dependency relations and higher-level syntactic structures. ",
|
| 909 |
+
"bbox": [
|
| 910 |
+
174,
|
| 911 |
+
580,
|
| 912 |
+
825,
|
| 913 |
+
678
|
| 914 |
+
],
|
| 915 |
+
"page_idx": 9
|
| 916 |
+
},
|
| 917 |
+
{
|
| 918 |
+
"type": "text",
|
| 919 |
+
"text": "We release our data processing and model code, and hope that this can be a useful tool to facilitate understanding of, and improvements in, contextualized word embedding models. ",
|
| 920 |
+
"bbox": [
|
| 921 |
+
174,
|
| 922 |
+
685,
|
| 923 |
+
821,
|
| 924 |
+
713
|
| 925 |
+
],
|
| 926 |
+
"page_idx": 9
|
| 927 |
+
},
|
| 928 |
+
{
|
| 929 |
+
"type": "text",
|
| 930 |
+
"text": "ACKNOWLEDGMENTS ",
|
| 931 |
+
"text_level": 1,
|
| 932 |
+
"bbox": [
|
| 933 |
+
176,
|
| 934 |
+
729,
|
| 935 |
+
326,
|
| 936 |
+
742
|
| 937 |
+
],
|
| 938 |
+
"page_idx": 9
|
| 939 |
+
},
|
| 940 |
+
{
|
| 941 |
+
"type": "text",
|
| 942 |
+
"text": "This work was conducted in part at the 2018 Frederick Jelinek Memorial Summer Workshop on Speech and Language Technologies, and supported by Johns Hopkins University with unrestricted gifts from Amazon, Facebook, Google, Microsoft and Mitsubishi Electric Research Laboratories, as well as a team-specific donation of computing resources from Google. PX, AP, and BVD were supported by DARPA AIDA and LORELEI. Special thanks to Jacob Devlin for providing checkpoints of GPT model trained on the BWB corpus, and to the members of the Google AI Language team for many productive discussions. ",
|
| 943 |
+
"bbox": [
|
| 944 |
+
174,
|
| 945 |
+
752,
|
| 946 |
+
825,
|
| 947 |
+
851
|
| 948 |
+
],
|
| 949 |
+
"page_idx": 9
|
| 950 |
+
},
|
| 951 |
+
{
|
| 952 |
+
"type": "text",
|
| 953 |
+
"text": "REFERENCES ",
|
| 954 |
+
"text_level": 1,
|
| 955 |
+
"bbox": [
|
| 956 |
+
176,
|
| 957 |
+
872,
|
| 958 |
+
285,
|
| 959 |
+
887
|
| 960 |
+
],
|
| 961 |
+
"page_idx": 9
|
| 962 |
+
},
|
| 963 |
+
{
|
| 964 |
+
"type": "text",
|
| 965 |
+
"text": "Yossi Adi, Einat Kermany, Yonatan Belinkov, Ofer Lavi, and Yoav Goldberg. Fine-grained analysis of sentence embeddings using auxiliary prediction tasks. In Proceedings of ICLR, 2017. ",
|
| 966 |
+
"bbox": [
|
| 967 |
+
178,
|
| 968 |
+
895,
|
| 969 |
+
823,
|
| 970 |
+
924
|
| 971 |
+
],
|
| 972 |
+
"page_idx": 9
|
| 973 |
+
},
|
| 974 |
+
{
|
| 975 |
+
"type": "text",
|
| 976 |
+
"text": "Yonatan Belinkov. On internal language representations in deep learning: An analysis of machine translation and speech recognition. PhD thesis, Massachusetts Institute of Technology, 2018. ",
|
| 977 |
+
"bbox": [
|
| 978 |
+
171,
|
| 979 |
+
103,
|
| 980 |
+
825,
|
| 981 |
+
132
|
| 982 |
+
],
|
| 983 |
+
"page_idx": 10
|
| 984 |
+
},
|
| 985 |
+
{
|
| 986 |
+
"type": "text",
|
| 987 |
+
"text": "Yonatan Belinkov, Nadir Durrani, Fahim Dalvi, Hassan Sajjad, and James Glass. What do neural machine translation models learn about morphology? In Proceedings of EMNLP, 2017a. ",
|
| 988 |
+
"bbox": [
|
| 989 |
+
173,
|
| 990 |
+
142,
|
| 991 |
+
823,
|
| 992 |
+
171
|
| 993 |
+
],
|
| 994 |
+
"page_idx": 10
|
| 995 |
+
},
|
| 996 |
+
{
|
| 997 |
+
"type": "text",
|
| 998 |
+
"text": "Yonatan Belinkov, Llu´ıs Marquez, Hassan Sajjad, Nadir Durrani, Fahim Dalvi, and James Glass. \\` Evaluating layers of representation in neural machine translation on part-of-speech and semantic tagging tasks. In Proceedings of IJCNLP, 2017b. ",
|
| 999 |
+
"bbox": [
|
| 1000 |
+
174,
|
| 1001 |
+
181,
|
| 1002 |
+
825,
|
| 1003 |
+
224
|
| 1004 |
+
],
|
| 1005 |
+
"page_idx": 10
|
| 1006 |
+
},
|
| 1007 |
+
{
|
| 1008 |
+
"type": "text",
|
| 1009 |
+
"text": "Terra Blevins, Omer Levy, and Luke Zettlemoyer. Deep RNNs encode soft hierarchical syntax. In Proceedings of ACL, 2018. ",
|
| 1010 |
+
"bbox": [
|
| 1011 |
+
176,
|
| 1012 |
+
234,
|
| 1013 |
+
823,
|
| 1014 |
+
263
|
| 1015 |
+
],
|
| 1016 |
+
"page_idx": 10
|
| 1017 |
+
},
|
| 1018 |
+
{
|
| 1019 |
+
"type": "text",
|
| 1020 |
+
"text": "Ondˇrej Bojar, Christian Buck, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, and Julia Kreutzer (eds.). Proceedings of the Second Conference on Machine Translation. 2017. ",
|
| 1021 |
+
"bbox": [
|
| 1022 |
+
173,
|
| 1023 |
+
273,
|
| 1024 |
+
825,
|
| 1025 |
+
316
|
| 1026 |
+
],
|
| 1027 |
+
"page_idx": 10
|
| 1028 |
+
},
|
| 1029 |
+
{
|
| 1030 |
+
"type": "text",
|
| 1031 |
+
"text": "Ciprian Chelba, Tomas Mikolov, Mike Schuster, Qi Ge, Thorsten Brants, Phillipp Koehn, and Tony Robinson. One billion word benchmark for measuring progress in statistical language modeling. In Proceedings of Interspeech, 2014. ",
|
| 1032 |
+
"bbox": [
|
| 1033 |
+
174,
|
| 1034 |
+
327,
|
| 1035 |
+
821,
|
| 1036 |
+
369
|
| 1037 |
+
],
|
| 1038 |
+
"page_idx": 10
|
| 1039 |
+
},
|
| 1040 |
+
{
|
| 1041 |
+
"type": "text",
|
| 1042 |
+
"text": "Alexis Conneau and Douwe Kiela. SentEval: An evaluation toolkit for universal sentence representations. In Proceedings of the Eleventh International Conference on Language Resources and Evaluation, 2018. ",
|
| 1043 |
+
"bbox": [
|
| 1044 |
+
173,
|
| 1045 |
+
378,
|
| 1046 |
+
823,
|
| 1047 |
+
422
|
| 1048 |
+
],
|
| 1049 |
+
"page_idx": 10
|
| 1050 |
+
},
|
| 1051 |
+
{
|
| 1052 |
+
"type": "text",
|
| 1053 |
+
"text": "Alexis Conneau, Douwe Kiela, Holger Schwenk, Lo¨ıc Barrault, and Antoine Bordes. Supervised learning of universal sentence representations from natural language inference data. In Proceedings of EMNLP, 2017. ",
|
| 1054 |
+
"bbox": [
|
| 1055 |
+
174,
|
| 1056 |
+
433,
|
| 1057 |
+
825,
|
| 1058 |
+
476
|
| 1059 |
+
],
|
| 1060 |
+
"page_idx": 10
|
| 1061 |
+
},
|
| 1062 |
+
{
|
| 1063 |
+
"type": "text",
|
| 1064 |
+
"text": "Alexis Conneau, German Kruszewski, Guillaume Lample, Lo ´ ¨ıc Barrault, and Marco Baroni. What you can cram into a single $\\$ 8#$ vector: Probing sentence embeddings for linguistic properties. In Proceedings of ACL, 2018. ",
|
| 1065 |
+
"bbox": [
|
| 1066 |
+
174,
|
| 1067 |
+
484,
|
| 1068 |
+
825,
|
| 1069 |
+
529
|
| 1070 |
+
],
|
| 1071 |
+
"page_idx": 10
|
| 1072 |
+
},
|
| 1073 |
+
{
|
| 1074 |
+
"type": "text",
|
| 1075 |
+
"text": "Ishita Dasgupta, Demi Guo, Andreas Stuhlmuller, Samuel J Gershman, and Noah D Goodman. ¨ Evaluating compositionality in sentence embeddings. arXiv preprint 1802.04302, 2018. ",
|
| 1076 |
+
"bbox": [
|
| 1077 |
+
171,
|
| 1078 |
+
537,
|
| 1079 |
+
823,
|
| 1080 |
+
568
|
| 1081 |
+
],
|
| 1082 |
+
"page_idx": 10
|
| 1083 |
+
},
|
| 1084 |
+
{
|
| 1085 |
+
"type": "text",
|
| 1086 |
+
"text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint 1810.04805, 2018. ",
|
| 1087 |
+
"bbox": [
|
| 1088 |
+
169,
|
| 1089 |
+
577,
|
| 1090 |
+
821,
|
| 1091 |
+
608
|
| 1092 |
+
],
|
| 1093 |
+
"page_idx": 10
|
| 1094 |
+
},
|
| 1095 |
+
{
|
| 1096 |
+
"type": "text",
|
| 1097 |
+
"text": "Allyson Ettinger, Ahmed Elgohary, Colin Phillips, and Philip Resnik. Assessing composition in sentence vector representations. In Proceedings of COLING, 2018. ",
|
| 1098 |
+
"bbox": [
|
| 1099 |
+
171,
|
| 1100 |
+
616,
|
| 1101 |
+
823,
|
| 1102 |
+
646
|
| 1103 |
+
],
|
| 1104 |
+
"page_idx": 10
|
| 1105 |
+
},
|
| 1106 |
+
{
|
| 1107 |
+
"type": "text",
|
| 1108 |
+
"text": "Matt Gardner, Joel Grus, Mark Neumann, Oyvind Tafjord, Pradeep Dasigi, Nelson F Liu, Matthew Peters, Michael Schmitz, and Luke Zettlemoyer. AllenNLP: A deep semantic natural language processing platform. In Proceedings of Workshop for NLP Open Source Software (NLP-OSS), 2018. ",
|
| 1109 |
+
"bbox": [
|
| 1110 |
+
174,
|
| 1111 |
+
655,
|
| 1112 |
+
825,
|
| 1113 |
+
712
|
| 1114 |
+
],
|
| 1115 |
+
"page_idx": 10
|
| 1116 |
+
},
|
| 1117 |
+
{
|
| 1118 |
+
"type": "text",
|
| 1119 |
+
"text": "Daniel Gildea and Martha Palmer. The necessity of parsing for predicate argument recognition. In Proceedings of ACL, 2002. ",
|
| 1120 |
+
"bbox": [
|
| 1121 |
+
174,
|
| 1122 |
+
722,
|
| 1123 |
+
823,
|
| 1124 |
+
752
|
| 1125 |
+
],
|
| 1126 |
+
"page_idx": 10
|
| 1127 |
+
},
|
| 1128 |
+
{
|
| 1129 |
+
"type": "text",
|
| 1130 |
+
"text": "Kristina Gulordava, Piotr Bojanowski, Edouard Grave, Tal Linzen, and Marco Baroni. Colorless green recurrent networks dream hierarchically. In Proceedings of NAACL, 2018. ",
|
| 1131 |
+
"bbox": [
|
| 1132 |
+
173,
|
| 1133 |
+
761,
|
| 1134 |
+
823,
|
| 1135 |
+
791
|
| 1136 |
+
],
|
| 1137 |
+
"page_idx": 10
|
| 1138 |
+
},
|
| 1139 |
+
{
|
| 1140 |
+
"type": "text",
|
| 1141 |
+
"text": "Luheng He, Kenton Lee, Omer Levy, and Luke Zettlemoyer. Jointly predicting predicates and arguments in neural semantic role labeling. In Proceedings of ACL, 2018. ",
|
| 1142 |
+
"bbox": [
|
| 1143 |
+
169,
|
| 1144 |
+
801,
|
| 1145 |
+
823,
|
| 1146 |
+
830
|
| 1147 |
+
],
|
| 1148 |
+
"page_idx": 10
|
| 1149 |
+
},
|
| 1150 |
+
{
|
| 1151 |
+
"type": "text",
|
| 1152 |
+
"text": "Iris Hendrickx, Su Nam Kim, Zornitsa Kozareva, Preslav Nakov, Diarmuid O S ´ eaghdha, Sebas- ´ tian Pado, Marco Pennacchiotti, Lorenza Romano, and Stan Szpakowicz. SemEval-2010 task 8: ´ Multi-way classification of semantic relations between pairs of nominals. In Proceedings of the Workshop on Semantic Evaluations: Recent Achievements and Future Directions, 2009. ",
|
| 1153 |
+
"bbox": [
|
| 1154 |
+
174,
|
| 1155 |
+
842,
|
| 1156 |
+
825,
|
| 1157 |
+
898
|
| 1158 |
+
],
|
| 1159 |
+
"page_idx": 10
|
| 1160 |
+
},
|
| 1161 |
+
{
|
| 1162 |
+
"type": "text",
|
| 1163 |
+
"text": "Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 1997. ",
|
| 1164 |
+
"bbox": [
|
| 1165 |
+
171,
|
| 1166 |
+
909,
|
| 1167 |
+
805,
|
| 1168 |
+
924
|
| 1169 |
+
],
|
| 1170 |
+
"page_idx": 10
|
| 1171 |
+
},
|
| 1172 |
+
{
|
| 1173 |
+
"type": "text",
|
| 1174 |
+
"text": "Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In Proceedings of ACL, 2018. ",
|
| 1175 |
+
"bbox": [
|
| 1176 |
+
171,
|
| 1177 |
+
103,
|
| 1178 |
+
823,
|
| 1179 |
+
132
|
| 1180 |
+
],
|
| 1181 |
+
"page_idx": 11
|
| 1182 |
+
},
|
| 1183 |
+
{
|
| 1184 |
+
"type": "text",
|
| 1185 |
+
"text": "Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of ICLR, 2015. ",
|
| 1186 |
+
"bbox": [
|
| 1187 |
+
173,
|
| 1188 |
+
141,
|
| 1189 |
+
823,
|
| 1190 |
+
170
|
| 1191 |
+
],
|
| 1192 |
+
"page_idx": 11
|
| 1193 |
+
},
|
| 1194 |
+
{
|
| 1195 |
+
"type": "text",
|
| 1196 |
+
"text": "Ryan Kiros, Yukun Zhu, Ruslan R. Salakhutdinov, Richard Zemel, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Skip-thought vectors. In Proceedings of NIPS, 2015. ",
|
| 1197 |
+
"bbox": [
|
| 1198 |
+
171,
|
| 1199 |
+
179,
|
| 1200 |
+
823,
|
| 1201 |
+
208
|
| 1202 |
+
],
|
| 1203 |
+
"page_idx": 11
|
| 1204 |
+
},
|
| 1205 |
+
{
|
| 1206 |
+
"type": "text",
|
| 1207 |
+
"text": "Nikita Kitaev and Dan Klein. Constituency parsing with a self-attentive encoder. In Proceedings of ACL, July 2018. ",
|
| 1208 |
+
"bbox": [
|
| 1209 |
+
171,
|
| 1210 |
+
217,
|
| 1211 |
+
825,
|
| 1212 |
+
246
|
| 1213 |
+
],
|
| 1214 |
+
"page_idx": 11
|
| 1215 |
+
},
|
| 1216 |
+
{
|
| 1217 |
+
"type": "text",
|
| 1218 |
+
"text": "Adhiguna Kuncoro, Chris Dyer, John Hale, Dani Yogatama, Stephen Clark, and Phil Blunsom. LSTMs can learn syntax-sensitive dependencies well, but modeling structure makes them better. In Proceedings of ACL, 2018. ",
|
| 1219 |
+
"bbox": [
|
| 1220 |
+
176,
|
| 1221 |
+
255,
|
| 1222 |
+
823,
|
| 1223 |
+
299
|
| 1224 |
+
],
|
| 1225 |
+
"page_idx": 11
|
| 1226 |
+
},
|
| 1227 |
+
{
|
| 1228 |
+
"type": "text",
|
| 1229 |
+
"text": "Kenton Lee, Luheng He, Mike Lewis, and Luke Zettlemoyer. End-to-end neural coreference resolution. In Proceedings of EMNLP, 2017. ",
|
| 1230 |
+
"bbox": [
|
| 1231 |
+
174,
|
| 1232 |
+
306,
|
| 1233 |
+
820,
|
| 1234 |
+
337
|
| 1235 |
+
],
|
| 1236 |
+
"page_idx": 11
|
| 1237 |
+
},
|
| 1238 |
+
{
|
| 1239 |
+
"type": "text",
|
| 1240 |
+
"text": "Kenton Lee, Luheng He, and Luke Zettlemoyer. Higher-order coreference resolution with coarseto-fine inference. In Proceedings of NAACL, 2018. ",
|
| 1241 |
+
"bbox": [
|
| 1242 |
+
173,
|
| 1243 |
+
344,
|
| 1244 |
+
820,
|
| 1245 |
+
375
|
| 1246 |
+
],
|
| 1247 |
+
"page_idx": 11
|
| 1248 |
+
},
|
| 1249 |
+
{
|
| 1250 |
+
"type": "text",
|
| 1251 |
+
"text": "Hector J. Levesque, Ernest Davis, and Leora Morgenstern. The winograd schema challenge. In Proceedings of the Thirteenth International Conference on Principles of Knowledge Representation and Reasoning, 2012. ",
|
| 1252 |
+
"bbox": [
|
| 1253 |
+
173,
|
| 1254 |
+
382,
|
| 1255 |
+
825,
|
| 1256 |
+
426
|
| 1257 |
+
],
|
| 1258 |
+
"page_idx": 11
|
| 1259 |
+
},
|
| 1260 |
+
{
|
| 1261 |
+
"type": "text",
|
| 1262 |
+
"text": "Tal Linzen, Emmanuel Dupoux, and Yoav Goldberg. Assessing the ability of LSTMs to learn syntaxsensitive dependencies. Transactions of the ACL, 2016. ",
|
| 1263 |
+
"bbox": [
|
| 1264 |
+
173,
|
| 1265 |
+
434,
|
| 1266 |
+
823,
|
| 1267 |
+
464
|
| 1268 |
+
],
|
| 1269 |
+
"page_idx": 11
|
| 1270 |
+
},
|
| 1271 |
+
{
|
| 1272 |
+
"type": "text",
|
| 1273 |
+
"text": "Rebecca Marvin and Tal Linzen. Targeted syntactic evaluation of language models. In Proceedings of EMNLP, 2018. ",
|
| 1274 |
+
"bbox": [
|
| 1275 |
+
174,
|
| 1276 |
+
473,
|
| 1277 |
+
823,
|
| 1278 |
+
502
|
| 1279 |
+
],
|
| 1280 |
+
"page_idx": 11
|
| 1281 |
+
},
|
| 1282 |
+
{
|
| 1283 |
+
"type": "text",
|
| 1284 |
+
"text": "Bryan McCann, James Bradbury, Caiming Xiong, and Richard Socher. Learned in translation: Contextualized word vectors. In Proceedings of NIPS, 2017. ",
|
| 1285 |
+
"bbox": [
|
| 1286 |
+
174,
|
| 1287 |
+
511,
|
| 1288 |
+
823,
|
| 1289 |
+
541
|
| 1290 |
+
],
|
| 1291 |
+
"page_idx": 11
|
| 1292 |
+
},
|
| 1293 |
+
{
|
| 1294 |
+
"type": "text",
|
| 1295 |
+
"text": "Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S. Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Proceedings of NIPS, 2013. ",
|
| 1296 |
+
"bbox": [
|
| 1297 |
+
171,
|
| 1298 |
+
549,
|
| 1299 |
+
823,
|
| 1300 |
+
579
|
| 1301 |
+
],
|
| 1302 |
+
"page_idx": 11
|
| 1303 |
+
},
|
| 1304 |
+
{
|
| 1305 |
+
"type": "text",
|
| 1306 |
+
"text": "Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In Proceedings of NIPS, 2017. ",
|
| 1307 |
+
"bbox": [
|
| 1308 |
+
176,
|
| 1309 |
+
587,
|
| 1310 |
+
825,
|
| 1311 |
+
631
|
| 1312 |
+
],
|
| 1313 |
+
"page_idx": 11
|
| 1314 |
+
},
|
| 1315 |
+
{
|
| 1316 |
+
"type": "text",
|
| 1317 |
+
"text": "Jeffrey Pennington, Richard Socher, and Christopher Manning. GloVe: Global vectors for word representation. In Proceedings of EMNLP, 2014. ",
|
| 1318 |
+
"bbox": [
|
| 1319 |
+
169,
|
| 1320 |
+
638,
|
| 1321 |
+
825,
|
| 1322 |
+
669
|
| 1323 |
+
],
|
| 1324 |
+
"page_idx": 11
|
| 1325 |
+
},
|
| 1326 |
+
{
|
| 1327 |
+
"type": "text",
|
| 1328 |
+
"text": "Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of NAACL, 2018a. ",
|
| 1329 |
+
"bbox": [
|
| 1330 |
+
171,
|
| 1331 |
+
676,
|
| 1332 |
+
823,
|
| 1333 |
+
707
|
| 1334 |
+
],
|
| 1335 |
+
"page_idx": 11
|
| 1336 |
+
},
|
| 1337 |
+
{
|
| 1338 |
+
"type": "text",
|
| 1339 |
+
"text": "Matthew Peters, Mark Neumann, Luke Zettlemoyer, and Wen-tau Yih. Dissecting contextual word embeddings: Architecture and representation. In Proceedings of EMNLP, 2018b. ",
|
| 1340 |
+
"bbox": [
|
| 1341 |
+
169,
|
| 1342 |
+
714,
|
| 1343 |
+
823,
|
| 1344 |
+
744
|
| 1345 |
+
],
|
| 1346 |
+
"page_idx": 11
|
| 1347 |
+
},
|
| 1348 |
+
{
|
| 1349 |
+
"type": "text",
|
| 1350 |
+
"text": "Adam Poliak, Yonatan Belinkov, James Glass, and Benjamin Van Durme. On the evaluation of semantic phenomena in neural machine translation using natural language inference. In Proceedings of NAACL, 2018a. ",
|
| 1351 |
+
"bbox": [
|
| 1352 |
+
173,
|
| 1353 |
+
752,
|
| 1354 |
+
825,
|
| 1355 |
+
796
|
| 1356 |
+
],
|
| 1357 |
+
"page_idx": 11
|
| 1358 |
+
},
|
| 1359 |
+
{
|
| 1360 |
+
"type": "text",
|
| 1361 |
+
"text": "Adam Poliak, Aparajita Haldar, Rachel Rudinger, J. Edward Hu, Ellie Pavlick, Aaron Steven White, and Benjamin Van Durme. Collecting diverse natural language inference problems for sentence representation evaluation. In Proceedings of EMNLP, 2018b. ",
|
| 1362 |
+
"bbox": [
|
| 1363 |
+
176,
|
| 1364 |
+
804,
|
| 1365 |
+
823,
|
| 1366 |
+
848
|
| 1367 |
+
],
|
| 1368 |
+
"page_idx": 11
|
| 1369 |
+
},
|
| 1370 |
+
{
|
| 1371 |
+
"type": "text",
|
| 1372 |
+
"text": "Vasin Punyakanok, Dan Roth, and Wen-tau Yih. The importance of syntactic parsing and inference in semantic role labeling. Computational Linguistics, 34(2):257–287, 2008. ",
|
| 1373 |
+
"bbox": [
|
| 1374 |
+
176,
|
| 1375 |
+
856,
|
| 1376 |
+
821,
|
| 1377 |
+
886
|
| 1378 |
+
],
|
| 1379 |
+
"page_idx": 11
|
| 1380 |
+
},
|
| 1381 |
+
{
|
| 1382 |
+
"type": "text",
|
| 1383 |
+
"text": "Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. https://blog.openai.com/language-unsupervised, 2018. ",
|
| 1384 |
+
"bbox": [
|
| 1385 |
+
176,
|
| 1386 |
+
895,
|
| 1387 |
+
820,
|
| 1388 |
+
924
|
| 1389 |
+
],
|
| 1390 |
+
"page_idx": 11
|
| 1391 |
+
},
|
| 1392 |
+
{
|
| 1393 |
+
"type": "text",
|
| 1394 |
+
"text": "Altaf Rahman and Vincent Ng. Resolving complex cases of definite pronouns: The Winograd schema challenge. In Proceedings of EMNLP, 2012. ",
|
| 1395 |
+
"bbox": [
|
| 1396 |
+
171,
|
| 1397 |
+
103,
|
| 1398 |
+
825,
|
| 1399 |
+
132
|
| 1400 |
+
],
|
| 1401 |
+
"page_idx": 12
|
| 1402 |
+
},
|
| 1403 |
+
{
|
| 1404 |
+
"type": "text",
|
| 1405 |
+
"text": "Rachel Rudinger, Adam Teichert, Ryan Culkin, Sheng Zhang, and Benjamin Van Durme. Neural Davidsonian semantic proto-role labeling. In Proceedings of EMNLP, 2018. ",
|
| 1406 |
+
"bbox": [
|
| 1407 |
+
173,
|
| 1408 |
+
141,
|
| 1409 |
+
823,
|
| 1410 |
+
170
|
| 1411 |
+
],
|
| 1412 |
+
"page_idx": 12
|
| 1413 |
+
},
|
| 1414 |
+
{
|
| 1415 |
+
"type": "text",
|
| 1416 |
+
"text": "Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of ACL, 2016. ",
|
| 1417 |
+
"bbox": [
|
| 1418 |
+
173,
|
| 1419 |
+
179,
|
| 1420 |
+
823,
|
| 1421 |
+
208
|
| 1422 |
+
],
|
| 1423 |
+
"page_idx": 12
|
| 1424 |
+
},
|
| 1425 |
+
{
|
| 1426 |
+
"type": "text",
|
| 1427 |
+
"text": "Xing Shi, Inkit Padhi, and Kevin Knight. Does string-based neural MT learn source syntax? In Proceedings of EMNLP, 2016. ",
|
| 1428 |
+
"bbox": [
|
| 1429 |
+
171,
|
| 1430 |
+
215,
|
| 1431 |
+
825,
|
| 1432 |
+
246
|
| 1433 |
+
],
|
| 1434 |
+
"page_idx": 12
|
| 1435 |
+
},
|
| 1436 |
+
{
|
| 1437 |
+
"type": "text",
|
| 1438 |
+
"text": "Natalia Silveira, Timothy Dozat, Marie-Catherine de Marneffe, Samuel Bowman, Miriam Connor, John Bauer, and Christopher D. Manning. A gold standard dependency corpus for English. In Proceedings of the Ninth International Conference on Language Resources and Evaluation, 2014. ",
|
| 1439 |
+
"bbox": [
|
| 1440 |
+
176,
|
| 1441 |
+
253,
|
| 1442 |
+
823,
|
| 1443 |
+
297
|
| 1444 |
+
],
|
| 1445 |
+
"page_idx": 12
|
| 1446 |
+
},
|
| 1447 |
+
{
|
| 1448 |
+
"type": "text",
|
| 1449 |
+
"text": "Emma Strubell, Patrick Verga, Daniel Andor, David Weiss, and Andrew McCallum. Linguisticallyinformed self-attention for semantic role labeling. In Proceedings of EMNLP, 2018. ",
|
| 1450 |
+
"bbox": [
|
| 1451 |
+
171,
|
| 1452 |
+
305,
|
| 1453 |
+
823,
|
| 1454 |
+
335
|
| 1455 |
+
],
|
| 1456 |
+
"page_idx": 12
|
| 1457 |
+
},
|
| 1458 |
+
{
|
| 1459 |
+
"type": "text",
|
| 1460 |
+
"text": "Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. In Proceedings of NIPS, 2014. ",
|
| 1461 |
+
"bbox": [
|
| 1462 |
+
171,
|
| 1463 |
+
343,
|
| 1464 |
+
823,
|
| 1465 |
+
372
|
| 1466 |
+
],
|
| 1467 |
+
"page_idx": 12
|
| 1468 |
+
},
|
| 1469 |
+
{
|
| 1470 |
+
"type": "text",
|
| 1471 |
+
"text": "Adam Teichert, Adam Poliak, Benjamin Van Durme, and Matthew Gormley. Semantic proto-role labeling. In Proceedings of AAAI, 2017. ",
|
| 1472 |
+
"bbox": [
|
| 1473 |
+
173,
|
| 1474 |
+
381,
|
| 1475 |
+
821,
|
| 1476 |
+
410
|
| 1477 |
+
],
|
| 1478 |
+
"page_idx": 12
|
| 1479 |
+
},
|
| 1480 |
+
{
|
| 1481 |
+
"type": "text",
|
| 1482 |
+
"text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of NIPS, 2017. ",
|
| 1483 |
+
"bbox": [
|
| 1484 |
+
173,
|
| 1485 |
+
419,
|
| 1486 |
+
823,
|
| 1487 |
+
448
|
| 1488 |
+
],
|
| 1489 |
+
"page_idx": 12
|
| 1490 |
+
},
|
| 1491 |
+
{
|
| 1492 |
+
"type": "text",
|
| 1493 |
+
"text": "Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, 2018. ",
|
| 1494 |
+
"bbox": [
|
| 1495 |
+
173,
|
| 1496 |
+
457,
|
| 1497 |
+
825,
|
| 1498 |
+
513
|
| 1499 |
+
],
|
| 1500 |
+
"page_idx": 12
|
| 1501 |
+
},
|
| 1502 |
+
{
|
| 1503 |
+
"type": "text",
|
| 1504 |
+
"text": "Ralph Weischedel, Martha Palmer, Mitchell Marcus, Eduard Hovy, Sameer Pradhan, Lance Ramshaw, Nianwen Xue, Ann Taylor, Jeff Kaufman, Michelle Franchini, et al. OntoNotes release 5.0 LDC2013T19. Linguistic Data Consortium, Philadelphia, PA, 2013. ",
|
| 1505 |
+
"bbox": [
|
| 1506 |
+
173,
|
| 1507 |
+
522,
|
| 1508 |
+
821,
|
| 1509 |
+
565
|
| 1510 |
+
],
|
| 1511 |
+
"page_idx": 12
|
| 1512 |
+
},
|
| 1513 |
+
{
|
| 1514 |
+
"type": "text",
|
| 1515 |
+
"text": "Aaron Steven White, Pushpendre Rastogi, Kevin Duh, and Benjamin Van Durme. Inference is everything: Recasting semantic resources into a unified evaluation framework. In Proceedings of IJCNLP, 2017. ",
|
| 1516 |
+
"bbox": [
|
| 1517 |
+
173,
|
| 1518 |
+
573,
|
| 1519 |
+
823,
|
| 1520 |
+
616
|
| 1521 |
+
],
|
| 1522 |
+
"page_idx": 12
|
| 1523 |
+
},
|
| 1524 |
+
{
|
| 1525 |
+
"type": "text",
|
| 1526 |
+
"text": "Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint 1609.08144, 2016. ",
|
| 1527 |
+
"bbox": [
|
| 1528 |
+
173,
|
| 1529 |
+
626,
|
| 1530 |
+
823,
|
| 1531 |
+
681
|
| 1532 |
+
],
|
| 1533 |
+
"page_idx": 12
|
| 1534 |
+
},
|
| 1535 |
+
{
|
| 1536 |
+
"type": "text",
|
| 1537 |
+
"text": "Kelly Zhang and Samuel Bowman. Language modeling teaches you more than translation does: Lessons learned through auxiliary syntactic task analysis. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, 2018. ",
|
| 1538 |
+
"bbox": [
|
| 1539 |
+
176,
|
| 1540 |
+
690,
|
| 1541 |
+
823,
|
| 1542 |
+
734
|
| 1543 |
+
],
|
| 1544 |
+
"page_idx": 12
|
| 1545 |
+
},
|
| 1546 |
+
{
|
| 1547 |
+
"type": "text",
|
| 1548 |
+
"text": "Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In Proceedings of ICCV, 2015. ",
|
| 1549 |
+
"bbox": [
|
| 1550 |
+
178,
|
| 1551 |
+
742,
|
| 1552 |
+
823,
|
| 1553 |
+
786
|
| 1554 |
+
],
|
| 1555 |
+
"page_idx": 12
|
| 1556 |
+
},
|
| 1557 |
+
{
|
| 1558 |
+
"type": "text",
|
| 1559 |
+
"text": "A CHANGES FROM ORIGINAL VERSION ",
|
| 1560 |
+
"text_level": 1,
|
| 1561 |
+
"bbox": [
|
| 1562 |
+
176,
|
| 1563 |
+
102,
|
| 1564 |
+
519,
|
| 1565 |
+
118
|
| 1566 |
+
],
|
| 1567 |
+
"page_idx": 13
|
| 1568 |
+
},
|
| 1569 |
+
{
|
| 1570 |
+
"type": "text",
|
| 1571 |
+
"text": "This version of the paper has been updated to include probing results on the popular BERT (Devlin et al., 2018) model, which was released after our original submission. Aside from formatting and minor re-wording, the following changes have been made: ",
|
| 1572 |
+
"bbox": [
|
| 1573 |
+
176,
|
| 1574 |
+
132,
|
| 1575 |
+
825,
|
| 1576 |
+
175
|
| 1577 |
+
],
|
| 1578 |
+
"page_idx": 13
|
| 1579 |
+
},
|
| 1580 |
+
{
|
| 1581 |
+
"type": "text",
|
| 1582 |
+
"text": "• We include probing results on the BERT-base and BERT-large models (Devlin et al., 2018). \n• We add one additional task to Table 2, relation classification on SemEval 2010 Task 8 (Hendrickx et al., 2009), in order to better explore how pre-trained encoders capture semantic information. \n• We refer to the OpenAI Transformer LM (Radford et al., 2018) as “GPT” to better reflect common usage. \n• We add experiments with ELMo-style scalar mixing (Section 3.2) on the OpenAI GPT model. This improves performance slightly, and changes our conclusion that ELMo was overall superior to GPT; the two are approximately equal on average, with slight differences on some tasks. \n• To reduce noise, we report the average over five runs for experiments on Winograd coreference (DPR). ",
|
| 1583 |
+
"bbox": [
|
| 1584 |
+
215,
|
| 1585 |
+
185,
|
| 1586 |
+
825,
|
| 1587 |
+
371
|
| 1588 |
+
],
|
| 1589 |
+
"page_idx": 13
|
| 1590 |
+
},
|
| 1591 |
+
{
|
| 1592 |
+
"type": "text",
|
| 1593 |
+
"text": "B DATASET STATISTICS ",
|
| 1594 |
+
"text_level": 1,
|
| 1595 |
+
"bbox": [
|
| 1596 |
+
174,
|
| 1597 |
+
390,
|
| 1598 |
+
387,
|
| 1599 |
+
406
|
| 1600 |
+
],
|
| 1601 |
+
"page_idx": 13
|
| 1602 |
+
},
|
| 1603 |
+
{
|
| 1604 |
+
"type": "text",
|
| 1605 |
+
"text": "Table 3: For each probing task, corpus summary statistics of the number of labels, examples, tokens and targets (split by train/dev/test). Examples generally refer to sentences. For semantic role labeling, they instead refer to the total number of frames. Targets refer to the total number of classification targets (edges or spans, as described in Table 1 and Section 2). For SemEval relation classification there is no standard development split, so we use a fixed subset of $15 \\%$ of the training data and use the remaining $85 \\%$ to train. ",
|
| 1606 |
+
"bbox": [
|
| 1607 |
+
173,
|
| 1608 |
+
411,
|
| 1609 |
+
825,
|
| 1610 |
+
494
|
| 1611 |
+
],
|
| 1612 |
+
"page_idx": 13
|
| 1613 |
+
},
|
| 1614 |
+
{
|
| 1615 |
+
"type": "table",
|
| 1616 |
+
"img_path": "images/565495293df4d9be7a34834243aeb385d27079797c0fde264f74eee45d05a835.jpg",
|
| 1617 |
+
"table_caption": [],
|
| 1618 |
+
"table_footnote": [],
|
| 1619 |
+
"table_body": "<table><tr><td>Task</td><td>|L|</td><td>Examples</td><td>Tokens</td><td>Total Targets</td></tr><tr><td>Part-of-Speech</td><td>48</td><td>116K/16K/12K</td><td>2.2M/305K/230K</td><td>2.1M/290K/212K</td></tr><tr><td>Constituents</td><td>30</td><td>116K/16K/12K</td><td>2.2M/305K/230K</td><td>1.9M/255K/191K</td></tr><tr><td>Dependencies</td><td>49</td><td>13K/2.0K/2.1K</td><td>204K/25K/25K</td><td>204K/25K/25K</td></tr><tr><td>Entities</td><td>18</td><td>116K/16K/12K</td><td>2.2M/305K/230K</td><td>128K/20K/13K</td></tr><tr><td>SRL (all)</td><td>66</td><td>253K/35K/24K</td><td>6.6M/934K/640K</td><td>599K/83K/56K</td></tr><tr><td>Core roles</td><td>6</td><td>253K/35K/24K</td><td>6.6M/934K/640K</td><td>411K/57K/38K</td></tr><tr><td>Non-core roles</td><td>21</td><td>253K/35K/24K</td><td>6.6M/934K/640K</td><td>170K/24K/16K</td></tr><tr><td>OntoNotes coref.</td><td>2</td><td>116K/16K/12K</td><td>2.2M/305K/230K</td><td>248K/43K/40K</td></tr><tr><td>SPR1</td><td>18</td><td>3.8K/513/551</td><td>81K/11K/12K</td><td>7.6K/1.1k/1.1K</td></tr><tr><td>SPR2</td><td>20</td><td>2.2K/291/276</td><td>47K /4.9K /5.6K</td><td>4.9K/630 / 582</td></tr><tr><td>Winograd coref.</td><td>2</td><td>1.0K /2.0K/2.1K</td><td>14K/8.0K/14K</td><td>1.8K/949 /379</td></tr><tr><td>Rel. (SemEval)</td><td>19</td><td>6.9K/1.1K/2.7K</td><td>117K/20K/47K</td><td>6.9K/1.1K/2.7K</td></tr></table>",
|
| 1620 |
+
"bbox": [
|
| 1621 |
+
178,
|
| 1622 |
+
507,
|
| 1623 |
+
816,
|
| 1624 |
+
738
|
| 1625 |
+
],
|
| 1626 |
+
"page_idx": 13
|
| 1627 |
+
},
|
| 1628 |
+
{
|
| 1629 |
+
"type": "text",
|
| 1630 |
+
"text": "C MODEL DETAILS ",
|
| 1631 |
+
"text_level": 1,
|
| 1632 |
+
"bbox": [
|
| 1633 |
+
174,
|
| 1634 |
+
773,
|
| 1635 |
+
351,
|
| 1636 |
+
790
|
| 1637 |
+
],
|
| 1638 |
+
"page_idx": 13
|
| 1639 |
+
},
|
| 1640 |
+
{
|
| 1641 |
+
"type": "text",
|
| 1642 |
+
"text": "Because the vectors have varying dimension across probed models, and to improve performance we first project the vectors down to 256 dimensions: ",
|
| 1643 |
+
"bbox": [
|
| 1644 |
+
173,
|
| 1645 |
+
804,
|
| 1646 |
+
823,
|
| 1647 |
+
833
|
| 1648 |
+
],
|
| 1649 |
+
"page_idx": 13
|
| 1650 |
+
},
|
| 1651 |
+
{
|
| 1652 |
+
"type": "equation",
|
| 1653 |
+
"img_path": "images/28a1c0d8af38b74d1aa44054a90275796fb97e75980b654c7c5bae697e7734ec.jpg",
|
| 1654 |
+
"text": "$$\ne _ { i } ^ { ( k ) } = A ^ { ( k ) } e _ { i } + b ^ { ( k ) }\n$$",
|
| 1655 |
+
"text_format": "latex",
|
| 1656 |
+
"bbox": [
|
| 1657 |
+
429,
|
| 1658 |
+
848,
|
| 1659 |
+
568,
|
| 1660 |
+
869
|
| 1661 |
+
],
|
| 1662 |
+
"page_idx": 13
|
| 1663 |
+
},
|
| 1664 |
+
{
|
| 1665 |
+
"type": "text",
|
| 1666 |
+
"text": "We use separate projections $( k = 1 , 2$ ) so that the model can extract different information from $s ^ { ( 1 ) }$ (for example, a predicate) and $s ^ { ( 2 ) }$ (for example, an argument). We then apply a pooling operator over the representations within a span to yield a fixed-length representation: ",
|
| 1667 |
+
"bbox": [
|
| 1668 |
+
176,
|
| 1669 |
+
880,
|
| 1670 |
+
823,
|
| 1671 |
+
924
|
| 1672 |
+
],
|
| 1673 |
+
"page_idx": 13
|
| 1674 |
+
},
|
| 1675 |
+
{
|
| 1676 |
+
"type": "equation",
|
| 1677 |
+
"img_path": "images/68bae9552361d7ae4d4eb6480348d15acb42f54808d4a04ef9314b58d63810e0.jpg",
|
| 1678 |
+
"text": "$$\nr ^ { ( k ) } ( s _ { k } ) = r ^ { ( k ) } ( i _ { k } , j _ { k } ) = \\mathrm { P o o l } ( e _ { i _ { k } } ^ { ( k ) } , e _ { i _ { k } + 1 } ^ { ( k ) } , \\dots , e _ { j _ { k } - 1 } ^ { ( k ) } )\n$$",
|
| 1679 |
+
"text_format": "latex",
|
| 1680 |
+
"bbox": [
|
| 1681 |
+
316,
|
| 1682 |
+
116,
|
| 1683 |
+
681,
|
| 1684 |
+
138
|
| 1685 |
+
],
|
| 1686 |
+
"page_idx": 14
|
| 1687 |
+
},
|
| 1688 |
+
{
|
| 1689 |
+
"type": "text",
|
| 1690 |
+
"text": "We use the sellearns a weight ng operator from Lee et al. (2017) andfor each token, then represents the span $\\mathrm { H e }$ et al. (2018). Thisa sum of the vectors $z _ { i } ^ { ( k ) } = W _ { a t t } ^ { ( k ) } e _ { i } ^ { ( k ) }$ \n$e _ { i _ { k } } ^ { ( k ) } , e _ { i _ { k } + 1 } ^ { ( k ) } , \\ldots , e _ { j _ { k } - 1 } ^ { ( k ) }$ weighted by $a _ { i } ^ { ( k ) } = \\mathrm { s o f t m a x } ( \\mathbf { z } ^ { ( k ) } ) _ { i }$ . ",
|
| 1691 |
+
"bbox": [
|
| 1692 |
+
173,
|
| 1693 |
+
148,
|
| 1694 |
+
825,
|
| 1695 |
+
200
|
| 1696 |
+
],
|
| 1697 |
+
"page_idx": 14
|
| 1698 |
+
},
|
| 1699 |
+
{
|
| 1700 |
+
"type": "text",
|
| 1701 |
+
"text": "Finally, the pooled span representations are fed into a two-layer MLP followed by a sigmoid output layer: ",
|
| 1702 |
+
"bbox": [
|
| 1703 |
+
171,
|
| 1704 |
+
205,
|
| 1705 |
+
823,
|
| 1706 |
+
234
|
| 1707 |
+
],
|
| 1708 |
+
"page_idx": 14
|
| 1709 |
+
},
|
| 1710 |
+
{
|
| 1711 |
+
"type": "equation",
|
| 1712 |
+
"img_path": "images/7b968150e5f75bc1c812f2306adb5b9988ad86e39ffe0309b9c848691d7b3897.jpg",
|
| 1713 |
+
"text": "$$\n\\begin{array} { c } { { h = M L P ( [ r ^ { ( 1 ) } ( s ^ { ( 1 ) } ) , r ^ { ( 2 ) } ( s ^ { ( 2 ) } ) ] ) } } \\\\ { { P ( \\mathrm { l a b e l } _ { \\ell } = 1 ) = \\sigma ( W h + b ) _ { \\ell } \\quad \\mathrm { f o r } \\quad \\ell = 0 , \\ldots , | { \\mathcal L } | } } \\end{array}\n$$",
|
| 1714 |
+
"text_format": "latex",
|
| 1715 |
+
"bbox": [
|
| 1716 |
+
325,
|
| 1717 |
+
252,
|
| 1718 |
+
676,
|
| 1719 |
+
292
|
| 1720 |
+
],
|
| 1721 |
+
"page_idx": 14
|
| 1722 |
+
},
|
| 1723 |
+
{
|
| 1724 |
+
"type": "text",
|
| 1725 |
+
"text": "We train by minimizing binary cross entropy against the set of true labels. While convention on many tasks (e.g. SRL) is to use a softmax loss, this enforces an exclusivity constraint. By using a per-label sigmoid our model can estimate each label independently, which allows us to stratify our analysis (see $\\ S 5$ ) to individual labels or groups of labels within a task. ",
|
| 1726 |
+
"bbox": [
|
| 1727 |
+
174,
|
| 1728 |
+
303,
|
| 1729 |
+
825,
|
| 1730 |
+
359
|
| 1731 |
+
],
|
| 1732 |
+
"page_idx": 14
|
| 1733 |
+
},
|
| 1734 |
+
{
|
| 1735 |
+
"type": "text",
|
| 1736 |
+
"text": "With the exception of ELMo scalars, we hold the weights of the sentence encoder (§ 3.2) fixed while we train our probing classifier. We train using the Adam optimizer (Kingma $\\&$ Ba, 2015) with a batch $\\mathrm { s i z e ^ { 9 } }$ of 32, an initial learning rate of 1e-4, and gradient clipping with max $L _ { 2 }$ norm of 5.0. We evaluate on the validation set every 1000 steps (or every 100 for SPR1, SPR2, and Winograd), halve the learning rate if no improvement is seen in 5 validations, and stop training if no improvement is seen in 20 validations. ",
|
| 1737 |
+
"bbox": [
|
| 1738 |
+
173,
|
| 1739 |
+
366,
|
| 1740 |
+
825,
|
| 1741 |
+
449
|
| 1742 |
+
],
|
| 1743 |
+
"page_idx": 14
|
| 1744 |
+
},
|
| 1745 |
+
{
|
| 1746 |
+
"type": "text",
|
| 1747 |
+
"text": "D CONTEXTUAL REPRESENTATION MODELS ",
|
| 1748 |
+
"text_level": 1,
|
| 1749 |
+
"bbox": [
|
| 1750 |
+
173,
|
| 1751 |
+
472,
|
| 1752 |
+
560,
|
| 1753 |
+
488
|
| 1754 |
+
],
|
| 1755 |
+
"page_idx": 14
|
| 1756 |
+
},
|
| 1757 |
+
{
|
| 1758 |
+
"type": "text",
|
| 1759 |
+
"text": "CoVe The CoVe model (McCann et al., 2017) is a two-layer biLSTM trained as the encoder side of a sequence-to-sequence(Sutskever et al., 2014) English-German machine translation model. We use the original authors’ implementation and the best released pre-trained model 10. This model is trained on the WMT2017 dataset Bojar et al. (2017) which contains approximately 7 million sentences of English text. Following McCann et al. (2017), we concatenate the activations of the top-layer forward and backward LSTMs ( $\\mathit { d } = 3 0 0$ each) with the pre-trained GloVe (Pennington et al., 2014) embedding11 $\\angle d = 3 0 0$ ) of each token, for a total representation dimension of $d = 9 0 0$ . ",
|
| 1760 |
+
"bbox": [
|
| 1761 |
+
173,
|
| 1762 |
+
503,
|
| 1763 |
+
825,
|
| 1764 |
+
603
|
| 1765 |
+
],
|
| 1766 |
+
"page_idx": 14
|
| 1767 |
+
},
|
| 1768 |
+
{
|
| 1769 |
+
"type": "text",
|
| 1770 |
+
"text": "ELMo The ELMo model (Peters et al., 2018a) is a two layer LSTM trained as the concatenation of a forward and a backward language model, and built over a context-independent character CNN layer. We use the original authors’ implementation as provided in the AllenNLP (Gardner et al., 2018) toolkit12 and the standard pre-trained model trained on the Billion Word Benchmark (BWB) (Chelba et al., 2014)We take the (fixed, contextual) representation of token $i$ to be the set of three vectors $h _ { 0 , i } , h _ { 1 , i }$ , and $h _ { 2 , i }$ containing the activations of each layer of the ELMo model. Following Equation 1 of Peters et al. (2018a), we learn task-specific scalar parameters and take a weighted sum: ",
|
| 1771 |
+
"bbox": [
|
| 1772 |
+
173,
|
| 1773 |
+
619,
|
| 1774 |
+
825,
|
| 1775 |
+
731
|
| 1776 |
+
],
|
| 1777 |
+
"page_idx": 14
|
| 1778 |
+
},
|
| 1779 |
+
{
|
| 1780 |
+
"type": "equation",
|
| 1781 |
+
"img_path": "images/66c659cd0664ef956c433ac8436cf0e599e19cf8215ce552d22cb048ffbba027.jpg",
|
| 1782 |
+
"text": "$$\ne _ { i } = \\gamma \\left( s _ { 0 } h _ { 0 , i } + s _ { 1 } h _ { 1 , i } + s _ { 2 } h _ { 2 , i } \\right) \\quad \\mathrm { f o r } i = 0 , 1 , \\ldots , n\n$$",
|
| 1783 |
+
"text_format": "latex",
|
| 1784 |
+
"bbox": [
|
| 1785 |
+
316,
|
| 1786 |
+
732,
|
| 1787 |
+
679,
|
| 1788 |
+
750
|
| 1789 |
+
],
|
| 1790 |
+
"page_idx": 14
|
| 1791 |
+
},
|
| 1792 |
+
{
|
| 1793 |
+
"type": "text",
|
| 1794 |
+
"text": "to give 1024-dimensional representations for each token. ",
|
| 1795 |
+
"bbox": [
|
| 1796 |
+
173,
|
| 1797 |
+
755,
|
| 1798 |
+
547,
|
| 1799 |
+
770
|
| 1800 |
+
],
|
| 1801 |
+
"page_idx": 14
|
| 1802 |
+
},
|
| 1803 |
+
{
|
| 1804 |
+
"type": "text",
|
| 1805 |
+
"text": "OpenAI GPT The GPT model (Radford et al., 2018) was recently shown to outperform ELMo on a number of downstream tasks, and as of submission holds the highest score on the GLUE benchmark (Wang et al., 2018). It consists of a 12-layer Transformer (Vaswani et al., 2017) model, trained as a left-to-right language model using masked attention. We use a PyTorch reimplementation of the model13, and the pre-trained weights14 trained on the Toronto Book Corpus (Zhu et al., 2015) Unlike Radford et al. (2018), we hold the Transformer weights fixed while training our probing model in order to better understand what information is available from the pre-training procedure alone. To facilitate more direct comparison with ELMo and CoVe we concatenate (cat) the activations of the final Transformer layer $\\zeta d = 7 6 8 )$ with the context-independent subword embeddings $\\zeta d = 7 6 8 )$ ) to give contextual vectors of $d = 1 5 3 6$ for each (sub)-token. We also experiment with ELMo-style scalar mixing $\\left( \\mathrm { m i x } \\right)$ , which uses additional weight parameters for each layer (embeddings plus layers 1 − 12) learned for each probing task to give a contextual vector of $d = 7 6 8$ for each (sub)-token. ",
|
| 1806 |
+
"bbox": [
|
| 1807 |
+
173,
|
| 1808 |
+
785,
|
| 1809 |
+
825,
|
| 1810 |
+
843
|
| 1811 |
+
],
|
| 1812 |
+
"page_idx": 14
|
| 1813 |
+
},
|
| 1814 |
+
{
|
| 1815 |
+
"type": "text",
|
| 1816 |
+
"text": "",
|
| 1817 |
+
"bbox": [
|
| 1818 |
+
173,
|
| 1819 |
+
103,
|
| 1820 |
+
825,
|
| 1821 |
+
229
|
| 1822 |
+
],
|
| 1823 |
+
"page_idx": 15
|
| 1824 |
+
},
|
| 1825 |
+
{
|
| 1826 |
+
"type": "text",
|
| 1827 |
+
"text": "BERT The BERT model of Devlin et al. (2018) has recently shown state-of-the-art performance on a broad set of NLP tasks, outperforming ELMo and the OpenAI Transformer LM. It consists of a stack of Transformer (Vaswani et al., 2017) layers trained jointly as a masked language model and on a next-sentence prediction task. We use a PyTorch reimplementation of the model via the pytorch pretrained bert package15, and the pre-trained bert-base-uncased (12- layer) and bert-large-uncased (24-layer) models trained on the concatenation of the Toronto Books Corpus (Zhu et al., 2015, 800M words of fiction books) and English Wikipedia (2.5B words). Unlike standard usage of the BERT model (Devlin et al., 2018), we hold the Transformer weights fixed while training our probing model. We produce cat and mix representations with dimensionality $d = 1 5 3 6$ and $d = 7 6 8$ , respectively for BERT-base and $d = 2 0 4 8$ and $d = 1 0 2 4$ for BERT-large. ",
|
| 1828 |
+
"bbox": [
|
| 1829 |
+
173,
|
| 1830 |
+
244,
|
| 1831 |
+
825,
|
| 1832 |
+
397
|
| 1833 |
+
],
|
| 1834 |
+
"page_idx": 15
|
| 1835 |
+
},
|
| 1836 |
+
{
|
| 1837 |
+
"type": "text",
|
| 1838 |
+
"text": "E RETOKENIZATION ",
|
| 1839 |
+
"text_level": 1,
|
| 1840 |
+
"bbox": [
|
| 1841 |
+
174,
|
| 1842 |
+
417,
|
| 1843 |
+
357,
|
| 1844 |
+
434
|
| 1845 |
+
],
|
| 1846 |
+
"page_idx": 15
|
| 1847 |
+
},
|
| 1848 |
+
{
|
| 1849 |
+
"type": "text",
|
| 1850 |
+
"text": "The pre-trained encoder models expect a particular tokenization of the input string, which does not always match the original tokenization of each probing set. To correct this we retokenize the probing data to match the tokenization of each encoder, which for CoVe is Moses tokenization, and for GPT and BERT is a custom subword model (Sennrich et al., 2016; Wu et al., 2016). We then align the spans to the new tokenization using a heuristic projection based on byte-level Levenshtein distance. ",
|
| 1851 |
+
"bbox": [
|
| 1852 |
+
174,
|
| 1853 |
+
449,
|
| 1854 |
+
825,
|
| 1855 |
+
520
|
| 1856 |
+
],
|
| 1857 |
+
"page_idx": 15
|
| 1858 |
+
},
|
| 1859 |
+
{
|
| 1860 |
+
"type": "text",
|
| 1861 |
+
"text": "The source data for our probing tasks is annotated with respect to a particular tokenization, typically the conventions of the source treebanks (Penn Treebank, Universal Dependencies, and OntoNotes 5.0). This does not always align to the tokenization of the pre-trained representation models. Consider a dummy sentence: ",
|
| 1862 |
+
"bbox": [
|
| 1863 |
+
174,
|
| 1864 |
+
526,
|
| 1865 |
+
823,
|
| 1866 |
+
583
|
| 1867 |
+
],
|
| 1868 |
+
"page_idx": 15
|
| 1869 |
+
},
|
| 1870 |
+
{
|
| 1871 |
+
"type": "text",
|
| 1872 |
+
"text": "• Text: I don’t like pineapples. • Native: [I do n’t like pineapples .] • Moses: [I do n \\'t like pineapples .] • Subword: [_i _do _n’t _like _pinea pples .] ",
|
| 1873 |
+
"bbox": [
|
| 1874 |
+
215,
|
| 1875 |
+
594,
|
| 1876 |
+
632,
|
| 1877 |
+
667
|
| 1878 |
+
],
|
| 1879 |
+
"page_idx": 15
|
| 1880 |
+
},
|
| 1881 |
+
{
|
| 1882 |
+
"type": "text",
|
| 1883 |
+
"text": "An annotation on the word ”pineapples” might be expressed as $s \\ = \\ [ 4 , 5 )$ in the original (”native”) tokenization, but the corresponding text is span $s _ { \\mathrm { M o s e s } } = [ 5 , 6 )$ under Moses tokenization and $s _ { \\mathrm { s u b w o r d } } = [ 5 , 7 )$ under the particular subword model above. ",
|
| 1884 |
+
"bbox": [
|
| 1885 |
+
176,
|
| 1886 |
+
678,
|
| 1887 |
+
823,
|
| 1888 |
+
720
|
| 1889 |
+
],
|
| 1890 |
+
"page_idx": 15
|
| 1891 |
+
},
|
| 1892 |
+
{
|
| 1893 |
+
"type": "text",
|
| 1894 |
+
"text": "We resolve this by aligning the source and target tokenization using Levenshtein distance. We take the source tokenization $\\left[ s _ { 0 } , s _ { 1 } , \\ldots , s _ { m } \\right]$ as given, and treat the target tokenizer as a black-box function from a string $\\tilde { S }$ to a list of tokens $[ t _ { 0 } , t _ { 1 } , \\ldots , t _ { n } ]$ (note that in general, $n \\ne m$ ). Let $\\tilde { S }$ be the source string. We create a target string $\\tilde { T }$ by joining $[ t _ { 0 } , t _ { 1 } , \\ldots , t _ { n } ]$ with spaces, and then compute a byte-level Levenshtein alignment16 $\\tilde { A } = \\mathrm { A l i g n } ( \\tilde { T } , \\tilde { S } )$ . We then compute token-tobyte alignments $U = \\mathrm { A l i g n } ( [ t _ { 0 } , t _ { 1 } , \\dots , t _ { n } ] , \\tilde { { \\cal T } } )$ and $V = \\mathrm { A l i g n } ( [ s _ { 0 } , s _ { 1 } , \\ldots , s _ { m } ] , \\tilde { S } )$ . Representing the alignments as boolean adjacency matricies, we can compose them to form a token-to-token alignment $\\boldsymbol { A } = \\boldsymbol { U } \\tilde { \\boldsymbol { A } } \\boldsymbol { V } ^ { T }$ . ",
|
| 1895 |
+
"bbox": [
|
| 1896 |
+
173,
|
| 1897 |
+
727,
|
| 1898 |
+
825,
|
| 1899 |
+
821
|
| 1900 |
+
],
|
| 1901 |
+
"page_idx": 15
|
| 1902 |
+
},
|
| 1903 |
+
{
|
| 1904 |
+
"type": "text",
|
| 1905 |
+
"text": "",
|
| 1906 |
+
"bbox": [
|
| 1907 |
+
171,
|
| 1908 |
+
103,
|
| 1909 |
+
823,
|
| 1910 |
+
132
|
| 1911 |
+
],
|
| 1912 |
+
"page_idx": 16
|
| 1913 |
+
},
|
| 1914 |
+
{
|
| 1915 |
+
"type": "text",
|
| 1916 |
+
"text": "We then represent each source span as a boolean vector with 1s inside the span and 0s outside, e.g. $[ 2 , 4 ) = [ 0 , 0 , 1 , 1 , 0 , 0 , . . . ] \\in \\{ 0 , 1 \\} ^ { m }$ , and project through the alignment $A$ to the target side. We recover a target-side span from the minimum and maximum nonzero indices. ",
|
| 1917 |
+
"bbox": [
|
| 1918 |
+
173,
|
| 1919 |
+
140,
|
| 1920 |
+
825,
|
| 1921 |
+
183
|
| 1922 |
+
],
|
| 1923 |
+
"page_idx": 16
|
| 1924 |
+
}
|
| 1925 |
+
]
|
parse/train/SJzSgnRcKX/SJzSgnRcKX_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/SJzSgnRcKX/SJzSgnRcKX_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/cnWSyJNmeCE/cnWSyJNmeCE.md
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CogView: Mastering Text-to-Image Generation via Transformers
|
| 2 |
+
|
| 3 |
+
Ming Ding†, Zhuoyi $\mathbf { Y a n g } ^ { \dagger }$ , Wenyi $\mathbf { H o n g } ^ { \dagger }$ , Wendi Zheng†, Chang Zhou‡, Da Yin†, Junyang $\mathbf { L i n } ^ { \ddagger }$ , $\mathbf { X } \mathbf { u } \mathbf { Z } \mathbf { o } \mathbf { u } ^ { \dagger }$ , Zhou Shao♠, Hongxia Yang‡, Jie Tang†♠ †Tsinghua University ‡DAMO Academy, Alibaba Group ♠BAAI {dm18@mails, jietang@mail}.tsinghua.edu.cn
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Text-to-Image generation in the general domain has long been an open problem, which requires both a powerful generative model and cross-modal understanding. We propose CogView, a 4-billion-parameter Transformer with VQ-VAE tokenizer to advance this problem. We also demonstrate the finetuning strategies for various downstream tasks, e.g. style learning, super-resolution, text-image ranking and fashion design, and methods to stabilize pretraining, e.g. eliminating NaN losses. CogView achieves the state-of-the-art FID on the blurred MS COCO dataset, outperforming previous GAN-based models and a recent similar work DALL-E. 1
|
| 8 |
+
|
| 9 |
+

|
| 10 |
+
Figure 1: Samples generated by CogView. The text in the first line is either from MS COCO (outside our training set) or user queries on our demo website. The images in the second line are finetuned results for different styles or super-resolution. The actual input text is in Chinese, which is translated into English here for better understanding. More samples for captions from MS COCO are included in Appendix F.
|
| 11 |
+
|
| 12 |
+
# 1 Introduction
|
| 13 |
+
|
| 14 |
+
“There are two things for a painter, the eye and the mind... eyes, through which we view the nature; brain, in which we organize sensations by logic for meaningful expression.” (Paul Cézanne [17])
|
| 15 |
+
|
| 16 |
+
As contrastive self-supervised pretraining has revolutionized computer vision (CV) [24, 21, 8, 32], visual-language pretraining, which brings high-level semantics to images, is becoming the next frontier of visual understanding [38, 30, 39]. Among various pretext tasks, text-to-image generation expects the model to (1) disentangle shape, color, gesture and other features from pixels, (2) understand the input text, (2) align objects and features with corresponding words and their synonyms and (4) learn complex distributions to generate the overlapping and composite of different objects and features, which, like painting, is beyond basic visual functions (related to eyes and the V1–V4 in brain [22]), requiring a higher-level cognitive ability (more related to the angular gyrus in brain [3]).
|
| 17 |
+
|
| 18 |
+
The attempts to teach machines text-to-image generation can be traced to the early times of deep generative models, when Mansimov et al. [35] added text information to DRAW [20]. Then Generative Adversarial Nets [19] (GANs) began to dominate this task. Reed et al. [42] fed the text embeddings to both generator and discriminator as extra inputs. StackGAN [54] decomposed the generation into a sketch-refinement process. AttnGAN [51] used attention on words to focus on the corresponding subregion. ObjectGAN [29] generated images following a text boxes layouts image process. DM-GAN [55] and DF-GAN [45] introduced new architectures, e.g. dyanmic memory or deep fusion block, for better image refinement. Although these GAN-based models can perform reasonable synthesis in simple and domain-specific dataset, e.g. Caltech-UCSD Birds 200 (CUB), the results on complex and domain-general scenes, e.g. MS COCO [31], are far from satisfactory.
|
| 19 |
+
|
| 20 |
+
Recent years have seen a rise of the auto-regressive generative models. Generative Pre-Training (GPT) models [37, 4] leveraged Transformers [48] to learn language models in large-scale corpus, greatly promoting the performance of natural language generation and few-shot language understanding [33]. Auto-regressive model is not nascent in CV. PixelCNN, PixelRNN [47] and Image Transformer [36] factorized the probability density function on an image over its sub-pixels (color channels in a pixel) with different network backbones, showing promising results. However, a real image usually comprises millions of sub-pixels, indicating an unaffordable amount of computation for large models. Even the biggest pixel-level auto-regressive model, ImageGPT [7], was pretrained on ImageNet at a max resolution of only $9 6 \times 9 6$ .
|
| 21 |
+
|
| 22 |
+
The framework of Vector Quantized Variational AutoEncoders (VQ-VAE) [46] alleviates this problem. VQ-VAE trains an encoder to compress the image into a low-dimensional discrete latent space, and a decoder to recover the image from the hidden variable in the stage 1. Then in the stage 2, an auto-regressive model (such as PixelCNN [47]) learns to fit the prior of hidden variables. This discrete compression loses less fidelity than direct downsampling, meanwhile maintains the spatial relevance of pixels. Therefore, VQ-VAE revitalized the auto-regressive models in CV [41]. Following this framework, Esser et al. [15] used Transformer to fit the prior and further switches from $L _ { 2 }$ loss to GAN loss for the decoder training, greatly improving the performance of domain-specific unconditional generation.
|
| 23 |
+
|
| 24 |
+
The idea of CogView comes naturally: large-scale generative joint pretraining for both text and image (from VQ-VAE) tokens. We collect 30 million high-quality (Chinese) text-image pairs and pretrain a Transformer with 4 billion parameters. However, large-scale text-to-image generative pretraining could be very unstable due to the heterogeneity of data. We systematically analyze the reasons and solved this problem by the proposed Precision Bottleneck Relaxation and Sandwich Layernorm. As a result, CogView greatly advances the quality of text-to-image generation.
|
| 25 |
+
|
| 26 |
+
A recent work DALL-E [39] independently proposed the same idea, and was released earlier than CogView. Compared with DALL-E, CogView steps forward on the following four aspects:
|
| 27 |
+
|
| 28 |
+
• CogView outperforms DALL-E and previous GAN-based methods at a large margin according to the Fréchet Inception Distance (FID) [25] on blurred MS COCO, and is the first open-source large text-to-image transformer.
|
| 29 |
+
• Beyond zero-shot generation, we further investigate the potential of finetuning the pretrained CogView. CogView can be adapted for diverse downstream tasks, such as style learning (domain-specific text-to-image), super-resolution (image-to-image), image captioning (image-to-text), and even text-image reranking.
|
| 30 |
+
The finetuned CogView enables self-reranking for post-selection, and gets rid of an additional CLIP model [38] in DALL-E. It also provides a new metric Caption Loss to measure the quality and accuracy for text-image generation at a finer granularity than FID and Inception Score (IS) [43].
|
| 31 |
+
|
| 32 |
+
• We proposed PB-relaxation and Sandwich-LN to stabilize the training of large Transformers on complex datasets. These techniques are very simple and can eliminate overflow in forwarding (characterized as NaN losses), and make CogView able to be trained with almost FP16 $( \mathbf { O } 2 ^ { \bar { 2 } } )$ ). They can also be generalized to the training of other transformers.
|
| 33 |
+
|
| 34 |
+
# 2 Method
|
| 35 |
+
|
| 36 |
+
# 2.1 Theory
|
| 37 |
+
|
| 38 |
+
In this section, we will derive the theory of CogView from $\mathrm { V A E } ^ { 3 }$ [26]: CogView optimizes the Evidence Lower BOund (ELBO) of joint likelihood of image and text. The following derivation will turn into a clear re-interpretation of VQ-VAE if without text t.
|
| 39 |
+
|
| 40 |
+
Suppose the dataset $( { \bf X } , { \bf T } ) = \{ x _ { i } , t _ { i } \} _ { i = 1 } ^ { N }$ consists of $N$ i.i.d. samples of image variable $\mathbf { x }$ and its description text variable t. We assume the image $\mathbf { x }$ can be generated by a random process involving a latent variable $\mathbf { z }$ : (1) $t _ { i }$ is first generated from a prior $p ( \mathbf { t } ; \theta )$ . (2) $z _ { i }$ is then generated from the conditional distribution $p ( \mathbf { z } | \mathbf { t } = t _ { i } ; \boldsymbol { \theta } )$ . (3) $x _ { i }$ is finally generated from $p ( \mathbf { x } | \mathbf { z } = z _ { i } ; \psi )$ . We will use a shorthand form like $p ( x _ { i } )$ to refer to $p ( \mathbf { x } = x _ { i } )$ in the following part.
|
| 41 |
+
|
| 42 |
+
Let $q ( \mathbf { z } | x _ { i } ; \phi )$ be the variational distribution, which is the output of the encoder $\phi$ of VAE. The log-likelihood and the evidence lower bound (ELBO) can be written as:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\begin{array} { l } { { \displaystyle \log p ( { \bf X } , { \bf T } ; \theta , \psi ) = \sum _ { i = 1 } ^ { N } \log p ( t _ { i } ; \theta ) + \sum _ { i = 1 } ^ { N } \log p ( x _ { i } | t _ { i } ; \theta , \psi ) } \ ~ } \\ { { \displaystyle \geq - \sum _ { i = 1 } ^ { N } \left( \underbrace { - \log p ( t _ { i } ; \theta ) } _ { \mathrm { ~ N L ~ l o s s ~ f o r ~ t e x t } } + \underbrace { \mathbb { E } _ { z _ { i } \sim q ( z | x _ { i } ; \phi ) } [ - \log p ( x _ { i } | z _ { i } ; \psi ) ] } _ { \mathrm { ~ r e c o n s t u c t i o n ~ l o s s } } + \underbrace { \mathrm { K L } \big ( q ( { \bf z } | x _ { i } ; \phi ) \big | \big | p ( { \bf z } | t _ { i } ; \theta ) \big ) } _ { \mathrm { ~ K L ~ b e t w e e n ~ } q \mathrm { ~ a n d ~ ( t e x t ~ c o n d i t i o n a l ) ~ p r i o r } } \right) } . } \end{array}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
The framework of VQ-VAE differs with traditional VAE mainly in the KL term. Traditional VAE fixes the prior $p ( \mathbf { z } | t _ { i } ; \mathbf { \boldsymbol { \theta } } )$ , usually as $\mathcal { N } ( 0 , \bf { I } )$ , and learns the encoder $\phi$ . However, it leads to posterior collapse [23], meaning that $q ( \mathbf { z } | x _ { i } ; \phi )$ sometimes collapses towards the prior. VQ-VAE turns to fix $\phi$ and fit the prior $p ( \mathbf { z } | t _ { i } ; \mathbf { \boldsymbol { \theta } } )$ with another model parameterized by $\theta$ . This technique eliminates posterior collapse, because the encoder $\phi$ is now only updated for the optimization of the reconstruction loss. In exchange, the approximated posterior $q ( \mathbf { z } | x _ { i } ; \phi )$ could be very different for different $x _ { i }$ , so we need a very powerful model for $p ( \mathbf { z } | t _ { i } ; \mathbf { \boldsymbol { \theta } } )$ to minimize the KL term.
|
| 49 |
+
|
| 50 |
+
Currently, the most powerful generative model, Transformer (GPT), copes with sequences of tokens over a discrete codebook. To use it, we make $\mathbf { z } \in \{ 0 , . . . , | V | - 1 \} ^ { h \times w }$ , where $| V |$ is the size of codebook and $h \times w$ is the number of dimensions of $\mathbf { z }$ . The sequences $z _ { i }$ can be either sampled from $q ( \mathbf { z } | x _ { i } ; \phi )$ , or directly $z _ { i } = \mathrm { a r g m a x } _ { \mathbf { z } } q ( \mathbf { z } | x _ { i } ; \boldsymbol { \phi } )$ . We choose the latter for simplicity, so that $q ( \mathbf { z } | x _ { i } ; \phi )$ becomes a one-point distribution on $z _ { i }$ . The Equation (2) can be rewritten as:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
- \sum _ { i = 1 } ^ { N } \bigg ( \underbrace { \mathbb { E } } _ { \underbrace { z _ { i } \sim q ( \mathbf { z } | x _ { i } ; \phi ) } _ { \mathrm { r e c o n s t r u c t i o n ~ l o s s } } } \bigl [ - \log p ( x _ { i } | z _ { i } ; \psi ) \bigr ] \underbrace { - \log p ( t _ { i } ; \theta ) } _ { \mathrm { N L ~ l o s s ~ f o r ~ t e x t } } \underbrace { - \log p ( z _ { i } | t _ { i } ; \theta ) } _ { \mathrm { N L ~ l o s s ~ f o r ~ \mathbf { z } ~ } } \bigg ) .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
The learning process is then divided into two stages: (1) The encoder $\phi$ and decoder $\psi$ learn to minimize the reconstruction loss. (2) A single GPT optimizes the two negative log-likelihood (NLL) losses by concatenating text $t _ { i }$ and $z _ { i }$ as an input sequence.
|
| 57 |
+
|
| 58 |
+
As a result, the first stage degenerates into a pure discrete Auto-Encoder, serving as an image tokenizer to transform an image to a sequence of tokens; the GPT in the second stage undertakes most of the modeling task. Figure 3 illustrates the framework of CogView.
|
| 59 |
+
|
| 60 |
+
# 2.2 Tokenization
|
| 61 |
+
|
| 62 |
+
In this section, we will introduce the details about the tokenizers in CogView and a comparison about different training strategies about the image tokenizer (VQVAE stage 1).
|
| 63 |
+
|
| 64 |
+
Tokenization for text is already well-studied, e.g. BPE [16] and SentencePiece [28]. In CogView, we ran SentencePiece on a large Chinese corpus to extract 50,000 text tokens.
|
| 65 |
+
|
| 66 |
+
The image tokenizer is a discrete Auto-Encoder, which is similar to the stage 1 of VQ-VAE [46] or d-VAE [39]. More specifically, the Encoder $\phi$ maps an image $x$ of shape $H \times W \times 3$ into $\operatorname { E n c } _ { \phi } ( x )$ of shape $h \times w \times d$ , and then each $d -$ dimensional vector is quantized to a nearby embedding in a learnable codebook $\{ v _ { 0 } , . . . , v _ { | V | - 1 } \} , \forall v _ { k } \in \mathbb { R } ^ { d }$ . The quantized result can be represented by $h \times w$ indices of embeddings, and then we get the latent variable $\mathbf { z } \in \{ 0 , . . . , | V | - 1 \} ^ { h \times w }$ . The Decoder $\psi$ maps the quantized vectors back to a (blurred) image to reconstruct the input. In our 4B-parameter CogView, $| V | = 8 1 9 2 , d = 2 5 6 , H = W = 2 5 6 , h = w = 3 2 .$ .
|
| 67 |
+
|
| 68 |
+
The training of the image tokenizer is non-trivial due to the existence of discrete selection. Here we introduce four methods to train an image tokenizer.
|
| 69 |
+
|
| 70 |
+
• The nearest-neighbor mapping, straight-through estimator [2], which is proposed by the original VQVAE. A common concern of this method [39] is that, when the codebook is large and not initialized carefully, only a few of embeddings will be used due to the curse of dimensionality. We did not observe this phenomenon in the experiments. Gumbel sampling, straight-through estimator. If we follow the original VAE to reparameterize a categorical distribution of latent variable $\mathbf { z }$ based on distance between vectors, i.e. $\begin{array} { r } { p ( \mathbf { z } _ { i \times w + j } = v _ { k } | x ) = \frac { e ^ { - \| v _ { k } - \mathrm { E n c } _ { \phi } ( x ) _ { i j } \| _ { 2 } / \tau } } { \sum _ { k = 0 } ^ { | V | - 1 } e ^ { - \| v _ { k } - \mathrm { E n c } _ { \phi } ( x ) _ { i j } \| _ { 2 } / \tau } } } \end{array}$ k φ ij 2 −kvk−Encφ(x)ijk2/τ , an unbiased sampling strategy is $z _ { i \times w + j } = \mathrm { a r g m a x } _ { k } g _ { k } - \| v _ { k } - \mathrm { E n c } _ { \phi } ( x ) _ { i j } \| _ { 2 } / \tau$ , $g _ { k } \sim \mathrm { G u m b e l } ( 0 , 1 )$ , where the temperature $\tau$ is gradually decreased to 0. We can further use the differentiable softmax to approximate the one-hot distribution from argmax. DALL-E adopts this method with many other tricks to stabilize the training. • The nearest-neighbor mapping, moving average, where each embedding in the codebook is updated periodically during training as the mean of the vectors recently mapped to it [46]. • The nearest-neighbor mapping, fixed codebook, where the codebook is fixed after initialized.
|
| 71 |
+
|
| 72 |
+
Comparison. To compare the methods, we train four image tokenizers with the same architecture on the same dataset and random seed, and demonstrate the loss curves in Figure 2. We find that all the methods are basically evenly matched, meaning that the learning of the embeddings in the codebook is not very important, if initialized properly. In pretraining, we use the tokenizer of moving average method.
|
| 73 |
+
|
| 74 |
+
The introduction of data and more details about tokenization are in Appendix A.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 2: $L _ { 2 }$ loss curves during training image tokenizers. All the above methods finally converge to a similar loss level.
|
| 78 |
+
|
| 79 |
+
# 2.3 Auto-regressive Transformer
|
| 80 |
+
|
| 81 |
+
The backbone of CogView is a unidirectional Transformer (GPT). The Transformer has 48 layers, with the hidden size of 2560, 40 attention heads and 4 billion parameters in total. As shown in Figure 3, four seperator tokens, [ROI1] (reference text of image), [BASE], [BOI1] (beginning of image), [EOI1] (end of image) are added to each sequence to indicate the boundaries of text and image. All the sequences are clipped or padded to a length of 1088.
|
| 82 |
+
|
| 83 |
+
The pretext task of pretraining is left-to-right token prediction, a.k.a. language modeling. Both image and text tokens are equally treated. DALL-E [39] suggests to lower the loss weight of text tokens; on the contrary, during small-scale experiments we surprisingly find the text modeling is the key for the success of text-to-image pretraining. If the loss weight of text tokens is set to zero, the model will fail to find the connections between text and image and generate images totally unrelated to the input text.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 3: The framework of CogView. [ROI1], [BASE1], etc., are seperator tokens.
|
| 87 |
+
|
| 88 |
+
We hypothesize that text modeling abstracts knowledge in hidden layers, which can be efficiently exploited during the later image modeling.
|
| 89 |
+
|
| 90 |
+
We train the model with batch size of 6,144 sequences (6.7 million tokens per batch) for 144,000 steps on 512 V100 GPUs (32GB). The parameters are updated by Adam with max $l r = 3 \times 1 0 ^ { - 4 } , \beta _ { 1 } \overset { \cdot } { = }$ $0 . 9 , \beta _ { 2 } = 0 . 9 5$ , weight decay $= 4 \times 1 0 ^ { - 2 }$ . The learning rate warms up during the first $2 \%$ steps and decays with cosine annealing [34]. With hyperparameters in an appropriate range, we find that the training loss mainly depends on the total number of trained tokens (tokens per batch $\times$ steps), which means that doubling the batch size (and learning rate) results in a very similar loss if the same number of tokens are trained. Thus, we use a relatively large batch size to improve the parallelism and reduce the percentage of time for communication. We also design a three-region sparse attention to speed up training and save memory without hurting the performance, which is introduced in Appendix B.
|
| 91 |
+
|
| 92 |
+
# 2.4 Stabilization of training
|
| 93 |
+
|
| 94 |
+
Currently, pretraining large models $\scriptstyle ( > 2 \mathrm { { B } }$ parameters) usually relies on 16-bit precision to save GPU memory and speed up the computation. Many frameworks, e.g. DeepSpeed ZeRO [40], even only support FP16 parameters. However, text-to-image pretraining is very unstable under 16-bit precision. Training a 4B ordinary pre-LN Transformer will quickly result in NaN loss within 1,000 iterations. To stabilize the training is the most challenging part of CogView, which is well-aligned with DALL-E.
|
| 95 |
+
|
| 96 |
+
We summarize the solution of DALL-E as to tolerate the numerical problem of training. Since the values and gradients vary dramatically in scale in different layers, they propose a new mixed-precision framework per-resblock loss scaling and store all gains, biases, embeddings, and unembeddings in 32-bit precision, with 32-bit gradients. This solution is complex, consuming extra time and memory and not supported by most current training frameworks.
|
| 97 |
+
|
| 98 |
+
CogView instead regularizes the values. We find that there are two kinds of instability: overflow (characterized by NaN losses) and underflow (characterized by diverging loss). The following techniques are proposed to solve them.
|
| 99 |
+
|
| 100 |
+
Precision Bottleneck Relaxation (PB-Relax). After analyzing the dynamics of training, we find that overflow always happens at two bottleneck operations, the final LayerNorm or attention.
|
| 101 |
+
|
| 102 |
+
• In the deep layers, the values of the outputs could explode to be as large as $1 0 ^ { 4 } ~ \sim$ $1 0 ^ { 5 }$ , making the variation in LayerNorm overflow. Luckily, as LayerNorm $\left( x \right) \mathbf { \Psi } =$ LayerNorm $\bar { ( x / \operatorname* { m a x } ( x ) ) }$ , we can relax this bottleneck by dividing the maximum first4.
|
| 103 |
+
|
| 104 |
+
• The attention scores $Q ^ { T } K / \sqrt { d }$ could be significantly larger than input elements, and result in overflow. Changing the computational order into $Q ^ { T } ( K / \sqrt { d } )$ alleviates the problem.√ To eliminate the overflow, we notice that softmax $( Q ^ { T } K / \sqrt { d } ) = \mathrm { s o f t m a x } ( Q ^ { T } K / \sqrt { d } -$ constant), meaning that we can change the computation of attention into
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 4: (a) Illustration of different LayerNorm structures in Transformers. Post-LN is from the original paper; Pre-LN is the most popular structure currently; Sandwich-LN is our proposed structure to stabilize training. (b) The numerical scales in our toy experiments with 64 layers and a large learning rate. Trainings without Sandwich-LN overflow in main branch; trainings without PB-relax overflow in attention; Only the training with both can continue.
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\operatorname { s o f t m a x } ( \frac { Q ^ { T } K } { \sqrt { d } } ) = \operatorname { s o f t m a x } \bigg ( \big ( \frac { Q ^ { T } } { \alpha \sqrt { d } } K - \operatorname * { m a x } ( \frac { Q ^ { T } } { \alpha \sqrt { d } } K ) \big ) \times \alpha \bigg ) ,
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $\alpha$ is a big number, e.g. $\alpha = 3 2$ .5 In this way, the maximum (absolute value) of attention scores are also divided by $\alpha$ to prevent it from overflow. A detailed analysis about the attention in CogView is in Appendix C.
|
| 114 |
+
|
| 115 |
+
Sandwich LayerNorm (Sandwich-LN). The LayerNorms [1] in Transformers are essential for stable training. Pre-LN [50] is proven to converge faster and more stable than the original Post-LN, and becomes the default structure of Transformer layers in recent works. However, it is not enough for text-to-image pretraining. The output of LayerNorm $\begin{array} { r } { \frac { ( x - \bar { x } ) \sqrt { d } } { \sqrt { \sum _ { i } ( x _ { i } - \bar { x } ) ^ { 2 } } } \gamma + \beta } \end{array}$ 2 γ + β is basically proportional to the square root of the hidden size of $x$ , which is ${ \sqrt { d } } = { \sqrt { 2 5 6 0 } } \approx 5 0$ in CogView. If input values in some dimensions are obviously larger than the others – which is true for Transformers – output values in these dimensions will also be large $( 1 0 ^ { 1 } \sim 1 0 ^ { 2 }$ ). In the residual branch, these large values are magnified and be added back to the main branch, which aggravates this phenomenon in the next layer, and finally causes the value explosion in the deep layers.
|
| 116 |
+
|
| 117 |
+
This reason behind value explosion inspires us to restrict the layer-by-layer aggravation. We propose Sandwich LayerNorm, which also adds a LayerNorm at the end of each residual branch. SandwichLN ensures the scale of input values in each layer within a reasonable range, and experiments on training 500M model shows that its influence on convergence is negligible. Figure 4(a) illustrates different LayerNorm structures in Transformers.
|
| 118 |
+
|
| 119 |
+
Toy Experiments. Figure 4(b) shows the effectiveness of PB-relax and Sandwich-LN with a toy experimental setting, since training many large models for verification is not realistic. We find that deep transformers (64 layers, 1024 hidden size), large learning rates (0.1 or 0.01), small batch size (4) can simulate the value explosion in training with reasonable hyperparameters. PB-relax $^ +$ Sandwich-LN can even stabilize the toy experiments.
|
| 120 |
+
|
| 121 |
+
Shrink embedding gradient. Although we did not observe any sign of underflow after using Sandwich-LN, we find that the gradient of token embeddings is much larger than that of the other parameters, so that simply shrinking its scale by $\alpha = 0 . 1$ increases the dynamic loss scale to further prevent underflow, which can be implemented by emb $=$ emb\*alpha+emb.detach $\mathtt { ( ) } \ast \mathtt { ( 1 \mathrm { - a l p h a ) } }$ in Pytorch. It seems to slow down the updating of token embeddings, but actually does not hurt performance in our experiments, which also corresponds to a recent work MoCo v3 [9].
|
| 122 |
+
|
| 123 |
+
Discussion. The PB-relax and Sandwich-LN successfully stabilize the training of CogView and a 8.3B-parameter CogView-large. They are also general for all Transformer pretraining, and will enable the training of very deep Transformers in the future. As an evidence, we used PB-relax successfully eliminating the overflow in training a 10B-parameter GLM [14]. However, in general, the precision problems in language pretraining is not so significant as in text-to-image pretraining. We hypothesize that the root is the heterogeneity of data, because we observed that text and image tokens are distinguished by scale in some hidden states. Another possible reason is hard-to-find underflow, guessed by DALL-E. A thorough investigation is left for future work.
|
| 124 |
+
|
| 125 |
+
# 3 Finetuning
|
| 126 |
+
|
| 127 |
+
CogView steps further than DALL-E on finetuning. Especially, we can improve the text-to-image generation via finetuning CogView for super-resolution and self-reranking. All the finetuning tasks can be completed within one day on a single DGX-2.
|
| 128 |
+
|
| 129 |
+
# 3.1 Super-resolution
|
| 130 |
+
|
| 131 |
+
Since the image tokenizer compresses $2 5 6 \times 2 5 6$ -pixel images into $3 2 \times 3 2$ -token sequences before training, the generated images are blurrier than real images due to the lossy compression. However, enlarging the sequence length will consume much more computation and memory due to the $O ( n ^ { 2 } )$ complex of attention operations. Previous works [13] about super-resolution, or image restoration, usually deal with images already in high resolution, mapping the blurred local textures to clear ones. They cannot be applied to our case, where we need to add meaningful details to the generated low-resolution images. Figure 5 (b) is an example of our finetuning method, and illustrates our desired behavior of super-resolution.
|
| 132 |
+
|
| 133 |
+
The motivation of our finetuning solution for super-resolution is a belief that CogView is trained on the most complex distribution in general domain, and the objects of different resolution has already been covered.6 Therefore, finetuning CogView for super-resolution should not be hard.
|
| 134 |
+
|
| 135 |
+
Specifically, we first finetune CogView into a conditional super-resolution model from $1 6 \times 1 6$ image tokens to $3 2 \times 3 2$ tokens. Then we magnify an image of $3 2 \times 3 2$ tokens to $6 4 \times 6 4$ tokens $( 5 1 2 \times 5 1 2$ pixels) patch-by-patch via a center-continuous sliding-window strategy in Figure 5 (a). This order performs better that the raster-scan order in preserving the completeness of the central area.
|
| 136 |
+
|
| 137 |
+
To prepare data, we crop about 2 million images to $2 5 6 \times 2 5 6$ regions and downsample them to $1 2 8 \times 1 2 8$ . After tokenization, we get $3 2 \times 3 2$ and $1 6 \times 1 6$ sequence pairs for different resolution. The pattern of finetuning sequence is “[ROI1] text tokens [BASE][BOI1] $1 6 \times 1 6$ image tokens [EOI1] [ROI2][BASE] [BOI2] $3 2 \times 3 2$ image tokens [EOI2]”, longer than the max position embedding index 1087. As a solution, we recount the position index from 0 at [ROI2].7
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 5: (a) A $6 4 \times 6 4$ -token image are generated patch-by-patch in the numerical order. The overlapping positions will not be overwritten. The key idea is to make the tokens in the 2nd and 4th regions – usually regions of faces or other important parts – generated when attending to the whole region. (b) The finetuned super-resolution model does not barely transform the textures, but generates new local structures, e.g. the open mouth or tail in the example.
|
| 141 |
+
|
| 142 |
+
# 3.2 Image Captioning and Self-reranking
|
| 143 |
+
|
| 144 |
+
To finetune CogView for image captioning is straightforward: exchanging the order of text and image tokens in the input sequences. Since the model has already learnt the corresponding relationships between text and images, reversing the generation is not hard. We did not evaluate the performance due to that (1) there is no authoritative Chinese image captioning benchmark (2) image captioning is not the focus of this work. The main purpose of finetuning such a model is for self-reranking.
|
| 145 |
+
|
| 146 |
+
We propose the Caption Loss (CapLoss) to evaluate the correspondence between images and text. More specifically, $\begin{array} { r } { \mathrm { { \bar { \ c a p L o s s } } } ( x , t ) \ = \ \frac { 1 } { | t | } \sum _ { i = 0 } ^ { | t | } - \log p ( t _ { i } | x , t _ { 0 : i - 1 } ) } \end{array}$ , where $t$ is a sequence of text tokens and $x$ is the image. $\mathrm { C a p L o s s } ( x , t )$ is the cross-entropy loss for the text tokens, and this method can be seen as an adaptation of inverse prompting [56] for text-to-image generation. Finally, images with the lowest CapLosses are chosen.
|
| 147 |
+
|
| 148 |
+
Compared to additionally training another constrastive self-supervised model, e.g. CLIP [38], for reranking, our method consumes less computational resource because we only need finetuning. The results in Figure 9 shows the images selected by our methods performs better in FID than those selected by CLIP. Figure 6 shows an example for reranking.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 6: 60 generated images for “A man in red shirt is playing video games” (selected at random from COCO), displayed in the order of CapLoss. Most bad cases are ranked in last places. The diversity also eases the concern that CogView might be overfitting a similar image in the training set.
|
| 152 |
+
|
| 153 |
+
# 3.3 Style Learning
|
| 154 |
+
|
| 155 |
+
Although CogView is pretrained to cover diverse images as possible, the desire to generate images of a specific style or topic cannot be satisfied well. We finetune models on four styles: Chinese traditional drawing, oil painting, sketch, and cartoon. Images of these styles are automatically extracted from search engine pages including Google, Baidu and Bing, etc., with keyword as “An image of $\{ \mathsf { s t y l e } \}$ style”, where {style} is the name of style. We finetune the model for different styles separately, with 1,000 images each.
|
| 156 |
+
|
| 157 |
+
During finetuning, the corresponding text for the images are also “An image of $\{ \mathsf { s t y l e } \}$ style“. When generating, the text is “A {object} of $\{ \mathsf { s t y l e } \}$ style“, where $\{ \mathsf { o b j e c t } \}$ is the object to generate. In this way, CogView can transfer the knowledge of shape of the objects learned from pretraining to the style of finetuning. Figure 7 shows examples for the styles.
|
| 158 |
+
|
| 159 |
+

|
| 160 |
+
Figure 7: Generated images for “The Oriental Pearl” (a landmark of Shanghai) in different styles.
|
| 161 |
+
|
| 162 |
+
# 3.4 Industrial Fashion Design
|
| 163 |
+
|
| 164 |
+
When the generation targets at a single domain, the complexity of the textures are largely reduced. In these scenarios, we can (1) train a VQGAN [15] instead of VQVAE for the latent variable for more realistic textures, (2) decrease the number of parameters and increase the length of sequences for a higher resolution. Our three-region sparse attention (Appendix B) can speed up the generation of high-resolution images in this case.
|
| 165 |
+
|
| 166 |
+
We train a 3B-parameter model on about 10 million fashion-caption pairs, using $5 0 \times 5 0$ VQGAN image tokens and decodes them into $8 0 0 \times 8 0 0$ pixels. Figure 8 shows samples of CogView for fashion design, which has been successfully deployed to Alibaba Rhino fashion production.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 8: Generated images for fashion design.
|
| 170 |
+
|
| 171 |
+
# 4 Experimental Results
|
| 172 |
+
|
| 173 |
+
# 4.1 Machine Evaluation
|
| 174 |
+
|
| 175 |
+
At present, the most authoritative machine evaluation metrics for general-domain text-to-image generation is the FID on MS COCO, which is not included in our training set. To compare with DALL-E, we follow the same setting, evaluating CogView on a subset of 30,000 captions sampled from the dataset, after applying a Gaussian filter with varying radius to both the ground-truth and generated images.8 The captions are translated into Chinese for CogView by machine translation. To fairly compare with DALL-E, we do not use super-resolution. Besides, DALL-E generates 512 images for each caption and selects the best one by CLIP, which needs to generate about 15 billion tokens. To save computational resource, we select the best one from 60 generated images according to their CapLosses. The evaluation of CapLoss is on a subset of 5,000 images. We finally enhance the contrast of generated images by 1.5. Table 1 shows the metrics for CogView and other methods.
|
| 176 |
+
|
| 177 |
+
Table 1: Metrics for machine evaluation. Statistics about DALL-E and GANs are extracted from their figures. FID- $k$ means that all the images are blurred by a Gaussian Filter with radius $k$ .
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Model</td><td>FID-0</td><td>FID-1</td><td>FID-2</td><td>FID-4</td><td>FID-8</td><td>IS</td><td>CapLoss</td></tr><tr><td>AttnGAN</td><td>35.2</td><td>44.0</td><td>72.0</td><td>108.0</td><td>100.0</td><td>23.3</td><td>3.01</td></tr><tr><td>DM-GAN</td><td>26.5</td><td>39.0</td><td>73.0</td><td>119.0</td><td>112.3</td><td>32.2</td><td>2.87</td></tr><tr><td>DF-GAN</td><td>26.5</td><td>33.8</td><td>55.9</td><td>91.0</td><td>97.0</td><td>18.7</td><td>3.09</td></tr><tr><td>DALL-E</td><td>27.5</td><td>28.0</td><td>45.5</td><td>83.5</td><td>85.0</td><td>17.9</td><td>1</td></tr><tr><td>CogView</td><td>27.1</td><td>19.4</td><td>13.9</td><td>19.4</td><td>23.6</td><td>18.2</td><td>2.43</td></tr></table>
|
| 180 |
+
|
| 181 |
+
Caption Loss as a Metric. FID and IS are designed to measure the quality of unconditional generation from relatively simple distributions, usually single objects. However, text-to-image generation should be evaluated pair-by-pair. Table 1 shows that DM-GAN achieves the best unblurred FID and IS, but is ranked last in human preference (Figure 10(a)). Caption Loss is an absolute (instead of relative, like CLIP) score, so that it can be averaged across samples. It should be a better metrics for this task and is more consistent with the overall scores of our human evaluation in $\ S 4 . 2$ .
|
| 182 |
+
|
| 183 |
+
Comparing self-reranking with CLIP. We evaluate the FID-0 and IS of CogView-generated images selected by CLIP and self-reranking on MS COCO. Figure 9 shows the curves with different number of candidates. Self-reranking gets better FID, and steadily refines FID as the number of candidates increases. CLIP performs better in increasing IS, but as discussed above, it is not a suitable metric for this task.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 9: IS and FID-0 for CLIP and self-ranking.
|
| 187 |
+
|
| 188 |
+
Discussion about the differences in performance between CogView and DALL-E. Since DALLE is pretrained with more data and parameters than CogView, why CogView gets a better FID even without super-resolution? It is hard to know the accurate reason, because DALL-E is not open-source, but we guess that the reasons include: (1) CogView uses PB-relax and Sandwich-LN for a more stable optimization. (2) DALL-E uses many cartoon and rendered data, making the texture of generated images quite different from that of the photos in MS COCO. (3) Self-reranking selects images better in FID than CLIP. (4) CogView is trained longer (96B trained tokens in CogView vs. 56B trained tokens in DALL-E).
|
| 189 |
+
|
| 190 |
+
# 4.2 Human Evaluation
|
| 191 |
+
|
| 192 |
+
Human evaluation is much more persuasive than machine evaluation on text-to-image generation. Our human evaluation consists of 2,950 groups of comparison between images generated by AttnGAN, DM-GAN, DF-GAN, CogView, and recovered ground truth, i.e., the ground truth blurred by our image tokenizer. Details and example-based comparison between models are in Appendix E.
|
| 193 |
+
|
| 194 |
+
Results in Figure 10 show that CogView outperforms GAN-based baselines at a large margin. CogView is chosen as the best one with probability $3 7 . 0 2 \%$ , competitive with the performance of recovered ground truth $( 5 9 . 5 3 \% )$ . Figure 10(b)(c) also indicates our super-resolution model consistently improves the quality of images, especially the clarity, which even outperforms the recovered ground truth.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 10: Human Evaluation results. The recovered ground truth is obtained by first encoding the ground truth image and then decoding it, which is theoretically the upper bound of CogView.
|
| 198 |
+
|
| 199 |
+
# 5 Conclusion and Discussion
|
| 200 |
+
|
| 201 |
+
Limitations. A disadvantage of CogView is the slow generation, which is common for auto-regressive model, because each image is generated token-by-token. The blurriness brought by VQVAE is also an important limitation. These problems will be solved in the future work.
|
| 202 |
+
|
| 203 |
+
Ethics Concerns. Similar to Deepfake, CogView is vulnerable to malicious use [49] because of its controllable and strong capacity to generate images. The possible methods to mitigate this issue are discussed in a survey [5]. Moreover, there are usually fairness problems in generative models about human 9. In Appendix D, we analyze the situation about fairness in CogView and introduce a simple “word replacing” method to solve this problem.
|
| 204 |
+
|
| 205 |
+
We systematically investigate the framework of combining VQVAE and Transformers for text-toimage generation. CogView demonstrates promising results for scalable cross-modal generative pretraining, and also reveals and solves the precision problems probably originating from data heterogeneity. We also introduce methods to finetune CogView for diverse downstream tasks. We hope that CogView could advance both research and application of controllable image generation and cross-modal knowledge understanding, but need to prevent it from being used to create images for misinformation.
|
| 206 |
+
|
| 207 |
+
# Acknowledgments and Disclosure of Funding
|
| 208 |
+
|
| 209 |
+
We would like to thank Zhao Xue, Zhengxiao Du, Hanxiao Qu, Hanyu Zhao, Sha Yuan, Yukuo Cen, Xiao Liu, An Yang, Yiming Ju for their help in data, machine maintaining or discussion. We would also thank Zhilin Yang for presenting this work at the conference of BAAI.
|
| 210 |
+
|
| 211 |
+
Funding in direct support of this work: a fund for GPUs donated by BAAI, a research fund from Alibaba Group, NSFC for Distinguished Young Scholar (61825602), NSFC (61836013).
|
| 212 |
+
|
| 213 |
+
# References
|
| 214 |
+
|
| 215 |
+
[1] J. L. Ba, J. R. Kiros, and G. E. Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 216 |
+
[2] Y. Bengio, N. Léonard, and A. Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 217 |
+
[3] H. M. Bonnici, F. R. Richter, Y. Yazar, and J. S. Simons. Multimodal feature integration in the angular gyrus during episodic and semantic retrieval. Journal of Neuroscience, 36(20): 5462–5471, 2016.
|
| 218 |
+
[4] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
|
| 219 |
+
[5] M. Brundage, S. Avin, J. Clark, H. Toner, P. Eckersley, B. Garfinkel, A. Dafoe, P. Scharre, T. Zeitzoff, B. Filar, et al. The malicious use of artificial intelligence: Forecasting, prevention, and mitigation. arXiv preprint arXiv:1802.07228, 2018.
|
| 220 |
+
[6] A. Caliskan, J. J. Bryson, and A. Narayanan. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183–186, 2017.
|
| 221 |
+
[7] M. Chen, A. Radford, R. Child, J. Wu, H. Jun, D. Luan, and I. Sutskever. Generative pretraining from pixels. In International Conference on Machine Learning, pages 1691–1703. PMLR, 2020.
|
| 222 |
+
[8] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597–1607. PMLR, 2020.
|
| 223 |
+
[9] X. Chen, S. Xie, and K. He. An empirical study of training self-supervised visual transformers. arXiv preprint arXiv:2104.02057, 2021.
|
| 224 |
+
[10] K. Clark, U. Khandelwal, O. Levy, and C. D. Manning. What does bert look at? an analysis of bert’s attention. arXiv preprint arXiv:1906.04341, 2019.
|
| 225 |
+
[11] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 226 |
+
[12] M. Ding. The road from MLE to EM to VAE: A brief tutorial. URL https://www. researchgate.net/profile/Ming-Ding-2/publication/342347643_The_Road_ from_MLE_to_EM_to_VAE_A_Brief_Tutorial/links/5f1e986792851cd5fa4b2290/ The-Road-from-MLE-to-EM-to-VAE-A-Brief-Tutorial.pdf.
|
| 227 |
+
[13] C. Dong, C. C. Loy, K. He, and X. Tang. Learning a deep convolutional network for image super-resolution. In European conference on computer vision, pages 184–199. Springer, 2014.
|
| 228 |
+
[14] Z. Du, Y. Qian, X. Liu, M. Ding, J. Qiu, Z. Yang, and J. Tang. All nlp tasks are generation tasks: A general pretraining framework. arXiv preprint arXiv:2103.10360, 2021.
|
| 229 |
+
[15] P. Esser, R. Rombach, and B. Ommer. Taming transformers for high-resolution image synthesis. arXiv preprint arXiv:2012.09841, 2020.
|
| 230 |
+
|
| 231 |
+
[16] P. Gage. A new algorithm for data compression. C Users Journal, 12(2):23–38, 1994.
|
| 232 |
+
|
| 233 |
+
[17] J. Gasquet. Cézanne. pages 159–186, 1926.
|
| 234 |
+
|
| 235 |
+
[18] X. Glorot and Y. Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pages 249–256. JMLR Workshop and Conference Proceedings, 2010.
|
| 236 |
+
|
| 237 |
+
[19] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014.
|
| 238 |
+
|
| 239 |
+
[20] K. Gregor, I. Danihelka, A. Graves, D. Rezende, and D. Wierstra. Draw: A recurrent neural network for image generation. In International Conference on Machine Learning, pages 1462–1471. PMLR, 2015.
|
| 240 |
+
|
| 241 |
+
[21] J.-B. Grill, F. Strub, F. Altché, C. Tallec, P. H. Richemond, E. Buchatskaya, C. Doersch, B. A. Pires, Z. D. Guo, M. G. Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020.
|
| 242 |
+
|
| 243 |
+
[22] K. Grill-Spector and R. Malach. The human visual cortex. Annu. Rev. Neurosci., 27:649–677, 2004.
|
| 244 |
+
|
| 245 |
+
[23] J. He, D. Spokoyny, G. Neubig, and T. Berg-Kirkpatrick. Lagging inference networks and posterior collapse in variational autoencoders. In International Conference on Learning Representations, 2018.
|
| 246 |
+
|
| 247 |
+
[24] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9729–9738, 2020.
|
| 248 |
+
|
| 249 |
+
[25] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6629–6640, 2017.
|
| 250 |
+
|
| 251 |
+
[26] D. P. Kingma and M. Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 252 |
+
|
| 253 |
+
[27] J. Y. Koh, J. Baldridge, H. Lee, and Y. Yang. Text-to-image generation grounded by fine-grained user attention. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 237–246, 2021.
|
| 254 |
+
|
| 255 |
+
[28] T. Kudo and J. Richardson. SentencePiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 66–71, Brussels, Belgium, Nov. 2018. Association for Computational Linguistics. doi: 10.18653/v1/ D18-2012. URL https://www.aclweb.org/anthology/D18-2012.
|
| 256 |
+
|
| 257 |
+
[29] W. Li, P. Zhang, L. Zhang, Q. Huang, X. He, S. Lyu, and J. Gao. Object-driven text-to-image synthesis via adversarial training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12174–12182, 2019.
|
| 258 |
+
|
| 259 |
+
[30] J. Lin, R. Men, A. Yang, C. Zhou, M. Ding, Y. Zhang, P. Wang, A. Wang, L. Jiang, X. Jia, et al. M6: A chinese multimodal pretrainer. arXiv preprint arXiv:2103.00823, 2021.
|
| 260 |
+
|
| 261 |
+
[31] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740–755. Springer, 2014.
|
| 262 |
+
|
| 263 |
+
[32] X. Liu, F. Zhang, Z. Hou, Z. Wang, L. Mian, J. Zhang, and J. Tang. Self-supervised learning: Generative or contrastive. arXiv preprint arXiv:2006.08218, 1(2), 2020.
|
| 264 |
+
|
| 265 |
+
[33] X. Liu, Y. Zheng, Z. Du, M. Ding, Y. Qian, Z. Yang, and J. Tang. Gpt understands, too. arXiv preprint arXiv:2103.10385, 2021.
|
| 266 |
+
|
| 267 |
+
[34] I. Loshchilov and F. Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016.
|
| 268 |
+
[35] E. Mansimov, E. Parisotto, J. L. Ba, and R. Salakhutdinov. Generating images from captions with attention. ICLR, 2016.
|
| 269 |
+
[36] N. Parmar, A. Vaswani, J. Uszkoreit, L. Kaiser, N. Shazeer, A. Ku, and D. Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018.
|
| 270 |
+
[37] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
|
| 271 |
+
[38] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark, et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021.
|
| 272 |
+
[39] A. Ramesh, M. Pavlov, G. Goh, S. Gray, C. Voss, A. Radford, M. Chen, and I. Sutskever. Zero-shot text-to-image generation. arXiv preprint arXiv:2102.12092, 2021.
|
| 273 |
+
[40] J. Rasley, S. Rajbhandari, O. Ruwase, and Y. He. Deepspeed: System optimizations enable training deep learning models with over 100 billion parameters. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 3505–3506, 2020.
|
| 274 |
+
[41] A. Razavi, A. v. d. Oord, and O. Vinyals. Generating diverse high-fidelity images with vq-vae-2. arXiv preprint arXiv:1906.00446, 2019.
|
| 275 |
+
[42] S. Reed, Z. Akata, X. Yan, L. Logeswaran, B. Schiele, and H. Lee. Generative adversarial text to image synthesis. In International Conference on Machine Learning, pages 1060–1069. PMLR, 2016.
|
| 276 |
+
[43] T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. Improved techniques for training gans. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 2234–2242, 2016.
|
| 277 |
+
[44] P. Sharma, N. Ding, S. Goodman, and R. Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2556–2565, 2018.
|
| 278 |
+
[45] M. Tao, H. Tang, S. Wu, N. Sebe, F. Wu, and X.-Y. Jing. Df-gan: Deep fusion generative adversarial networks for text-to-image synthesis. arXiv preprint arXiv:2008.05865, 2020.
|
| 279 |
+
[46] A. van den Oord, O. Vinyals, and K. Kavukcuoglu. Neural discrete representation learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6309–6318, 2017.
|
| 280 |
+
[47] A. Van Oord, N. Kalchbrenner, and K. Kavukcuoglu. Pixel recurrent neural networks. In International Conference on Machine Learning, pages 1747–1756. PMLR, 2016.
|
| 281 |
+
[48] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 282 |
+
[49] M. Westerlund. The emergence of deepfake technology: A review. Technology Innovation Management Review, 9(11), 2019.
|
| 283 |
+
[50] R. Xiong, Y. Yang, D. He, K. Zheng, S. Zheng, C. Xing, H. Zhang, Y. Lan, L. Wang, and T. Liu. On layer normalization in the transformer architecture. In International Conference on Machine Learning, pages 10524–10533. PMLR, 2020.
|
| 284 |
+
[51] T. Xu, P. Zhang, Q. Huang, H. Zhang, Z. Gan, X. Huang, and X. He. Attngan: Fine-grained text to image generation with attentional generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1316–1324, 2018.
|
| 285 |
+
[52] S. Yuan, H. Zhao, Z. Du, M. Ding, X. Liu, Y. Cen, X. Zou, and Z. Yang. Wudaocorpora: A super large-scale chinese corpora for pre-training language models. Preprint, 2021.
|
| 286 |
+
[53] M. Zaheer, G. Guruganesh, A. Dubey, J. Ainslie, C. Alberti, S. Ontanon, P. Pham, A. Ravula, Q. Wang, L. Yang, et al. Big bird: Transformers for longer sequences. arXiv preprint arXiv:2007.14062, 2020.
|
| 287 |
+
[54] H. Zhang, T. Xu, H. Li, S. Zhang, X. Wang, X. Huang, and D. N. Metaxas. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 5907–5915, 2017.
|
| 288 |
+
[55] M. Zhu, P. Pan, W. Chen, and Y. Yang. Dm-gan: Dynamic memory generative adversarial networks for text-to-image synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5802–5810, 2019.
|
| 289 |
+
[56] X. Zou, D. Yin, Q. Zhong, H. Yang, Z. Yang, and J. Tang. Controllable generation from pre-trained language models via inverse prompting. arXiv preprint arXiv:2103.10685, 2021.
|
parse/train/cnWSyJNmeCE/cnWSyJNmeCE_content_list.json
ADDED
|
@@ -0,0 +1,1414 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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"Ming Ding†, Zhuoyi $\\mathbf { Y a n g } ^ { \\dagger }$ , Wenyi $\\mathbf { H o n g } ^ { \\dagger }$ , Wendi Zheng†, Chang Zhou‡, Da Yin†, Junyang $\\mathbf { L i n } ^ { \\ddagger }$ , $\\mathbf { X } \\mathbf { u } \\mathbf { Z } \\mathbf { o } \\mathbf { u } ^ { \\dagger }$ , Zhou Shao♠, Hongxia Yang‡, Jie Tang†♠ †Tsinghua University ‡DAMO Academy, Alibaba Group ♠BAAI {dm18@mails, jietang@mail}.tsinghua.edu.cn ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
215,
|
| 19 |
+
220,
|
| 20 |
+
784,
|
| 21 |
+
280
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "Abstract ",
|
| 28 |
+
"text_level": 1,
|
| 29 |
+
"bbox": [
|
| 30 |
+
462,
|
| 31 |
+
315,
|
| 32 |
+
535,
|
| 33 |
+
332
|
| 34 |
+
],
|
| 35 |
+
"page_idx": 0
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"type": "text",
|
| 39 |
+
"text": "Text-to-Image generation in the general domain has long been an open problem, which requires both a powerful generative model and cross-modal understanding. We propose CogView, a 4-billion-parameter Transformer with VQ-VAE tokenizer to advance this problem. We also demonstrate the finetuning strategies for various downstream tasks, e.g. style learning, super-resolution, text-image ranking and fashion design, and methods to stabilize pretraining, e.g. eliminating NaN losses. CogView achieves the state-of-the-art FID on the blurred MS COCO dataset, outperforming previous GAN-based models and a recent similar work DALL-E. 1 ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
232,
|
| 42 |
+
344,
|
| 43 |
+
767,
|
| 44 |
+
457
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "image",
|
| 50 |
+
"img_path": "images/7947f768b2efbbe0940b319e488f3d18fac634253cee549c3e729f5a6ccb7cc3.jpg",
|
| 51 |
+
"image_caption": [
|
| 52 |
+
"Figure 1: Samples generated by CogView. The text in the first line is either from MS COCO (outside our training set) or user queries on our demo website. The images in the second line are finetuned results for different styles or super-resolution. The actual input text is in Chinese, which is translated into English here for better understanding. More samples for captions from MS COCO are included in Appendix F. "
|
| 53 |
+
],
|
| 54 |
+
"image_footnote": [],
|
| 55 |
+
"bbox": [
|
| 56 |
+
173,
|
| 57 |
+
472,
|
| 58 |
+
823,
|
| 59 |
+
694
|
| 60 |
+
],
|
| 61 |
+
"page_idx": 0
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"type": "text",
|
| 65 |
+
"text": "1 Introduction ",
|
| 66 |
+
"text_level": 1,
|
| 67 |
+
"bbox": [
|
| 68 |
+
176,
|
| 69 |
+
794,
|
| 70 |
+
312,
|
| 71 |
+
810
|
| 72 |
+
],
|
| 73 |
+
"page_idx": 0
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"type": "text",
|
| 77 |
+
"text": "“There are two things for a painter, the eye and the mind... eyes, through which we view the nature; brain, in which we organize sensations by logic for meaningful expression.” (Paul Cézanne [17]) ",
|
| 78 |
+
"bbox": [
|
| 79 |
+
232,
|
| 80 |
+
825,
|
| 81 |
+
766,
|
| 82 |
+
867
|
| 83 |
+
],
|
| 84 |
+
"page_idx": 0
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"type": "text",
|
| 88 |
+
"text": "As contrastive self-supervised pretraining has revolutionized computer vision (CV) [24, 21, 8, 32], visual-language pretraining, which brings high-level semantics to images, is becoming the next frontier of visual understanding [38, 30, 39]. Among various pretext tasks, text-to-image generation expects the model to (1) disentangle shape, color, gesture and other features from pixels, (2) understand the input text, (2) align objects and features with corresponding words and their synonyms and (4) learn complex distributions to generate the overlapping and composite of different objects and features, which, like painting, is beyond basic visual functions (related to eyes and the V1–V4 in brain [22]), requiring a higher-level cognitive ability (more related to the angular gyrus in brain [3]). ",
|
| 89 |
+
"bbox": [
|
| 90 |
+
174,
|
| 91 |
+
90,
|
| 92 |
+
825,
|
| 93 |
+
203
|
| 94 |
+
],
|
| 95 |
+
"page_idx": 1
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
"type": "text",
|
| 99 |
+
"text": "The attempts to teach machines text-to-image generation can be traced to the early times of deep generative models, when Mansimov et al. [35] added text information to DRAW [20]. Then Generative Adversarial Nets [19] (GANs) began to dominate this task. Reed et al. [42] fed the text embeddings to both generator and discriminator as extra inputs. StackGAN [54] decomposed the generation into a sketch-refinement process. AttnGAN [51] used attention on words to focus on the corresponding subregion. ObjectGAN [29] generated images following a text boxes layouts image process. DM-GAN [55] and DF-GAN [45] introduced new architectures, e.g. dyanmic memory or deep fusion block, for better image refinement. Although these GAN-based models can perform reasonable synthesis in simple and domain-specific dataset, e.g. Caltech-UCSD Birds 200 (CUB), the results on complex and domain-general scenes, e.g. MS COCO [31], are far from satisfactory. ",
|
| 100 |
+
"bbox": [
|
| 101 |
+
174,
|
| 102 |
+
208,
|
| 103 |
+
825,
|
| 104 |
+
347
|
| 105 |
+
],
|
| 106 |
+
"page_idx": 1
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"type": "text",
|
| 110 |
+
"text": "Recent years have seen a rise of the auto-regressive generative models. Generative Pre-Training (GPT) models [37, 4] leveraged Transformers [48] to learn language models in large-scale corpus, greatly promoting the performance of natural language generation and few-shot language understanding [33]. Auto-regressive model is not nascent in CV. PixelCNN, PixelRNN [47] and Image Transformer [36] factorized the probability density function on an image over its sub-pixels (color channels in a pixel) with different network backbones, showing promising results. However, a real image usually comprises millions of sub-pixels, indicating an unaffordable amount of computation for large models. Even the biggest pixel-level auto-regressive model, ImageGPT [7], was pretrained on ImageNet at a max resolution of only $9 6 \\times 9 6$ . ",
|
| 111 |
+
"bbox": [
|
| 112 |
+
174,
|
| 113 |
+
353,
|
| 114 |
+
825,
|
| 115 |
+
478
|
| 116 |
+
],
|
| 117 |
+
"page_idx": 1
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
"type": "text",
|
| 121 |
+
"text": "The framework of Vector Quantized Variational AutoEncoders (VQ-VAE) [46] alleviates this problem. VQ-VAE trains an encoder to compress the image into a low-dimensional discrete latent space, and a decoder to recover the image from the hidden variable in the stage 1. Then in the stage 2, an auto-regressive model (such as PixelCNN [47]) learns to fit the prior of hidden variables. This discrete compression loses less fidelity than direct downsampling, meanwhile maintains the spatial relevance of pixels. Therefore, VQ-VAE revitalized the auto-regressive models in CV [41]. Following this framework, Esser et al. [15] used Transformer to fit the prior and further switches from $L _ { 2 }$ loss to GAN loss for the decoder training, greatly improving the performance of domain-specific unconditional generation. ",
|
| 122 |
+
"bbox": [
|
| 123 |
+
174,
|
| 124 |
+
484,
|
| 125 |
+
825,
|
| 126 |
+
608
|
| 127 |
+
],
|
| 128 |
+
"page_idx": 1
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"type": "text",
|
| 132 |
+
"text": "The idea of CogView comes naturally: large-scale generative joint pretraining for both text and image (from VQ-VAE) tokens. We collect 30 million high-quality (Chinese) text-image pairs and pretrain a Transformer with 4 billion parameters. However, large-scale text-to-image generative pretraining could be very unstable due to the heterogeneity of data. We systematically analyze the reasons and solved this problem by the proposed Precision Bottleneck Relaxation and Sandwich Layernorm. As a result, CogView greatly advances the quality of text-to-image generation. ",
|
| 133 |
+
"bbox": [
|
| 134 |
+
174,
|
| 135 |
+
614,
|
| 136 |
+
825,
|
| 137 |
+
698
|
| 138 |
+
],
|
| 139 |
+
"page_idx": 1
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"type": "text",
|
| 143 |
+
"text": "A recent work DALL-E [39] independently proposed the same idea, and was released earlier than CogView. Compared with DALL-E, CogView steps forward on the following four aspects: ",
|
| 144 |
+
"bbox": [
|
| 145 |
+
173,
|
| 146 |
+
704,
|
| 147 |
+
821,
|
| 148 |
+
733
|
| 149 |
+
],
|
| 150 |
+
"page_idx": 1
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"type": "text",
|
| 154 |
+
"text": "• CogView outperforms DALL-E and previous GAN-based methods at a large margin according to the Fréchet Inception Distance (FID) [25] on blurred MS COCO, and is the first open-source large text-to-image transformer. \n• Beyond zero-shot generation, we further investigate the potential of finetuning the pretrained CogView. CogView can be adapted for diverse downstream tasks, such as style learning (domain-specific text-to-image), super-resolution (image-to-image), image captioning (image-to-text), and even text-image reranking. \nThe finetuned CogView enables self-reranking for post-selection, and gets rid of an additional CLIP model [38] in DALL-E. It also provides a new metric Caption Loss to measure the quality and accuracy for text-image generation at a finer granularity than FID and Inception Score (IS) [43]. ",
|
| 155 |
+
"bbox": [
|
| 156 |
+
215,
|
| 157 |
+
744,
|
| 158 |
+
826,
|
| 159 |
+
911
|
| 160 |
+
],
|
| 161 |
+
"page_idx": 1
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"type": "text",
|
| 165 |
+
"text": "• We proposed PB-relaxation and Sandwich-LN to stabilize the training of large Transformers on complex datasets. These techniques are very simple and can eliminate overflow in forwarding (characterized as NaN losses), and make CogView able to be trained with almost FP16 $( \\mathbf { O } 2 ^ { \\bar { 2 } } )$ ). They can also be generalized to the training of other transformers. ",
|
| 166 |
+
"bbox": [
|
| 167 |
+
217,
|
| 168 |
+
90,
|
| 169 |
+
825,
|
| 170 |
+
147
|
| 171 |
+
],
|
| 172 |
+
"page_idx": 2
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"type": "text",
|
| 176 |
+
"text": "2 Method ",
|
| 177 |
+
"text_level": 1,
|
| 178 |
+
"bbox": [
|
| 179 |
+
173,
|
| 180 |
+
169,
|
| 181 |
+
271,
|
| 182 |
+
186
|
| 183 |
+
],
|
| 184 |
+
"page_idx": 2
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"type": "text",
|
| 188 |
+
"text": "2.1 Theory ",
|
| 189 |
+
"text_level": 1,
|
| 190 |
+
"bbox": [
|
| 191 |
+
173,
|
| 192 |
+
203,
|
| 193 |
+
264,
|
| 194 |
+
218
|
| 195 |
+
],
|
| 196 |
+
"page_idx": 2
|
| 197 |
+
},
|
| 198 |
+
{
|
| 199 |
+
"type": "text",
|
| 200 |
+
"text": "In this section, we will derive the theory of CogView from $\\mathrm { V A E } ^ { 3 }$ [26]: CogView optimizes the Evidence Lower BOund (ELBO) of joint likelihood of image and text. The following derivation will turn into a clear re-interpretation of VQ-VAE if without text t. ",
|
| 201 |
+
"bbox": [
|
| 202 |
+
176,
|
| 203 |
+
228,
|
| 204 |
+
825,
|
| 205 |
+
272
|
| 206 |
+
],
|
| 207 |
+
"page_idx": 2
|
| 208 |
+
},
|
| 209 |
+
{
|
| 210 |
+
"type": "text",
|
| 211 |
+
"text": "Suppose the dataset $( { \\bf X } , { \\bf T } ) = \\{ x _ { i } , t _ { i } \\} _ { i = 1 } ^ { N }$ consists of $N$ i.i.d. samples of image variable $\\mathbf { x }$ and its description text variable t. We assume the image $\\mathbf { x }$ can be generated by a random process involving a latent variable $\\mathbf { z }$ : (1) $t _ { i }$ is first generated from a prior $p ( \\mathbf { t } ; \\theta )$ . (2) $z _ { i }$ is then generated from the conditional distribution $p ( \\mathbf { z } | \\mathbf { t } = t _ { i } ; \\boldsymbol { \\theta } )$ . (3) $x _ { i }$ is finally generated from $p ( \\mathbf { x } | \\mathbf { z } = z _ { i } ; \\psi )$ . We will use a shorthand form like $p ( x _ { i } )$ to refer to $p ( \\mathbf { x } = x _ { i } )$ in the following part. ",
|
| 212 |
+
"bbox": [
|
| 213 |
+
173,
|
| 214 |
+
276,
|
| 215 |
+
825,
|
| 216 |
+
348
|
| 217 |
+
],
|
| 218 |
+
"page_idx": 2
|
| 219 |
+
},
|
| 220 |
+
{
|
| 221 |
+
"type": "text",
|
| 222 |
+
"text": "Let $q ( \\mathbf { z } | x _ { i } ; \\phi )$ be the variational distribution, which is the output of the encoder $\\phi$ of VAE. The log-likelihood and the evidence lower bound (ELBO) can be written as: ",
|
| 223 |
+
"bbox": [
|
| 224 |
+
169,
|
| 225 |
+
353,
|
| 226 |
+
823,
|
| 227 |
+
382
|
| 228 |
+
],
|
| 229 |
+
"page_idx": 2
|
| 230 |
+
},
|
| 231 |
+
{
|
| 232 |
+
"type": "equation",
|
| 233 |
+
"img_path": "images/e0592903bdf38f521e6f7b90d5d0cdfe5b2bba043975f35935facbbd7a7565cc.jpg",
|
| 234 |
+
"text": "$$\n\\begin{array} { l } { { \\displaystyle \\log p ( { \\bf X } , { \\bf T } ; \\theta , \\psi ) = \\sum _ { i = 1 } ^ { N } \\log p ( t _ { i } ; \\theta ) + \\sum _ { i = 1 } ^ { N } \\log p ( x _ { i } | t _ { i } ; \\theta , \\psi ) } \\ ~ } \\\\ { { \\displaystyle \\geq - \\sum _ { i = 1 } ^ { N } \\left( \\underbrace { - \\log p ( t _ { i } ; \\theta ) } _ { \\mathrm { ~ N L ~ l o s s ~ f o r ~ t e x t } } + \\underbrace { \\mathbb { E } _ { z _ { i } \\sim q ( z | x _ { i } ; \\phi ) } [ - \\log p ( x _ { i } | z _ { i } ; \\psi ) ] } _ { \\mathrm { ~ r e c o n s t u c t i o n ~ l o s s } } + \\underbrace { \\mathrm { K L } \\big ( q ( { \\bf z } | x _ { i } ; \\phi ) \\big | \\big | p ( { \\bf z } | t _ { i } ; \\theta ) \\big ) } _ { \\mathrm { ~ K L ~ b e t w e e n ~ } q \\mathrm { ~ a n d ~ ( t e x t ~ c o n d i t i o n a l ) ~ p r i o r } } \\right) } . } \\end{array}\n$$",
|
| 235 |
+
"text_format": "latex",
|
| 236 |
+
"bbox": [
|
| 237 |
+
186,
|
| 238 |
+
390,
|
| 239 |
+
792,
|
| 240 |
+
494
|
| 241 |
+
],
|
| 242 |
+
"page_idx": 2
|
| 243 |
+
},
|
| 244 |
+
{
|
| 245 |
+
"type": "text",
|
| 246 |
+
"text": "The framework of VQ-VAE differs with traditional VAE mainly in the KL term. Traditional VAE fixes the prior $p ( \\mathbf { z } | t _ { i } ; \\mathbf { \\boldsymbol { \\theta } } )$ , usually as $\\mathcal { N } ( 0 , \\bf { I } )$ , and learns the encoder $\\phi$ . However, it leads to posterior collapse [23], meaning that $q ( \\mathbf { z } | x _ { i } ; \\phi )$ sometimes collapses towards the prior. VQ-VAE turns to fix $\\phi$ and fit the prior $p ( \\mathbf { z } | t _ { i } ; \\mathbf { \\boldsymbol { \\theta } } )$ with another model parameterized by $\\theta$ . This technique eliminates posterior collapse, because the encoder $\\phi$ is now only updated for the optimization of the reconstruction loss. In exchange, the approximated posterior $q ( \\mathbf { z } | x _ { i } ; \\phi )$ could be very different for different $x _ { i }$ , so we need a very powerful model for $p ( \\mathbf { z } | t _ { i } ; \\mathbf { \\boldsymbol { \\theta } } )$ to minimize the KL term. ",
|
| 247 |
+
"bbox": [
|
| 248 |
+
173,
|
| 249 |
+
502,
|
| 250 |
+
826,
|
| 251 |
+
601
|
| 252 |
+
],
|
| 253 |
+
"page_idx": 2
|
| 254 |
+
},
|
| 255 |
+
{
|
| 256 |
+
"type": "text",
|
| 257 |
+
"text": "Currently, the most powerful generative model, Transformer (GPT), copes with sequences of tokens over a discrete codebook. To use it, we make $\\mathbf { z } \\in \\{ 0 , . . . , | V | - 1 \\} ^ { h \\times w }$ , where $| V |$ is the size of codebook and $h \\times w$ is the number of dimensions of $\\mathbf { z }$ . The sequences $z _ { i }$ can be either sampled from $q ( \\mathbf { z } | x _ { i } ; \\phi )$ , or directly $z _ { i } = \\mathrm { a r g m a x } _ { \\mathbf { z } } q ( \\mathbf { z } | x _ { i } ; \\boldsymbol { \\phi } )$ . We choose the latter for simplicity, so that $q ( \\mathbf { z } | x _ { i } ; \\phi )$ becomes a one-point distribution on $z _ { i }$ . The Equation (2) can be rewritten as: ",
|
| 258 |
+
"bbox": [
|
| 259 |
+
174,
|
| 260 |
+
604,
|
| 261 |
+
825,
|
| 262 |
+
676
|
| 263 |
+
],
|
| 264 |
+
"page_idx": 2
|
| 265 |
+
},
|
| 266 |
+
{
|
| 267 |
+
"type": "equation",
|
| 268 |
+
"img_path": "images/aa50d0c96f19a3b163fd5c115de89d56d521360364bebe3ab2b131fcbb7c141a.jpg",
|
| 269 |
+
"text": "$$\n- \\sum _ { i = 1 } ^ { N } \\bigg ( \\underbrace { \\mathbb { E } } _ { \\underbrace { z _ { i } \\sim q ( \\mathbf { z } | x _ { i } ; \\phi ) } _ { \\mathrm { r e c o n s t r u c t i o n ~ l o s s } } } \\bigl [ - \\log p ( x _ { i } | z _ { i } ; \\psi ) \\bigr ] \\underbrace { - \\log p ( t _ { i } ; \\theta ) } _ { \\mathrm { N L ~ l o s s ~ f o r ~ t e x t } } \\underbrace { - \\log p ( z _ { i } | t _ { i } ; \\theta ) } _ { \\mathrm { N L ~ l o s s ~ f o r ~ \\mathbf { z } ~ } } \\bigg ) .\n$$",
|
| 270 |
+
"text_format": "latex",
|
| 271 |
+
"bbox": [
|
| 272 |
+
259,
|
| 273 |
+
684,
|
| 274 |
+
735,
|
| 275 |
+
742
|
| 276 |
+
],
|
| 277 |
+
"page_idx": 2
|
| 278 |
+
},
|
| 279 |
+
{
|
| 280 |
+
"type": "text",
|
| 281 |
+
"text": "The learning process is then divided into two stages: (1) The encoder $\\phi$ and decoder $\\psi$ learn to minimize the reconstruction loss. (2) A single GPT optimizes the two negative log-likelihood (NLL) losses by concatenating text $t _ { i }$ and $z _ { i }$ as an input sequence. ",
|
| 282 |
+
"bbox": [
|
| 283 |
+
174,
|
| 284 |
+
752,
|
| 285 |
+
823,
|
| 286 |
+
795
|
| 287 |
+
],
|
| 288 |
+
"page_idx": 2
|
| 289 |
+
},
|
| 290 |
+
{
|
| 291 |
+
"type": "text",
|
| 292 |
+
"text": "As a result, the first stage degenerates into a pure discrete Auto-Encoder, serving as an image tokenizer to transform an image to a sequence of tokens; the GPT in the second stage undertakes most of the modeling task. Figure 3 illustrates the framework of CogView. ",
|
| 293 |
+
"bbox": [
|
| 294 |
+
173,
|
| 295 |
+
800,
|
| 296 |
+
825,
|
| 297 |
+
843
|
| 298 |
+
],
|
| 299 |
+
"page_idx": 2
|
| 300 |
+
},
|
| 301 |
+
{
|
| 302 |
+
"type": "text",
|
| 303 |
+
"text": "2.2 Tokenization ",
|
| 304 |
+
"text_level": 1,
|
| 305 |
+
"bbox": [
|
| 306 |
+
174,
|
| 307 |
+
92,
|
| 308 |
+
303,
|
| 309 |
+
106
|
| 310 |
+
],
|
| 311 |
+
"page_idx": 3
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"type": "text",
|
| 315 |
+
"text": "In this section, we will introduce the details about the tokenizers in CogView and a comparison about different training strategies about the image tokenizer (VQVAE stage 1). ",
|
| 316 |
+
"bbox": [
|
| 317 |
+
174,
|
| 318 |
+
116,
|
| 319 |
+
823,
|
| 320 |
+
145
|
| 321 |
+
],
|
| 322 |
+
"page_idx": 3
|
| 323 |
+
},
|
| 324 |
+
{
|
| 325 |
+
"type": "text",
|
| 326 |
+
"text": "Tokenization for text is already well-studied, e.g. BPE [16] and SentencePiece [28]. In CogView, we ran SentencePiece on a large Chinese corpus to extract 50,000 text tokens. ",
|
| 327 |
+
"bbox": [
|
| 328 |
+
173,
|
| 329 |
+
150,
|
| 330 |
+
823,
|
| 331 |
+
179
|
| 332 |
+
],
|
| 333 |
+
"page_idx": 3
|
| 334 |
+
},
|
| 335 |
+
{
|
| 336 |
+
"type": "text",
|
| 337 |
+
"text": "The image tokenizer is a discrete Auto-Encoder, which is similar to the stage 1 of VQ-VAE [46] or d-VAE [39]. More specifically, the Encoder $\\phi$ maps an image $x$ of shape $H \\times W \\times 3$ into $\\operatorname { E n c } _ { \\phi } ( x )$ of shape $h \\times w \\times d$ , and then each $d -$ dimensional vector is quantized to a nearby embedding in a learnable codebook $\\{ v _ { 0 } , . . . , v _ { | V | - 1 } \\} , \\forall v _ { k } \\in \\mathbb { R } ^ { d }$ . The quantized result can be represented by $h \\times w$ indices of embeddings, and then we get the latent variable $\\mathbf { z } \\in \\{ 0 , . . . , | V | - 1 \\} ^ { h \\times w }$ . The Decoder $\\psi$ maps the quantized vectors back to a (blurred) image to reconstruct the input. In our 4B-parameter CogView, $| V | = 8 1 9 2 , d = 2 5 6 , H = W = 2 5 6 , h = w = 3 2 .$ . ",
|
| 338 |
+
"bbox": [
|
| 339 |
+
174,
|
| 340 |
+
185,
|
| 341 |
+
825,
|
| 342 |
+
286
|
| 343 |
+
],
|
| 344 |
+
"page_idx": 3
|
| 345 |
+
},
|
| 346 |
+
{
|
| 347 |
+
"type": "text",
|
| 348 |
+
"text": "The training of the image tokenizer is non-trivial due to the existence of discrete selection. Here we introduce four methods to train an image tokenizer. ",
|
| 349 |
+
"bbox": [
|
| 350 |
+
173,
|
| 351 |
+
291,
|
| 352 |
+
823,
|
| 353 |
+
319
|
| 354 |
+
],
|
| 355 |
+
"page_idx": 3
|
| 356 |
+
},
|
| 357 |
+
{
|
| 358 |
+
"type": "text",
|
| 359 |
+
"text": "• The nearest-neighbor mapping, straight-through estimator [2], which is proposed by the original VQVAE. A common concern of this method [39] is that, when the codebook is large and not initialized carefully, only a few of embeddings will be used due to the curse of dimensionality. We did not observe this phenomenon in the experiments. Gumbel sampling, straight-through estimator. If we follow the original VAE to reparameterize a categorical distribution of latent variable $\\mathbf { z }$ based on distance between vectors, i.e. $\\begin{array} { r } { p ( \\mathbf { z } _ { i \\times w + j } = v _ { k } | x ) = \\frac { e ^ { - \\| v _ { k } - \\mathrm { E n c } _ { \\phi } ( x ) _ { i j } \\| _ { 2 } / \\tau } } { \\sum _ { k = 0 } ^ { | V | - 1 } e ^ { - \\| v _ { k } - \\mathrm { E n c } _ { \\phi } ( x ) _ { i j } \\| _ { 2 } / \\tau } } } \\end{array}$ k φ ij 2 −kvk−Encφ(x)ijk2/τ , an unbiased sampling strategy is $z _ { i \\times w + j } = \\mathrm { a r g m a x } _ { k } g _ { k } - \\| v _ { k } - \\mathrm { E n c } _ { \\phi } ( x ) _ { i j } \\| _ { 2 } / \\tau$ , $g _ { k } \\sim \\mathrm { G u m b e l } ( 0 , 1 )$ , where the temperature $\\tau$ is gradually decreased to 0. We can further use the differentiable softmax to approximate the one-hot distribution from argmax. DALL-E adopts this method with many other tricks to stabilize the training. • The nearest-neighbor mapping, moving average, where each embedding in the codebook is updated periodically during training as the mean of the vectors recently mapped to it [46]. • The nearest-neighbor mapping, fixed codebook, where the codebook is fixed after initialized. ",
|
| 360 |
+
"bbox": [
|
| 361 |
+
215,
|
| 362 |
+
333,
|
| 363 |
+
825,
|
| 364 |
+
553
|
| 365 |
+
],
|
| 366 |
+
"page_idx": 3
|
| 367 |
+
},
|
| 368 |
+
{
|
| 369 |
+
"type": "text",
|
| 370 |
+
"text": "Comparison. To compare the methods, we train four image tokenizers with the same architecture on the same dataset and random seed, and demonstrate the loss curves in Figure 2. We find that all the methods are basically evenly matched, meaning that the learning of the embeddings in the codebook is not very important, if initialized properly. In pretraining, we use the tokenizer of moving average method. ",
|
| 371 |
+
"bbox": [
|
| 372 |
+
174,
|
| 373 |
+
565,
|
| 374 |
+
537,
|
| 375 |
+
676
|
| 376 |
+
],
|
| 377 |
+
"page_idx": 3
|
| 378 |
+
},
|
| 379 |
+
{
|
| 380 |
+
"type": "text",
|
| 381 |
+
"text": "The introduction of data and more details about tokenization are in Appendix A. ",
|
| 382 |
+
"bbox": [
|
| 383 |
+
173,
|
| 384 |
+
683,
|
| 385 |
+
537,
|
| 386 |
+
710
|
| 387 |
+
],
|
| 388 |
+
"page_idx": 3
|
| 389 |
+
},
|
| 390 |
+
{
|
| 391 |
+
"type": "image",
|
| 392 |
+
"img_path": "images/f313f682531376d3859f6bb9f64cf99d2dad3f2098787da73b31c7c4a19682f3.jpg",
|
| 393 |
+
"image_caption": [
|
| 394 |
+
"Figure 2: $L _ { 2 }$ loss curves during training image tokenizers. All the above methods finally converge to a similar loss level. "
|
| 395 |
+
],
|
| 396 |
+
"image_footnote": [],
|
| 397 |
+
"bbox": [
|
| 398 |
+
552,
|
| 399 |
+
565,
|
| 400 |
+
821,
|
| 401 |
+
722
|
| 402 |
+
],
|
| 403 |
+
"page_idx": 3
|
| 404 |
+
},
|
| 405 |
+
{
|
| 406 |
+
"type": "text",
|
| 407 |
+
"text": "2.3 Auto-regressive Transformer ",
|
| 408 |
+
"text_level": 1,
|
| 409 |
+
"bbox": [
|
| 410 |
+
174,
|
| 411 |
+
727,
|
| 412 |
+
411,
|
| 413 |
+
741
|
| 414 |
+
],
|
| 415 |
+
"page_idx": 3
|
| 416 |
+
},
|
| 417 |
+
{
|
| 418 |
+
"type": "text",
|
| 419 |
+
"text": "The backbone of CogView is a unidirectional Transformer (GPT). The Transformer has 48 layers, with the hidden size of 2560, 40 attention heads and 4 billion parameters in total. As shown in Figure 3, four seperator tokens, [ROI1] (reference text of image), [BASE], [BOI1] (beginning of image), [EOI1] (end of image) are added to each sequence to indicate the boundaries of text and image. All the sequences are clipped or padded to a length of 1088. ",
|
| 420 |
+
"bbox": [
|
| 421 |
+
174,
|
| 422 |
+
752,
|
| 423 |
+
537,
|
| 424 |
+
780
|
| 425 |
+
],
|
| 426 |
+
"page_idx": 3
|
| 427 |
+
},
|
| 428 |
+
{
|
| 429 |
+
"type": "text",
|
| 430 |
+
"text": "",
|
| 431 |
+
"bbox": [
|
| 432 |
+
173,
|
| 433 |
+
780,
|
| 434 |
+
825,
|
| 435 |
+
835
|
| 436 |
+
],
|
| 437 |
+
"page_idx": 3
|
| 438 |
+
},
|
| 439 |
+
{
|
| 440 |
+
"type": "text",
|
| 441 |
+
"text": "The pretext task of pretraining is left-to-right token prediction, a.k.a. language modeling. Both image and text tokens are equally treated. DALL-E [39] suggests to lower the loss weight of text tokens; on the contrary, during small-scale experiments we surprisingly find the text modeling is the key for the success of text-to-image pretraining. If the loss weight of text tokens is set to zero, the model will fail to find the connections between text and image and generate images totally unrelated to the input text. ",
|
| 442 |
+
"bbox": [
|
| 443 |
+
174,
|
| 444 |
+
842,
|
| 445 |
+
825,
|
| 446 |
+
911
|
| 447 |
+
],
|
| 448 |
+
"page_idx": 3
|
| 449 |
+
},
|
| 450 |
+
{
|
| 451 |
+
"type": "image",
|
| 452 |
+
"img_path": "images/d5719b94e74e4703d76722b813fc7ec9fa998e9f90f1c82af723be3560d8cc50.jpg",
|
| 453 |
+
"image_caption": [
|
| 454 |
+
"Figure 3: The framework of CogView. [ROI1], [BASE1], etc., are seperator tokens. "
|
| 455 |
+
],
|
| 456 |
+
"image_footnote": [],
|
| 457 |
+
"bbox": [
|
| 458 |
+
173,
|
| 459 |
+
93,
|
| 460 |
+
825,
|
| 461 |
+
291
|
| 462 |
+
],
|
| 463 |
+
"page_idx": 4
|
| 464 |
+
},
|
| 465 |
+
{
|
| 466 |
+
"type": "text",
|
| 467 |
+
"text": "We hypothesize that text modeling abstracts knowledge in hidden layers, which can be efficiently exploited during the later image modeling. ",
|
| 468 |
+
"bbox": [
|
| 469 |
+
173,
|
| 470 |
+
333,
|
| 471 |
+
821,
|
| 472 |
+
361
|
| 473 |
+
],
|
| 474 |
+
"page_idx": 4
|
| 475 |
+
},
|
| 476 |
+
{
|
| 477 |
+
"type": "text",
|
| 478 |
+
"text": "We train the model with batch size of 6,144 sequences (6.7 million tokens per batch) for 144,000 steps on 512 V100 GPUs (32GB). The parameters are updated by Adam with max $l r = 3 \\times 1 0 ^ { - 4 } , \\beta _ { 1 } \\overset { \\cdot } { = }$ $0 . 9 , \\beta _ { 2 } = 0 . 9 5$ , weight decay $= 4 \\times 1 0 ^ { - 2 }$ . The learning rate warms up during the first $2 \\%$ steps and decays with cosine annealing [34]. With hyperparameters in an appropriate range, we find that the training loss mainly depends on the total number of trained tokens (tokens per batch $\\times$ steps), which means that doubling the batch size (and learning rate) results in a very similar loss if the same number of tokens are trained. Thus, we use a relatively large batch size to improve the parallelism and reduce the percentage of time for communication. We also design a three-region sparse attention to speed up training and save memory without hurting the performance, which is introduced in Appendix B. ",
|
| 479 |
+
"bbox": [
|
| 480 |
+
173,
|
| 481 |
+
367,
|
| 482 |
+
825,
|
| 483 |
+
492
|
| 484 |
+
],
|
| 485 |
+
"page_idx": 4
|
| 486 |
+
},
|
| 487 |
+
{
|
| 488 |
+
"type": "text",
|
| 489 |
+
"text": "2.4 Stabilization of training ",
|
| 490 |
+
"text_level": 1,
|
| 491 |
+
"bbox": [
|
| 492 |
+
176,
|
| 493 |
+
512,
|
| 494 |
+
379,
|
| 495 |
+
526
|
| 496 |
+
],
|
| 497 |
+
"page_idx": 4
|
| 498 |
+
},
|
| 499 |
+
{
|
| 500 |
+
"type": "text",
|
| 501 |
+
"text": "Currently, pretraining large models $\\scriptstyle ( > 2 \\mathrm { { B } }$ parameters) usually relies on 16-bit precision to save GPU memory and speed up the computation. Many frameworks, e.g. DeepSpeed ZeRO [40], even only support FP16 parameters. However, text-to-image pretraining is very unstable under 16-bit precision. Training a 4B ordinary pre-LN Transformer will quickly result in NaN loss within 1,000 iterations. To stabilize the training is the most challenging part of CogView, which is well-aligned with DALL-E. ",
|
| 502 |
+
"bbox": [
|
| 503 |
+
174,
|
| 504 |
+
539,
|
| 505 |
+
825,
|
| 506 |
+
609
|
| 507 |
+
],
|
| 508 |
+
"page_idx": 4
|
| 509 |
+
},
|
| 510 |
+
{
|
| 511 |
+
"type": "text",
|
| 512 |
+
"text": "We summarize the solution of DALL-E as to tolerate the numerical problem of training. Since the values and gradients vary dramatically in scale in different layers, they propose a new mixed-precision framework per-resblock loss scaling and store all gains, biases, embeddings, and unembeddings in 32-bit precision, with 32-bit gradients. This solution is complex, consuming extra time and memory and not supported by most current training frameworks. ",
|
| 513 |
+
"bbox": [
|
| 514 |
+
174,
|
| 515 |
+
614,
|
| 516 |
+
825,
|
| 517 |
+
684
|
| 518 |
+
],
|
| 519 |
+
"page_idx": 4
|
| 520 |
+
},
|
| 521 |
+
{
|
| 522 |
+
"type": "text",
|
| 523 |
+
"text": "CogView instead regularizes the values. We find that there are two kinds of instability: overflow (characterized by NaN losses) and underflow (characterized by diverging loss). The following techniques are proposed to solve them. ",
|
| 524 |
+
"bbox": [
|
| 525 |
+
176,
|
| 526 |
+
690,
|
| 527 |
+
823,
|
| 528 |
+
732
|
| 529 |
+
],
|
| 530 |
+
"page_idx": 4
|
| 531 |
+
},
|
| 532 |
+
{
|
| 533 |
+
"type": "text",
|
| 534 |
+
"text": "Precision Bottleneck Relaxation (PB-Relax). After analyzing the dynamics of training, we find that overflow always happens at two bottleneck operations, the final LayerNorm or attention. ",
|
| 535 |
+
"bbox": [
|
| 536 |
+
173,
|
| 537 |
+
738,
|
| 538 |
+
823,
|
| 539 |
+
767
|
| 540 |
+
],
|
| 541 |
+
"page_idx": 4
|
| 542 |
+
},
|
| 543 |
+
{
|
| 544 |
+
"type": "text",
|
| 545 |
+
"text": "• In the deep layers, the values of the outputs could explode to be as large as $1 0 ^ { 4 } ~ \\sim$ $1 0 ^ { 5 }$ , making the variation in LayerNorm overflow. Luckily, as LayerNorm $\\left( x \\right) \\mathbf { \\Psi } =$ LayerNorm $\\bar { ( x / \\operatorname* { m a x } ( x ) ) }$ , we can relax this bottleneck by dividing the maximum first4. ",
|
| 546 |
+
"bbox": [
|
| 547 |
+
217,
|
| 548 |
+
780,
|
| 549 |
+
823,
|
| 550 |
+
823
|
| 551 |
+
],
|
| 552 |
+
"page_idx": 4
|
| 553 |
+
},
|
| 554 |
+
{
|
| 555 |
+
"type": "text",
|
| 556 |
+
"text": "• The attention scores $Q ^ { T } K / \\sqrt { d }$ could be significantly larger than input elements, and result in overflow. Changing the computational order into $Q ^ { T } ( K / \\sqrt { d } )$ alleviates the problem.√ To eliminate the overflow, we notice that softmax $( Q ^ { T } K / \\sqrt { d } ) = \\mathrm { s o f t m a x } ( Q ^ { T } K / \\sqrt { d } -$ constant), meaning that we can change the computation of attention into ",
|
| 557 |
+
"bbox": [
|
| 558 |
+
217,
|
| 559 |
+
830,
|
| 560 |
+
823,
|
| 561 |
+
880
|
| 562 |
+
],
|
| 563 |
+
"page_idx": 4
|
| 564 |
+
},
|
| 565 |
+
{
|
| 566 |
+
"type": "image",
|
| 567 |
+
"img_path": "images/636041c745c4a7cde7fb06af55ac46ab528b904ae274eddea4014f4e8e03cdc8.jpg",
|
| 568 |
+
"image_caption": [
|
| 569 |
+
"Figure 4: (a) Illustration of different LayerNorm structures in Transformers. Post-LN is from the original paper; Pre-LN is the most popular structure currently; Sandwich-LN is our proposed structure to stabilize training. (b) The numerical scales in our toy experiments with 64 layers and a large learning rate. Trainings without Sandwich-LN overflow in main branch; trainings without PB-relax overflow in attention; Only the training with both can continue. "
|
| 570 |
+
],
|
| 571 |
+
"image_footnote": [],
|
| 572 |
+
"bbox": [
|
| 573 |
+
179,
|
| 574 |
+
92,
|
| 575 |
+
813,
|
| 576 |
+
236
|
| 577 |
+
],
|
| 578 |
+
"page_idx": 5
|
| 579 |
+
},
|
| 580 |
+
{
|
| 581 |
+
"type": "text",
|
| 582 |
+
"text": "",
|
| 583 |
+
"bbox": [
|
| 584 |
+
232,
|
| 585 |
+
327,
|
| 586 |
+
705,
|
| 587 |
+
343
|
| 588 |
+
],
|
| 589 |
+
"page_idx": 5
|
| 590 |
+
},
|
| 591 |
+
{
|
| 592 |
+
"type": "equation",
|
| 593 |
+
"img_path": "images/ece1e9650d818524f1701e35fb580e3872d6e25474c627831f96524c75a4e06f.jpg",
|
| 594 |
+
"text": "$$\n\\operatorname { s o f t m a x } ( \\frac { Q ^ { T } K } { \\sqrt { d } } ) = \\operatorname { s o f t m a x } \\bigg ( \\big ( \\frac { Q ^ { T } } { \\alpha \\sqrt { d } } K - \\operatorname * { m a x } ( \\frac { Q ^ { T } } { \\alpha \\sqrt { d } } K ) \\big ) \\times \\alpha \\bigg ) ,\n$$",
|
| 595 |
+
"text_format": "latex",
|
| 596 |
+
"bbox": [
|
| 597 |
+
313,
|
| 598 |
+
348,
|
| 599 |
+
740,
|
| 600 |
+
385
|
| 601 |
+
],
|
| 602 |
+
"page_idx": 5
|
| 603 |
+
},
|
| 604 |
+
{
|
| 605 |
+
"type": "text",
|
| 606 |
+
"text": "where $\\alpha$ is a big number, e.g. $\\alpha = 3 2$ .5 In this way, the maximum (absolute value) of attention scores are also divided by $\\alpha$ to prevent it from overflow. A detailed analysis about the attention in CogView is in Appendix C. ",
|
| 607 |
+
"bbox": [
|
| 608 |
+
232,
|
| 609 |
+
391,
|
| 610 |
+
825,
|
| 611 |
+
434
|
| 612 |
+
],
|
| 613 |
+
"page_idx": 5
|
| 614 |
+
},
|
| 615 |
+
{
|
| 616 |
+
"type": "text",
|
| 617 |
+
"text": "Sandwich LayerNorm (Sandwich-LN). The LayerNorms [1] in Transformers are essential for stable training. Pre-LN [50] is proven to converge faster and more stable than the original Post-LN, and becomes the default structure of Transformer layers in recent works. However, it is not enough for text-to-image pretraining. The output of LayerNorm $\\begin{array} { r } { \\frac { ( x - \\bar { x } ) \\sqrt { d } } { \\sqrt { \\sum _ { i } ( x _ { i } - \\bar { x } ) ^ { 2 } } } \\gamma + \\beta } \\end{array}$ 2 γ + β is basically proportional to the square root of the hidden size of $x$ , which is ${ \\sqrt { d } } = { \\sqrt { 2 5 6 0 } } \\approx 5 0$ in CogView. If input values in some dimensions are obviously larger than the others – which is true for Transformers – output values in these dimensions will also be large $( 1 0 ^ { 1 } \\sim 1 0 ^ { 2 }$ ). In the residual branch, these large values are magnified and be added back to the main branch, which aggravates this phenomenon in the next layer, and finally causes the value explosion in the deep layers. ",
|
| 618 |
+
"bbox": [
|
| 619 |
+
173,
|
| 620 |
+
444,
|
| 621 |
+
825,
|
| 622 |
+
585
|
| 623 |
+
],
|
| 624 |
+
"page_idx": 5
|
| 625 |
+
},
|
| 626 |
+
{
|
| 627 |
+
"type": "text",
|
| 628 |
+
"text": "This reason behind value explosion inspires us to restrict the layer-by-layer aggravation. We propose Sandwich LayerNorm, which also adds a LayerNorm at the end of each residual branch. SandwichLN ensures the scale of input values in each layer within a reasonable range, and experiments on training 500M model shows that its influence on convergence is negligible. Figure 4(a) illustrates different LayerNorm structures in Transformers. ",
|
| 629 |
+
"bbox": [
|
| 630 |
+
174,
|
| 631 |
+
590,
|
| 632 |
+
825,
|
| 633 |
+
660
|
| 634 |
+
],
|
| 635 |
+
"page_idx": 5
|
| 636 |
+
},
|
| 637 |
+
{
|
| 638 |
+
"type": "text",
|
| 639 |
+
"text": "Toy Experiments. Figure 4(b) shows the effectiveness of PB-relax and Sandwich-LN with a toy experimental setting, since training many large models for verification is not realistic. We find that deep transformers (64 layers, 1024 hidden size), large learning rates (0.1 or 0.01), small batch size (4) can simulate the value explosion in training with reasonable hyperparameters. PB-relax $^ +$ Sandwich-LN can even stabilize the toy experiments. ",
|
| 640 |
+
"bbox": [
|
| 641 |
+
173,
|
| 642 |
+
666,
|
| 643 |
+
825,
|
| 644 |
+
736
|
| 645 |
+
],
|
| 646 |
+
"page_idx": 5
|
| 647 |
+
},
|
| 648 |
+
{
|
| 649 |
+
"type": "text",
|
| 650 |
+
"text": "Shrink embedding gradient. Although we did not observe any sign of underflow after using Sandwich-LN, we find that the gradient of token embeddings is much larger than that of the other parameters, so that simply shrinking its scale by $\\alpha = 0 . 1$ increases the dynamic loss scale to further prevent underflow, which can be implemented by emb $=$ emb\\*alpha+emb.detach $\\mathtt { ( ) } \\ast \\mathtt { ( 1 \\mathrm { - a l p h a ) } }$ in Pytorch. It seems to slow down the updating of token embeddings, but actually does not hurt performance in our experiments, which also corresponds to a recent work MoCo v3 [9]. ",
|
| 651 |
+
"bbox": [
|
| 652 |
+
173,
|
| 653 |
+
742,
|
| 654 |
+
825,
|
| 655 |
+
825
|
| 656 |
+
],
|
| 657 |
+
"page_idx": 5
|
| 658 |
+
},
|
| 659 |
+
{
|
| 660 |
+
"type": "text",
|
| 661 |
+
"text": "Discussion. The PB-relax and Sandwich-LN successfully stabilize the training of CogView and a 8.3B-parameter CogView-large. They are also general for all Transformer pretraining, and will enable the training of very deep Transformers in the future. As an evidence, we used PB-relax successfully eliminating the overflow in training a 10B-parameter GLM [14]. However, in general, the precision problems in language pretraining is not so significant as in text-to-image pretraining. We hypothesize that the root is the heterogeneity of data, because we observed that text and image tokens are distinguished by scale in some hidden states. Another possible reason is hard-to-find underflow, guessed by DALL-E. A thorough investigation is left for future work. ",
|
| 662 |
+
"bbox": [
|
| 663 |
+
174,
|
| 664 |
+
832,
|
| 665 |
+
825,
|
| 666 |
+
888
|
| 667 |
+
],
|
| 668 |
+
"page_idx": 5
|
| 669 |
+
},
|
| 670 |
+
{
|
| 671 |
+
"type": "text",
|
| 672 |
+
"text": "",
|
| 673 |
+
"bbox": [
|
| 674 |
+
174,
|
| 675 |
+
92,
|
| 676 |
+
825,
|
| 677 |
+
147
|
| 678 |
+
],
|
| 679 |
+
"page_idx": 6
|
| 680 |
+
},
|
| 681 |
+
{
|
| 682 |
+
"type": "text",
|
| 683 |
+
"text": "3 Finetuning ",
|
| 684 |
+
"text_level": 1,
|
| 685 |
+
"bbox": [
|
| 686 |
+
174,
|
| 687 |
+
174,
|
| 688 |
+
297,
|
| 689 |
+
191
|
| 690 |
+
],
|
| 691 |
+
"page_idx": 6
|
| 692 |
+
},
|
| 693 |
+
{
|
| 694 |
+
"type": "text",
|
| 695 |
+
"text": "CogView steps further than DALL-E on finetuning. Especially, we can improve the text-to-image generation via finetuning CogView for super-resolution and self-reranking. All the finetuning tasks can be completed within one day on a single DGX-2. ",
|
| 696 |
+
"bbox": [
|
| 697 |
+
174,
|
| 698 |
+
210,
|
| 699 |
+
825,
|
| 700 |
+
252
|
| 701 |
+
],
|
| 702 |
+
"page_idx": 6
|
| 703 |
+
},
|
| 704 |
+
{
|
| 705 |
+
"type": "text",
|
| 706 |
+
"text": "3.1 Super-resolution ",
|
| 707 |
+
"text_level": 1,
|
| 708 |
+
"bbox": [
|
| 709 |
+
176,
|
| 710 |
+
276,
|
| 711 |
+
328,
|
| 712 |
+
291
|
| 713 |
+
],
|
| 714 |
+
"page_idx": 6
|
| 715 |
+
},
|
| 716 |
+
{
|
| 717 |
+
"type": "text",
|
| 718 |
+
"text": "Since the image tokenizer compresses $2 5 6 \\times 2 5 6$ -pixel images into $3 2 \\times 3 2$ -token sequences before training, the generated images are blurrier than real images due to the lossy compression. However, enlarging the sequence length will consume much more computation and memory due to the $O ( n ^ { 2 } )$ complex of attention operations. Previous works [13] about super-resolution, or image restoration, usually deal with images already in high resolution, mapping the blurred local textures to clear ones. They cannot be applied to our case, where we need to add meaningful details to the generated low-resolution images. Figure 5 (b) is an example of our finetuning method, and illustrates our desired behavior of super-resolution. ",
|
| 719 |
+
"bbox": [
|
| 720 |
+
174,
|
| 721 |
+
304,
|
| 722 |
+
825,
|
| 723 |
+
416
|
| 724 |
+
],
|
| 725 |
+
"page_idx": 6
|
| 726 |
+
},
|
| 727 |
+
{
|
| 728 |
+
"type": "text",
|
| 729 |
+
"text": "The motivation of our finetuning solution for super-resolution is a belief that CogView is trained on the most complex distribution in general domain, and the objects of different resolution has already been covered.6 Therefore, finetuning CogView for super-resolution should not be hard. ",
|
| 730 |
+
"bbox": [
|
| 731 |
+
174,
|
| 732 |
+
422,
|
| 733 |
+
825,
|
| 734 |
+
464
|
| 735 |
+
],
|
| 736 |
+
"page_idx": 6
|
| 737 |
+
},
|
| 738 |
+
{
|
| 739 |
+
"type": "text",
|
| 740 |
+
"text": "Specifically, we first finetune CogView into a conditional super-resolution model from $1 6 \\times 1 6$ image tokens to $3 2 \\times 3 2$ tokens. Then we magnify an image of $3 2 \\times 3 2$ tokens to $6 4 \\times 6 4$ tokens $( 5 1 2 \\times 5 1 2$ pixels) patch-by-patch via a center-continuous sliding-window strategy in Figure 5 (a). This order performs better that the raster-scan order in preserving the completeness of the central area. ",
|
| 741 |
+
"bbox": [
|
| 742 |
+
174,
|
| 743 |
+
470,
|
| 744 |
+
825,
|
| 745 |
+
526
|
| 746 |
+
],
|
| 747 |
+
"page_idx": 6
|
| 748 |
+
},
|
| 749 |
+
{
|
| 750 |
+
"type": "text",
|
| 751 |
+
"text": "To prepare data, we crop about 2 million images to $2 5 6 \\times 2 5 6$ regions and downsample them to $1 2 8 \\times 1 2 8$ . After tokenization, we get $3 2 \\times 3 2$ and $1 6 \\times 1 6$ sequence pairs for different resolution. The pattern of finetuning sequence is “[ROI1] text tokens [BASE][BOI1] $1 6 \\times 1 6$ image tokens [EOI1] [ROI2][BASE] [BOI2] $3 2 \\times 3 2$ image tokens [EOI2]”, longer than the max position embedding index 1087. As a solution, we recount the position index from 0 at [ROI2].7 ",
|
| 752 |
+
"bbox": [
|
| 753 |
+
174,
|
| 754 |
+
532,
|
| 755 |
+
825,
|
| 756 |
+
603
|
| 757 |
+
],
|
| 758 |
+
"page_idx": 6
|
| 759 |
+
},
|
| 760 |
+
{
|
| 761 |
+
"type": "image",
|
| 762 |
+
"img_path": "images/1e017e540b711a01f18bc9d1a273a282297955c992d44b2f9a54678c395f02d5.jpg",
|
| 763 |
+
"image_caption": [
|
| 764 |
+
"Figure 5: (a) A $6 4 \\times 6 4$ -token image are generated patch-by-patch in the numerical order. The overlapping positions will not be overwritten. The key idea is to make the tokens in the 2nd and 4th regions – usually regions of faces or other important parts – generated when attending to the whole region. (b) The finetuned super-resolution model does not barely transform the textures, but generates new local structures, e.g. the open mouth or tail in the example. "
|
| 765 |
+
],
|
| 766 |
+
"image_footnote": [],
|
| 767 |
+
"bbox": [
|
| 768 |
+
197,
|
| 769 |
+
622,
|
| 770 |
+
823,
|
| 771 |
+
743
|
| 772 |
+
],
|
| 773 |
+
"page_idx": 6
|
| 774 |
+
},
|
| 775 |
+
{
|
| 776 |
+
"type": "text",
|
| 777 |
+
"text": "3.2 Image Captioning and Self-reranking ",
|
| 778 |
+
"text_level": 1,
|
| 779 |
+
"bbox": [
|
| 780 |
+
176,
|
| 781 |
+
90,
|
| 782 |
+
475,
|
| 783 |
+
106
|
| 784 |
+
],
|
| 785 |
+
"page_idx": 7
|
| 786 |
+
},
|
| 787 |
+
{
|
| 788 |
+
"type": "text",
|
| 789 |
+
"text": "To finetune CogView for image captioning is straightforward: exchanging the order of text and image tokens in the input sequences. Since the model has already learnt the corresponding relationships between text and images, reversing the generation is not hard. We did not evaluate the performance due to that (1) there is no authoritative Chinese image captioning benchmark (2) image captioning is not the focus of this work. The main purpose of finetuning such a model is for self-reranking. ",
|
| 790 |
+
"bbox": [
|
| 791 |
+
174,
|
| 792 |
+
117,
|
| 793 |
+
825,
|
| 794 |
+
188
|
| 795 |
+
],
|
| 796 |
+
"page_idx": 7
|
| 797 |
+
},
|
| 798 |
+
{
|
| 799 |
+
"type": "text",
|
| 800 |
+
"text": "We propose the Caption Loss (CapLoss) to evaluate the correspondence between images and text. More specifically, $\\begin{array} { r } { \\mathrm { { \\bar { \\ c a p L o s s } } } ( x , t ) \\ = \\ \\frac { 1 } { | t | } \\sum _ { i = 0 } ^ { | t | } - \\log p ( t _ { i } | x , t _ { 0 : i - 1 } ) } \\end{array}$ , where $t$ is a sequence of text tokens and $x$ is the image. $\\mathrm { C a p L o s s } ( x , t )$ is the cross-entropy loss for the text tokens, and this method can be seen as an adaptation of inverse prompting [56] for text-to-image generation. Finally, images with the lowest CapLosses are chosen. ",
|
| 801 |
+
"bbox": [
|
| 802 |
+
173,
|
| 803 |
+
193,
|
| 804 |
+
825,
|
| 805 |
+
270
|
| 806 |
+
],
|
| 807 |
+
"page_idx": 7
|
| 808 |
+
},
|
| 809 |
+
{
|
| 810 |
+
"type": "text",
|
| 811 |
+
"text": "Compared to additionally training another constrastive self-supervised model, e.g. CLIP [38], for reranking, our method consumes less computational resource because we only need finetuning. The results in Figure 9 shows the images selected by our methods performs better in FID than those selected by CLIP. Figure 6 shows an example for reranking. ",
|
| 812 |
+
"bbox": [
|
| 813 |
+
173,
|
| 814 |
+
276,
|
| 815 |
+
825,
|
| 816 |
+
332
|
| 817 |
+
],
|
| 818 |
+
"page_idx": 7
|
| 819 |
+
},
|
| 820 |
+
{
|
| 821 |
+
"type": "image",
|
| 822 |
+
"img_path": "images/c81d592d11a8b9c38f8c42973d644b683e8a91e5acc2b15924695fe791849d5b.jpg",
|
| 823 |
+
"image_caption": [
|
| 824 |
+
"Figure 6: 60 generated images for “A man in red shirt is playing video games” (selected at random from COCO), displayed in the order of CapLoss. Most bad cases are ranked in last places. The diversity also eases the concern that CogView might be overfitting a similar image in the training set. "
|
| 825 |
+
],
|
| 826 |
+
"image_footnote": [],
|
| 827 |
+
"bbox": [
|
| 828 |
+
174,
|
| 829 |
+
348,
|
| 830 |
+
825,
|
| 831 |
+
483
|
| 832 |
+
],
|
| 833 |
+
"page_idx": 7
|
| 834 |
+
},
|
| 835 |
+
{
|
| 836 |
+
"type": "text",
|
| 837 |
+
"text": "3.3 Style Learning ",
|
| 838 |
+
"text_level": 1,
|
| 839 |
+
"bbox": [
|
| 840 |
+
174,
|
| 841 |
+
560,
|
| 842 |
+
316,
|
| 843 |
+
575
|
| 844 |
+
],
|
| 845 |
+
"page_idx": 7
|
| 846 |
+
},
|
| 847 |
+
{
|
| 848 |
+
"type": "text",
|
| 849 |
+
"text": "Although CogView is pretrained to cover diverse images as possible, the desire to generate images of a specific style or topic cannot be satisfied well. We finetune models on four styles: Chinese traditional drawing, oil painting, sketch, and cartoon. Images of these styles are automatically extracted from search engine pages including Google, Baidu and Bing, etc., with keyword as “An image of $\\{ \\mathsf { s t y l e } \\}$ style”, where {style} is the name of style. We finetune the model for different styles separately, with 1,000 images each. ",
|
| 850 |
+
"bbox": [
|
| 851 |
+
174,
|
| 852 |
+
587,
|
| 853 |
+
825,
|
| 854 |
+
670
|
| 855 |
+
],
|
| 856 |
+
"page_idx": 7
|
| 857 |
+
},
|
| 858 |
+
{
|
| 859 |
+
"type": "text",
|
| 860 |
+
"text": "During finetuning, the corresponding text for the images are also “An image of $\\{ \\mathsf { s t y l e } \\}$ style“. When generating, the text is “A {object} of $\\{ \\mathsf { s t y l e } \\}$ style“, where $\\{ \\mathsf { o b j e c t } \\}$ is the object to generate. In this way, CogView can transfer the knowledge of shape of the objects learned from pretraining to the style of finetuning. Figure 7 shows examples for the styles. ",
|
| 861 |
+
"bbox": [
|
| 862 |
+
173,
|
| 863 |
+
676,
|
| 864 |
+
825,
|
| 865 |
+
733
|
| 866 |
+
],
|
| 867 |
+
"page_idx": 7
|
| 868 |
+
},
|
| 869 |
+
{
|
| 870 |
+
"type": "image",
|
| 871 |
+
"img_path": "images/7a4bf401855a1f90dfa91c305ddba051a7b1bbbec00eaa59ece12cebc87fd4b3.jpg",
|
| 872 |
+
"image_caption": [
|
| 873 |
+
"Figure 7: Generated images for “The Oriental Pearl” (a landmark of Shanghai) in different styles. "
|
| 874 |
+
],
|
| 875 |
+
"image_footnote": [],
|
| 876 |
+
"bbox": [
|
| 877 |
+
176,
|
| 878 |
+
750,
|
| 879 |
+
825,
|
| 880 |
+
882
|
| 881 |
+
],
|
| 882 |
+
"page_idx": 7
|
| 883 |
+
},
|
| 884 |
+
{
|
| 885 |
+
"type": "text",
|
| 886 |
+
"text": "3.4 Industrial Fashion Design ",
|
| 887 |
+
"text_level": 1,
|
| 888 |
+
"bbox": [
|
| 889 |
+
174,
|
| 890 |
+
92,
|
| 891 |
+
393,
|
| 892 |
+
106
|
| 893 |
+
],
|
| 894 |
+
"page_idx": 8
|
| 895 |
+
},
|
| 896 |
+
{
|
| 897 |
+
"type": "text",
|
| 898 |
+
"text": "When the generation targets at a single domain, the complexity of the textures are largely reduced. In these scenarios, we can (1) train a VQGAN [15] instead of VQVAE for the latent variable for more realistic textures, (2) decrease the number of parameters and increase the length of sequences for a higher resolution. Our three-region sparse attention (Appendix B) can speed up the generation of high-resolution images in this case. ",
|
| 899 |
+
"bbox": [
|
| 900 |
+
174,
|
| 901 |
+
116,
|
| 902 |
+
503,
|
| 903 |
+
241
|
| 904 |
+
],
|
| 905 |
+
"page_idx": 8
|
| 906 |
+
},
|
| 907 |
+
{
|
| 908 |
+
"type": "text",
|
| 909 |
+
"text": "We train a 3B-parameter model on about 10 million fashion-caption pairs, using $5 0 \\times 5 0$ VQGAN image tokens and decodes them into $8 0 0 \\times 8 0 0$ pixels. Figure 8 shows samples of CogView for fashion design, which has been successfully deployed to Alibaba Rhino fashion production. ",
|
| 910 |
+
"bbox": [
|
| 911 |
+
173,
|
| 912 |
+
247,
|
| 913 |
+
504,
|
| 914 |
+
303
|
| 915 |
+
],
|
| 916 |
+
"page_idx": 8
|
| 917 |
+
},
|
| 918 |
+
{
|
| 919 |
+
"type": "image",
|
| 920 |
+
"img_path": "images/036820b0eb8f4b916174531b25d5a3afd79295f7b3fd4c8992dad68a3a1de7aa.jpg",
|
| 921 |
+
"image_caption": [
|
| 922 |
+
"Figure 8: Generated images for fashion design. "
|
| 923 |
+
],
|
| 924 |
+
"image_footnote": [],
|
| 925 |
+
"bbox": [
|
| 926 |
+
519,
|
| 927 |
+
117,
|
| 928 |
+
797,
|
| 929 |
+
275
|
| 930 |
+
],
|
| 931 |
+
"page_idx": 8
|
| 932 |
+
},
|
| 933 |
+
{
|
| 934 |
+
"type": "text",
|
| 935 |
+
"text": "",
|
| 936 |
+
"bbox": [
|
| 937 |
+
179,
|
| 938 |
+
303,
|
| 939 |
+
740,
|
| 940 |
+
318
|
| 941 |
+
],
|
| 942 |
+
"page_idx": 8
|
| 943 |
+
},
|
| 944 |
+
{
|
| 945 |
+
"type": "text",
|
| 946 |
+
"text": "4 Experimental Results ",
|
| 947 |
+
"text_level": 1,
|
| 948 |
+
"bbox": [
|
| 949 |
+
174,
|
| 950 |
+
329,
|
| 951 |
+
385,
|
| 952 |
+
345
|
| 953 |
+
],
|
| 954 |
+
"page_idx": 8
|
| 955 |
+
},
|
| 956 |
+
{
|
| 957 |
+
"type": "text",
|
| 958 |
+
"text": "4.1 Machine Evaluation ",
|
| 959 |
+
"text_level": 1,
|
| 960 |
+
"bbox": [
|
| 961 |
+
174,
|
| 962 |
+
356,
|
| 963 |
+
352,
|
| 964 |
+
369
|
| 965 |
+
],
|
| 966 |
+
"page_idx": 8
|
| 967 |
+
},
|
| 968 |
+
{
|
| 969 |
+
"type": "text",
|
| 970 |
+
"text": "At present, the most authoritative machine evaluation metrics for general-domain text-to-image generation is the FID on MS COCO, which is not included in our training set. To compare with DALL-E, we follow the same setting, evaluating CogView on a subset of 30,000 captions sampled from the dataset, after applying a Gaussian filter with varying radius to both the ground-truth and generated images.8 The captions are translated into Chinese for CogView by machine translation. To fairly compare with DALL-E, we do not use super-resolution. Besides, DALL-E generates 512 images for each caption and selects the best one by CLIP, which needs to generate about 15 billion tokens. To save computational resource, we select the best one from 60 generated images according to their CapLosses. The evaluation of CapLoss is on a subset of 5,000 images. We finally enhance the contrast of generated images by 1.5. Table 1 shows the metrics for CogView and other methods. ",
|
| 971 |
+
"bbox": [
|
| 972 |
+
173,
|
| 973 |
+
377,
|
| 974 |
+
825,
|
| 975 |
+
516
|
| 976 |
+
],
|
| 977 |
+
"page_idx": 8
|
| 978 |
+
},
|
| 979 |
+
{
|
| 980 |
+
"type": "table",
|
| 981 |
+
"img_path": "images/ecc2248e2f3e8ed8e1de11e7b7e94ea814160ec715889fb71e1d99b8629a78d8.jpg",
|
| 982 |
+
"table_caption": [
|
| 983 |
+
"Table 1: Metrics for machine evaluation. Statistics about DALL-E and GANs are extracted from their figures. FID- $k$ means that all the images are blurred by a Gaussian Filter with radius $k$ . "
|
| 984 |
+
],
|
| 985 |
+
"table_footnote": [],
|
| 986 |
+
"table_body": "<table><tr><td>Model</td><td>FID-0</td><td>FID-1</td><td>FID-2</td><td>FID-4</td><td>FID-8</td><td>IS</td><td>CapLoss</td></tr><tr><td>AttnGAN</td><td>35.2</td><td>44.0</td><td>72.0</td><td>108.0</td><td>100.0</td><td>23.3</td><td>3.01</td></tr><tr><td>DM-GAN</td><td>26.5</td><td>39.0</td><td>73.0</td><td>119.0</td><td>112.3</td><td>32.2</td><td>2.87</td></tr><tr><td>DF-GAN</td><td>26.5</td><td>33.8</td><td>55.9</td><td>91.0</td><td>97.0</td><td>18.7</td><td>3.09</td></tr><tr><td>DALL-E</td><td>27.5</td><td>28.0</td><td>45.5</td><td>83.5</td><td>85.0</td><td>17.9</td><td>1</td></tr><tr><td>CogView</td><td>27.1</td><td>19.4</td><td>13.9</td><td>19.4</td><td>23.6</td><td>18.2</td><td>2.43</td></tr></table>",
|
| 987 |
+
"bbox": [
|
| 988 |
+
240,
|
| 989 |
+
556,
|
| 990 |
+
753,
|
| 991 |
+
661
|
| 992 |
+
],
|
| 993 |
+
"page_idx": 8
|
| 994 |
+
},
|
| 995 |
+
{
|
| 996 |
+
"type": "text",
|
| 997 |
+
"text": "Caption Loss as a Metric. FID and IS are designed to measure the quality of unconditional generation from relatively simple distributions, usually single objects. However, text-to-image generation should be evaluated pair-by-pair. Table 1 shows that DM-GAN achieves the best unblurred FID and IS, but is ranked last in human preference (Figure 10(a)). Caption Loss is an absolute (instead of relative, like CLIP) score, so that it can be averaged across samples. It should be a better metrics for this task and is more consistent with the overall scores of our human evaluation in $\\ S 4 . 2$ . ",
|
| 998 |
+
"bbox": [
|
| 999 |
+
173,
|
| 1000 |
+
670,
|
| 1001 |
+
826,
|
| 1002 |
+
753
|
| 1003 |
+
],
|
| 1004 |
+
"page_idx": 8
|
| 1005 |
+
},
|
| 1006 |
+
{
|
| 1007 |
+
"type": "text",
|
| 1008 |
+
"text": "Comparing self-reranking with CLIP. We evaluate the FID-0 and IS of CogView-generated images selected by CLIP and self-reranking on MS COCO. Figure 9 shows the curves with different number of candidates. Self-reranking gets better FID, and steadily refines FID as the number of candidates increases. CLIP performs better in increasing IS, but as discussed above, it is not a suitable metric for this task. ",
|
| 1009 |
+
"bbox": [
|
| 1010 |
+
174,
|
| 1011 |
+
755,
|
| 1012 |
+
485,
|
| 1013 |
+
877
|
| 1014 |
+
],
|
| 1015 |
+
"page_idx": 8
|
| 1016 |
+
},
|
| 1017 |
+
{
|
| 1018 |
+
"type": "image",
|
| 1019 |
+
"img_path": "images/1e3a5c605de04f4a7680af7246bc0b7ad53e56fb7f25273929bd80cd530b8e8f.jpg",
|
| 1020 |
+
"image_caption": [
|
| 1021 |
+
"Figure 9: IS and FID-0 for CLIP and self-ranking. "
|
| 1022 |
+
],
|
| 1023 |
+
"image_footnote": [],
|
| 1024 |
+
"bbox": [
|
| 1025 |
+
498,
|
| 1026 |
+
760,
|
| 1027 |
+
821,
|
| 1028 |
+
849
|
| 1029 |
+
],
|
| 1030 |
+
"page_idx": 8
|
| 1031 |
+
},
|
| 1032 |
+
{
|
| 1033 |
+
"type": "text",
|
| 1034 |
+
"text": "Discussion about the differences in performance between CogView and DALL-E. Since DALLE is pretrained with more data and parameters than CogView, why CogView gets a better FID even without super-resolution? It is hard to know the accurate reason, because DALL-E is not open-source, but we guess that the reasons include: (1) CogView uses PB-relax and Sandwich-LN for a more stable optimization. (2) DALL-E uses many cartoon and rendered data, making the texture of generated images quite different from that of the photos in MS COCO. (3) Self-reranking selects images better in FID than CLIP. (4) CogView is trained longer (96B trained tokens in CogView vs. 56B trained tokens in DALL-E). ",
|
| 1035 |
+
"bbox": [
|
| 1036 |
+
173,
|
| 1037 |
+
90,
|
| 1038 |
+
826,
|
| 1039 |
+
202
|
| 1040 |
+
],
|
| 1041 |
+
"page_idx": 9
|
| 1042 |
+
},
|
| 1043 |
+
{
|
| 1044 |
+
"type": "text",
|
| 1045 |
+
"text": "4.2 Human Evaluation ",
|
| 1046 |
+
"text_level": 1,
|
| 1047 |
+
"bbox": [
|
| 1048 |
+
174,
|
| 1049 |
+
226,
|
| 1050 |
+
344,
|
| 1051 |
+
241
|
| 1052 |
+
],
|
| 1053 |
+
"page_idx": 9
|
| 1054 |
+
},
|
| 1055 |
+
{
|
| 1056 |
+
"type": "text",
|
| 1057 |
+
"text": "Human evaluation is much more persuasive than machine evaluation on text-to-image generation. Our human evaluation consists of 2,950 groups of comparison between images generated by AttnGAN, DM-GAN, DF-GAN, CogView, and recovered ground truth, i.e., the ground truth blurred by our image tokenizer. Details and example-based comparison between models are in Appendix E. ",
|
| 1058 |
+
"bbox": [
|
| 1059 |
+
174,
|
| 1060 |
+
253,
|
| 1061 |
+
825,
|
| 1062 |
+
309
|
| 1063 |
+
],
|
| 1064 |
+
"page_idx": 9
|
| 1065 |
+
},
|
| 1066 |
+
{
|
| 1067 |
+
"type": "text",
|
| 1068 |
+
"text": "Results in Figure 10 show that CogView outperforms GAN-based baselines at a large margin. CogView is chosen as the best one with probability $3 7 . 0 2 \\%$ , competitive with the performance of recovered ground truth $( 5 9 . 5 3 \\% )$ . Figure 10(b)(c) also indicates our super-resolution model consistently improves the quality of images, especially the clarity, which even outperforms the recovered ground truth. ",
|
| 1069 |
+
"bbox": [
|
| 1070 |
+
173,
|
| 1071 |
+
315,
|
| 1072 |
+
825,
|
| 1073 |
+
386
|
| 1074 |
+
],
|
| 1075 |
+
"page_idx": 9
|
| 1076 |
+
},
|
| 1077 |
+
{
|
| 1078 |
+
"type": "image",
|
| 1079 |
+
"img_path": "images/b818fe41f1441ff85c5eb238e6030e3a57ff0fce6f482a16adc206908f835e7d.jpg",
|
| 1080 |
+
"image_caption": [
|
| 1081 |
+
"Figure 10: Human Evaluation results. The recovered ground truth is obtained by first encoding the ground truth image and then decoding it, which is theoretically the upper bound of CogView. "
|
| 1082 |
+
],
|
| 1083 |
+
"image_footnote": [],
|
| 1084 |
+
"bbox": [
|
| 1085 |
+
173,
|
| 1086 |
+
406,
|
| 1087 |
+
820,
|
| 1088 |
+
546
|
| 1089 |
+
],
|
| 1090 |
+
"page_idx": 9
|
| 1091 |
+
},
|
| 1092 |
+
{
|
| 1093 |
+
"type": "text",
|
| 1094 |
+
"text": "5 Conclusion and Discussion ",
|
| 1095 |
+
"text_level": 1,
|
| 1096 |
+
"bbox": [
|
| 1097 |
+
176,
|
| 1098 |
+
619,
|
| 1099 |
+
426,
|
| 1100 |
+
637
|
| 1101 |
+
],
|
| 1102 |
+
"page_idx": 9
|
| 1103 |
+
},
|
| 1104 |
+
{
|
| 1105 |
+
"type": "text",
|
| 1106 |
+
"text": "Limitations. A disadvantage of CogView is the slow generation, which is common for auto-regressive model, because each image is generated token-by-token. The blurriness brought by VQVAE is also an important limitation. These problems will be solved in the future work. ",
|
| 1107 |
+
"bbox": [
|
| 1108 |
+
174,
|
| 1109 |
+
656,
|
| 1110 |
+
823,
|
| 1111 |
+
696
|
| 1112 |
+
],
|
| 1113 |
+
"page_idx": 9
|
| 1114 |
+
},
|
| 1115 |
+
{
|
| 1116 |
+
"type": "text",
|
| 1117 |
+
"text": "Ethics Concerns. Similar to Deepfake, CogView is vulnerable to malicious use [49] because of its controllable and strong capacity to generate images. The possible methods to mitigate this issue are discussed in a survey [5]. Moreover, there are usually fairness problems in generative models about human 9. In Appendix D, we analyze the situation about fairness in CogView and introduce a simple “word replacing” method to solve this problem. ",
|
| 1118 |
+
"bbox": [
|
| 1119 |
+
173,
|
| 1120 |
+
704,
|
| 1121 |
+
825,
|
| 1122 |
+
773
|
| 1123 |
+
],
|
| 1124 |
+
"page_idx": 9
|
| 1125 |
+
},
|
| 1126 |
+
{
|
| 1127 |
+
"type": "text",
|
| 1128 |
+
"text": "We systematically investigate the framework of combining VQVAE and Transformers for text-toimage generation. CogView demonstrates promising results for scalable cross-modal generative pretraining, and also reveals and solves the precision problems probably originating from data heterogeneity. We also introduce methods to finetune CogView for diverse downstream tasks. We hope that CogView could advance both research and application of controllable image generation and cross-modal knowledge understanding, but need to prevent it from being used to create images for misinformation. ",
|
| 1129 |
+
"bbox": [
|
| 1130 |
+
174,
|
| 1131 |
+
780,
|
| 1132 |
+
825,
|
| 1133 |
+
876
|
| 1134 |
+
],
|
| 1135 |
+
"page_idx": 9
|
| 1136 |
+
},
|
| 1137 |
+
{
|
| 1138 |
+
"type": "text",
|
| 1139 |
+
"text": "Acknowledgments and Disclosure of Funding ",
|
| 1140 |
+
"text_level": 1,
|
| 1141 |
+
"bbox": [
|
| 1142 |
+
174,
|
| 1143 |
+
88,
|
| 1144 |
+
553,
|
| 1145 |
+
107
|
| 1146 |
+
],
|
| 1147 |
+
"page_idx": 10
|
| 1148 |
+
},
|
| 1149 |
+
{
|
| 1150 |
+
"type": "text",
|
| 1151 |
+
"text": "We would like to thank Zhao Xue, Zhengxiao Du, Hanxiao Qu, Hanyu Zhao, Sha Yuan, Yukuo Cen, Xiao Liu, An Yang, Yiming Ju for their help in data, machine maintaining or discussion. We would also thank Zhilin Yang for presenting this work at the conference of BAAI. ",
|
| 1152 |
+
"bbox": [
|
| 1153 |
+
174,
|
| 1154 |
+
119,
|
| 1155 |
+
826,
|
| 1156 |
+
162
|
| 1157 |
+
],
|
| 1158 |
+
"page_idx": 10
|
| 1159 |
+
},
|
| 1160 |
+
{
|
| 1161 |
+
"type": "text",
|
| 1162 |
+
"text": "Funding in direct support of this work: a fund for GPUs donated by BAAI, a research fund from Alibaba Group, NSFC for Distinguished Young Scholar (61825602), NSFC (61836013). ",
|
| 1163 |
+
"bbox": [
|
| 1164 |
+
174,
|
| 1165 |
+
167,
|
| 1166 |
+
823,
|
| 1167 |
+
198
|
| 1168 |
+
],
|
| 1169 |
+
"page_idx": 10
|
| 1170 |
+
},
|
| 1171 |
+
{
|
| 1172 |
+
"type": "text",
|
| 1173 |
+
"text": "References ",
|
| 1174 |
+
"text_level": 1,
|
| 1175 |
+
"bbox": [
|
| 1176 |
+
174,
|
| 1177 |
+
217,
|
| 1178 |
+
267,
|
| 1179 |
+
233
|
| 1180 |
+
],
|
| 1181 |
+
"page_idx": 10
|
| 1182 |
+
},
|
| 1183 |
+
{
|
| 1184 |
+
"type": "text",
|
| 1185 |
+
"text": "[1] J. L. Ba, J. R. Kiros, and G. E. Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. \n[2] Y. Bengio, N. Léonard, and A. Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013. \n[3] H. M. Bonnici, F. R. Richter, Y. Yazar, and J. S. Simons. Multimodal feature integration in the angular gyrus during episodic and semantic retrieval. Journal of Neuroscience, 36(20): 5462–5471, 2016. \n[4] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. \n[5] M. Brundage, S. Avin, J. Clark, H. Toner, P. Eckersley, B. Garfinkel, A. Dafoe, P. Scharre, T. Zeitzoff, B. Filar, et al. The malicious use of artificial intelligence: Forecasting, prevention, and mitigation. arXiv preprint arXiv:1802.07228, 2018. \n[6] A. Caliskan, J. J. Bryson, and A. Narayanan. Semantics derived automatically from language corpora contain human-like biases. Science, 356(6334):183–186, 2017. \n[7] M. Chen, A. Radford, R. Child, J. Wu, H. Jun, D. Luan, and I. Sutskever. Generative pretraining from pixels. In International Conference on Machine Learning, pages 1691–1703. PMLR, 2020. \n[8] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597–1607. PMLR, 2020. \n[9] X. Chen, S. Xie, and K. He. An empirical study of training self-supervised visual transformers. arXiv preprint arXiv:2104.02057, 2021. \n[10] K. Clark, U. Khandelwal, O. Levy, and C. D. Manning. What does bert look at? an analysis of bert’s attention. arXiv preprint arXiv:1906.04341, 2019. \n[11] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009. \n[12] M. Ding. The road from MLE to EM to VAE: A brief tutorial. URL https://www. researchgate.net/profile/Ming-Ding-2/publication/342347643_The_Road_ from_MLE_to_EM_to_VAE_A_Brief_Tutorial/links/5f1e986792851cd5fa4b2290/ The-Road-from-MLE-to-EM-to-VAE-A-Brief-Tutorial.pdf. \n[13] C. Dong, C. C. Loy, K. He, and X. Tang. Learning a deep convolutional network for image super-resolution. In European conference on computer vision, pages 184–199. Springer, 2014. \n[14] Z. Du, Y. Qian, X. Liu, M. Ding, J. Qiu, Z. Yang, and J. Tang. All nlp tasks are generation tasks: A general pretraining framework. arXiv preprint arXiv:2103.10360, 2021. \n[15] P. Esser, R. Rombach, and B. Ommer. Taming transformers for high-resolution image synthesis. arXiv preprint arXiv:2012.09841, 2020. ",
|
| 1186 |
+
"bbox": [
|
| 1187 |
+
178,
|
| 1188 |
+
237,
|
| 1189 |
+
828,
|
| 1190 |
+
916
|
| 1191 |
+
],
|
| 1192 |
+
"page_idx": 10
|
| 1193 |
+
},
|
| 1194 |
+
{
|
| 1195 |
+
"type": "text",
|
| 1196 |
+
"text": "[16] P. Gage. A new algorithm for data compression. C Users Journal, 12(2):23–38, 1994. ",
|
| 1197 |
+
"bbox": [
|
| 1198 |
+
166,
|
| 1199 |
+
90,
|
| 1200 |
+
772,
|
| 1201 |
+
107
|
| 1202 |
+
],
|
| 1203 |
+
"page_idx": 11
|
| 1204 |
+
},
|
| 1205 |
+
{
|
| 1206 |
+
"type": "text",
|
| 1207 |
+
"text": "[17] J. Gasquet. Cézanne. pages 159–186, 1926. ",
|
| 1208 |
+
"bbox": [
|
| 1209 |
+
176,
|
| 1210 |
+
116,
|
| 1211 |
+
498,
|
| 1212 |
+
131
|
| 1213 |
+
],
|
| 1214 |
+
"page_idx": 11
|
| 1215 |
+
},
|
| 1216 |
+
{
|
| 1217 |
+
"type": "text",
|
| 1218 |
+
"text": "[18] X. Glorot and Y. Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pages 249–256. JMLR Workshop and Conference Proceedings, 2010. ",
|
| 1219 |
+
"bbox": [
|
| 1220 |
+
173,
|
| 1221 |
+
140,
|
| 1222 |
+
823,
|
| 1223 |
+
184
|
| 1224 |
+
],
|
| 1225 |
+
"page_idx": 11
|
| 1226 |
+
},
|
| 1227 |
+
{
|
| 1228 |
+
"type": "text",
|
| 1229 |
+
"text": "[19] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014. ",
|
| 1230 |
+
"bbox": [
|
| 1231 |
+
171,
|
| 1232 |
+
191,
|
| 1233 |
+
826,
|
| 1234 |
+
222
|
| 1235 |
+
],
|
| 1236 |
+
"page_idx": 11
|
| 1237 |
+
},
|
| 1238 |
+
{
|
| 1239 |
+
"type": "text",
|
| 1240 |
+
"text": "[20] K. Gregor, I. Danihelka, A. Graves, D. Rezende, and D. Wierstra. Draw: A recurrent neural network for image generation. In International Conference on Machine Learning, pages 1462–1471. PMLR, 2015. ",
|
| 1241 |
+
"bbox": [
|
| 1242 |
+
174,
|
| 1243 |
+
231,
|
| 1244 |
+
823,
|
| 1245 |
+
273
|
| 1246 |
+
],
|
| 1247 |
+
"page_idx": 11
|
| 1248 |
+
},
|
| 1249 |
+
{
|
| 1250 |
+
"type": "text",
|
| 1251 |
+
"text": "[21] J.-B. Grill, F. Strub, F. Altché, C. Tallec, P. H. Richemond, E. Buchatskaya, C. Doersch, B. A. Pires, Z. D. Guo, M. G. Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020. ",
|
| 1252 |
+
"bbox": [
|
| 1253 |
+
173,
|
| 1254 |
+
282,
|
| 1255 |
+
825,
|
| 1256 |
+
327
|
| 1257 |
+
],
|
| 1258 |
+
"page_idx": 11
|
| 1259 |
+
},
|
| 1260 |
+
{
|
| 1261 |
+
"type": "text",
|
| 1262 |
+
"text": "[22] K. Grill-Spector and R. Malach. The human visual cortex. Annu. Rev. Neurosci., 27:649–677, 2004. ",
|
| 1263 |
+
"bbox": [
|
| 1264 |
+
174,
|
| 1265 |
+
335,
|
| 1266 |
+
825,
|
| 1267 |
+
364
|
| 1268 |
+
],
|
| 1269 |
+
"page_idx": 11
|
| 1270 |
+
},
|
| 1271 |
+
{
|
| 1272 |
+
"type": "text",
|
| 1273 |
+
"text": "[23] J. He, D. Spokoyny, G. Neubig, and T. Berg-Kirkpatrick. Lagging inference networks and posterior collapse in variational autoencoders. In International Conference on Learning Representations, 2018. ",
|
| 1274 |
+
"bbox": [
|
| 1275 |
+
174,
|
| 1276 |
+
373,
|
| 1277 |
+
825,
|
| 1278 |
+
416
|
| 1279 |
+
],
|
| 1280 |
+
"page_idx": 11
|
| 1281 |
+
},
|
| 1282 |
+
{
|
| 1283 |
+
"type": "text",
|
| 1284 |
+
"text": "[24] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9729–9738, 2020. ",
|
| 1285 |
+
"bbox": [
|
| 1286 |
+
174,
|
| 1287 |
+
425,
|
| 1288 |
+
823,
|
| 1289 |
+
469
|
| 1290 |
+
],
|
| 1291 |
+
"page_idx": 11
|
| 1292 |
+
},
|
| 1293 |
+
{
|
| 1294 |
+
"type": "text",
|
| 1295 |
+
"text": "[25] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6629–6640, 2017. ",
|
| 1296 |
+
"bbox": [
|
| 1297 |
+
173,
|
| 1298 |
+
478,
|
| 1299 |
+
823,
|
| 1300 |
+
522
|
| 1301 |
+
],
|
| 1302 |
+
"page_idx": 11
|
| 1303 |
+
},
|
| 1304 |
+
{
|
| 1305 |
+
"type": "text",
|
| 1306 |
+
"text": "[26] D. P. Kingma and M. Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. ",
|
| 1307 |
+
"bbox": [
|
| 1308 |
+
171,
|
| 1309 |
+
530,
|
| 1310 |
+
826,
|
| 1311 |
+
559
|
| 1312 |
+
],
|
| 1313 |
+
"page_idx": 11
|
| 1314 |
+
},
|
| 1315 |
+
{
|
| 1316 |
+
"type": "text",
|
| 1317 |
+
"text": "[27] J. Y. Koh, J. Baldridge, H. Lee, and Y. Yang. Text-to-image generation grounded by fine-grained user attention. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 237–246, 2021. ",
|
| 1318 |
+
"bbox": [
|
| 1319 |
+
173,
|
| 1320 |
+
569,
|
| 1321 |
+
823,
|
| 1322 |
+
612
|
| 1323 |
+
],
|
| 1324 |
+
"page_idx": 11
|
| 1325 |
+
},
|
| 1326 |
+
{
|
| 1327 |
+
"type": "text",
|
| 1328 |
+
"text": "[28] T. Kudo and J. Richardson. SentencePiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pages 66–71, Brussels, Belgium, Nov. 2018. Association for Computational Linguistics. doi: 10.18653/v1/ D18-2012. URL https://www.aclweb.org/anthology/D18-2012. ",
|
| 1329 |
+
"bbox": [
|
| 1330 |
+
173,
|
| 1331 |
+
621,
|
| 1332 |
+
828,
|
| 1333 |
+
691
|
| 1334 |
+
],
|
| 1335 |
+
"page_idx": 11
|
| 1336 |
+
},
|
| 1337 |
+
{
|
| 1338 |
+
"type": "text",
|
| 1339 |
+
"text": "[29] W. Li, P. Zhang, L. Zhang, Q. Huang, X. He, S. Lyu, and J. Gao. Object-driven text-to-image synthesis via adversarial training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12174–12182, 2019. ",
|
| 1340 |
+
"bbox": [
|
| 1341 |
+
173,
|
| 1342 |
+
700,
|
| 1343 |
+
821,
|
| 1344 |
+
744
|
| 1345 |
+
],
|
| 1346 |
+
"page_idx": 11
|
| 1347 |
+
},
|
| 1348 |
+
{
|
| 1349 |
+
"type": "text",
|
| 1350 |
+
"text": "[30] J. Lin, R. Men, A. Yang, C. Zhou, M. Ding, Y. Zhang, P. Wang, A. Wang, L. Jiang, X. Jia, et al. M6: A chinese multimodal pretrainer. arXiv preprint arXiv:2103.00823, 2021. ",
|
| 1351 |
+
"bbox": [
|
| 1352 |
+
168,
|
| 1353 |
+
752,
|
| 1354 |
+
825,
|
| 1355 |
+
784
|
| 1356 |
+
],
|
| 1357 |
+
"page_idx": 11
|
| 1358 |
+
},
|
| 1359 |
+
{
|
| 1360 |
+
"type": "text",
|
| 1361 |
+
"text": "[31] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick. Microsoft coco: Common objects in context. In European conference on computer vision, pages 740–755. Springer, 2014. ",
|
| 1362 |
+
"bbox": [
|
| 1363 |
+
171,
|
| 1364 |
+
791,
|
| 1365 |
+
825,
|
| 1366 |
+
835
|
| 1367 |
+
],
|
| 1368 |
+
"page_idx": 11
|
| 1369 |
+
},
|
| 1370 |
+
{
|
| 1371 |
+
"type": "text",
|
| 1372 |
+
"text": "[32] X. Liu, F. Zhang, Z. Hou, Z. Wang, L. Mian, J. Zhang, and J. Tang. Self-supervised learning: Generative or contrastive. arXiv preprint arXiv:2006.08218, 1(2), 2020. ",
|
| 1373 |
+
"bbox": [
|
| 1374 |
+
171,
|
| 1375 |
+
843,
|
| 1376 |
+
823,
|
| 1377 |
+
873
|
| 1378 |
+
],
|
| 1379 |
+
"page_idx": 11
|
| 1380 |
+
},
|
| 1381 |
+
{
|
| 1382 |
+
"type": "text",
|
| 1383 |
+
"text": "[33] X. Liu, Y. Zheng, Z. Du, M. Ding, Y. Qian, Z. Yang, and J. Tang. Gpt understands, too. arXiv preprint arXiv:2103.10385, 2021. ",
|
| 1384 |
+
"bbox": [
|
| 1385 |
+
173,
|
| 1386 |
+
882,
|
| 1387 |
+
820,
|
| 1388 |
+
911
|
| 1389 |
+
],
|
| 1390 |
+
"page_idx": 11
|
| 1391 |
+
},
|
| 1392 |
+
{
|
| 1393 |
+
"type": "text",
|
| 1394 |
+
"text": "[34] I. Loshchilov and F. Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016. \n[35] E. Mansimov, E. Parisotto, J. L. Ba, and R. Salakhutdinov. Generating images from captions with attention. ICLR, 2016. \n[36] N. Parmar, A. Vaswani, J. Uszkoreit, L. Kaiser, N. Shazeer, A. Ku, and D. Tran. Image transformer. In International Conference on Machine Learning, pages 4055–4064. PMLR, 2018. \n[37] A. Radford, J. Wu, R. Child, D. Luan, D. Amodei, and I. Sutskever. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. \n[38] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark, et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021. \n[39] A. Ramesh, M. Pavlov, G. Goh, S. Gray, C. Voss, A. Radford, M. Chen, and I. Sutskever. Zero-shot text-to-image generation. arXiv preprint arXiv:2102.12092, 2021. \n[40] J. Rasley, S. Rajbhandari, O. Ruwase, and Y. He. Deepspeed: System optimizations enable training deep learning models with over 100 billion parameters. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 3505–3506, 2020. \n[41] A. Razavi, A. v. d. Oord, and O. Vinyals. Generating diverse high-fidelity images with vq-vae-2. arXiv preprint arXiv:1906.00446, 2019. \n[42] S. Reed, Z. Akata, X. Yan, L. Logeswaran, B. Schiele, and H. Lee. Generative adversarial text to image synthesis. In International Conference on Machine Learning, pages 1060–1069. PMLR, 2016. \n[43] T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. Improved techniques for training gans. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 2234–2242, 2016. \n[44] P. Sharma, N. Ding, S. Goodman, and R. Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2556–2565, 2018. \n[45] M. Tao, H. Tang, S. Wu, N. Sebe, F. Wu, and X.-Y. Jing. Df-gan: Deep fusion generative adversarial networks for text-to-image synthesis. arXiv preprint arXiv:2008.05865, 2020. \n[46] A. van den Oord, O. Vinyals, and K. Kavukcuoglu. Neural discrete representation learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6309–6318, 2017. \n[47] A. Van Oord, N. Kalchbrenner, and K. Kavukcuoglu. Pixel recurrent neural networks. In International Conference on Machine Learning, pages 1747–1756. PMLR, 2016. \n[48] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017. \n[49] M. Westerlund. The emergence of deepfake technology: A review. Technology Innovation Management Review, 9(11), 2019. \n[50] R. Xiong, Y. Yang, D. He, K. Zheng, S. Zheng, C. Xing, H. Zhang, Y. Lan, L. Wang, and T. Liu. On layer normalization in the transformer architecture. In International Conference on Machine Learning, pages 10524–10533. PMLR, 2020. \n[51] T. Xu, P. Zhang, Q. Huang, H. Zhang, Z. Gan, X. Huang, and X. He. Attngan: Fine-grained text to image generation with attentional generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1316–1324, 2018. \n[52] S. Yuan, H. Zhao, Z. Du, M. Ding, X. Liu, Y. Cen, X. Zou, and Z. Yang. Wudaocorpora: A super large-scale chinese corpora for pre-training language models. Preprint, 2021. \n[53] M. Zaheer, G. Guruganesh, A. Dubey, J. Ainslie, C. Alberti, S. Ontanon, P. Pham, A. Ravula, Q. Wang, L. Yang, et al. Big bird: Transformers for longer sequences. arXiv preprint arXiv:2007.14062, 2020. \n[54] H. Zhang, T. Xu, H. Li, S. Zhang, X. Wang, X. Huang, and D. N. Metaxas. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 5907–5915, 2017. \n[55] M. Zhu, P. Pan, W. Chen, and Y. Yang. Dm-gan: Dynamic memory generative adversarial networks for text-to-image synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5802–5810, 2019. \n[56] X. Zou, D. Yin, Q. Zhong, H. Yang, Z. Yang, and J. Tang. Controllable generation from pre-trained language models via inverse prompting. arXiv preprint arXiv:2103.10685, 2021. ",
|
| 1395 |
+
"bbox": [
|
| 1396 |
+
169,
|
| 1397 |
+
68,
|
| 1398 |
+
828,
|
| 1399 |
+
914
|
| 1400 |
+
],
|
| 1401 |
+
"page_idx": 12
|
| 1402 |
+
},
|
| 1403 |
+
{
|
| 1404 |
+
"type": "text",
|
| 1405 |
+
"text": "",
|
| 1406 |
+
"bbox": [
|
| 1407 |
+
169,
|
| 1408 |
+
90,
|
| 1409 |
+
828,
|
| 1410 |
+
313
|
| 1411 |
+
],
|
| 1412 |
+
"page_idx": 13
|
| 1413 |
+
}
|
| 1414 |
+
]
|
parse/train/cnWSyJNmeCE/cnWSyJNmeCE_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/cnWSyJNmeCE/cnWSyJNmeCE_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/r16Vyf-0-/r16Vyf-0-.md
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IMAGE TRANSFORMER
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Image generation has been successfully cast as an autoregressive sequence generation or transformation problem. Recent work has shown that self-attention is an effective way of modeling textual sequences. In this work, we generalize a recently proposed model architecture based on self-attention, the Transformer, to a sequence modeling formulation of image generation with a tractable likelihood. By restricting the self-attention mechanism to attend to local neighborhoods we significantly increase the size of images the model can process in practice, despite maintaining significantly larger receptive fields per layer than typical convolutional neural networks. We propose another extension of self-attention allowing it to efficiently take advantage of the two-dimensional nature of images.
|
| 8 |
+
|
| 9 |
+
While conceptually simple, our generative models trained on two image data sets are competitive with or significantly outperform the current state of the art in autoregressive image generation on two different data sets, CIFAR-10 and ImageNet. We also present results on image super-resolution with a large magnification ratio, applying an encoder-decoder configuration of our architecture. In a human evaluation study, we show that our super-resolution models improve significantly over previously published autoregressive super-resolution models. Images they generate fool human observers three times more often than the previous state of the art.
|
| 10 |
+
|
| 11 |
+

|
| 12 |
+
Table 1: Three outputs of a CelebA super-resolution model followed by three image completions by a conditional CIFAR-10 model, with input, model output and the original from left to right
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Recent advances in modeling the distribution of natural images with neural networks allow them to generate increasingly natural-looking images.
|
| 17 |
+
|
| 18 |
+
Some models, such as the PixelRNN and PixelCNN (van den Oord et al., 2016), have a tractable likelihood. Beyond licensing the comparatively simple and stable training regime of directly maximizing log-likelihood, this enables the straightforward application of these models in problems such as image compression (van den Oord & Schrauwen, 2014) and probabilistic planning and exploration (Bellemare et al., 2016).
|
| 19 |
+
|
| 20 |
+
The likelihood is made tractable by modeling the joint distribution of the pixels in the image as the product of conditional distributions (Larochelle & Murray, 2011; Theis & Bethge, 2015). Having thus turned the problem into a sequence modeling problem, the state of the art approaches apply recurrent or convolutional neural networks, predicting each next pixel given all previously generated pixels (van den Oord et al., 2016). Training recurrent neural networks to sequentially predict each pixel of even a small image is computationally very challenging. Thus, models based on much more parallelizable convolutional neural networks such as the PixelCNN have recently received much more attention, and have now surpassed the PixelRNN in quality PixelCNN.
|
| 21 |
+
|
| 22 |
+
One disadvantage of CNNs compared to RNNs is their typically fairly limited receptive field. This can adversely affect their ability to model long-range phenomena common in images, such as symmetry and occlusion, especially with a small number of layers. Growing the receptive field has been shown to improve quality significantly (Salimans et al.). Doing so, however, like deepening the network, comes at a significant cost in number of parameters and consequently computational performance and can make training such models more challenging.
|
| 23 |
+
|
| 24 |
+
In this work we aim to find a better balance in the trade-off between the virtually unlimited receptive field of the necessarily sequential PixelRNN and the limited receptive field of the much more parallelizable PixelCNN and its various extensions.
|
| 25 |
+
|
| 26 |
+
We adopt similar factorizations of the joint pixel distribution as previous work. Following recent work on modeling text (Vaswani et al., 2017), however, we propose eschewing recurrent and convolutional networks in favor of the Image Transformer, a model based entirely on a self-attention mechanism (Cheng et al., 2016; Parikh et al., 2016). The specific, locally restricted form of multihead self-attention we propose could also be interpreted as a sparsely parameterized form of gated convolution, allowing for significantly larger receptive fields than CNNs at the same number of parameters.
|
| 27 |
+
|
| 28 |
+
Despite comparatively low resource requirements for training, the Image Transformer attains a new state of the art in modeling images from the standard ImageNet data set, as measured by loglikelihood. Our experiments indicate that increasing the size of the receptive field plays a significant role in this improvement.
|
| 29 |
+
|
| 30 |
+
Many applications of image density models require conditioning on additional information of various kinds: from images in enhancement or reconstruction tasks such as super-resolution, in-painting and denoising to text when synthesizing images from natural language descriptions (Mansimov et al., 2015). In visual planning tasks, conditional image generation models could predict future frames of video conditioned on previous frames and taken actions.
|
| 31 |
+
|
| 32 |
+
In this work we hence also evaluate two different methods of performing conditional image generation with the Image Transformer. In image-class conditional generation we condition on an embedding of one of a small number of image classes. In super-resolution with high magnification ratio, we condition on a very low-resolution image, employing the Image Transformer in an encoder-decoder configuration (Kalchbrenner & Blunsom, 2013). In comparison to recent work on autoregressive super-resolution (Dahl et al., 2017), a human evaluation study found images generated by our models look convincingly natural significantly more often.
|
| 33 |
+
|
| 34 |
+
# 2 BACKGROUND
|
| 35 |
+
|
| 36 |
+
There is a broad variety of types of image generation models in the literature. This work is most strongly inspired by autoregressive models such as fully visible belief networks and NADE (Bengio & Bengio, 2000; Larochelle & Murray, 2011) in that we also factor the joint probability of the image pixels into conditional distributions. Following PixelRNN (van den Oord et al., 2016), we also model the color channels of the output pixels as discrete values generated from a multinomial distribution, implemented using a simple softmax layer.
|
| 37 |
+
|
| 38 |
+
The current state of the art in modeling images in the CIFAR-10 data set was achieved by the PixelCNN++, modeling the output pixel distribution with a discretized logistic mixture likelihood, conditioning on whole pixels instead of color channels and changes to the architecture (Salimans et al.). Most of these modifications can also be applied to our model which we plan to evaluate in future work.
|
| 39 |
+
|
| 40 |
+
Another, currently wildly popular direction of research in image generation is training models with an adversarial loss (Goodfellow et al., 2014). Typically, in this regime a generator network is trained in opposition to a discriminator network trying to determine if a given image is real or generated. In contrast to the often blurry images generated by networks trained with likelihood-based losses, such generative adversarial networks (GANs) have been shown to generate sharper images with realistic high-frequency detail in generation and image super-resolution tasks (Zhang et al., 2016; Ledig et al., 2016).
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 1: A slice of one layer of the Image Transformer, recomputing the representation $q ^ { \prime }$ of a single channel of one pixel $q$ by attending to a memory of previously generated pixels $m _ { 1 } , m _ { 2 } , . . . .$ We apply a two-layer feed-forward neural network to the weighted average produced by the selfattention mechanism, perform layer normalization and sum the result with a residual connection. The position encodings $p _ { q } , p _ { 1 } , . . .$ are added only in the first layer.
|
| 44 |
+
|
| 45 |
+
While very promising, GANs have various drawbacks. They are notoriously unstable (Radford et al., 2015), motivating a large number of methods attempting to make their training more robust (Metz et al., 2016; Berthelot et al., 2017). Another common issue is that of mode collapse, where generated images fail to reflect the diversity in the training set (Metz et al., 2016).
|
| 46 |
+
|
| 47 |
+
A related problem is that GANs do not readily offer a probabilistic interpretation of their outputs, making it very challenging to measure the degree to which the models capture diversity. In contrast to models with a tractable likelihood, it also complicates optimizing model design, as objectively comparing different parameterizations or hyperparameter choices in this setting is considerably more difficult than comparing log-probabilities assigned to a validation set.
|
| 48 |
+
|
| 49 |
+
# 3 MODEL ARCHITECTURE
|
| 50 |
+
|
| 51 |
+
# 3.1 IMAGE REPRESENTATION AND 2D POSITIONAL INFORMATION
|
| 52 |
+
|
| 53 |
+
We treat both the input and predicted pixel RGB intensities as categorical variables rather than real numbers. Each input pixel’s channel is encoded using a channel-specific set of 256 $d$ -dimensional embedding vectors of the channel intensity values $0 - 2 5 5$ . For output intensities, we share a single, separate set of 256 $d$ -dimensional embeddings across channels.
|
| 54 |
+
|
| 55 |
+
We then combine the width and channels dimensions, yielding, for an image of width $w$ and height $h$ , a 3-dimensional tensor with shape $[ h , w \cdot 3 , d ]$ .
|
| 56 |
+
|
| 57 |
+
To each pixel representation, we add a $d$ -dimensional encoding of the coordinates of that pixel. Following Vaswani et al. (2017), the encoding consists of sine and cosine functions of the coordinates, with different frequencies across different dimensions. Since we need to represent two coordinates, we use $d / 2$ of the dimensions to encode the row number and the other $d / 2$ of the dimensions to encode the the column and color channel.
|
| 58 |
+
|
| 59 |
+
The resulting tensor forms the input to our 2D local attention models (Section 3.3). For 1D local attention (Section 3.3) and the input to our super-resolution models we flatten this tensor in rasterscan order, similar to previous work (van den Oord et al., 2016). This yields a $[ h \cdot w \cdot 3 , d ]$ tensor.
|
| 60 |
+
|
| 61 |
+
# 3.2 SELF-ATTENTION
|
| 62 |
+
|
| 63 |
+
Like the Transformer (Vaswani et al., 2017), the Image Transformer uses stacks of self-attention and position-wise feed-forward layers. Before we describe how we scale self-attention from sentences to images, which contain many more positions, we give a brief description of the self-attention layer.
|
| 64 |
+
|
| 65 |
+
Each self-attention layer computes a new $d$ -dimensional representation for each position, that is each channel of each pixel. To recompute the representation for a given position, it first compares the position’s current representation to other positions’ representations, obtaining an attention distribution over the other positions. This distribution is then used to weight the contribution of the other postions’ representations to the next representation for the position at hand.
|
| 66 |
+
|
| 67 |
+
Equation 1 and Figure1 fully describe all operations performed in every layer, independently for each position, with the exception of multi-head attention. For a detailed description of multi-head self-attention the reader is referred to (Vaswani et al., 2017).
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
q ^ { \prime } = q + \mathrm { d r o p o u t } ( \mathrm { l a y e r n o r m } ( \mathrm { F F N N } ( \mathrm { s o f t m a x } \left( \frac { W _ { q } q ( M W _ { k } ) ^ { T } } { \sqrt { d } } \right) M W _ { v } ) ) )
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
In more detail, following previous work, we call the current representation of the pixel’s channel, or position, to be recomputed the query $q$ . The other positions whose representations will be used in computing a new representation for $q$ are $m _ { 1 } , m _ { 2 } , . . .$ which together comprise the columns of the memory matrix $M$ . Note that $M$ can also contain $q$ . We first transform $q$ and $M$ linearly by learned matrices $W _ { q }$ and $W _ { k }$ , respectively.
|
| 74 |
+
|
| 75 |
+
The self-attention mechanism then compares $q$ to each of the pixel’s channel representations in the memory with a dot-product, scaled by $1 / { \sqrt { d } }$ . We apply the softmax function to the resulting compatibility scores, treating the obtained vector as attention distribution over the pixel channels in the memory. After applying another linear transformation $W _ { v }$ to the memory $M$ , we compute a weighted average of the transformed memory, weighted by the attention distribution. In the decoders of our different models we mask the outputs of the comparisons appropriately so that the model cannot attend to positions in the memory that have not been generated, yet.
|
| 76 |
+
|
| 77 |
+
To the resulting vector we then apply a single-layer fully-connected feed-forward neural network with rectified linear activation followed by another linear transformation. The learned parameters of these are shared across all positions but different from layer to layer. Lastly, we perform layer normalization followed by dropout (Ba et al., 2016; Srivastava et al., 2014).
|
| 78 |
+
|
| 79 |
+
The entire self-attention operation can be implemented using highly optimized matrix multiplication code and executed in parallel for all pixels’ channels.
|
| 80 |
+
|
| 81 |
+
# 3.3 LOCAL SELF-ATTENTION
|
| 82 |
+
|
| 83 |
+
The number of positions included in the memory $l _ { m }$ , or the number of columns of $M$ , has tremendous impact on the scalability of the self-attention mechanism, which has a time complexity in $O ( h \cdot w \cdot l _ { m } \cdot d )$ .
|
| 84 |
+
|
| 85 |
+
The encoders of our super-resolution models operate on $8 \times 8$ pixel images and it is computationally feasible to attend to all of their 192 positions. The decoders in our experiments, however, produce $3 2 \times 3 2$ pixel images with 3072 positions, rendering attending to all positions impractical.
|
| 86 |
+
|
| 87 |
+
Inspired by convolutional neural networks we address this by adopting a notion of locality, restricting the positions in the memory matrix $M$ to a local neighborhood around the query position. Changing this neighborhood per query position, however, would prohibit packing most of the computation necessary for self-attention into two matrix multiplications - one for computing the pairwise comparisons and another for generating the weighted averages. To avoid this, we partition the image into query blocks and associate each of these with a larger memory block that also contains the query block. For all queries from a given query block, the model attends to the same memory matrix, comprised of all positions from the memory block.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 2: The two different conditional factorizations used in our experiments, with 1D and 2D local attention on the left and right, respectively. In both, the image is partitioned into non-overlapping query blocks, each associated with a memory block covering a superset of the query block pixels. In every self-attention layer, each position in a query block attends to all positions in the memory block. The pixel marked as $q$ is the last that was generated. All channels of pixels in the memory and query blocks shown in white have masked attention weights and do not contribute to the next representations of positions in the query block. While the effective receptive field size in this figure is the same for both schemes, in 2D attention the memory block contains a more evenly balanced number of pixels next to and above the query block, respectively.
|
| 91 |
+
|
| 92 |
+
The self-attention is then computed for all query blocks in parallel, while the feed-forward networks and layer normalizations are computed in parallel for all positions.
|
| 93 |
+
|
| 94 |
+
In our experiments we use two different schemes for choosing query blocks and their associated memory block neighborhoods, resulting in two different factorizations of the joint pixel distribution into conditional distributions. Both are illustrated in Figure 2.
|
| 95 |
+
|
| 96 |
+
1D Local Attention To compute self-attention on raster-scanned linearized images, we partition the length into non-overlapping query blocks $Q$ of length $l _ { q }$ , padding with zeroes if necessary. While contiguous in the linearized image, these blocks can be discontiguous in image coordinate space. For each query block we build the memory block $M$ from the same positions as $Q$ and an additional $l _ { m }$ positions from pixels that have been generated before, which can result in overlapping memory blocks.
|
| 97 |
+
|
| 98 |
+
2D Local Attention In 2D local attention models, we partition the image into query blocks rectangular and contiguous in the original image space. We generate the image one query block after another, ordering the blocks in raster-scan order. Within each block, we generate individual positions, or pixel channels, again in raster-scan order.
|
| 99 |
+
|
| 100 |
+
As illustrated in the right half of Figure 2, we generate the blocks outlined in grey lines left-to-right and top-to-bottom. We use 2-dimensional query blocks of a size $l _ { q }$ specified by height and width $l _ { q } = w _ { q } \cdot h _ { q }$ , and memory blocks extending the query block to the top, left and right by $h _ { m }$ , $w _ { m }$ and again $w _ { m }$ pixels, respectively.
|
| 101 |
+
|
| 102 |
+
In both 1D and 2D local attention, we mask attention weights in the query and memory blocks such that positions that have not yet been generated are ignored.
|
| 103 |
+
|
| 104 |
+
As can be seen in Figure 2, 2D local attention balances horizontal and vertical conditioning context much more evenly. We believe this might have an increasingly positive effect on quality with growing image size as the conditioning information in 1D local attention becomes increasingly dominated by pixels next to a given position as opposed to above it.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Table 2: Conditional image generations for all CIFAR-10 categories. Images on the left are from a model that achieves 3.03 bits/dim on the test set. Images on the right are from our best nonaveraged model with 2.99 bits/dim. Both models are able to generate convincing cars, trucks, and ships. Generated horses, planes, and birds also look reasonable.
|
| 108 |
+
|
| 109 |
+
# 4 INFERENCE
|
| 110 |
+
|
| 111 |
+
Across all of the presented experiments, we sample from the various models with a tempered softmax (Dahl et al., 2017). We adjust the concentration of the distribution we sample from with a temperature $\tau > 0$ by which we divide the logits for the channel intensities.
|
| 112 |
+
|
| 113 |
+
We tuned $\tau$ between 0.8 and 1.0, observing the highest perceptual quality in unconditioned and classconditional image generation with $\tau = 1 . 0$ . For super-resolution we present results for different temperatures in Table 4.
|
| 114 |
+
|
| 115 |
+
# 5 EXPERIMENTS
|
| 116 |
+
|
| 117 |
+
For all of our experiments we optimize with Adam (Kingma & Ba, 2015), and vary the learning rate as specified in Vaswani et al. (2017). We train our models on both p100 and k40 GPUs, with batch sizes ranging from 1 to 4 per GPU.
|
| 118 |
+
|
| 119 |
+
Table 3: Negative log-likelihoods on the CIFAR-10 test and ImageNet validation sets. The Image Transformer outperforms all models but PixelC $\mathrm { N N } { + } { + }$ , achieving a new state of the art on ImageNet. Larger memory blocks significantly improve its performance.
|
| 120 |
+
|
| 121 |
+
<table><tr><td rowspan="2">Model Type</td><td rowspan="2">Memory Block Size</td><td colspan="2">NLL</td></tr><tr><td>CIFAR-10 (Test)</td><td>ImageNet (Validation)</td></tr><tr><td>Pixel CNN</td><td></td><td>3.14</td><td>1</td></tr><tr><td>RowPixel RNN</td><td></td><td>3.00</td><td>3.86</td></tr><tr><td>Gated Pixel CNN</td><td></td><td>3.03</td><td>3.83</td></tr><tr><td>Pixel CNN++</td><td>=</td><td>2.92</td><td>=</td></tr><tr><td rowspan="4">Image Transformer 1D local</td><td>8</td><td>4.06</td><td></td></tr><tr><td>16</td><td>3.47</td><td></td></tr><tr><td>64</td><td>3.13</td><td></td></tr><tr><td>256</td><td>2.99</td><td>3.78</td></tr><tr><td>with checkpoint averaging</td><td>256</td><td>2.98</td><td>3.77</td></tr></table>
|
| 122 |
+
|
| 123 |
+
# 5.1 GENERATIVE IMAGE MODELING
|
| 124 |
+
|
| 125 |
+
Our unconditioned and class-conditioned image generation models both use 1D local attention, with $l _ { q } = 2 5 6$ and a total memory size of 512. On CIFAR-10 our best class-conditioned model (2.99 bits/dim) uses 8 self-attention and feed-forward layers, $d = 1 0 2 4$ , 16 attention heads, 2048 dimensions in the feed-forward layers, and a dropout of 0.3. Our smaller CIFAR-10 models (3.03 bits/dim) have $d = 5 1 2$ , 1024 dimensions in the feed-forward layers, 8 attention heads and use dropout $= ~ 0 . 1$ . Our state of the art ImageNet unconditioned generation model is significantly larger, with 12 self-attention and feed-forward layers, $d = 1 0 2 4$ , 4096-dimensional feed-forward layers, 16 attention heads, and dropout $= 0 . 1$ .
|
| 126 |
+
|
| 127 |
+
As Table 3 shows, our models improve over various previously proposed models including the PixelRNN and the gated PixelCNN. On ImageNet we establish a new state of the art of 3.78, which we can improve to 3.77 by averaging the last ten checkpoints.
|
| 128 |
+
|
| 129 |
+
While the Pixel $\mathrm { C N N + + }$ achieved significantly better log-likelihoods on CIFAR-10 (Salimans et al.), we expect that many of the modifications in the PixelCNN++ carry over to the Image Transformer. We further believe our curated images for various classes to be of reasonable perceptual quality.
|
| 130 |
+
|
| 131 |
+
# 5.2 CONDITIONING ON IMAGE CLASS
|
| 132 |
+
|
| 133 |
+
We represent the image classes as learned $d$ -dimensional embeddings per class and simply add the respective embedding to the input representation of every input position together with the positional encodings.
|
| 134 |
+
|
| 135 |
+
We trained the class-conditioned Image Transformer on CIFAR-10 and ImageNet data sets, achieving very similar log-likelihoods as in unconditioned generation. The perceptual quality of generated images, however, is significantly higher than that of our unconditioned models. We present some samples in Table 2.
|
| 136 |
+
|
| 137 |
+
# 5.3 IMAGE SUPER-RESOLUTION
|
| 138 |
+
|
| 139 |
+
Super-resolution is the process of recovering a high resolution image from a low resolution image while generating realistic and plausible details. Following (Dahl et al., 2017), in our experimental setup we enlarge an $8 \times 8$ pixel image four-fold to $3 2 \times 3 2$ , a process that is massively underspecified: the model has to generate aspects such as texture of hair, makeup, skin and sometimes even gender that cannot possibly be recovered from the source image.
|
| 140 |
+
|
| 141 |
+
Here, we use the Image Transformer in an encoder-decoder configuration, connecting the encoder and decoder through an attention mechanism (Vaswani et al., 2017). Since the input is an $8 \times 8$ image, it is practical to use 1D attention with only one query and one memory block, each covering the entire image. We further use model dimension $d = 5 1 2$ , 1024 hidden units in the position-wise feed-forward network, 4 encoder layers and 12 decoder layers. We train end-to-end, maximizing likelihood.
|
| 142 |
+
|
| 143 |
+
Table 4: Negative log-likelihood and human eval performance for the Image Transformer on CelebA. The fraction of humans fooled is significantly better than the previous state of the art. 2D local attention outperforms 1D local attention in the human evaluation.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Model Type</td><td>NLL</td><td colspan="3">%Fooled</td></tr><tr><td></td><td></td><td>T=n/a T = 1.0</td><td>T = 0.9</td><td>T = 0.8</td></tr><tr><td>ResNet</td><td></td><td>4.0</td><td></td><td></td></tr><tr><td>srez GAN (Garcia, 2016)</td><td>8.5</td><td></td><td></td><td>10.2</td></tr><tr><td>PixelRecursive (Dahl et al., 2017)</td><td>1 1 2.74</td><td>11.0 21.5 ± 4.0</td><td>10.4 30.1 ± 3.5</td><td>32.5± 3.0</td></tr><tr><td>ImageTransformer 1D local attention</td><td>2.79</td><td></td><td>36.9 ± 2.5</td><td>32.5 ± 2.5</td></tr><tr><td>ImageTransformer 2D local attention</td><td></td><td>31.25 ± 3.5</td><td></td><td></td></tr></table>
|
| 146 |
+
|
| 147 |
+
For both of the following data sets, we resized the image to $8 \times 8$ pixels for the input and $3 2 \times 3 2$ pixels for the label using TensorFlow’s area interpolation method.
|
| 148 |
+
|
| 149 |
+
CelebA We trained on the standard CelebA data set of celebrity faces with cropped boundaries. Existing automated metrics like pSNR, SSIM and MS-SSIM have been shown to not correlate with perceptual image quality (Dahl et al., 2017). Instead, we conducted a human evaluation study on Amazon Mechanical Turk. Each worker is required to make a binary choice when shown one generated and one real image. Following (Dahl et al., 2017), we show 50 pairs of images, selected randomly, to 50 workers each. In our method, workers choose images from our model up to $3 6 . 9 \%$ of the time, a significant improvement over previous models. Sampling temperature of 0.9 and 2D local attention maximized perceptual quality as measured by this evaluation.
|
| 150 |
+
|
| 151 |
+
CIFAR-10 We also trained a super-resolution model on the CIFAR-10 data set. Our model reached a negative log-likelihood of 2.76 using 1D local attention and 2.78 using 2D local attention on the test set. As seen in Figure 5.3, our model commonly generates plausible looking objects even though the input images seem to barely show any discernible structure beyond coarse shapes.
|
| 152 |
+
|
| 153 |
+
# 6 CONCLUSION
|
| 154 |
+
|
| 155 |
+
In this work we demonstrate that models based on self-attention can operate effectively on modalities other than text, and through local self-attention scale to significantly larger structures than sentences. With fewer layers, its larger receptive fields allow the Image Transformer to improve over the state of the art in unconditional, probabilistic image modeling of comparatively complex images from ImageNet as well as super-resolution.
|
| 156 |
+
|
| 157 |
+
We further hope to have provided additional evidence that even in the light of generative adversarial networks, autoregressive generation of images is very much a promising area for further research - as is using network architectures such as the Image Transformer in GANs.
|
| 158 |
+
|
| 159 |
+
In future work we would like to explore a broader variety of conditioning information including free-form text, as previously proposed (Mansimov et al., 2015), and tasks combining modalities such as language-driven editing of images.
|
| 160 |
+
|
| 161 |
+
Fundamentally, we aim to move beyond still images to video (Kalchbrenner et al., 2016) and towards applications of such models in more model-based reinforcement learning approaches.
|
| 162 |
+
|
| 163 |
+
# REFERENCES
|
| 164 |
+
|
| 165 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Table 5: Images from our 1D and 2D local attention super-resolution models trained on CelebA, sampled with different temperatures. 2D local attention with $\tau = 0 . 9$ scored highest in our human evaluation study.
|
| 169 |
+
|
| 170 |
+
Marc G. Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi ´ Munos. Unifying count-based exploration and intrinsic motivation. CoRR, abs/1606.01868, 2016. URL http://arxiv.org/abs/1606.01868.
|
| 171 |
+
|
| 172 |
+
Yoshua Bengio and Samy Bengio. Modeling high-dimensional discrete data with multi-layer neural networks. In ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS 12, pp. 400– 406. MIT Press, 2000.
|
| 173 |
+
|
| 174 |
+
David Berthelot, Tom Schumm, and Luke Metz. BEGAN: boundary equilibrium generative adversarial networks. CoRR, abs/1703.10717, 2017. URL http://arxiv.org/abs/1703. 10717.
|
| 175 |
+
|
| 176 |
+
Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine reading. arXiv preprint arXiv:1601.06733, 2016.
|
| 177 |
+
|
| 178 |
+
Ryan Dahl, Mohammad Norouzi, and Jonathan Shlens. Pixel recursive super resolution. 2017. URL https://arxiv.org/abs/1702.00783.
|
| 179 |
+
|
| 180 |
+
David Garcia. srez: Adversarial super resolution. https://github.com/david-gpu/srez, 2016. URL https://github.com/david-gpu/srez.
|
| 181 |
+
|
| 182 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets, 2014.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Table 6: On the left are image completions from our best conditional generation model, where we sample the second half. On the right are samples from our four-fold super-resolution model trained on CIFAR-10. Our images look realistic and plausible, show good diversity among the completion samples and observe the outputs carry surprising details for coarse inputs in super-resolution.
|
| 186 |
+
|
| 187 |
+
Nal Kalchbrenner and Phil Blunsom. Recurrent continuous translation models. In Proceedings EMNLP 2013, pp. 1700–1709, 2013. URL http://nal.co/papers/ KalchbrennerBlunsom_EMNLP13.
|
| 188 |
+
Nal Kalchbrenner, Aaron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex ¨ Graves, and Koray Kavukcuoglu. Video pixel networks. CoRR, abs/1610.00527, 2016. URL http://arxiv.org/abs/1610.00527.
|
| 189 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 190 |
+
Hugo Larochelle and Iain Murray. The neural autoregressive distribution estimator. In The Proceedings of the 14th International Conference on Artificial Intelligence and Statistics, volume 15 of JMLR: W&CP, pp. 29–37, 2011.
|
| 191 |
+
Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, and Wenzhe Shi. Photo-realistic single image super-resolution using a generative adversarial network. arXiv:1609.04802, 2016.
|
| 192 |
+
Elman Mansimov, Emilio Parisotto, Lei Jimmy Ba, and Ruslan Salakhutdinov. Generating images from captions with attention. CoRR, abs/1511.02793, 2015. URL http://arxiv.org/abs/ 1511.02793.
|
| 193 |
+
Luke Metz, Ben Poole, David Pfau, and Jascha Sohl-Dickstein. Unrolled generative adversarial networks. CoRR, abs/1611.02163, 2016. URL http://arxiv.org/abs/1611.02163.
|
| 194 |
+
Ankur Parikh, Oscar Tckstrm, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention model. In Empirical Methods in Natural Language Processing, 2016. URL https://arxiv.org/ pdf/1606.01933.pdf.
|
| 195 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. CoRR, abs/1511.06434, 2015. URL http:// arxiv.org/abs/1511.06434.
|
| 196 |
+
Tim Salimans, Andrej Karpathy, Xi Chen, Diederik P. Kingma, and Yaroslav Bulatov. Pixelcnn++: A pixelcnn implementation with discretized logistic mixture likelihood and other modifications. under review at ICLR 2017.
|
| 197 |
+
|
| 198 |
+
Nitish Srivastava, Geoffrey E Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1):1929–1958, 2014.
|
| 199 |
+
|
| 200 |
+
Lucas Theis and Matthias Bethge. Generative image modeling using spatial lstms. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, NIPS’15, pp. 1927–1935, Cambridge, MA, USA, 2015. MIT Press. URL http: //dl.acm.org/citation.cfm?id $= .$ 2969442.2969455.
|
| 201 |
+
|
| 202 |
+
Aaron van den Oord and Benjamin Schrauwen. The student-t mixture as a natural image patch prior ¨ with application to image compression. Journal of Machine Learning Research, 15:2061–2086, 2014. URL http://jmlr.org/papers/v15/vandenoord14a.html.
|
| 203 |
+
|
| 204 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. ¨ ICML, 2016.
|
| 205 |
+
|
| 206 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. 2017. URL http://arxiv. org/abs/1706.03762.
|
| 207 |
+
|
| 208 |
+
Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaolei Huang, Xiaogang Wang, and Dimitris N. Metaxas. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. CoRR, abs/1612.03242, 2016. URL http://arxiv.org/abs/1612. 03242.
|
| 209 |
+
|
| 210 |
+
# A CELEBA SUPERRESOLUTION
|
| 211 |
+
|
| 212 |
+
Image pairs comparing ratings of generated images by the Local 2D ImageTransformer model and the original images. On the left side are images where the raters prefer the generated image over the original ones. On the right side, raters prefer the original over generated image.
|
| 213 |
+
|
| 214 |
+
Original $>$ Local 2D
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
|
| 218 |
+

|
parse/train/r16Vyf-0-/r16Vyf-0-_content_list.json
ADDED
|
@@ -0,0 +1,1202 @@
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "IMAGE TRANSFORMER ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
178,
|
| 8 |
+
99,
|
| 9 |
+
447,
|
| 10 |
+
121
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Anonymous authors Paper under double-blind review ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
183,
|
| 19 |
+
145,
|
| 20 |
+
398,
|
| 21 |
+
172
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "ABSTRACT ",
|
| 28 |
+
"text_level": 1,
|
| 29 |
+
"bbox": [
|
| 30 |
+
454,
|
| 31 |
+
210,
|
| 32 |
+
544,
|
| 33 |
+
226
|
| 34 |
+
],
|
| 35 |
+
"page_idx": 0
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"type": "text",
|
| 39 |
+
"text": "Image generation has been successfully cast as an autoregressive sequence generation or transformation problem. Recent work has shown that self-attention is an effective way of modeling textual sequences. In this work, we generalize a recently proposed model architecture based on self-attention, the Transformer, to a sequence modeling formulation of image generation with a tractable likelihood. By restricting the self-attention mechanism to attend to local neighborhoods we significantly increase the size of images the model can process in practice, despite maintaining significantly larger receptive fields per layer than typical convolutional neural networks. We propose another extension of self-attention allowing it to efficiently take advantage of the two-dimensional nature of images. ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
232,
|
| 42 |
+
241,
|
| 43 |
+
766,
|
| 44 |
+
378
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "While conceptually simple, our generative models trained on two image data sets are competitive with or significantly outperform the current state of the art in autoregressive image generation on two different data sets, CIFAR-10 and ImageNet. We also present results on image super-resolution with a large magnification ratio, applying an encoder-decoder configuration of our architecture. In a human evaluation study, we show that our super-resolution models improve significantly over previously published autoregressive super-resolution models. Images they generate fool human observers three times more often than the previous state of the art. ",
|
| 51 |
+
"bbox": [
|
| 52 |
+
232,
|
| 53 |
+
381,
|
| 54 |
+
764,
|
| 55 |
+
508
|
| 56 |
+
],
|
| 57 |
+
"page_idx": 0
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"type": "image",
|
| 61 |
+
"img_path": "images/933cd96f1e90f14dae74623d4f819500d8268efe9acbe2ae014122f6fc11d3c3.jpg",
|
| 62 |
+
"image_caption": [
|
| 63 |
+
"Table 1: Three outputs of a CelebA super-resolution model followed by three image completions by a conditional CIFAR-10 model, with input, model output and the original from left to right "
|
| 64 |
+
],
|
| 65 |
+
"image_footnote": [],
|
| 66 |
+
"bbox": [
|
| 67 |
+
179,
|
| 68 |
+
542,
|
| 69 |
+
812,
|
| 70 |
+
652
|
| 71 |
+
],
|
| 72 |
+
"page_idx": 0
|
| 73 |
+
},
|
| 74 |
+
{
|
| 75 |
+
"type": "text",
|
| 76 |
+
"text": "1 INTRODUCTION ",
|
| 77 |
+
"text_level": 1,
|
| 78 |
+
"bbox": [
|
| 79 |
+
176,
|
| 80 |
+
729,
|
| 81 |
+
336,
|
| 82 |
+
746
|
| 83 |
+
],
|
| 84 |
+
"page_idx": 0
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"type": "text",
|
| 88 |
+
"text": "Recent advances in modeling the distribution of natural images with neural networks allow them to generate increasingly natural-looking images. ",
|
| 89 |
+
"bbox": [
|
| 90 |
+
174,
|
| 91 |
+
761,
|
| 92 |
+
823,
|
| 93 |
+
790
|
| 94 |
+
],
|
| 95 |
+
"page_idx": 0
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
"type": "text",
|
| 99 |
+
"text": "Some models, such as the PixelRNN and PixelCNN (van den Oord et al., 2016), have a tractable likelihood. Beyond licensing the comparatively simple and stable training regime of directly maximizing log-likelihood, this enables the straightforward application of these models in problems such as image compression (van den Oord & Schrauwen, 2014) and probabilistic planning and exploration (Bellemare et al., 2016). ",
|
| 100 |
+
"bbox": [
|
| 101 |
+
174,
|
| 102 |
+
796,
|
| 103 |
+
825,
|
| 104 |
+
866
|
| 105 |
+
],
|
| 106 |
+
"page_idx": 0
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"type": "text",
|
| 110 |
+
"text": "The likelihood is made tractable by modeling the joint distribution of the pixels in the image as the product of conditional distributions (Larochelle & Murray, 2011; Theis & Bethge, 2015). Having thus turned the problem into a sequence modeling problem, the state of the art approaches apply recurrent or convolutional neural networks, predicting each next pixel given all previously generated pixels (van den Oord et al., 2016). Training recurrent neural networks to sequentially predict each pixel of even a small image is computationally very challenging. Thus, models based on much more parallelizable convolutional neural networks such as the PixelCNN have recently received much more attention, and have now surpassed the PixelRNN in quality PixelCNN. ",
|
| 111 |
+
"bbox": [
|
| 112 |
+
176,
|
| 113 |
+
873,
|
| 114 |
+
823,
|
| 115 |
+
901
|
| 116 |
+
],
|
| 117 |
+
"page_idx": 0
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
"type": "text",
|
| 121 |
+
"text": "",
|
| 122 |
+
"bbox": [
|
| 123 |
+
174,
|
| 124 |
+
103,
|
| 125 |
+
823,
|
| 126 |
+
188
|
| 127 |
+
],
|
| 128 |
+
"page_idx": 1
|
| 129 |
+
},
|
| 130 |
+
{
|
| 131 |
+
"type": "text",
|
| 132 |
+
"text": "One disadvantage of CNNs compared to RNNs is their typically fairly limited receptive field. This can adversely affect their ability to model long-range phenomena common in images, such as symmetry and occlusion, especially with a small number of layers. Growing the receptive field has been shown to improve quality significantly (Salimans et al.). Doing so, however, like deepening the network, comes at a significant cost in number of parameters and consequently computational performance and can make training such models more challenging. ",
|
| 133 |
+
"bbox": [
|
| 134 |
+
174,
|
| 135 |
+
194,
|
| 136 |
+
825,
|
| 137 |
+
277
|
| 138 |
+
],
|
| 139 |
+
"page_idx": 1
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"type": "text",
|
| 143 |
+
"text": "In this work we aim to find a better balance in the trade-off between the virtually unlimited receptive field of the necessarily sequential PixelRNN and the limited receptive field of the much more parallelizable PixelCNN and its various extensions. ",
|
| 144 |
+
"bbox": [
|
| 145 |
+
174,
|
| 146 |
+
285,
|
| 147 |
+
823,
|
| 148 |
+
327
|
| 149 |
+
],
|
| 150 |
+
"page_idx": 1
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"type": "text",
|
| 154 |
+
"text": "We adopt similar factorizations of the joint pixel distribution as previous work. Following recent work on modeling text (Vaswani et al., 2017), however, we propose eschewing recurrent and convolutional networks in favor of the Image Transformer, a model based entirely on a self-attention mechanism (Cheng et al., 2016; Parikh et al., 2016). The specific, locally restricted form of multihead self-attention we propose could also be interpreted as a sparsely parameterized form of gated convolution, allowing for significantly larger receptive fields than CNNs at the same number of parameters. ",
|
| 155 |
+
"bbox": [
|
| 156 |
+
174,
|
| 157 |
+
333,
|
| 158 |
+
825,
|
| 159 |
+
431
|
| 160 |
+
],
|
| 161 |
+
"page_idx": 1
|
| 162 |
+
},
|
| 163 |
+
{
|
| 164 |
+
"type": "text",
|
| 165 |
+
"text": "Despite comparatively low resource requirements for training, the Image Transformer attains a new state of the art in modeling images from the standard ImageNet data set, as measured by loglikelihood. Our experiments indicate that increasing the size of the receptive field plays a significant role in this improvement. ",
|
| 166 |
+
"bbox": [
|
| 167 |
+
176,
|
| 168 |
+
438,
|
| 169 |
+
823,
|
| 170 |
+
493
|
| 171 |
+
],
|
| 172 |
+
"page_idx": 1
|
| 173 |
+
},
|
| 174 |
+
{
|
| 175 |
+
"type": "text",
|
| 176 |
+
"text": "Many applications of image density models require conditioning on additional information of various kinds: from images in enhancement or reconstruction tasks such as super-resolution, in-painting and denoising to text when synthesizing images from natural language descriptions (Mansimov et al., 2015). In visual planning tasks, conditional image generation models could predict future frames of video conditioned on previous frames and taken actions. ",
|
| 177 |
+
"bbox": [
|
| 178 |
+
174,
|
| 179 |
+
501,
|
| 180 |
+
823,
|
| 181 |
+
570
|
| 182 |
+
],
|
| 183 |
+
"page_idx": 1
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"type": "text",
|
| 187 |
+
"text": "In this work we hence also evaluate two different methods of performing conditional image generation with the Image Transformer. In image-class conditional generation we condition on an embedding of one of a small number of image classes. In super-resolution with high magnification ratio, we condition on a very low-resolution image, employing the Image Transformer in an encoder-decoder configuration (Kalchbrenner & Blunsom, 2013). In comparison to recent work on autoregressive super-resolution (Dahl et al., 2017), a human evaluation study found images generated by our models look convincingly natural significantly more often. ",
|
| 188 |
+
"bbox": [
|
| 189 |
+
174,
|
| 190 |
+
577,
|
| 191 |
+
825,
|
| 192 |
+
675
|
| 193 |
+
],
|
| 194 |
+
"page_idx": 1
|
| 195 |
+
},
|
| 196 |
+
{
|
| 197 |
+
"type": "text",
|
| 198 |
+
"text": "2 BACKGROUND ",
|
| 199 |
+
"text_level": 1,
|
| 200 |
+
"bbox": [
|
| 201 |
+
176,
|
| 202 |
+
695,
|
| 203 |
+
326,
|
| 204 |
+
712
|
| 205 |
+
],
|
| 206 |
+
"page_idx": 1
|
| 207 |
+
},
|
| 208 |
+
{
|
| 209 |
+
"type": "text",
|
| 210 |
+
"text": "There is a broad variety of types of image generation models in the literature. This work is most strongly inspired by autoregressive models such as fully visible belief networks and NADE (Bengio & Bengio, 2000; Larochelle & Murray, 2011) in that we also factor the joint probability of the image pixels into conditional distributions. Following PixelRNN (van den Oord et al., 2016), we also model the color channels of the output pixels as discrete values generated from a multinomial distribution, implemented using a simple softmax layer. ",
|
| 211 |
+
"bbox": [
|
| 212 |
+
174,
|
| 213 |
+
728,
|
| 214 |
+
823,
|
| 215 |
+
811
|
| 216 |
+
],
|
| 217 |
+
"page_idx": 1
|
| 218 |
+
},
|
| 219 |
+
{
|
| 220 |
+
"type": "text",
|
| 221 |
+
"text": "The current state of the art in modeling images in the CIFAR-10 data set was achieved by the PixelCNN++, modeling the output pixel distribution with a discretized logistic mixture likelihood, conditioning on whole pixels instead of color channels and changes to the architecture (Salimans et al.). Most of these modifications can also be applied to our model which we plan to evaluate in future work. ",
|
| 222 |
+
"bbox": [
|
| 223 |
+
174,
|
| 224 |
+
819,
|
| 225 |
+
823,
|
| 226 |
+
888
|
| 227 |
+
],
|
| 228 |
+
"page_idx": 1
|
| 229 |
+
},
|
| 230 |
+
{
|
| 231 |
+
"type": "text",
|
| 232 |
+
"text": "Another, currently wildly popular direction of research in image generation is training models with an adversarial loss (Goodfellow et al., 2014). Typically, in this regime a generator network is trained in opposition to a discriminator network trying to determine if a given image is real or generated. In contrast to the often blurry images generated by networks trained with likelihood-based losses, such generative adversarial networks (GANs) have been shown to generate sharper images with realistic high-frequency detail in generation and image super-resolution tasks (Zhang et al., 2016; Ledig et al., 2016). ",
|
| 233 |
+
"bbox": [
|
| 234 |
+
174,
|
| 235 |
+
895,
|
| 236 |
+
821,
|
| 237 |
+
924
|
| 238 |
+
],
|
| 239 |
+
"page_idx": 1
|
| 240 |
+
},
|
| 241 |
+
{
|
| 242 |
+
"type": "image",
|
| 243 |
+
"img_path": "images/5cd909220d9c30121e12d3674ad75e559de12f50afbc9499627061dc1ff9e094.jpg",
|
| 244 |
+
"image_caption": [
|
| 245 |
+
"Figure 1: A slice of one layer of the Image Transformer, recomputing the representation $q ^ { \\prime }$ of a single channel of one pixel $q$ by attending to a memory of previously generated pixels $m _ { 1 } , m _ { 2 } , . . . .$ We apply a two-layer feed-forward neural network to the weighted average produced by the selfattention mechanism, perform layer normalization and sum the result with a residual connection. The position encodings $p _ { q } , p _ { 1 } , . . .$ are added only in the first layer. "
|
| 246 |
+
],
|
| 247 |
+
"image_footnote": [],
|
| 248 |
+
"bbox": [
|
| 249 |
+
282,
|
| 250 |
+
106,
|
| 251 |
+
712,
|
| 252 |
+
377
|
| 253 |
+
],
|
| 254 |
+
"page_idx": 2
|
| 255 |
+
},
|
| 256 |
+
{
|
| 257 |
+
"type": "text",
|
| 258 |
+
"text": "",
|
| 259 |
+
"bbox": [
|
| 260 |
+
174,
|
| 261 |
+
492,
|
| 262 |
+
825,
|
| 263 |
+
563
|
| 264 |
+
],
|
| 265 |
+
"page_idx": 2
|
| 266 |
+
},
|
| 267 |
+
{
|
| 268 |
+
"type": "text",
|
| 269 |
+
"text": "While very promising, GANs have various drawbacks. They are notoriously unstable (Radford et al., 2015), motivating a large number of methods attempting to make their training more robust (Metz et al., 2016; Berthelot et al., 2017). Another common issue is that of mode collapse, where generated images fail to reflect the diversity in the training set (Metz et al., 2016). ",
|
| 270 |
+
"bbox": [
|
| 271 |
+
174,
|
| 272 |
+
570,
|
| 273 |
+
825,
|
| 274 |
+
626
|
| 275 |
+
],
|
| 276 |
+
"page_idx": 2
|
| 277 |
+
},
|
| 278 |
+
{
|
| 279 |
+
"type": "text",
|
| 280 |
+
"text": "A related problem is that GANs do not readily offer a probabilistic interpretation of their outputs, making it very challenging to measure the degree to which the models capture diversity. In contrast to models with a tractable likelihood, it also complicates optimizing model design, as objectively comparing different parameterizations or hyperparameter choices in this setting is considerably more difficult than comparing log-probabilities assigned to a validation set. ",
|
| 281 |
+
"bbox": [
|
| 282 |
+
174,
|
| 283 |
+
632,
|
| 284 |
+
825,
|
| 285 |
+
703
|
| 286 |
+
],
|
| 287 |
+
"page_idx": 2
|
| 288 |
+
},
|
| 289 |
+
{
|
| 290 |
+
"type": "text",
|
| 291 |
+
"text": "3 MODEL ARCHITECTURE ",
|
| 292 |
+
"text_level": 1,
|
| 293 |
+
"bbox": [
|
| 294 |
+
176,
|
| 295 |
+
724,
|
| 296 |
+
408,
|
| 297 |
+
741
|
| 298 |
+
],
|
| 299 |
+
"page_idx": 2
|
| 300 |
+
},
|
| 301 |
+
{
|
| 302 |
+
"type": "text",
|
| 303 |
+
"text": "3.1 IMAGE REPRESENTATION AND 2D POSITIONAL INFORMATION ",
|
| 304 |
+
"text_level": 1,
|
| 305 |
+
"bbox": [
|
| 306 |
+
176,
|
| 307 |
+
756,
|
| 308 |
+
645,
|
| 309 |
+
771
|
| 310 |
+
],
|
| 311 |
+
"page_idx": 2
|
| 312 |
+
},
|
| 313 |
+
{
|
| 314 |
+
"type": "text",
|
| 315 |
+
"text": "We treat both the input and predicted pixel RGB intensities as categorical variables rather than real numbers. Each input pixel’s channel is encoded using a channel-specific set of 256 $d$ -dimensional embedding vectors of the channel intensity values $0 - 2 5 5$ . For output intensities, we share a single, separate set of 256 $d$ -dimensional embeddings across channels. ",
|
| 316 |
+
"bbox": [
|
| 317 |
+
174,
|
| 318 |
+
784,
|
| 319 |
+
825,
|
| 320 |
+
839
|
| 321 |
+
],
|
| 322 |
+
"page_idx": 2
|
| 323 |
+
},
|
| 324 |
+
{
|
| 325 |
+
"type": "text",
|
| 326 |
+
"text": "We then combine the width and channels dimensions, yielding, for an image of width $w$ and height $h$ , a 3-dimensional tensor with shape $[ h , w \\cdot 3 , d ]$ . ",
|
| 327 |
+
"bbox": [
|
| 328 |
+
174,
|
| 329 |
+
845,
|
| 330 |
+
820,
|
| 331 |
+
876
|
| 332 |
+
],
|
| 333 |
+
"page_idx": 2
|
| 334 |
+
},
|
| 335 |
+
{
|
| 336 |
+
"type": "text",
|
| 337 |
+
"text": "To each pixel representation, we add a $d$ -dimensional encoding of the coordinates of that pixel. Following Vaswani et al. (2017), the encoding consists of sine and cosine functions of the coordinates, with different frequencies across different dimensions. Since we need to represent two coordinates, we use $d / 2$ of the dimensions to encode the row number and the other $d / 2$ of the dimensions to encode the the column and color channel. ",
|
| 338 |
+
"bbox": [
|
| 339 |
+
176,
|
| 340 |
+
882,
|
| 341 |
+
823,
|
| 342 |
+
924
|
| 343 |
+
],
|
| 344 |
+
"page_idx": 2
|
| 345 |
+
},
|
| 346 |
+
{
|
| 347 |
+
"type": "text",
|
| 348 |
+
"text": "",
|
| 349 |
+
"bbox": [
|
| 350 |
+
173,
|
| 351 |
+
103,
|
| 352 |
+
823,
|
| 353 |
+
132
|
| 354 |
+
],
|
| 355 |
+
"page_idx": 3
|
| 356 |
+
},
|
| 357 |
+
{
|
| 358 |
+
"type": "text",
|
| 359 |
+
"text": "The resulting tensor forms the input to our 2D local attention models (Section 3.3). For 1D local attention (Section 3.3) and the input to our super-resolution models we flatten this tensor in rasterscan order, similar to previous work (van den Oord et al., 2016). This yields a $[ h \\cdot w \\cdot 3 , d ]$ tensor. ",
|
| 360 |
+
"bbox": [
|
| 361 |
+
176,
|
| 362 |
+
138,
|
| 363 |
+
823,
|
| 364 |
+
181
|
| 365 |
+
],
|
| 366 |
+
"page_idx": 3
|
| 367 |
+
},
|
| 368 |
+
{
|
| 369 |
+
"type": "text",
|
| 370 |
+
"text": "3.2 SELF-ATTENTION ",
|
| 371 |
+
"text_level": 1,
|
| 372 |
+
"bbox": [
|
| 373 |
+
174,
|
| 374 |
+
200,
|
| 375 |
+
338,
|
| 376 |
+
214
|
| 377 |
+
],
|
| 378 |
+
"page_idx": 3
|
| 379 |
+
},
|
| 380 |
+
{
|
| 381 |
+
"type": "text",
|
| 382 |
+
"text": "Like the Transformer (Vaswani et al., 2017), the Image Transformer uses stacks of self-attention and position-wise feed-forward layers. Before we describe how we scale self-attention from sentences to images, which contain many more positions, we give a brief description of the self-attention layer. ",
|
| 383 |
+
"bbox": [
|
| 384 |
+
176,
|
| 385 |
+
227,
|
| 386 |
+
823,
|
| 387 |
+
270
|
| 388 |
+
],
|
| 389 |
+
"page_idx": 3
|
| 390 |
+
},
|
| 391 |
+
{
|
| 392 |
+
"type": "text",
|
| 393 |
+
"text": "Each self-attention layer computes a new $d$ -dimensional representation for each position, that is each channel of each pixel. To recompute the representation for a given position, it first compares the position’s current representation to other positions’ representations, obtaining an attention distribution over the other positions. This distribution is then used to weight the contribution of the other postions’ representations to the next representation for the position at hand. ",
|
| 394 |
+
"bbox": [
|
| 395 |
+
174,
|
| 396 |
+
275,
|
| 397 |
+
825,
|
| 398 |
+
347
|
| 399 |
+
],
|
| 400 |
+
"page_idx": 3
|
| 401 |
+
},
|
| 402 |
+
{
|
| 403 |
+
"type": "text",
|
| 404 |
+
"text": "Equation 1 and Figure1 fully describe all operations performed in every layer, independently for each position, with the exception of multi-head attention. For a detailed description of multi-head self-attention the reader is referred to (Vaswani et al., 2017). ",
|
| 405 |
+
"bbox": [
|
| 406 |
+
173,
|
| 407 |
+
353,
|
| 408 |
+
823,
|
| 409 |
+
396
|
| 410 |
+
],
|
| 411 |
+
"page_idx": 3
|
| 412 |
+
},
|
| 413 |
+
{
|
| 414 |
+
"type": "equation",
|
| 415 |
+
"img_path": "images/b87c8f5a688a5a57367993bbe8a2ba5f067f45466fda86dc6a419ed2140a3229.jpg",
|
| 416 |
+
"text": "$$\nq ^ { \\prime } = q + \\mathrm { d r o p o u t } ( \\mathrm { l a y e r n o r m } ( \\mathrm { F F N N } ( \\mathrm { s o f t m a x } \\left( \\frac { W _ { q } q ( M W _ { k } ) ^ { T } } { \\sqrt { d } } \\right) M W _ { v } ) ) )\n$$",
|
| 417 |
+
"text_format": "latex",
|
| 418 |
+
"bbox": [
|
| 419 |
+
246,
|
| 420 |
+
415,
|
| 421 |
+
750,
|
| 422 |
+
450
|
| 423 |
+
],
|
| 424 |
+
"page_idx": 3
|
| 425 |
+
},
|
| 426 |
+
{
|
| 427 |
+
"type": "text",
|
| 428 |
+
"text": "In more detail, following previous work, we call the current representation of the pixel’s channel, or position, to be recomputed the query $q$ . The other positions whose representations will be used in computing a new representation for $q$ are $m _ { 1 } , m _ { 2 } , . . .$ which together comprise the columns of the memory matrix $M$ . Note that $M$ can also contain $q$ . We first transform $q$ and $M$ linearly by learned matrices $W _ { q }$ and $W _ { k }$ , respectively. ",
|
| 429 |
+
"bbox": [
|
| 430 |
+
173,
|
| 431 |
+
463,
|
| 432 |
+
825,
|
| 433 |
+
532
|
| 434 |
+
],
|
| 435 |
+
"page_idx": 3
|
| 436 |
+
},
|
| 437 |
+
{
|
| 438 |
+
"type": "text",
|
| 439 |
+
"text": "The self-attention mechanism then compares $q$ to each of the pixel’s channel representations in the memory with a dot-product, scaled by $1 / { \\sqrt { d } }$ . We apply the softmax function to the resulting compatibility scores, treating the obtained vector as attention distribution over the pixel channels in the memory. After applying another linear transformation $W _ { v }$ to the memory $M$ , we compute a weighted average of the transformed memory, weighted by the attention distribution. In the decoders of our different models we mask the outputs of the comparisons appropriately so that the model cannot attend to positions in the memory that have not been generated, yet. ",
|
| 440 |
+
"bbox": [
|
| 441 |
+
174,
|
| 442 |
+
539,
|
| 443 |
+
825,
|
| 444 |
+
638
|
| 445 |
+
],
|
| 446 |
+
"page_idx": 3
|
| 447 |
+
},
|
| 448 |
+
{
|
| 449 |
+
"type": "text",
|
| 450 |
+
"text": "To the resulting vector we then apply a single-layer fully-connected feed-forward neural network with rectified linear activation followed by another linear transformation. The learned parameters of these are shared across all positions but different from layer to layer. Lastly, we perform layer normalization followed by dropout (Ba et al., 2016; Srivastava et al., 2014). ",
|
| 451 |
+
"bbox": [
|
| 452 |
+
174,
|
| 453 |
+
646,
|
| 454 |
+
825,
|
| 455 |
+
702
|
| 456 |
+
],
|
| 457 |
+
"page_idx": 3
|
| 458 |
+
},
|
| 459 |
+
{
|
| 460 |
+
"type": "text",
|
| 461 |
+
"text": "The entire self-attention operation can be implemented using highly optimized matrix multiplication code and executed in parallel for all pixels’ channels. ",
|
| 462 |
+
"bbox": [
|
| 463 |
+
174,
|
| 464 |
+
709,
|
| 465 |
+
823,
|
| 466 |
+
737
|
| 467 |
+
],
|
| 468 |
+
"page_idx": 3
|
| 469 |
+
},
|
| 470 |
+
{
|
| 471 |
+
"type": "text",
|
| 472 |
+
"text": "3.3 LOCAL SELF-ATTENTION ",
|
| 473 |
+
"text_level": 1,
|
| 474 |
+
"bbox": [
|
| 475 |
+
176,
|
| 476 |
+
757,
|
| 477 |
+
392,
|
| 478 |
+
771
|
| 479 |
+
],
|
| 480 |
+
"page_idx": 3
|
| 481 |
+
},
|
| 482 |
+
{
|
| 483 |
+
"type": "text",
|
| 484 |
+
"text": "The number of positions included in the memory $l _ { m }$ , or the number of columns of $M$ , has tremendous impact on the scalability of the self-attention mechanism, which has a time complexity in $O ( h \\cdot w \\cdot l _ { m } \\cdot d )$ . ",
|
| 485 |
+
"bbox": [
|
| 486 |
+
174,
|
| 487 |
+
784,
|
| 488 |
+
823,
|
| 489 |
+
827
|
| 490 |
+
],
|
| 491 |
+
"page_idx": 3
|
| 492 |
+
},
|
| 493 |
+
{
|
| 494 |
+
"type": "text",
|
| 495 |
+
"text": "The encoders of our super-resolution models operate on $8 \\times 8$ pixel images and it is computationally feasible to attend to all of their 192 positions. The decoders in our experiments, however, produce $3 2 \\times 3 2$ pixel images with 3072 positions, rendering attending to all positions impractical. ",
|
| 496 |
+
"bbox": [
|
| 497 |
+
174,
|
| 498 |
+
833,
|
| 499 |
+
825,
|
| 500 |
+
875
|
| 501 |
+
],
|
| 502 |
+
"page_idx": 3
|
| 503 |
+
},
|
| 504 |
+
{
|
| 505 |
+
"type": "text",
|
| 506 |
+
"text": "Inspired by convolutional neural networks we address this by adopting a notion of locality, restricting the positions in the memory matrix $M$ to a local neighborhood around the query position. Changing this neighborhood per query position, however, would prohibit packing most of the computation necessary for self-attention into two matrix multiplications - one for computing the pairwise comparisons and another for generating the weighted averages. To avoid this, we partition the image into query blocks and associate each of these with a larger memory block that also contains the query block. For all queries from a given query block, the model attends to the same memory matrix, comprised of all positions from the memory block. ",
|
| 507 |
+
"bbox": [
|
| 508 |
+
176,
|
| 509 |
+
881,
|
| 510 |
+
823,
|
| 511 |
+
924
|
| 512 |
+
],
|
| 513 |
+
"page_idx": 3
|
| 514 |
+
},
|
| 515 |
+
{
|
| 516 |
+
"type": "image",
|
| 517 |
+
"img_path": "images/30d100ecf3d3faac2c41810886ac2e9a3dbc045b98fcd9aa30107d53e7149da6.jpg",
|
| 518 |
+
"image_caption": [
|
| 519 |
+
"Figure 2: The two different conditional factorizations used in our experiments, with 1D and 2D local attention on the left and right, respectively. In both, the image is partitioned into non-overlapping query blocks, each associated with a memory block covering a superset of the query block pixels. In every self-attention layer, each position in a query block attends to all positions in the memory block. The pixel marked as $q$ is the last that was generated. All channels of pixels in the memory and query blocks shown in white have masked attention weights and do not contribute to the next representations of positions in the query block. While the effective receptive field size in this figure is the same for both schemes, in 2D attention the memory block contains a more evenly balanced number of pixels next to and above the query block, respectively. "
|
| 520 |
+
],
|
| 521 |
+
"image_footnote": [],
|
| 522 |
+
"bbox": [
|
| 523 |
+
284,
|
| 524 |
+
102,
|
| 525 |
+
714,
|
| 526 |
+
257
|
| 527 |
+
],
|
| 528 |
+
"page_idx": 4
|
| 529 |
+
},
|
| 530 |
+
{
|
| 531 |
+
"type": "text",
|
| 532 |
+
"text": "",
|
| 533 |
+
"bbox": [
|
| 534 |
+
174,
|
| 535 |
+
428,
|
| 536 |
+
825,
|
| 537 |
+
498
|
| 538 |
+
],
|
| 539 |
+
"page_idx": 4
|
| 540 |
+
},
|
| 541 |
+
{
|
| 542 |
+
"type": "text",
|
| 543 |
+
"text": "The self-attention is then computed for all query blocks in parallel, while the feed-forward networks and layer normalizations are computed in parallel for all positions. ",
|
| 544 |
+
"bbox": [
|
| 545 |
+
173,
|
| 546 |
+
505,
|
| 547 |
+
823,
|
| 548 |
+
534
|
| 549 |
+
],
|
| 550 |
+
"page_idx": 4
|
| 551 |
+
},
|
| 552 |
+
{
|
| 553 |
+
"type": "text",
|
| 554 |
+
"text": "In our experiments we use two different schemes for choosing query blocks and their associated memory block neighborhoods, resulting in two different factorizations of the joint pixel distribution into conditional distributions. Both are illustrated in Figure 2. ",
|
| 555 |
+
"bbox": [
|
| 556 |
+
176,
|
| 557 |
+
540,
|
| 558 |
+
821,
|
| 559 |
+
582
|
| 560 |
+
],
|
| 561 |
+
"page_idx": 4
|
| 562 |
+
},
|
| 563 |
+
{
|
| 564 |
+
"type": "text",
|
| 565 |
+
"text": "1D Local Attention To compute self-attention on raster-scanned linearized images, we partition the length into non-overlapping query blocks $Q$ of length $l _ { q }$ , padding with zeroes if necessary. While contiguous in the linearized image, these blocks can be discontiguous in image coordinate space. For each query block we build the memory block $M$ from the same positions as $Q$ and an additional $l _ { m }$ positions from pixels that have been generated before, which can result in overlapping memory blocks. ",
|
| 566 |
+
"bbox": [
|
| 567 |
+
174,
|
| 568 |
+
602,
|
| 569 |
+
825,
|
| 570 |
+
685
|
| 571 |
+
],
|
| 572 |
+
"page_idx": 4
|
| 573 |
+
},
|
| 574 |
+
{
|
| 575 |
+
"type": "text",
|
| 576 |
+
"text": "2D Local Attention In 2D local attention models, we partition the image into query blocks rectangular and contiguous in the original image space. We generate the image one query block after another, ordering the blocks in raster-scan order. Within each block, we generate individual positions, or pixel channels, again in raster-scan order. ",
|
| 577 |
+
"bbox": [
|
| 578 |
+
174,
|
| 579 |
+
707,
|
| 580 |
+
823,
|
| 581 |
+
762
|
| 582 |
+
],
|
| 583 |
+
"page_idx": 4
|
| 584 |
+
},
|
| 585 |
+
{
|
| 586 |
+
"type": "text",
|
| 587 |
+
"text": "As illustrated in the right half of Figure 2, we generate the blocks outlined in grey lines left-to-right and top-to-bottom. We use 2-dimensional query blocks of a size $l _ { q }$ specified by height and width $l _ { q } = w _ { q } \\cdot h _ { q }$ , and memory blocks extending the query block to the top, left and right by $h _ { m }$ , $w _ { m }$ and again $w _ { m }$ pixels, respectively. ",
|
| 588 |
+
"bbox": [
|
| 589 |
+
173,
|
| 590 |
+
770,
|
| 591 |
+
825,
|
| 592 |
+
825
|
| 593 |
+
],
|
| 594 |
+
"page_idx": 4
|
| 595 |
+
},
|
| 596 |
+
{
|
| 597 |
+
"type": "text",
|
| 598 |
+
"text": "In both 1D and 2D local attention, we mask attention weights in the query and memory blocks such that positions that have not yet been generated are ignored. ",
|
| 599 |
+
"bbox": [
|
| 600 |
+
173,
|
| 601 |
+
833,
|
| 602 |
+
820,
|
| 603 |
+
861
|
| 604 |
+
],
|
| 605 |
+
"page_idx": 4
|
| 606 |
+
},
|
| 607 |
+
{
|
| 608 |
+
"type": "text",
|
| 609 |
+
"text": "As can be seen in Figure 2, 2D local attention balances horizontal and vertical conditioning context much more evenly. We believe this might have an increasingly positive effect on quality with growing image size as the conditioning information in 1D local attention becomes increasingly dominated by pixels next to a given position as opposed to above it. ",
|
| 610 |
+
"bbox": [
|
| 611 |
+
174,
|
| 612 |
+
867,
|
| 613 |
+
823,
|
| 614 |
+
924
|
| 615 |
+
],
|
| 616 |
+
"page_idx": 4
|
| 617 |
+
},
|
| 618 |
+
{
|
| 619 |
+
"type": "image",
|
| 620 |
+
"img_path": "images/052cf9c161ffc2890ecee2f98b4787434b04583a172ac30cba715d69854538f9.jpg",
|
| 621 |
+
"image_caption": [
|
| 622 |
+
"Table 2: Conditional image generations for all CIFAR-10 categories. Images on the left are from a model that achieves 3.03 bits/dim on the test set. Images on the right are from our best nonaveraged model with 2.99 bits/dim. Both models are able to generate convincing cars, trucks, and ships. Generated horses, planes, and birds also look reasonable. "
|
| 623 |
+
],
|
| 624 |
+
"image_footnote": [],
|
| 625 |
+
"bbox": [
|
| 626 |
+
186,
|
| 627 |
+
114,
|
| 628 |
+
803,
|
| 629 |
+
582
|
| 630 |
+
],
|
| 631 |
+
"page_idx": 5
|
| 632 |
+
},
|
| 633 |
+
{
|
| 634 |
+
"type": "text",
|
| 635 |
+
"text": "4 INFERENCE ",
|
| 636 |
+
"text_level": 1,
|
| 637 |
+
"bbox": [
|
| 638 |
+
174,
|
| 639 |
+
684,
|
| 640 |
+
302,
|
| 641 |
+
700
|
| 642 |
+
],
|
| 643 |
+
"page_idx": 5
|
| 644 |
+
},
|
| 645 |
+
{
|
| 646 |
+
"type": "text",
|
| 647 |
+
"text": "Across all of the presented experiments, we sample from the various models with a tempered softmax (Dahl et al., 2017). We adjust the concentration of the distribution we sample from with a temperature $\\tau > 0$ by which we divide the logits for the channel intensities. ",
|
| 648 |
+
"bbox": [
|
| 649 |
+
174,
|
| 650 |
+
722,
|
| 651 |
+
825,
|
| 652 |
+
763
|
| 653 |
+
],
|
| 654 |
+
"page_idx": 5
|
| 655 |
+
},
|
| 656 |
+
{
|
| 657 |
+
"type": "text",
|
| 658 |
+
"text": "We tuned $\\tau$ between 0.8 and 1.0, observing the highest perceptual quality in unconditioned and classconditional image generation with $\\tau = 1 . 0$ . For super-resolution we present results for different temperatures in Table 4. ",
|
| 659 |
+
"bbox": [
|
| 660 |
+
174,
|
| 661 |
+
770,
|
| 662 |
+
825,
|
| 663 |
+
813
|
| 664 |
+
],
|
| 665 |
+
"page_idx": 5
|
| 666 |
+
},
|
| 667 |
+
{
|
| 668 |
+
"type": "text",
|
| 669 |
+
"text": "5 EXPERIMENTS ",
|
| 670 |
+
"text_level": 1,
|
| 671 |
+
"bbox": [
|
| 672 |
+
176,
|
| 673 |
+
843,
|
| 674 |
+
326,
|
| 675 |
+
859
|
| 676 |
+
],
|
| 677 |
+
"page_idx": 5
|
| 678 |
+
},
|
| 679 |
+
{
|
| 680 |
+
"type": "text",
|
| 681 |
+
"text": "For all of our experiments we optimize with Adam (Kingma & Ba, 2015), and vary the learning rate as specified in Vaswani et al. (2017). We train our models on both p100 and k40 GPUs, with batch sizes ranging from 1 to 4 per GPU. ",
|
| 682 |
+
"bbox": [
|
| 683 |
+
176,
|
| 684 |
+
881,
|
| 685 |
+
823,
|
| 686 |
+
924
|
| 687 |
+
],
|
| 688 |
+
"page_idx": 5
|
| 689 |
+
},
|
| 690 |
+
{
|
| 691 |
+
"type": "table",
|
| 692 |
+
"img_path": "images/a8b34b0918ecb404618178a4ae5fdbdaa1f4918c40be5a82438ff617953ee8a0.jpg",
|
| 693 |
+
"table_caption": [
|
| 694 |
+
"Table 3: Negative log-likelihoods on the CIFAR-10 test and ImageNet validation sets. The Image Transformer outperforms all models but PixelC $\\mathrm { N N } { + } { + }$ , achieving a new state of the art on ImageNet. Larger memory blocks significantly improve its performance. "
|
| 695 |
+
],
|
| 696 |
+
"table_footnote": [],
|
| 697 |
+
"table_body": "<table><tr><td rowspan=\"2\">Model Type</td><td rowspan=\"2\">Memory Block Size</td><td colspan=\"2\">NLL</td></tr><tr><td>CIFAR-10 (Test)</td><td>ImageNet (Validation)</td></tr><tr><td>Pixel CNN</td><td></td><td>3.14</td><td>1</td></tr><tr><td>RowPixel RNN</td><td></td><td>3.00</td><td>3.86</td></tr><tr><td>Gated Pixel CNN</td><td></td><td>3.03</td><td>3.83</td></tr><tr><td>Pixel CNN++</td><td>=</td><td>2.92</td><td>=</td></tr><tr><td rowspan=\"4\">Image Transformer 1D local</td><td>8</td><td>4.06</td><td></td></tr><tr><td>16</td><td>3.47</td><td></td></tr><tr><td>64</td><td>3.13</td><td></td></tr><tr><td>256</td><td>2.99</td><td>3.78</td></tr><tr><td>with checkpoint averaging</td><td>256</td><td>2.98</td><td>3.77</td></tr></table>",
|
| 698 |
+
"bbox": [
|
| 699 |
+
174,
|
| 700 |
+
159,
|
| 701 |
+
828,
|
| 702 |
+
319
|
| 703 |
+
],
|
| 704 |
+
"page_idx": 6
|
| 705 |
+
},
|
| 706 |
+
{
|
| 707 |
+
"type": "text",
|
| 708 |
+
"text": "5.1 GENERATIVE IMAGE MODELING ",
|
| 709 |
+
"text_level": 1,
|
| 710 |
+
"bbox": [
|
| 711 |
+
176,
|
| 712 |
+
358,
|
| 713 |
+
441,
|
| 714 |
+
372
|
| 715 |
+
],
|
| 716 |
+
"page_idx": 6
|
| 717 |
+
},
|
| 718 |
+
{
|
| 719 |
+
"type": "text",
|
| 720 |
+
"text": "Our unconditioned and class-conditioned image generation models both use 1D local attention, with $l _ { q } = 2 5 6$ and a total memory size of 512. On CIFAR-10 our best class-conditioned model (2.99 bits/dim) uses 8 self-attention and feed-forward layers, $d = 1 0 2 4$ , 16 attention heads, 2048 dimensions in the feed-forward layers, and a dropout of 0.3. Our smaller CIFAR-10 models (3.03 bits/dim) have $d = 5 1 2$ , 1024 dimensions in the feed-forward layers, 8 attention heads and use dropout $= ~ 0 . 1$ . Our state of the art ImageNet unconditioned generation model is significantly larger, with 12 self-attention and feed-forward layers, $d = 1 0 2 4$ , 4096-dimensional feed-forward layers, 16 attention heads, and dropout $= 0 . 1$ . ",
|
| 721 |
+
"bbox": [
|
| 722 |
+
173,
|
| 723 |
+
383,
|
| 724 |
+
825,
|
| 725 |
+
496
|
| 726 |
+
],
|
| 727 |
+
"page_idx": 6
|
| 728 |
+
},
|
| 729 |
+
{
|
| 730 |
+
"type": "text",
|
| 731 |
+
"text": "As Table 3 shows, our models improve over various previously proposed models including the PixelRNN and the gated PixelCNN. On ImageNet we establish a new state of the art of 3.78, which we can improve to 3.77 by averaging the last ten checkpoints. ",
|
| 732 |
+
"bbox": [
|
| 733 |
+
174,
|
| 734 |
+
502,
|
| 735 |
+
821,
|
| 736 |
+
545
|
| 737 |
+
],
|
| 738 |
+
"page_idx": 6
|
| 739 |
+
},
|
| 740 |
+
{
|
| 741 |
+
"type": "text",
|
| 742 |
+
"text": "While the Pixel $\\mathrm { C N N + + }$ achieved significantly better log-likelihoods on CIFAR-10 (Salimans et al.), we expect that many of the modifications in the PixelCNN++ carry over to the Image Transformer. We further believe our curated images for various classes to be of reasonable perceptual quality. ",
|
| 743 |
+
"bbox": [
|
| 744 |
+
176,
|
| 745 |
+
551,
|
| 746 |
+
821,
|
| 747 |
+
594
|
| 748 |
+
],
|
| 749 |
+
"page_idx": 6
|
| 750 |
+
},
|
| 751 |
+
{
|
| 752 |
+
"type": "text",
|
| 753 |
+
"text": "5.2 CONDITIONING ON IMAGE CLASS ",
|
| 754 |
+
"text_level": 1,
|
| 755 |
+
"bbox": [
|
| 756 |
+
176,
|
| 757 |
+
613,
|
| 758 |
+
449,
|
| 759 |
+
627
|
| 760 |
+
],
|
| 761 |
+
"page_idx": 6
|
| 762 |
+
},
|
| 763 |
+
{
|
| 764 |
+
"type": "text",
|
| 765 |
+
"text": "We represent the image classes as learned $d$ -dimensional embeddings per class and simply add the respective embedding to the input representation of every input position together with the positional encodings. ",
|
| 766 |
+
"bbox": [
|
| 767 |
+
176,
|
| 768 |
+
640,
|
| 769 |
+
823,
|
| 770 |
+
683
|
| 771 |
+
],
|
| 772 |
+
"page_idx": 6
|
| 773 |
+
},
|
| 774 |
+
{
|
| 775 |
+
"type": "text",
|
| 776 |
+
"text": "We trained the class-conditioned Image Transformer on CIFAR-10 and ImageNet data sets, achieving very similar log-likelihoods as in unconditioned generation. The perceptual quality of generated images, however, is significantly higher than that of our unconditioned models. We present some samples in Table 2. ",
|
| 777 |
+
"bbox": [
|
| 778 |
+
174,
|
| 779 |
+
689,
|
| 780 |
+
825,
|
| 781 |
+
744
|
| 782 |
+
],
|
| 783 |
+
"page_idx": 6
|
| 784 |
+
},
|
| 785 |
+
{
|
| 786 |
+
"type": "text",
|
| 787 |
+
"text": "5.3 IMAGE SUPER-RESOLUTION ",
|
| 788 |
+
"text_level": 1,
|
| 789 |
+
"bbox": [
|
| 790 |
+
176,
|
| 791 |
+
763,
|
| 792 |
+
411,
|
| 793 |
+
779
|
| 794 |
+
],
|
| 795 |
+
"page_idx": 6
|
| 796 |
+
},
|
| 797 |
+
{
|
| 798 |
+
"type": "text",
|
| 799 |
+
"text": "Super-resolution is the process of recovering a high resolution image from a low resolution image while generating realistic and plausible details. Following (Dahl et al., 2017), in our experimental setup we enlarge an $8 \\times 8$ pixel image four-fold to $3 2 \\times 3 2$ , a process that is massively underspecified: the model has to generate aspects such as texture of hair, makeup, skin and sometimes even gender that cannot possibly be recovered from the source image. ",
|
| 800 |
+
"bbox": [
|
| 801 |
+
174,
|
| 802 |
+
791,
|
| 803 |
+
825,
|
| 804 |
+
861
|
| 805 |
+
],
|
| 806 |
+
"page_idx": 6
|
| 807 |
+
},
|
| 808 |
+
{
|
| 809 |
+
"type": "text",
|
| 810 |
+
"text": "Here, we use the Image Transformer in an encoder-decoder configuration, connecting the encoder and decoder through an attention mechanism (Vaswani et al., 2017). Since the input is an $8 \\times 8$ image, it is practical to use 1D attention with only one query and one memory block, each covering the entire image. We further use model dimension $d = 5 1 2$ , 1024 hidden units in the position-wise feed-forward network, 4 encoder layers and 12 decoder layers. We train end-to-end, maximizing likelihood. ",
|
| 811 |
+
"bbox": [
|
| 812 |
+
174,
|
| 813 |
+
867,
|
| 814 |
+
823,
|
| 815 |
+
924
|
| 816 |
+
],
|
| 817 |
+
"page_idx": 6
|
| 818 |
+
},
|
| 819 |
+
{
|
| 820 |
+
"type": "table",
|
| 821 |
+
"img_path": "images/3fb37523a090e54a25ac6ed21b9853276458b0cffa4adbd4d8b9071281c91975.jpg",
|
| 822 |
+
"table_caption": [
|
| 823 |
+
"Table 4: Negative log-likelihood and human eval performance for the Image Transformer on CelebA. The fraction of humans fooled is significantly better than the previous state of the art. 2D local attention outperforms 1D local attention in the human evaluation. "
|
| 824 |
+
],
|
| 825 |
+
"table_footnote": [],
|
| 826 |
+
"table_body": "<table><tr><td>Model Type</td><td>NLL</td><td colspan=\"3\">%Fooled</td></tr><tr><td></td><td></td><td>T=n/a T = 1.0</td><td>T = 0.9</td><td>T = 0.8</td></tr><tr><td>ResNet</td><td></td><td>4.0</td><td></td><td></td></tr><tr><td>srez GAN (Garcia, 2016)</td><td>8.5</td><td></td><td></td><td>10.2</td></tr><tr><td>PixelRecursive (Dahl et al., 2017)</td><td>1 1 2.74</td><td>11.0 21.5 ± 4.0</td><td>10.4 30.1 ± 3.5</td><td>32.5± 3.0</td></tr><tr><td>ImageTransformer 1D local attention</td><td>2.79</td><td></td><td>36.9 ± 2.5</td><td>32.5 ± 2.5</td></tr><tr><td>ImageTransformer 2D local attention</td><td></td><td>31.25 ± 3.5</td><td></td><td></td></tr></table>",
|
| 827 |
+
"bbox": [
|
| 828 |
+
173,
|
| 829 |
+
165,
|
| 830 |
+
846,
|
| 831 |
+
282
|
| 832 |
+
],
|
| 833 |
+
"page_idx": 7
|
| 834 |
+
},
|
| 835 |
+
{
|
| 836 |
+
"type": "text",
|
| 837 |
+
"text": "",
|
| 838 |
+
"bbox": [
|
| 839 |
+
174,
|
| 840 |
+
328,
|
| 841 |
+
823,
|
| 842 |
+
356
|
| 843 |
+
],
|
| 844 |
+
"page_idx": 7
|
| 845 |
+
},
|
| 846 |
+
{
|
| 847 |
+
"type": "text",
|
| 848 |
+
"text": "For both of the following data sets, we resized the image to $8 \\times 8$ pixels for the input and $3 2 \\times 3 2$ pixels for the label using TensorFlow’s area interpolation method. ",
|
| 849 |
+
"bbox": [
|
| 850 |
+
174,
|
| 851 |
+
363,
|
| 852 |
+
823,
|
| 853 |
+
391
|
| 854 |
+
],
|
| 855 |
+
"page_idx": 7
|
| 856 |
+
},
|
| 857 |
+
{
|
| 858 |
+
"type": "text",
|
| 859 |
+
"text": "CelebA We trained on the standard CelebA data set of celebrity faces with cropped boundaries. Existing automated metrics like pSNR, SSIM and MS-SSIM have been shown to not correlate with perceptual image quality (Dahl et al., 2017). Instead, we conducted a human evaluation study on Amazon Mechanical Turk. Each worker is required to make a binary choice when shown one generated and one real image. Following (Dahl et al., 2017), we show 50 pairs of images, selected randomly, to 50 workers each. In our method, workers choose images from our model up to $3 6 . 9 \\%$ of the time, a significant improvement over previous models. Sampling temperature of 0.9 and 2D local attention maximized perceptual quality as measured by this evaluation. ",
|
| 860 |
+
"bbox": [
|
| 861 |
+
173,
|
| 862 |
+
409,
|
| 863 |
+
825,
|
| 864 |
+
520
|
| 865 |
+
],
|
| 866 |
+
"page_idx": 7
|
| 867 |
+
},
|
| 868 |
+
{
|
| 869 |
+
"type": "text",
|
| 870 |
+
"text": "CIFAR-10 We also trained a super-resolution model on the CIFAR-10 data set. Our model reached a negative log-likelihood of 2.76 using 1D local attention and 2.78 using 2D local attention on the test set. As seen in Figure 5.3, our model commonly generates plausible looking objects even though the input images seem to barely show any discernible structure beyond coarse shapes. ",
|
| 871 |
+
"bbox": [
|
| 872 |
+
174,
|
| 873 |
+
536,
|
| 874 |
+
825,
|
| 875 |
+
592
|
| 876 |
+
],
|
| 877 |
+
"page_idx": 7
|
| 878 |
+
},
|
| 879 |
+
{
|
| 880 |
+
"type": "text",
|
| 881 |
+
"text": "6 CONCLUSION ",
|
| 882 |
+
"text_level": 1,
|
| 883 |
+
"bbox": [
|
| 884 |
+
174,
|
| 885 |
+
613,
|
| 886 |
+
318,
|
| 887 |
+
630
|
| 888 |
+
],
|
| 889 |
+
"page_idx": 7
|
| 890 |
+
},
|
| 891 |
+
{
|
| 892 |
+
"type": "text",
|
| 893 |
+
"text": "In this work we demonstrate that models based on self-attention can operate effectively on modalities other than text, and through local self-attention scale to significantly larger structures than sentences. With fewer layers, its larger receptive fields allow the Image Transformer to improve over the state of the art in unconditional, probabilistic image modeling of comparatively complex images from ImageNet as well as super-resolution. ",
|
| 894 |
+
"bbox": [
|
| 895 |
+
174,
|
| 896 |
+
645,
|
| 897 |
+
825,
|
| 898 |
+
715
|
| 899 |
+
],
|
| 900 |
+
"page_idx": 7
|
| 901 |
+
},
|
| 902 |
+
{
|
| 903 |
+
"type": "text",
|
| 904 |
+
"text": "We further hope to have provided additional evidence that even in the light of generative adversarial networks, autoregressive generation of images is very much a promising area for further research - as is using network architectures such as the Image Transformer in GANs. ",
|
| 905 |
+
"bbox": [
|
| 906 |
+
174,
|
| 907 |
+
723,
|
| 908 |
+
825,
|
| 909 |
+
765
|
| 910 |
+
],
|
| 911 |
+
"page_idx": 7
|
| 912 |
+
},
|
| 913 |
+
{
|
| 914 |
+
"type": "text",
|
| 915 |
+
"text": "In future work we would like to explore a broader variety of conditioning information including free-form text, as previously proposed (Mansimov et al., 2015), and tasks combining modalities such as language-driven editing of images. ",
|
| 916 |
+
"bbox": [
|
| 917 |
+
174,
|
| 918 |
+
771,
|
| 919 |
+
825,
|
| 920 |
+
814
|
| 921 |
+
],
|
| 922 |
+
"page_idx": 7
|
| 923 |
+
},
|
| 924 |
+
{
|
| 925 |
+
"type": "text",
|
| 926 |
+
"text": "Fundamentally, we aim to move beyond still images to video (Kalchbrenner et al., 2016) and towards applications of such models in more model-based reinforcement learning approaches. ",
|
| 927 |
+
"bbox": [
|
| 928 |
+
173,
|
| 929 |
+
820,
|
| 930 |
+
823,
|
| 931 |
+
849
|
| 932 |
+
],
|
| 933 |
+
"page_idx": 7
|
| 934 |
+
},
|
| 935 |
+
{
|
| 936 |
+
"type": "text",
|
| 937 |
+
"text": "REFERENCES ",
|
| 938 |
+
"text_level": 1,
|
| 939 |
+
"bbox": [
|
| 940 |
+
176,
|
| 941 |
+
871,
|
| 942 |
+
285,
|
| 943 |
+
886
|
| 944 |
+
],
|
| 945 |
+
"page_idx": 7
|
| 946 |
+
},
|
| 947 |
+
{
|
| 948 |
+
"type": "text",
|
| 949 |
+
"text": "Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. ",
|
| 950 |
+
"bbox": [
|
| 951 |
+
173,
|
| 952 |
+
895,
|
| 953 |
+
823,
|
| 954 |
+
922
|
| 955 |
+
],
|
| 956 |
+
"page_idx": 7
|
| 957 |
+
},
|
| 958 |
+
{
|
| 959 |
+
"type": "image",
|
| 960 |
+
"img_path": "images/baa79a37c4412859d26e807eaa90433f219ba47d3e938f4a44353c3b66598d75.jpg",
|
| 961 |
+
"image_caption": [
|
| 962 |
+
"Table 5: Images from our 1D and 2D local attention super-resolution models trained on CelebA, sampled with different temperatures. 2D local attention with $\\tau = 0 . 9$ scored highest in our human evaluation study. "
|
| 963 |
+
],
|
| 964 |
+
"image_footnote": [],
|
| 965 |
+
"bbox": [
|
| 966 |
+
225,
|
| 967 |
+
107,
|
| 968 |
+
763,
|
| 969 |
+
556
|
| 970 |
+
],
|
| 971 |
+
"page_idx": 8
|
| 972 |
+
},
|
| 973 |
+
{
|
| 974 |
+
"type": "text",
|
| 975 |
+
"text": "Marc G. Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi ´ Munos. Unifying count-based exploration and intrinsic motivation. CoRR, abs/1606.01868, 2016. URL http://arxiv.org/abs/1606.01868. ",
|
| 976 |
+
"bbox": [
|
| 977 |
+
174,
|
| 978 |
+
635,
|
| 979 |
+
826,
|
| 980 |
+
678
|
| 981 |
+
],
|
| 982 |
+
"page_idx": 8
|
| 983 |
+
},
|
| 984 |
+
{
|
| 985 |
+
"type": "text",
|
| 986 |
+
"text": "Yoshua Bengio and Samy Bengio. Modeling high-dimensional discrete data with multi-layer neural networks. In ADVANCES IN NEURAL INFORMATION PROCESSING SYSTEMS 12, pp. 400– 406. MIT Press, 2000. ",
|
| 987 |
+
"bbox": [
|
| 988 |
+
176,
|
| 989 |
+
685,
|
| 990 |
+
823,
|
| 991 |
+
728
|
| 992 |
+
],
|
| 993 |
+
"page_idx": 8
|
| 994 |
+
},
|
| 995 |
+
{
|
| 996 |
+
"type": "text",
|
| 997 |
+
"text": "David Berthelot, Tom Schumm, and Luke Metz. BEGAN: boundary equilibrium generative adversarial networks. CoRR, abs/1703.10717, 2017. URL http://arxiv.org/abs/1703. 10717. ",
|
| 998 |
+
"bbox": [
|
| 999 |
+
174,
|
| 1000 |
+
736,
|
| 1001 |
+
823,
|
| 1002 |
+
777
|
| 1003 |
+
],
|
| 1004 |
+
"page_idx": 8
|
| 1005 |
+
},
|
| 1006 |
+
{
|
| 1007 |
+
"type": "text",
|
| 1008 |
+
"text": "Jianpeng Cheng, Li Dong, and Mirella Lapata. Long short-term memory-networks for machine reading. arXiv preprint arXiv:1601.06733, 2016. ",
|
| 1009 |
+
"bbox": [
|
| 1010 |
+
173,
|
| 1011 |
+
785,
|
| 1012 |
+
823,
|
| 1013 |
+
815
|
| 1014 |
+
],
|
| 1015 |
+
"page_idx": 8
|
| 1016 |
+
},
|
| 1017 |
+
{
|
| 1018 |
+
"type": "text",
|
| 1019 |
+
"text": "Ryan Dahl, Mohammad Norouzi, and Jonathan Shlens. Pixel recursive super resolution. 2017. URL https://arxiv.org/abs/1702.00783. ",
|
| 1020 |
+
"bbox": [
|
| 1021 |
+
173,
|
| 1022 |
+
821,
|
| 1023 |
+
821,
|
| 1024 |
+
851
|
| 1025 |
+
],
|
| 1026 |
+
"page_idx": 8
|
| 1027 |
+
},
|
| 1028 |
+
{
|
| 1029 |
+
"type": "text",
|
| 1030 |
+
"text": "David Garcia. srez: Adversarial super resolution. https://github.com/david-gpu/srez, 2016. URL https://github.com/david-gpu/srez. ",
|
| 1031 |
+
"bbox": [
|
| 1032 |
+
174,
|
| 1033 |
+
859,
|
| 1034 |
+
820,
|
| 1035 |
+
888
|
| 1036 |
+
],
|
| 1037 |
+
"page_idx": 8
|
| 1038 |
+
},
|
| 1039 |
+
{
|
| 1040 |
+
"type": "text",
|
| 1041 |
+
"text": "Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets, 2014. ",
|
| 1042 |
+
"bbox": [
|
| 1043 |
+
174,
|
| 1044 |
+
895,
|
| 1045 |
+
821,
|
| 1046 |
+
924
|
| 1047 |
+
],
|
| 1048 |
+
"page_idx": 8
|
| 1049 |
+
},
|
| 1050 |
+
{
|
| 1051 |
+
"type": "image",
|
| 1052 |
+
"img_path": "images/2002f7f4507016c8198313277a443b14bf6c2b5b4e0abea1e589c7e4656632c3.jpg",
|
| 1053 |
+
"image_caption": [
|
| 1054 |
+
"Table 6: On the left are image completions from our best conditional generation model, where we sample the second half. On the right are samples from our four-fold super-resolution model trained on CIFAR-10. Our images look realistic and plausible, show good diversity among the completion samples and observe the outputs carry surprising details for coarse inputs in super-resolution. "
|
| 1055 |
+
],
|
| 1056 |
+
"image_footnote": [],
|
| 1057 |
+
"bbox": [
|
| 1058 |
+
233,
|
| 1059 |
+
114,
|
| 1060 |
+
756,
|
| 1061 |
+
324
|
| 1062 |
+
],
|
| 1063 |
+
"page_idx": 9
|
| 1064 |
+
},
|
| 1065 |
+
{
|
| 1066 |
+
"type": "text",
|
| 1067 |
+
"text": "Nal Kalchbrenner and Phil Blunsom. Recurrent continuous translation models. In Proceedings EMNLP 2013, pp. 1700–1709, 2013. URL http://nal.co/papers/ KalchbrennerBlunsom_EMNLP13. \nNal Kalchbrenner, Aaron van den Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex ¨ Graves, and Koray Kavukcuoglu. Video pixel networks. CoRR, abs/1610.00527, 2016. URL http://arxiv.org/abs/1610.00527. \nDiederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. \nHugo Larochelle and Iain Murray. The neural autoregressive distribution estimator. In The Proceedings of the 14th International Conference on Artificial Intelligence and Statistics, volume 15 of JMLR: W&CP, pp. 29–37, 2011. \nChristian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, and Wenzhe Shi. Photo-realistic single image super-resolution using a generative adversarial network. arXiv:1609.04802, 2016. \nElman Mansimov, Emilio Parisotto, Lei Jimmy Ba, and Ruslan Salakhutdinov. Generating images from captions with attention. CoRR, abs/1511.02793, 2015. URL http://arxiv.org/abs/ 1511.02793. \nLuke Metz, Ben Poole, David Pfau, and Jascha Sohl-Dickstein. Unrolled generative adversarial networks. CoRR, abs/1611.02163, 2016. URL http://arxiv.org/abs/1611.02163. \nAnkur Parikh, Oscar Tckstrm, Dipanjan Das, and Jakob Uszkoreit. A decomposable attention model. In Empirical Methods in Natural Language Processing, 2016. URL https://arxiv.org/ pdf/1606.01933.pdf. \nAlec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. CoRR, abs/1511.06434, 2015. URL http:// arxiv.org/abs/1511.06434. \nTim Salimans, Andrej Karpathy, Xi Chen, Diederik P. Kingma, and Yaroslav Bulatov. Pixelcnn++: A pixelcnn implementation with discretized logistic mixture likelihood and other modifications. under review at ICLR 2017. ",
|
| 1068 |
+
"bbox": [
|
| 1069 |
+
169,
|
| 1070 |
+
426,
|
| 1071 |
+
826,
|
| 1072 |
+
925
|
| 1073 |
+
],
|
| 1074 |
+
"page_idx": 9
|
| 1075 |
+
},
|
| 1076 |
+
{
|
| 1077 |
+
"type": "text",
|
| 1078 |
+
"text": "Nitish Srivastava, Geoffrey E Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1):1929–1958, 2014. ",
|
| 1079 |
+
"bbox": [
|
| 1080 |
+
178,
|
| 1081 |
+
103,
|
| 1082 |
+
823,
|
| 1083 |
+
146
|
| 1084 |
+
],
|
| 1085 |
+
"page_idx": 10
|
| 1086 |
+
},
|
| 1087 |
+
{
|
| 1088 |
+
"type": "text",
|
| 1089 |
+
"text": "Lucas Theis and Matthias Bethge. Generative image modeling using spatial lstms. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, NIPS’15, pp. 1927–1935, Cambridge, MA, USA, 2015. MIT Press. URL http: //dl.acm.org/citation.cfm?id $= .$ 2969442.2969455. ",
|
| 1090 |
+
"bbox": [
|
| 1091 |
+
173,
|
| 1092 |
+
155,
|
| 1093 |
+
825,
|
| 1094 |
+
212
|
| 1095 |
+
],
|
| 1096 |
+
"page_idx": 10
|
| 1097 |
+
},
|
| 1098 |
+
{
|
| 1099 |
+
"type": "text",
|
| 1100 |
+
"text": "Aaron van den Oord and Benjamin Schrauwen. The student-t mixture as a natural image patch prior ¨ with application to image compression. Journal of Machine Learning Research, 15:2061–2086, 2014. URL http://jmlr.org/papers/v15/vandenoord14a.html. ",
|
| 1101 |
+
"bbox": [
|
| 1102 |
+
174,
|
| 1103 |
+
219,
|
| 1104 |
+
823,
|
| 1105 |
+
263
|
| 1106 |
+
],
|
| 1107 |
+
"page_idx": 10
|
| 1108 |
+
},
|
| 1109 |
+
{
|
| 1110 |
+
"type": "text",
|
| 1111 |
+
"text": "Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. ¨ ICML, 2016. ",
|
| 1112 |
+
"bbox": [
|
| 1113 |
+
173,
|
| 1114 |
+
271,
|
| 1115 |
+
821,
|
| 1116 |
+
301
|
| 1117 |
+
],
|
| 1118 |
+
"page_idx": 10
|
| 1119 |
+
},
|
| 1120 |
+
{
|
| 1121 |
+
"type": "text",
|
| 1122 |
+
"text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. 2017. URL http://arxiv. org/abs/1706.03762. ",
|
| 1123 |
+
"bbox": [
|
| 1124 |
+
174,
|
| 1125 |
+
309,
|
| 1126 |
+
823,
|
| 1127 |
+
352
|
| 1128 |
+
],
|
| 1129 |
+
"page_idx": 10
|
| 1130 |
+
},
|
| 1131 |
+
{
|
| 1132 |
+
"type": "text",
|
| 1133 |
+
"text": "Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaolei Huang, Xiaogang Wang, and Dimitris N. Metaxas. Stackgan: Text to photo-realistic image synthesis with stacked generative adversarial networks. CoRR, abs/1612.03242, 2016. URL http://arxiv.org/abs/1612. 03242. ",
|
| 1134 |
+
"bbox": [
|
| 1135 |
+
174,
|
| 1136 |
+
361,
|
| 1137 |
+
823,
|
| 1138 |
+
417
|
| 1139 |
+
],
|
| 1140 |
+
"page_idx": 10
|
| 1141 |
+
},
|
| 1142 |
+
{
|
| 1143 |
+
"type": "text",
|
| 1144 |
+
"text": "A CELEBA SUPERRESOLUTION ",
|
| 1145 |
+
"text_level": 1,
|
| 1146 |
+
"bbox": [
|
| 1147 |
+
178,
|
| 1148 |
+
102,
|
| 1149 |
+
449,
|
| 1150 |
+
118
|
| 1151 |
+
],
|
| 1152 |
+
"page_idx": 11
|
| 1153 |
+
},
|
| 1154 |
+
{
|
| 1155 |
+
"type": "text",
|
| 1156 |
+
"text": "Image pairs comparing ratings of generated images by the Local 2D ImageTransformer model and the original images. On the left side are images where the raters prefer the generated image over the original ones. On the right side, raters prefer the original over generated image. ",
|
| 1157 |
+
"bbox": [
|
| 1158 |
+
174,
|
| 1159 |
+
133,
|
| 1160 |
+
825,
|
| 1161 |
+
176
|
| 1162 |
+
],
|
| 1163 |
+
"page_idx": 11
|
| 1164 |
+
},
|
| 1165 |
+
{
|
| 1166 |
+
"type": "text",
|
| 1167 |
+
"text": "Original $>$ Local 2D ",
|
| 1168 |
+
"bbox": [
|
| 1169 |
+
544,
|
| 1170 |
+
208,
|
| 1171 |
+
707,
|
| 1172 |
+
237
|
| 1173 |
+
],
|
| 1174 |
+
"page_idx": 11
|
| 1175 |
+
},
|
| 1176 |
+
{
|
| 1177 |
+
"type": "image",
|
| 1178 |
+
"img_path": "images/4c0fb41edebe5d4f9f1098457036167255c1ab790ee8a40df12ecbff4c7b31bb.jpg",
|
| 1179 |
+
"image_caption": [],
|
| 1180 |
+
"image_footnote": [],
|
| 1181 |
+
"bbox": [
|
| 1182 |
+
263,
|
| 1183 |
+
210,
|
| 1184 |
+
464,
|
| 1185 |
+
542
|
| 1186 |
+
],
|
| 1187 |
+
"page_idx": 11
|
| 1188 |
+
},
|
| 1189 |
+
{
|
| 1190 |
+
"type": "image",
|
| 1191 |
+
"img_path": "images/5e5b4af4b2317eca0df66797096e3fd154bc144d9e643b34e10daddc833f3798.jpg",
|
| 1192 |
+
"image_caption": [],
|
| 1193 |
+
"image_footnote": [],
|
| 1194 |
+
"bbox": [
|
| 1195 |
+
527,
|
| 1196 |
+
218,
|
| 1197 |
+
727,
|
| 1198 |
+
542
|
| 1199 |
+
],
|
| 1200 |
+
"page_idx": 11
|
| 1201 |
+
}
|
| 1202 |
+
]
|
parse/train/r16Vyf-0-/r16Vyf-0-_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/r16Vyf-0-/r16Vyf-0-_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/rJ8uNptgl/rJ8uNptgl.md
ADDED
|
@@ -0,0 +1,391 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS THE LIMIT OF NETWORK QUANTIZATION
|
| 2 |
+
|
| 3 |
+
Yoojin Choi, Mostafa El-Khamy, and Jungwon Lee Samsung US R&D Center, San Diego, CA 92121, USA {yoojin.c,mostafa.e,jungwon2.lee}@samsung.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Network quantization is one of network compression techniques to reduce the redundancy of deep neural networks. It reduces the number of distinct network parameter values by quantization in order to save the storage for them. In this paper, we design network quantization schemes that minimize the performance loss due to quantization given a compression ratio constraint. We analyze the quantitative relation of quantization errors to the neural network loss function and identify that the Hessian-weighted distortion measure is locally the right objective function for the optimization of network quantization. As a result, Hessian-weighted $\mathbf { k }$ -means clustering is proposed for clustering network parameters to quantize. When optimal variable-length binary codes, e.g., Huffman codes, are employed for further compression, we derive that the network quantization problem can be related to the entropy-constrained scalar quantization (ECSQ) problem in information theory and consequently propose two solutions of ECSQ for network quantization, i.e., uniform quantization and an iterative solution similar to Lloyd’s algorithm. Finally, using the simple uniform quantization followed by Huffman coding, we show from our experiments that the compression ratios of 51.25, 22.17 and 40.65 are achievable for LeNet, 32-layer ResNet and AlexNet, respectively.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks have emerged to be the state-of-the-art in the field of machine learning for image classification, object detection, speech recognition, natural language processing, and machine translation (LeCun et al., 2015). The substantial progress of neural networks however comes with high cost of computations and hardware resources resulting from a large number of parameters. For example, Krizhevsky et al. (2012) came up with a deep convolutional neural network consisting of 61 million parameters and won the ImageNet competition in 2012. It is followed by deeper neural networks with even larger numbers of parameters, e.g., Simonyan & Zisserman (2014).
|
| 12 |
+
|
| 13 |
+
The large sizes of deep neural networks make it difficult to deploy them on resource-limited devices, e.g., mobile or portable devices, and network compression is of great interest in recent years to reduce computational cost and memory requirements for deep neural networks. Our interest in this paper is mainly on curtailing the size of the storage (memory) for network parameters (weights and biases). In particular, we focus on the network size compression by reducing the number of distinct network parameters by quantization.
|
| 14 |
+
|
| 15 |
+
Besides network quantization, network pruning has been studied for network compression to remove redundant parameters permanently from neural networks (Mozer & Smolensky, 1989; LeCun et al., 1989; Hassibi & Stork, 1993; Han et al., 2015b; Lebedev & Lempitsky, 2016; Wen et al., 2016). Matrix/tensor factorization and low-rank approximation have been investigated as well to find more efficient representations of neural networks with a smaller number of parameters and consequently to save computations (Sainath et al., 2013; Xue et al., 2013; Jaderberg et al., 2014; Lebedev et al., 2014; Yang et al., 2015; Liu et al., 2015; Kim et al., 2015; Tai et al., 2015; Novikov et al., 2015). Moreover, similar to network quantization, low-precision network implementation has been examined in Vanhoucke et al. (2011); Courbariaux et al. (2014); Anwar et al. (2015); Gupta et al. (2015); Lin et al. (2015a). Some extremes of low-precision neural networks consisting of binary or ternary parameters can be found in Courbariaux et al. (2015); Lin et al. (2015b); Rastegari et al. (2016). We note that these are different types of network compression techniques, which can be employed on top of each other.
|
| 16 |
+
|
| 17 |
+
The most related work to our investigation in this paper can be found in Gong et al. (2014); Han et al. (2015a), where a conventional quantization method using k-means clustering is employed for network quantization. This conventional approach however is proposed with little consideration for the impact of quantization errors on the neural network performance loss and no effort to optimize the quantization procedure for a given compression ratio constraint. In this paper, we reveal the suboptimality of this conventional method and newly design quantization schemes for neural networks. In particular, we formulate an optimization problem to minimize the network performance loss due to quantization given a compression ratio constraint and find efficient quantization methods for neural networks.
|
| 18 |
+
|
| 19 |
+
The main contribution of the paper can be summarized as follows:
|
| 20 |
+
|
| 21 |
+
• It is derived that the performance loss due to quantization in neural networks can be quantified approximately by the Hessian-weighted distortion measure. Then, Hessian-weighted $\mathbf { k }$ -means clustering is proposed for network quantization to minimize the performance loss. It is identified that the optimization problem for network quantization provided a compression ratio constraint can be reduced to an entropy-constrained scalar quantization (ECSQ) problem when optimal variable-length binary coding is employed after quantization. Two efficient heuristic solutions for ECSQ are proposed for network quantization, i.e., uniform quantization and an iterative solution similar to Lloyd’s algorithm. • As an alternative of Hessian, it is proposed to utilize some function (e.g., square root) of the second moment estimates of gradients when the Adam (Kingma & Ba, 2014) stochastic gradient decent (SGD) optimizer is used in training. The advantage of using this alternative is that it is computed while training and can be obtained at the end of training at no additional cost. • It is shown how the proposed network quantization schemes can be applied for quantizing network parameters of all layers together at once, rather than layer-by-layer network quantization in Gong et al. (2014); Han et al. (2015a). This follows from our investigation that Hessian-weighting can handle the different impact of quantization errors properly not only within layers but also across layers. Moreover, quantizing network parameters of all layers together, one can even avoid layer-by-layer compression rate optimization.
|
| 22 |
+
|
| 23 |
+
The rest of the paper is organized as follows. In Section 2, we define the network quantization problem and review the conventional quantization method using $\mathbf { k }$ -means clustering. Section 3 discusses Hessian-weighted network quantization. Our entropy-constrained network quantization schemes follow in Section 4. Finally, experiment results and conclusion can be found in Section 5 and Section 6, respectively.
|
| 24 |
+
|
| 25 |
+
# 2 NETWORK QUANTIZATION
|
| 26 |
+
|
| 27 |
+
We consider a neural network that is already trained, pruned if employed and fine-tuned before quantization. If no network pruning is employed, all parameters in a network are subject to quantization. For pruned networks, our focus is on quantization of unpruned parameters.
|
| 28 |
+
|
| 29 |
+
The goal of network quantization is to quantize (unpruned) network parameters in order to reduce the size of the storage for them while minimizing the performance degradation due to quantization. For network quantization, network parameters are grouped into clusters. Parameters in the same cluster share their quantized value, which is the representative value (i.e., cluster center) of the cluster they belong to. After quantization, lossless binary coding follows to encode quantized parameters into binary codewords to store instead of actual parameter values. Either fixed-length binary coding or variable-length binary coding, e.g., Huffman coding, can be employed to this end.
|
| 30 |
+
|
| 31 |
+
# 2.1 COMPRESSION RATIO
|
| 32 |
+
|
| 33 |
+
Suppose that we have total $N$ parameters in a neural network. Before quantization, each parameter is assumed to be of $b$ bits. For quantization, we partition the network parameters into $k$ clusters. Let $\mathcal { C } _ { i }$ be the set of network parameters in cluster $i$ and let $b _ { i }$ be the number of bits of the codeword assigned to the network parameters in cluster $i$ for $1 \leq i \leq k$ . For a lookup table to decode quantized values from their binary encoded codewords, we store $k$ binary codewords $b _ { i }$ bits for $1 \leq i \leq k$ ) and corresponding quantized values ( $b$ bits for each). The compression ratio is then given by
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
{ \mathrm { C o m p r e s s i o n ~ r a t i o } } = { \frac { N b } { \sum _ { i = 1 } ^ { k } ( | { \mathcal { C } } _ { i } | + 1 ) b _ { i } + k b } } .
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
Observe in (1) that the compression ratio depends not only on the number of clusters but also on the sizes of the clusters and the lengths of the binary codewords assigned to them, in particular, when a variable-length code is used for encoding quantized values. For fixed-length codes, however, all codewords are of the same length, i.e., $b _ { i } = \lceil \log _ { 2 } k \rceil$ for all $1 \leq i \leq k$ , and thus the compression ratio is reduced to only a function of the number of clusters, i.e., $k$ , assuming that $N$ and $b$ are given.
|
| 40 |
+
|
| 41 |
+
# 2.2 K-MEANS CLUSTERING
|
| 42 |
+
|
| 43 |
+
Provided network parameters $\{ w _ { i } \} _ { i = 1 } ^ { N }$ to quantize, $\mathbf { k }$ -means clustering partitions them into $k$ disjoint sets (clusters), denoted by $\mathcal { C } _ { 1 } , \mathcal { C } _ { 2 } , \ldots , \mathcal { C } _ { k }$ , while minimizing the mean square quantization error (MSQE) as follows:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\operatorname * { a r g m i n } _ { \mathcal { C } _ { 1 } , \mathcal { C } _ { 2 } , \ldots , \mathcal { C } _ { k } } \sum _ { i = 1 } ^ { k } \sum _ { w \in \mathcal { C } _ { i } } | w - c _ { i } | ^ { 2 } , \mathrm { ~ w h e r e ~ } c _ { i } = \frac { 1 } { | \mathcal { C } _ { i } | } \sum _ { w \in \mathcal { C } _ { i } } w .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
We observe two issues with employing $\mathbf { k }$ -means clustering for network quantization.
|
| 50 |
+
|
| 51 |
+
• First, although $\mathbf { k }$ -means clustering minimizes the MSQE, it does not imply that $\mathbf { k }$ -means clustering minimizes the performance loss due to quantization as well in neural networks. K-means clustering treats quantization errors from all network parameters with equal importance. However, quantization errors from some network parameters may degrade the performance more significantly that the others. Thus, for minimizing the loss due to quantization in neural networks, one needs to take this dissimilarity into account. Second, $\mathbf { k }$ -means clustering does not consider any compression ratio constraint. It simply minimizes its distortion measure for a given number of clusters, i.e., for $k$ clusters. This is however suboptimal when variable-length coding follows since the compression ratio depends not only on the number of clusters but also on the sizes of the clusters and assigned codeword lengths to them, which are determined by the binary coding scheme employed after clustering. Therefore, for the optimization of network quantization given a compression ratio constraint, one need to take the impact of binary coding into account, i.e., we need to solve the quantization problem under the actual compression ratio constraint imposed by the specific binary coding scheme employed after clustering.
|
| 52 |
+
|
| 53 |
+
# 3 HESSIAN-WEIGHTED NETWORK QUANTIZATION
|
| 54 |
+
|
| 55 |
+
In this section, we analyze the impact of quantization errors on the neural network loss function and derive that the Hessian-weighted distortion measure is a relevant objective function for network quantization in order to minimize the quantization loss locally. Moreover, from this analysis, we propose Hessian-weighted $\mathbf { k }$ -means clustering for network quantization to minimize the performance loss due to quantization in neural networks.
|
| 56 |
+
|
| 57 |
+
# 3.1 NETWORK MODEL
|
| 58 |
+
|
| 59 |
+
We consider a general non-linear neural network that yields output $\mathbf { y } = f ( \mathbf { x } ; \mathbf { w } )$ from input x, where $\mathbf { w } = [ w _ { 1 } ~ \cdots ~ \bar { w } _ { N } ] ^ { T }$ is the vector consisting of all trainable network parameters in the network; $N$ is the total number of trainable parameters in the network. A loss function $l o s s ( \mathbf { y } , \hat { \mathbf { y } } )$ is defined as the objective function that we aim to minimize in average, where $\hat { \mathbf { y } } = \hat { \mathbf { y } } ( \mathbf { x } )$ is the expected (groundtruth) output for input $\mathbf { x }$ . Cross entropy or mean square error are typical examples of a loss function. Given a training data set $\mathcal { X } _ { \mathrm { t r a i n } }$ , we optimize network parameters by solving the following problem, e.g., approximately by using a stochastic gradient descent (SGD) method with mini-batches:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\hat { \mathbf { w } } = \operatorname * { a r g m i n } _ { \mathbf { w } } L ( \mathcal { X } _ { \mathrm { t r a i n } } ; \mathbf { w } ) , \quad \mathrm { w h e r e } \quad L ( \mathcal { X } ; \mathbf { w } ) = \frac { 1 } { | \mathcal { X } | } \sum _ { \mathbf { x } \in \mathcal { X } } l o s s ( f ( \mathbf { x } ; \mathbf { w } ) , \hat { \mathbf { y } } ( \mathbf { x } ) ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
# 3.2 HESSIAN-WEIGHTED QUANTIZATION ERROR
|
| 66 |
+
|
| 67 |
+
The average loss function $L ( \mathcal { X } ; { \mathbf w } )$ can be expanded by Taylor series with respect to w as follows:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\delta L ( \mathcal { X } ; \mathbf { w } ) = \mathbf { g } ( \mathbf { w } ) ^ { T } \delta \mathbf { w } + \frac { 1 } { 2 } \delta \mathbf { w } ^ { T } \mathbf { H } ( \mathbf { w } ) \delta \mathbf { w } + O ( \| \delta \mathbf { w } \| ^ { 3 } ) ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathbf { g } ( \mathbf { w } ) = \frac { \partial L ( \boldsymbol { \chi } ; \mathbf { w } ) } { \partial \mathbf { w } } , ~ \mathbf { H } ( \mathbf { w } ) = \frac { \partial ^ { 2 } L ( \boldsymbol { \chi } ; \mathbf { w } ) } { \partial \mathbf { w } ^ { 2 } } ;
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
the square matrix $\mathbf { H } ( \mathbf { w } )$ consisting of second-order partial derivatives is called as Hessian matrix or Hessian. Assume that the loss function has reached to one of its local minima, at $\mathbf { w } = \hat { \mathbf { w } }$ , after training. At local minima, gradients are all zero, i.e., we have $\mathbf { g } ( \hat { \mathbf { w } } ) = \mathbf { 0 }$ , and thus the first term in the right-hand side of (3) can be neglected at $\mathbf { w } = \hat { \mathbf { w } }$ . The third term in the right-hand side of (3) is also ignored under the assumption that the average loss function is approximately quadratic at the local minimum $\mathbf { w } = \hat { \mathbf { w } }$ . Finally, for simplicity, we approximate the Hessian matrix as a diagonal matrix by setting its off-diagonal terms to be zero. Then, it follows from (3) that
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\delta L ( \mathcal { X } ; \hat { \mathbf { w } } ) \approx \frac { 1 } { 2 } \sum _ { i = 1 } ^ { N } h _ { i i } ( \hat { \mathbf { w } } ) | \delta \hat { w } _ { i } | ^ { 2 } ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $h _ { i i } ( \hat { \mathbf { w } } )$ is the second-order partial derivative of the average loss function with respect to $w _ { i }$ evaluated at $\mathbf { w } = \hat { \mathbf { w } }$ , which is the $i$ -th diagonal element of the Hessian matrix $\mathbf { H } ( \hat { \mathbf { w } } )$ .
|
| 86 |
+
|
| 87 |
+
Now, we connect (4) with the problem of network quantization by treating $\delta \hat { w } _ { i }$ as the quantization error of network parameter $w _ { i }$ at its local optimum $w _ { i } = \hat { w } _ { i }$ , i.e.,
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\delta { \hat { w } } _ { i } = { \bar { w } } _ { i } - { \hat { w } } _ { i } ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where $\bar { w } _ { i }$ is a quantized value of $\hat { w } _ { i }$ . Finally, combining (4) and (5), we derive that the local impact of quantization on the average loss function at $\mathbf { w } = \hat { \mathbf { w } }$ can be quantified approximately as follows:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\delta L ( \mathcal { X } ; \hat { \mathbf { w } } ) \approx \frac { 1 } { 2 } \sum _ { i = 1 } ^ { N } h _ { i i } ( \hat { \mathbf { w } } ) | \hat { w } _ { i } - \bar { w } _ { i } | ^ { 2 } .
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
At a local minimum, the diagonal elements of Hessian, i.e., $h _ { i i } ( \hat { \mathbf { w } } )$ ’s, are all non-negative and thus the summation in (6) is always additive, implying that the average loss function either increases or stays the same. Therefore, the performance degradation due to quantization of a neural network can be measured approximately by the Hessian-weighted distortion as shown in (6). Further discussion on the Hessian-weighted distortion measure can be found in Appendix A.1.
|
| 100 |
+
|
| 101 |
+
# 3.3 HESSIAN-WEIGHTED K-MEANS CLUSTERING
|
| 102 |
+
|
| 103 |
+
For notational simplicity, we use $w _ { i } \equiv \hat { w } _ { i }$ and $h _ { i i } \equiv h _ { i i } ( \hat { \mathbf { w } } )$ from now on. The optimal clustering that minimizes the Hessian-weighted distortion measure is given by
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\underset { \mathcal { C } _ { 1 } , \mathcal { C } _ { 2 } , . . . , \mathcal { C } _ { k } } { \mathrm { a r g m i n } } \sum _ { j = 1 } ^ { k } \sum _ { w _ { i } \in \mathcal { C } _ { j } } h _ { i i } | w _ { i } - c _ { j } | ^ { 2 } , \mathrm { ~ w h e r e ~ } c _ { j } = \frac { \sum _ { w _ { i } \in \mathcal { C } _ { j } } h _ { i i } w _ { i } } { \sum _ { w _ { i } \in \mathcal { C } _ { j } } h _ { i i } } .
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
We call this as Hessian-weighted $\mathbf { k }$ -means clustering. Observe in (7) that we give a larger penalty for a network parameter in defining the distortion measure for clustering when its second-order partial derivative is larger, in order to avoid a large deviation from its original value, since the impact on the loss function due to quantization is expected to be larger for that parameter.
|
| 110 |
+
|
| 111 |
+
Hessian-weighted $\mathbf { k }$ -means clustering is locally optimal in minimizing the quantization loss when fixed-length binary coding follows, where the compression ratio solely depends on the number of clusters as shown in Section 2.1. Similar to the conventional $\mathbf { k }$ -means clustering, solving this optimization is not easy, but Lloyd’s algorithm is still applicable as an efficient heuristic solution for this problem if Hessian-weighted means are used as cluster centers instead of non-weighted regular means.
|
| 112 |
+
|
| 113 |
+
# 3.4 HESSIAN COMPUTATION
|
| 114 |
+
|
| 115 |
+
For obtaining Hessian, one needs to evaluate the second-order partial derivative of the average loss function with respect to each of network parameters, i.e., we need to calculate
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
h _ { i i } ( \hat { \mathbf { w } } ) = \frac { \partial ^ { 2 } L ( \mathcal { X } ; \mathbf { w } ) } { \partial w _ { i } ^ { 2 } } \bigg | _ { \mathbf { w } = \hat { \mathbf { w } } } = \frac { 1 } { | \mathcal { X } | } \frac { \partial ^ { 2 } } { \partial w _ { i } ^ { 2 } } \sum _ { \mathbf { x } \in \mathcal { X } } l o s s ( f ( \mathbf { x } ; \mathbf { w } ) , \hat { \mathbf { y } } ( \mathbf { x } ) ) \bigg | _ { \mathbf { w } = \hat { \mathbf { w } } } .
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
Recall that we are interested in only the diagonal elements of Hessian. An efficient way of computing the diagonal of Hessian is presented in Le Cun (1987); Becker & Le Cun (1988) and it is based on the back propagation method that is similar to the back propagation algorithm used for computing first-order partial derivatives (gradients). That is, computing the diagonal of Hessian is of the same order of complexity as computing gradients.
|
| 122 |
+
|
| 123 |
+
Hessian computation and our network quantization are performed after completing network training. For the data set $\mathcal { X }$ used to compute Hessian in (8), we can either reuse a training data set or use some other data set, e.g., validation data set. We observed from our experiments that even using a small subset of the training or validation data set is sufficient to yield good approximation of Hessian for network quantization.
|
| 124 |
+
|
| 125 |
+
# 3.5 ALTERNATIVE OF HESSIAN
|
| 126 |
+
|
| 127 |
+
Although there is an efficient way to obtain the diagonal of Hessian as discussed in the previous subsection, Hessian computation is not free. In order to avoid this additional Hessian computation, we propose to use an alternative metric instead of Hessian. In particular, we consider neural networks trained with the Adam SGD optimizer (Kingma & Ba, 2014) and propose to use some function (e.g., square root) of the second moment estimates of gradients as an alternative of Hessian.
|
| 128 |
+
|
| 129 |
+
The Adam algorithm computes adaptive learning rates for individual network parameters from the first and second moment estimates of gradients. We compare the Adam method to Newton’s optimization method using Hessian and notice that the second moment estimates of gradients in the Adam method act like the Hessian in Newton’s method. This observation leads us to use some function (e.g., square root) of the second moment estimates of gradients as an alternative of Hessian.
|
| 130 |
+
|
| 131 |
+
The advantage of using the second moment estimates from the Adam method is that they are computed while training and we can obtain them at the end of training at no additional cost. It makes Hessian-weighting more feasible for deep neural networks, which have millions of parameters. We note that similar quantities can be found and used for other SGD optimization methods using adaptive learning rates, e.g., AdaGrad (Duchi et al., 2011), Adadelta (Zeiler, 2012) and RMSProp (Tieleman & Hinton, 2012).
|
| 132 |
+
|
| 133 |
+
# 3.6 QUANTIZATION OF ALL LAYERS
|
| 134 |
+
|
| 135 |
+
We propose quantizing the network parameters of all layers in a neural network together at once by taking Hessian-weight into account. Layer-by-layer quantization was examined in the previous work (Gong et al., 2014; Han et al., 2015a). However, e.g., in Han et al. (2015a), a larger number of bits (a larger number of clusters) are assigned to convolutional layers than fully-connected layers, which implies that they heuristically treat convolutional layers more importantly. This follows from the fact that the impact of quantization errors on the performance varies significantly across layers; some layers, e.g., convolutional layers, may be more important than the others. This concern is exactly what we can address by Hessian-weighting.
|
| 136 |
+
|
| 137 |
+
Hessian-weighting properly handles the different impact of quantization errors not only within layers but also across layers and thus it can be employed for quantizing all layers of a network together. The impact of quantization errors may vary more substantially across layers than within layers. Thus, Hessian-weighting may show more benefit in deeper neural networks. We note that Hessianweighting can still provide gain even for layer-by-layer quantization since it can address the different impact of the quantization errors of network parameters within each layer as well.
|
| 138 |
+
|
| 139 |
+
Recent neural networks are getting deeper, e.g., see Szegedy et al. (2015a;b); He et al. (2015). For such deep neural networks, quantizing network parameters of all layers together is even more advantageous since we can avoid layer-by-layer compression rate optimization. Optimizing compression ratios jointly across all individual layers (to maximize the overall compression ratio for a network) requires exponential time complexity with respect to the number of layers. This is because the total number of possible combinations of compression ratios for individual layers increases exponentially as the number of layers increases.
|
| 140 |
+
|
| 141 |
+
# 4 ENTROPY-CONSTRAINED NETWORK QUANTIZATION
|
| 142 |
+
|
| 143 |
+
In this section, we investigate how to solve the network quantization problem under a constraint on the compression ratio. In designing network quantization schemes, we not only want to minimize the performance loss but also want to maximize the compression ratio. In Section 3, we explored how to quantify and minimize the loss due to quantization. In this section, we investigate how to take the compression ratio into account properly in the optimization of network quantization.
|
| 144 |
+
|
| 145 |
+
# 4.1 ENTROPY CODING
|
| 146 |
+
|
| 147 |
+
After quantizing network parameters by clustering, lossless data compression by variable-length binary coding can be followed for compressing quantized values. There is a set of optimal codes that achieve the minimum average codeword length for a given source. Entropy is the theoretical limit of the average codeword length per symbol that we can achieve by lossless data compression, proved by Shannon (see, e.g., Cover & Thomas (2012, Section 5.3)). It is known that optimal codes achieve this limit with some overhead less than 1 bit when only integer-length codewords are allowed. So optimal coding is also called as entropy coding. Huffman coding is one of entropy coding schemes commonly used when the source distribution is provided (see, e.g., Cover & Thomas (2012, Section 5.6)), or can be estimated.
|
| 148 |
+
|
| 149 |
+
# 4.2 ENTROPY-CONSTRAINED SCALAR QUANTIZATION (ECSQ)
|
| 150 |
+
|
| 151 |
+
Considering a compression ratio constraint in network quantization, we need to solve the clustering problem in (2) or (7) under the compression ratio constraint given by
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\mathrm { C o m p r e s s i o n \ r a t i o } = \frac { b } { \bar { b } + ( \sum _ { i = 1 } ^ { k } b _ { i } + k b ) / N } > C , \mathrm { w h e r e } \bar { b } = \frac { 1 } { N } \sum _ { i = 1 } ^ { k } | { \mathcal C } _ { i } | b _ { i } ,
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
which follows from (1). This optimization problem is too complex to solve for any arbitrary variablelength binary code since the average codeword length $\bar { b }$ can be arbitrary. However, we identify that it can be simplified if optimal codes, e.g., Huffman codes, are assumed to be used. In particular, optimal coding closely achieves the lower limit of the average source code length, i.e., entropy, and then we approximately have
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\bar { b } \approx H = - \sum _ { i = 1 } ^ { k } p _ { i } \log _ { 2 } p _ { i } ,
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
where $H$ is the entropy of the quantized network parameters after clustering (i.e., source), given that $p _ { i } = | \mathcal { C } _ { i } | / N$ is the ratio of the number of network parameters in cluster $\mathcal { C } _ { i }$ to the number of all network parameters (i.e., source distribution). Moreover, assuming that $N \gg k$ , we have
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
{ \frac { 1 } { N } } \left( \sum _ { i = 1 } ^ { k } b _ { i } + k b \right) \approx 0 ,
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
in (9). From (10) and (11), the constraint in (9) can be altered to an entropy constraint given by
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
H = - \sum _ { i = 1 } ^ { k } p _ { i } \log _ { 2 } p _ { i } < R ,
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
where $R \approx b / C$ . In summary, assuming that optimal coding is employed after clustering, one can approximately replace a compression ratio constraint with an entropy constraint for the clustering output. The network quantization problem is then translated into a quantization problem with an entropy constraint, which is called as entropy-constrained scalar quantization (ECSQ) in information theory. Two efficient heuristic solutions for ECSQ are proposed for network quantization in the following subsections, i.e., uniform quantization and an iterative solution similar to Lloyd’s algorithm for $\mathbf { k }$ -means clustering.
|
| 176 |
+
|
| 177 |
+
# 4.3 UNIFORM QUANTIZATION
|
| 178 |
+
|
| 179 |
+
It is shown in Gish & Pierce (1968) that the uniform quantizer is asymptotically optimal in minimizing the mean square quantization error for any random source with a reasonably smooth density function as the resolution becomes infinite, i.e., as the number of clusters $k \infty$ . This asymptotic result leads us to come up with a very simple but efficient network quantization scheme as follows:
|
| 180 |
+
|
| 181 |
+
1. We first set uniformly spaced thresholds and divide network parameters into clusters. 2. After determining clusters, their quantized values (cluster centers) are obtained by taking the mean of network parameters in each cluster.
|
| 182 |
+
|
| 183 |
+
Note that one can use Hessian-weighted mean instead of non-weighted mean in computing cluster centers in the second step above in order to take the benefit of Hessian-weighting. A performance comparison of uniform quantization with non-weighted mean and uniform quantization with Hessian-weighted mean can be found in Appendix A.2.
|
| 184 |
+
|
| 185 |
+
Although uniform quantization is a straightforward method, it has never been shown before in the literature that it is actually one of the most efficient quantization schemes for neural networks when optimal variable-length coding, e.g., Huffman coding, follows. We note that uniform quantization is not always good; it is inefficient for fixed-length coding, which is also first shown in this paper.
|
| 186 |
+
|
| 187 |
+
# 4.4 ITERATIVE ALGORITHM TO SOLVE ECSQ
|
| 188 |
+
|
| 189 |
+
Another scheme proposed to solve the ECSQ problem for network quantization is an iterative algorithm, which is similar to Lloyd’s algorithm for k-means clustering. Although this iterative solution is more complicated than the uniform quantization in Section 4.3, it finds a local optimum for a given discrete source. An iterative algorithm to solve the general ECSQ problem is provided in Chou et al. (1989). We derive a similar iterative algorithm to solve the ECSQ problem for network quantization. The main difference from the method in Chou et al. (1989) is that we minimize the Hessian-weighted distortion measure instead of the non-weighted regular distortion measure for optimal quantization. The detailed algorithm and further discussion can be found in Appendix A.3.
|
| 190 |
+
|
| 191 |
+
# 5 EXPERIMENTS
|
| 192 |
+
|
| 193 |
+
This section presents our experiment results for the proposed network quantization schemes in three exemplary convolutional neural networks: (a) LeNet (LeCun et al., 1998) for the MNIST data set, (b) ResNet (He et al., 2015) for the CIFAR-10 data set, and (c) AlexNet (Krizhevsky et al., 2012) for the ImageNet ILSVRC-2012 data set. Our experiments can be summarized as follows:
|
| 194 |
+
|
| 195 |
+
• We employ the proposed network quantization methods to quantize all of network parameters in a network together at once, as discussed in Section 3.6. We evaluate the performance of the proposed network quantization methods with and without network pruning. For a pruned model, we need to store not only the values of unpruned parameters but also their respective indexes (locations) in the original model. For the index information, we compute index differences between unpruned network parameters in the original model and further compress them by Huffman coding as in Han et al. (2015a). For Hessian computation, 50,000 samples of the training set are reused. We also evaluate the performance when Hessian is computed with 1,000 samples only. • Finally, we evaluate the performance of our network quantization schemes using Hessian when its alternative is used instead, as discussed in Section 3.5. To this end, we retrain the considered neural networks with the Adam SGD optimizer and obtain the second moment estimates of gradients at the end of training. Then, we use the square roots of the second moment estimates instead of Hessian and evaluate the performance.
|
| 196 |
+
|
| 197 |
+
# 5.1 EXPERIMENT MODELS
|
| 198 |
+
|
| 199 |
+
First, we evaluate our network quantization schemes for the MNIST data set with a simplified version of LeNet5 (LeCun et al., 1998), consisting of two convolutional layers and two fully-connected
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Figure 1: Accuracy versus average codeword length per network parameter after network quantization for 32-layer ResNet.
|
| 203 |
+
|
| 204 |
+
layers followed by a soft-max layer. It has total 431,080 parameters and achieves $9 9 . 2 5 \%$ accuracy.
|
| 205 |
+
For a pruned model, we prune $91 \%$ of the original network parameters and fine-tune the rest.
|
| 206 |
+
|
| 207 |
+
Second, we experiment our network quantization schemes for the CIFAR-10 data set (Krizhevsky, 2009) with a pre-trained 32-layer ResNet (He et al., 2015). The 32-layer ResNet consists of 464,154 parameters in total and achieves $9 2 . 5 8 \%$ accuracy. For a pruned model, we prune $80 \%$ of the original network parameters and fine-tune the rest.
|
| 208 |
+
|
| 209 |
+
Third, we evaluate our network quantization schemes with AlexNet (Krizhevsky et al., 2012) for the ImageNet ILSVRC-2012 data set (Russakovsky et al., 2015). We obtain a pre-trained AlexNet Caffe model, which achieves $5 7 . 1 6 \%$ top-1 accuracy. For a pruned model, we prune $89 \%$ parameters and fine-tune the rest. In fine-tuning, the Adam SGD optimizer is used in order to avoid the computation of Hessian by utilizing its alternative (see Section 3.5). However, the pruned model does not recover the original accuracy after fine-tuning with the Adam method; the top-1 accuracy recovered after pruning and fine-tuning is $5 6 . 0 0 \%$ . We are able to find a better pruned model achieving the original accuracy by pruning and retraining iteratively (Han et al., 2015b), which is however not used here.
|
| 210 |
+
|
| 211 |
+
# 5.2 EXPERIMENT RESULTS
|
| 212 |
+
|
| 213 |
+
We first present the quantization results without pruning for 32-layer ResNet in Figure 1, where the accuracy of 32-layer ResNet is plotted against the average codeword length per network parameter after quantization. When fixed-length coding is employed, the proposed Hessian-weighted $\mathbf { k }$ -means clustering method performs the best, as expected. Observe that Hessian-weighted k-means clustering yields better accuracy than others even after fine-tuning. On the other hand, when Huffman coding is employed, uniform quantization and the iterative algorithm for ECSQ outperform Hessian-weighted $\mathbf { k }$ -means clustering and $\mathbf { k }$ -means clustering. However, these two ECSQ solutions underperform Hessian-weighted $\mathbf { k }$ -means clustering and even k-means clustering when fixed-length coding is employed since they are optimized for optimal variable-length coding.
|
| 214 |
+
|
| 215 |
+

|
| 216 |
+
Figure 2: Accuracy versus average codeword length per network parameter after network quantization, Huffman coding and fine-tuning for LeNet and 32-layer ResNet when Hessian is computed with 50,000 or 1,000 samples and when the square roots of the second moment estimates of gradients are used instead of Hessian as an alternative.
|
| 217 |
+
|
| 218 |
+
Figure 2 shows the performance of Hessian-weighted k-means clustering when Hessian is computed with a small number of samples (1,000 samples). Observe that even using the Hessian computed with a small number of samples yields almost the same performance. We also show the performance of Hessian-weighted k-means clustering when an alternative of Hessian is used instead of Hessian as explained in Section 3.5. In particular, the square roots of the second moment estimates of gradients are used instead of Hessian, and using this alternative provides similar performance to using Hessian.
|
| 219 |
+
|
| 220 |
+
In Table 1, we summarize the compression ratios that we can achieve with different network quantization methods for pruned models. The original network parameters are 32-bit float numbers. Using the simple uniform quantization followed by Huffman coding, we achieve the compression ratios of 51.25, 22.17 and 40.65 (i.e., the compressed model sizes are $1 . 9 5 \%$ , $4 . 5 1 \%$ and $2 . 4 6 \%$ of the original model sizes) for LeNet, 32-layer ResNet and AlexNet, respectively, at no or marginal performance loss. Observe that the loss in the compressed AlexNet is mainly due to pruning. Here, we also compare our network quantization results to the ones in Han et al. (2015a). Note that layer-bylayer quantization with $\mathbf { k }$ -means clustering is evaluated in Han et al. (2015a) while our quantization schemes including $\mathbf { k }$ -means clustering are employed to quantize network parameters of all layers together at once (see Section 3.6).
|
| 221 |
+
|
| 222 |
+
# 6 CONCLUSION
|
| 223 |
+
|
| 224 |
+
This paper investigates the quantization problem of network parameters in deep neural networks. We identify the suboptimality of the conventional quantization method using $\mathbf { k }$ -means clustering and newly design network quantization schemes so that they can minimize the performance loss due to quantization given a compression ratio constraint. In particular, we analytically show that Hessian can be used as a measure of the importance of network parameters and propose to minimize Hessianweighted quantization errors in average for clustering network parameters to quantize. Hessianweighting is beneficial in quantizing all of the network parameters together at once since it can handle the different impact of quantization errors properly not only within layers but also across layers. Furthermore, we make a connection from the network quantization problem to the entropyconstrained data compression problem in information theory and push the compression ratio to the limit that information theory provides. Two efficient heuristic solutions are presented to this end, i.e., uniform quantization and an iterative solution for ECSQ. Our experiment results show that the proposed network quantization schemes provide considerable gain over the conventional method using $\mathbf { k }$ -means clustering, in particular for large and deep neural networks.
|
| 225 |
+
|
| 226 |
+
# REFERENCES
|
| 227 |
+
|
| 228 |
+
Sajid Anwar, Kyuyeon Hwang, and Wonyong Sung. Fixed point optimization of deep convolutional neural networks for object recognition. In IEEE International Conference on Acoustics, Speech
|
| 229 |
+
|
| 230 |
+
Table 1: Summary of network quantization results with Huffman coding for pruned models.
|
| 231 |
+
|
| 232 |
+
<table><tr><td colspan="3"></td><td>Accuracy %</td><td>Compression ratio</td></tr><tr><td rowspan="6">LeNet</td><td colspan="2">Original model</td><td>99.25</td><td>-</td></tr><tr><td colspan="2">Pruned model</td><td>99.27</td><td>10.13</td></tr><tr><td rowspan="3">Pruning + Quantization all layers + Huffman coding</td><td>k-means Hessian-weighted k-means</td><td>99.27</td><td>44.58</td></tr><tr><td></td><td>99.27</td><td>47.16</td></tr><tr><td>Uniform quantization</td><td>99.28</td><td>51.25</td></tr><tr><td colspan="2">Iterative ECSQ Deep compression (Han et al.,2015a)</td><td>99.27 99.26</td><td>49.01 39.00</td></tr><tr><td rowspan="6">ResNet</td><td colspan="2">Original model</td><td>92.58</td><td>-</td></tr><tr><td rowspan="3">Pruned model Pruning + Quantization all layers</td><td>k-means</td><td>92.58</td><td>4.52</td></tr><tr><td></td><td>92.64</td><td>18.25</td></tr><tr><td>Hessian-weighted k-means</td><td>92.67</td><td>20.51</td></tr><tr><td rowspan="3">+ Huffman coding</td><td>Uniform quantization</td><td>92.68</td><td>22.17</td></tr><tr><td>Iterative ECSQ</td><td>92.73</td><td>21.01</td></tr><tr><td colspan="2">Deep compression (Han et al.,2015a) Original model</td><td>N/A</td><td>N/A</td></tr><tr><td rowspan="5">AlexNet</td><td rowspan="2">Pruned model</td><td>k-means</td><td>57.16 56.00</td><td>1 7.91</td></tr><tr><td></td><td>56.12</td><td>30.53</td></tr><tr><td rowspan="2">Pruning + Quantization all layers + Huffman coding</td><td>Alt-Hessian-weighted k-means Uniform quantization</td><td>56.04</td><td>33.71</td></tr><tr><td></td><td>56.20</td><td>40.65</td></tr><tr><td colspan="2">Deep compression (Han et al., 2015a)</td><td>57.22</td><td>35.00</td></tr></table>
|
| 233 |
+
|
| 234 |
+
and Signal Processing, pp. 1131–1135, 2015.
|
| 235 |
+
|
| 236 |
+
Sue Becker and Yann Le Cun. Improving the convergence of back-propagation learning with second order methods. In Proceedings of the Connectionist Models Summer School, pp. 29–37. San Matteo, CA: Morgan Kaufmann, 1988.
|
| 237 |
+
|
| 238 |
+
Philip A Chou, Tom Lookabaugh, and Robert M Gray. Entropy-constrained vector quantization. IEEE Transactions on Acoustics, Speech, and Signal Processing, 37(1):31–42, 1989.
|
| 239 |
+
|
| 240 |
+
Matthieu Courbariaux, Jean-Pierre David, and Yoshua Bengio. Training deep neural networks with low precision multiplications. arXiv preprint arXiv:1412.7024, 2014.
|
| 241 |
+
|
| 242 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in Neural Information Processing Systems, pp. 3123–3131, 2015.
|
| 243 |
+
|
| 244 |
+
Thomas M Cover and Joy A Thomas. Elements of information theory. John Wiley & Sons, 2012.
|
| 245 |
+
|
| 246 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011.
|
| 247 |
+
|
| 248 |
+
Herbert Gish and John Pierce. Asymptotically efficient quantizing. IEEE Transactions on Information Theory, 14(5):676–683, 1968.
|
| 249 |
+
|
| 250 |
+
Yunchao Gong, Liu Liu, Ming Yang, and Lubomir Bourdev. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014.
|
| 251 |
+
|
| 252 |
+
Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In Proceedings of the 32nd International Conference on Machine Learning, pp. 1737–1746, 2015.
|
| 253 |
+
|
| 254 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015a.
|
| 255 |
+
|
| 256 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In Advances in Neural Information Processing Systems, pp. 1135–1143, 2015b.
|
| 257 |
+
|
| 258 |
+
Babak Hassibi and David G Stork. Second order derivatives for network pruning: Optimal brain surgeon. In Advances in Neural Information Processing Systems, pp. 164–171, 1993.
|
| 259 |
+
|
| 260 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
|
| 261 |
+
|
| 262 |
+
Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. In Proceedings of the British Machine Vision Conference, 2014.
|
| 263 |
+
|
| 264 |
+
Yong-Deok Kim, Eunhyeok Park, Sungjoo Yoo, Taelim Choi, Lu Yang, and Dongjun Shin. Compression of deep convolutional neural networks for fast and low power mobile applications. arXiv preprint arXiv:1511.06530, 2015.
|
| 265 |
+
|
| 266 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 267 |
+
|
| 268 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009.
|
| 269 |
+
|
| 270 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1097–1105, 2012.
|
| 271 |
+
|
| 272 |
+
Yann Le Cun. Modeles connexionnistes de l’apprentissage \` . PhD thesis, Paris 6, 1987.
|
| 273 |
+
|
| 274 |
+
Vadim Lebedev and Victor Lempitsky. Fast convnets using group-wise brain damage. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2554–2564, 2016.
|
| 275 |
+
|
| 276 |
+
Vadim Lebedev, Yaroslav Ganin, Maksim Rakhuba, Ivan Oseledets, and Victor Lempitsky. Speeding-up convolutional neural networks using fine-tuned CP-decomposition. arXiv preprint arXiv:1412.6553, 2014.
|
| 277 |
+
|
| 278 |
+
Yann LeCun, John S Denker, Sara A Solla, Richard E Howard, and Lawrence D Jackel. Optimal brain damage. In Advances in Neural Information Processing Systems, pp. 598–605, 1989.
|
| 279 |
+
|
| 280 |
+
Yann LeCun, L´eon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 281 |
+
|
| 282 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015.
|
| 283 |
+
|
| 284 |
+
Darryl D Lin, Sachin S Talathi, and V Sreekanth Annapureddy. Fixed point quantization of deep convolutional networks. arXiv preprint arXiv:1511.06393, 2015a.
|
| 285 |
+
|
| 286 |
+
Zhouhan Lin, Matthieu Courbariaux, Roland Memisevic, and Yoshua Bengio. Neural networks with few multiplications. arXiv preprint arXiv:1510.03009, 2015b.
|
| 287 |
+
|
| 288 |
+
Baoyuan Liu, Min Wang, Hassan Foroosh, Marshall Tappen, and Marianna Pensky. Sparse convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 806–814, 2015.
|
| 289 |
+
|
| 290 |
+
Michael C Mozer and Paul Smolensky. Skeletonization: A technique for trimming the fat from a network via relevance assessment. In Advances in Neural Information Processing Systems, pp. 107–115, 1989.
|
| 291 |
+
|
| 292 |
+
Alexander Novikov, Dmitrii Podoprikhin, Anton Osokin, and Dmitry P Vetrov. Tensorizing neural networks. In Advances in Neural Information Processing Systems, pp. 442–450, 2015.
|
| 293 |
+
|
| 294 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. XNOR-Net: Imagenet classification using binary convolutional neural networks. arXiv preprint arXiv:1603.05279, 2016.
|
| 295 |
+
|
| 296 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015.
|
| 297 |
+
|
| 298 |
+
Tara N Sainath, Brian Kingsbury, Vikas Sindhwani, Ebru Arisoy, and Bhuvana Ramabhadran. Lowrank matrix factorization for deep neural network training with high-dimensional output targets. In IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 6655–6659, 2013.
|
| 299 |
+
|
| 300 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 301 |
+
|
| 302 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–9, 2015a.
|
| 303 |
+
|
| 304 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. arXiv preprint arXiv:1512.00567, 2015b.
|
| 305 |
+
|
| 306 |
+
Cheng Tai, Tong Xiao, Xiaogang Wang, et al. Convolutional neural networks with low-rank regularization. arXiv preprint arXiv:1511.06067, 2015.
|
| 307 |
+
|
| 308 |
+
Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 4(2), 2012.
|
| 309 |
+
|
| 310 |
+
Vincent Vanhoucke, Andrew Senior, and Mark Z Mao. Improving the speed of neural networks on CPUs. In Deep Learning and Unsupervised Feature Learning Workshop, NIPS, 2011.
|
| 311 |
+
|
| 312 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in Neural Information Processing Systems, pp. 2074–2082, 2016.
|
| 313 |
+
|
| 314 |
+
Jian Xue, Jinyu Li, and Yifan Gong. Restructuring of deep neural network acoustic models with singular value decomposition. In INTERSPEECH, pp. 2365–2369, 2013.
|
| 315 |
+
|
| 316 |
+
Zichao Yang, Marcin Moczulski, Misha Denil, Nando de Freitas, Alex Smola, Le Song, and Ziyu Wang. Deep fried convnets. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1476–1483, 2015.
|
| 317 |
+
|
| 318 |
+
Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
|
| 319 |
+
|
| 320 |
+
# A APPENDIX
|
| 321 |
+
|
| 322 |
+
# A.1 FURTHER DISCUSSION ON THE HESSIAN-WEIGHTED QUANTIZATION ERROR
|
| 323 |
+
|
| 324 |
+
The diagonal approximation for Hessian simplifies the optimization problem as well as its solution for network quantization. This simplification comes with some performance loss. We conjecture that the loss due to this approximation is small. The reason is that the contributions from off-diagonal terms are not always additive and their summation may end up with a small value. However, diagonal terms are all non-negative and therefore their contributions are always additive. We do not verify this conjecture in this paper since solving the problem without diagonal approximation is too complex; we even need to compute the whole Hessian matrix, which is also too costly.
|
| 325 |
+
|
| 326 |
+
Observe that the relation of the Hessian-weighted distortion measure to the quantization loss holds for any model for which the objective function can be approximated as a quadratic function with respect to the parameters to quantize in the model. Hence, the quantization methods proposed in this paper to minimize the Hessian-weighted distortion measure are not specific to neural networks but are generally applicable to quantization of parameters of any model whose objective function is locally quadratic with respect to its parameters approximately.
|
| 327 |
+
|
| 328 |
+
Finally, we do not consider the interactions between quantization and retraining in our formulation in Section 3.2. We analyze the expected loss due to quantization assuming no further retraining and focus on finding optimal network quantization schemes that minimize the performance loss. In our experiments, however, we further fine-tune the quantized values (cluster centers) so that we can recover the loss due to quantization and improve the performance.
|
| 329 |
+
|
| 330 |
+
# A.2 EXPERIMENT RESULTS FOR UNIFORM QUANTIZATION
|
| 331 |
+
|
| 332 |
+
We compare uniform quantization with non-weighted mean and uniform quantization with Hessianweighted mean in Figure 3, which shows that uniform quantization with Hessian-weighted mean slightly outperforms uniform quantization with non-weighted mean.
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 3: Accuracy versus average codeword length per network parameter after network quantization, Huffman coding and fine-tuning for 32-layer ResNet when uniform quantization with nonweighted mean and uniform quantization with Hessian-weighted mean are used.
|
| 336 |
+
|
| 337 |
+
# A.3 FURTHER DISCUSSION ON THE ITERATIVE ALGORITHM FOR ECSQ
|
| 338 |
+
|
| 339 |
+
In order to solve the ECSQ problem for network quantization, we define a Lagrangian cost function:
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
J _ { \lambda } ( \mathcal { C } _ { 1 } , \mathcal { C } _ { 2 } , \ldots , \mathcal { C } _ { k } ) = D + \lambda H = \frac { 1 } { N } \sum _ { j = 1 } ^ { k } \sum _ { w _ { i } \in \mathcal { C } _ { j } } \underbrace { ( h _ { i i } | w _ { i } - c _ { j } | ^ { 2 } - \lambda \log _ { 2 } p _ { j } ) } _ { = d _ { \lambda } ( i , j ) } ,
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
where
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
D = \frac { 1 } { N } \sum _ { j = 1 } ^ { k } \sum _ { w _ { i } \in \mathcal { C } _ { j } } h _ { i i } | w _ { i } - c _ { j } | ^ { 2 } , ~ H = - \sum _ { j = 1 } ^ { k } p _ { j } \log _ { 2 } p _ { j } .
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
# Algorithm 1 Iterative solution for entropy-constrained network quantization
|
| 352 |
+
|
| 353 |
+
Initialization: $n \gets 0$
|
| 354 |
+
|
| 355 |
+
clusters: $c _ { 1 } ^ { ( 0 ) } , \ldots , c _ { k } ^ { ( 0 ) }$
|
| 356 |
+
|
| 357 |
+
Initialize the proportions of $k$ 1 kclusters (set all of them to be the same initially): $p _ { 1 } ^ { ( 0 ) } , \ldots , p _ { k } ^ { ( 0 ) }$ repeat
|
| 358 |
+
|
| 359 |
+
# Assignment:
|
| 360 |
+
|
| 361 |
+
for all network parameters $i = 1 N$ do
|
| 362 |
+
|
| 363 |
+
Assign $w _ { i }$ to the cluster $j$ that minimizes the individual Lagrangian cost as follows:
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\mathcal { C } _ { l } ^ { ( n + 1 ) } \gets \mathcal { C } _ { l } ^ { ( n + 1 ) } \cup \{ w _ { i } \} \quad \mathrm { f o r } \ l = \arg \operatorname* { m i n } _ { j } \left\{ h _ { i i } | w _ { i } - c _ { j } ^ { ( n ) } | ^ { 2 } - \lambda \log _ { 2 } p _ { j } ^ { ( n ) } \right\}
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
end for
|
| 370 |
+
|
| 371 |
+
Update:
|
| 372 |
+
|
| 373 |
+
for all clusters $j = 1 k$ do
|
| 374 |
+
|
| 375 |
+
Update the cluster center and the proportion of cluster $j$ :
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
c _ { j } ^ { ( n + 1 ) } \gets \frac { \sum _ { w _ { i } \in \mathcal { C } _ { j } ^ { ( n + 1 ) } } h _ { i i } w _ { i } } { \sum _ { w _ { i } \in \mathcal { C } _ { j } ^ { ( n + 1 ) } } h _ { i i } } \mathrm { a n d } p _ { j } ^ { ( n + 1 ) } \gets \frac { | \mathcal { C } _ { j } ^ { ( n + 1 ) } | } { N }
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
# end for
|
| 382 |
+
|
| 383 |
+
$n \gets n + 1$ until Lagrangian cost function $J _ { \lambda }$ decreases less than some threshold
|
| 384 |
+
|
| 385 |
+
The entropy-constrained network quantization problem is then reduced to find $k$ partitions (clusters) $\mathcal { C } _ { 1 } , \mathcal { C } _ { 2 } , \ldots , \mathcal { C } _ { k }$ that minimize the Lagrangian cost function as follows:
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\operatorname * { a r g m i n } _ { \mathcal { C } _ { 1 } , \mathcal { C } _ { 2 } , \ldots , \mathcal { C } _ { k } } J _ { \lambda } ( \mathcal { C } _ { 1 } , \mathcal { C } _ { 2 } , \ldots , \mathcal { C } _ { k } ) .
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
A heuristic iterative algorithm to solve this method of Lagrange multipliers for network quantization is presented in Algorithm 1. It is similar to Lloyd’s algorithm for $\mathbf { k }$ -means clustering. The key difference is how to partition network parameters at the assignment step. In Lloyd’s algorithm, the Euclidean distance (quantization error) is minimized. For ECSQ, the individual Lagrangian cost function, i.e., $d _ { \lambda } ( i , j )$ in (12), is minimized instead, which includes both quantization error and expected codeword length after entropy coding.
|
parse/train/rJ8uNptgl/rJ8uNptgl_content_list.json
ADDED
|
@@ -0,0 +1,2023 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"type": "text",
|
| 4 |
+
"text": "TOWARDS THE LIMIT OF NETWORK QUANTIZATION ",
|
| 5 |
+
"text_level": 1,
|
| 6 |
+
"bbox": [
|
| 7 |
+
178,
|
| 8 |
+
98,
|
| 9 |
+
797,
|
| 10 |
+
122
|
| 11 |
+
],
|
| 12 |
+
"page_idx": 0
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"type": "text",
|
| 16 |
+
"text": "Yoojin Choi, Mostafa El-Khamy, and Jungwon Lee Samsung US R&D Center, San Diego, CA 92121, USA {yoojin.c,mostafa.e,jungwon2.lee}@samsung.com ",
|
| 17 |
+
"bbox": [
|
| 18 |
+
183,
|
| 19 |
+
147,
|
| 20 |
+
625,
|
| 21 |
+
191
|
| 22 |
+
],
|
| 23 |
+
"page_idx": 0
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"type": "text",
|
| 27 |
+
"text": "ABSTRACT ",
|
| 28 |
+
"text_level": 1,
|
| 29 |
+
"bbox": [
|
| 30 |
+
454,
|
| 31 |
+
227,
|
| 32 |
+
542,
|
| 33 |
+
242
|
| 34 |
+
],
|
| 35 |
+
"page_idx": 0
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"type": "text",
|
| 39 |
+
"text": "Network quantization is one of network compression techniques to reduce the redundancy of deep neural networks. It reduces the number of distinct network parameter values by quantization in order to save the storage for them. In this paper, we design network quantization schemes that minimize the performance loss due to quantization given a compression ratio constraint. We analyze the quantitative relation of quantization errors to the neural network loss function and identify that the Hessian-weighted distortion measure is locally the right objective function for the optimization of network quantization. As a result, Hessian-weighted $\\mathbf { k }$ -means clustering is proposed for clustering network parameters to quantize. When optimal variable-length binary codes, e.g., Huffman codes, are employed for further compression, we derive that the network quantization problem can be related to the entropy-constrained scalar quantization (ECSQ) problem in information theory and consequently propose two solutions of ECSQ for network quantization, i.e., uniform quantization and an iterative solution similar to Lloyd’s algorithm. Finally, using the simple uniform quantization followed by Huffman coding, we show from our experiments that the compression ratios of 51.25, 22.17 and 40.65 are achievable for LeNet, 32-layer ResNet and AlexNet, respectively. ",
|
| 40 |
+
"bbox": [
|
| 41 |
+
233,
|
| 42 |
+
257,
|
| 43 |
+
764,
|
| 44 |
+
492
|
| 45 |
+
],
|
| 46 |
+
"page_idx": 0
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
"type": "text",
|
| 50 |
+
"text": "1 INTRODUCTION ",
|
| 51 |
+
"text_level": 1,
|
| 52 |
+
"bbox": [
|
| 53 |
+
176,
|
| 54 |
+
517,
|
| 55 |
+
334,
|
| 56 |
+
534
|
| 57 |
+
],
|
| 58 |
+
"page_idx": 0
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"type": "text",
|
| 62 |
+
"text": "Deep neural networks have emerged to be the state-of-the-art in the field of machine learning for image classification, object detection, speech recognition, natural language processing, and machine translation (LeCun et al., 2015). The substantial progress of neural networks however comes with high cost of computations and hardware resources resulting from a large number of parameters. For example, Krizhevsky et al. (2012) came up with a deep convolutional neural network consisting of 61 million parameters and won the ImageNet competition in 2012. It is followed by deeper neural networks with even larger numbers of parameters, e.g., Simonyan & Zisserman (2014). ",
|
| 63 |
+
"bbox": [
|
| 64 |
+
174,
|
| 65 |
+
547,
|
| 66 |
+
825,
|
| 67 |
+
646
|
| 68 |
+
],
|
| 69 |
+
"page_idx": 0
|
| 70 |
+
},
|
| 71 |
+
{
|
| 72 |
+
"type": "text",
|
| 73 |
+
"text": "The large sizes of deep neural networks make it difficult to deploy them on resource-limited devices, e.g., mobile or portable devices, and network compression is of great interest in recent years to reduce computational cost and memory requirements for deep neural networks. Our interest in this paper is mainly on curtailing the size of the storage (memory) for network parameters (weights and biases). In particular, we focus on the network size compression by reducing the number of distinct network parameters by quantization. ",
|
| 74 |
+
"bbox": [
|
| 75 |
+
174,
|
| 76 |
+
652,
|
| 77 |
+
825,
|
| 78 |
+
736
|
| 79 |
+
],
|
| 80 |
+
"page_idx": 0
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"type": "text",
|
| 84 |
+
"text": "Besides network quantization, network pruning has been studied for network compression to remove redundant parameters permanently from neural networks (Mozer & Smolensky, 1989; LeCun et al., 1989; Hassibi & Stork, 1993; Han et al., 2015b; Lebedev & Lempitsky, 2016; Wen et al., 2016). Matrix/tensor factorization and low-rank approximation have been investigated as well to find more efficient representations of neural networks with a smaller number of parameters and consequently to save computations (Sainath et al., 2013; Xue et al., 2013; Jaderberg et al., 2014; Lebedev et al., 2014; Yang et al., 2015; Liu et al., 2015; Kim et al., 2015; Tai et al., 2015; Novikov et al., 2015). Moreover, similar to network quantization, low-precision network implementation has been examined in Vanhoucke et al. (2011); Courbariaux et al. (2014); Anwar et al. (2015); Gupta et al. (2015); Lin et al. (2015a). Some extremes of low-precision neural networks consisting of binary or ternary parameters can be found in Courbariaux et al. (2015); Lin et al. (2015b); Rastegari et al. (2016). We note that these are different types of network compression techniques, which can be employed on top of each other. ",
|
| 85 |
+
"bbox": [
|
| 86 |
+
174,
|
| 87 |
+
743,
|
| 88 |
+
825,
|
| 89 |
+
922
|
| 90 |
+
],
|
| 91 |
+
"page_idx": 0
|
| 92 |
+
},
|
| 93 |
+
{
|
| 94 |
+
"type": "text",
|
| 95 |
+
"text": "The most related work to our investigation in this paper can be found in Gong et al. (2014); Han et al. (2015a), where a conventional quantization method using k-means clustering is employed for network quantization. This conventional approach however is proposed with little consideration for the impact of quantization errors on the neural network performance loss and no effort to optimize the quantization procedure for a given compression ratio constraint. In this paper, we reveal the suboptimality of this conventional method and newly design quantization schemes for neural networks. In particular, we formulate an optimization problem to minimize the network performance loss due to quantization given a compression ratio constraint and find efficient quantization methods for neural networks. ",
|
| 96 |
+
"bbox": [
|
| 97 |
+
174,
|
| 98 |
+
103,
|
| 99 |
+
825,
|
| 100 |
+
228
|
| 101 |
+
],
|
| 102 |
+
"page_idx": 1
|
| 103 |
+
},
|
| 104 |
+
{
|
| 105 |
+
"type": "text",
|
| 106 |
+
"text": "The main contribution of the paper can be summarized as follows: ",
|
| 107 |
+
"bbox": [
|
| 108 |
+
174,
|
| 109 |
+
236,
|
| 110 |
+
607,
|
| 111 |
+
251
|
| 112 |
+
],
|
| 113 |
+
"page_idx": 1
|
| 114 |
+
},
|
| 115 |
+
{
|
| 116 |
+
"type": "text",
|
| 117 |
+
"text": "• It is derived that the performance loss due to quantization in neural networks can be quantified approximately by the Hessian-weighted distortion measure. Then, Hessian-weighted $\\mathbf { k }$ -means clustering is proposed for network quantization to minimize the performance loss. It is identified that the optimization problem for network quantization provided a compression ratio constraint can be reduced to an entropy-constrained scalar quantization (ECSQ) problem when optimal variable-length binary coding is employed after quantization. Two efficient heuristic solutions for ECSQ are proposed for network quantization, i.e., uniform quantization and an iterative solution similar to Lloyd’s algorithm. • As an alternative of Hessian, it is proposed to utilize some function (e.g., square root) of the second moment estimates of gradients when the Adam (Kingma & Ba, 2014) stochastic gradient decent (SGD) optimizer is used in training. The advantage of using this alternative is that it is computed while training and can be obtained at the end of training at no additional cost. • It is shown how the proposed network quantization schemes can be applied for quantizing network parameters of all layers together at once, rather than layer-by-layer network quantization in Gong et al. (2014); Han et al. (2015a). This follows from our investigation that Hessian-weighting can handle the different impact of quantization errors properly not only within layers but also across layers. Moreover, quantizing network parameters of all layers together, one can even avoid layer-by-layer compression rate optimization. ",
|
| 118 |
+
"bbox": [
|
| 119 |
+
215,
|
| 120 |
+
261,
|
| 121 |
+
825,
|
| 122 |
+
542
|
| 123 |
+
],
|
| 124 |
+
"page_idx": 1
|
| 125 |
+
},
|
| 126 |
+
{
|
| 127 |
+
"type": "text",
|
| 128 |
+
"text": "The rest of the paper is organized as follows. In Section 2, we define the network quantization problem and review the conventional quantization method using $\\mathbf { k }$ -means clustering. Section 3 discusses Hessian-weighted network quantization. Our entropy-constrained network quantization schemes follow in Section 4. Finally, experiment results and conclusion can be found in Section 5 and Section 6, respectively. ",
|
| 129 |
+
"bbox": [
|
| 130 |
+
174,
|
| 131 |
+
555,
|
| 132 |
+
823,
|
| 133 |
+
625
|
| 134 |
+
],
|
| 135 |
+
"page_idx": 1
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"type": "text",
|
| 139 |
+
"text": "2 NETWORK QUANTIZATION ",
|
| 140 |
+
"text_level": 1,
|
| 141 |
+
"bbox": [
|
| 142 |
+
178,
|
| 143 |
+
645,
|
| 144 |
+
423,
|
| 145 |
+
661
|
| 146 |
+
],
|
| 147 |
+
"page_idx": 1
|
| 148 |
+
},
|
| 149 |
+
{
|
| 150 |
+
"type": "text",
|
| 151 |
+
"text": "We consider a neural network that is already trained, pruned if employed and fine-tuned before quantization. If no network pruning is employed, all parameters in a network are subject to quantization. For pruned networks, our focus is on quantization of unpruned parameters. ",
|
| 152 |
+
"bbox": [
|
| 153 |
+
176,
|
| 154 |
+
676,
|
| 155 |
+
821,
|
| 156 |
+
719
|
| 157 |
+
],
|
| 158 |
+
"page_idx": 1
|
| 159 |
+
},
|
| 160 |
+
{
|
| 161 |
+
"type": "text",
|
| 162 |
+
"text": "The goal of network quantization is to quantize (unpruned) network parameters in order to reduce the size of the storage for them while minimizing the performance degradation due to quantization. For network quantization, network parameters are grouped into clusters. Parameters in the same cluster share their quantized value, which is the representative value (i.e., cluster center) of the cluster they belong to. After quantization, lossless binary coding follows to encode quantized parameters into binary codewords to store instead of actual parameter values. Either fixed-length binary coding or variable-length binary coding, e.g., Huffman coding, can be employed to this end. ",
|
| 163 |
+
"bbox": [
|
| 164 |
+
174,
|
| 165 |
+
727,
|
| 166 |
+
825,
|
| 167 |
+
824
|
| 168 |
+
],
|
| 169 |
+
"page_idx": 1
|
| 170 |
+
},
|
| 171 |
+
{
|
| 172 |
+
"type": "text",
|
| 173 |
+
"text": "2.1 COMPRESSION RATIO ",
|
| 174 |
+
"text_level": 1,
|
| 175 |
+
"bbox": [
|
| 176 |
+
176,
|
| 177 |
+
842,
|
| 178 |
+
362,
|
| 179 |
+
856
|
| 180 |
+
],
|
| 181 |
+
"page_idx": 1
|
| 182 |
+
},
|
| 183 |
+
{
|
| 184 |
+
"type": "text",
|
| 185 |
+
"text": "Suppose that we have total $N$ parameters in a neural network. Before quantization, each parameter is assumed to be of $b$ bits. For quantization, we partition the network parameters into $k$ clusters. Let $\\mathcal { C } _ { i }$ be the set of network parameters in cluster $i$ and let $b _ { i }$ be the number of bits of the codeword assigned to the network parameters in cluster $i$ for $1 \\leq i \\leq k$ . For a lookup table to decode quantized values from their binary encoded codewords, we store $k$ binary codewords $b _ { i }$ bits for $1 \\leq i \\leq k$ ) and corresponding quantized values ( $b$ bits for each). The compression ratio is then given by ",
|
| 186 |
+
"bbox": [
|
| 187 |
+
174,
|
| 188 |
+
867,
|
| 189 |
+
823,
|
| 190 |
+
924
|
| 191 |
+
],
|
| 192 |
+
"page_idx": 1
|
| 193 |
+
},
|
| 194 |
+
{
|
| 195 |
+
"type": "text",
|
| 196 |
+
"text": "",
|
| 197 |
+
"bbox": [
|
| 198 |
+
171,
|
| 199 |
+
103,
|
| 200 |
+
823,
|
| 201 |
+
132
|
| 202 |
+
],
|
| 203 |
+
"page_idx": 2
|
| 204 |
+
},
|
| 205 |
+
{
|
| 206 |
+
"type": "equation",
|
| 207 |
+
"img_path": "images/e649686bd3c6e78c78f0b5b2b019aafb8e4aa6351371d5cb362a17cbac2a74d2.jpg",
|
| 208 |
+
"text": "$$\n{ \\mathrm { C o m p r e s s i o n ~ r a t i o } } = { \\frac { N b } { \\sum _ { i = 1 } ^ { k } ( | { \\mathcal { C } } _ { i } | + 1 ) b _ { i } + k b } } .\n$$",
|
| 209 |
+
"text_format": "latex",
|
| 210 |
+
"bbox": [
|
| 211 |
+
344,
|
| 212 |
+
136,
|
| 213 |
+
651,
|
| 214 |
+
174
|
| 215 |
+
],
|
| 216 |
+
"page_idx": 2
|
| 217 |
+
},
|
| 218 |
+
{
|
| 219 |
+
"type": "text",
|
| 220 |
+
"text": "Observe in (1) that the compression ratio depends not only on the number of clusters but also on the sizes of the clusters and the lengths of the binary codewords assigned to them, in particular, when a variable-length code is used for encoding quantized values. For fixed-length codes, however, all codewords are of the same length, i.e., $b _ { i } = \\lceil \\log _ { 2 } k \\rceil$ for all $1 \\leq i \\leq k$ , and thus the compression ratio is reduced to only a function of the number of clusters, i.e., $k$ , assuming that $N$ and $b$ are given. ",
|
| 221 |
+
"bbox": [
|
| 222 |
+
173,
|
| 223 |
+
178,
|
| 224 |
+
825,
|
| 225 |
+
248
|
| 226 |
+
],
|
| 227 |
+
"page_idx": 2
|
| 228 |
+
},
|
| 229 |
+
{
|
| 230 |
+
"type": "text",
|
| 231 |
+
"text": "2.2 K-MEANS CLUSTERING ",
|
| 232 |
+
"text_level": 1,
|
| 233 |
+
"bbox": [
|
| 234 |
+
174,
|
| 235 |
+
263,
|
| 236 |
+
377,
|
| 237 |
+
279
|
| 238 |
+
],
|
| 239 |
+
"page_idx": 2
|
| 240 |
+
},
|
| 241 |
+
{
|
| 242 |
+
"type": "text",
|
| 243 |
+
"text": "Provided network parameters $\\{ w _ { i } \\} _ { i = 1 } ^ { N }$ to quantize, $\\mathbf { k }$ -means clustering partitions them into $k$ disjoint sets (clusters), denoted by $\\mathcal { C } _ { 1 } , \\mathcal { C } _ { 2 } , \\ldots , \\mathcal { C } _ { k }$ , while minimizing the mean square quantization error (MSQE) as follows: ",
|
| 244 |
+
"bbox": [
|
| 245 |
+
174,
|
| 246 |
+
289,
|
| 247 |
+
825,
|
| 248 |
+
332
|
| 249 |
+
],
|
| 250 |
+
"page_idx": 2
|
| 251 |
+
},
|
| 252 |
+
{
|
| 253 |
+
"type": "equation",
|
| 254 |
+
"img_path": "images/ec3b38fd9e6741de269728720c6098be3b53cd467a9784b7dc5eafe4cbefe4ef.jpg",
|
| 255 |
+
"text": "$$\n\\operatorname * { a r g m i n } _ { \\mathcal { C } _ { 1 } , \\mathcal { C } _ { 2 } , \\ldots , \\mathcal { C } _ { k } } \\sum _ { i = 1 } ^ { k } \\sum _ { w \\in \\mathcal { C } _ { i } } | w - c _ { i } | ^ { 2 } , \\mathrm { ~ w h e r e ~ } c _ { i } = \\frac { 1 } { | \\mathcal { C } _ { i } | } \\sum _ { w \\in \\mathcal { C } _ { i } } w .\n$$",
|
| 256 |
+
"text_format": "latex",
|
| 257 |
+
"bbox": [
|
| 258 |
+
310,
|
| 259 |
+
335,
|
| 260 |
+
687,
|
| 261 |
+
381
|
| 262 |
+
],
|
| 263 |
+
"page_idx": 2
|
| 264 |
+
},
|
| 265 |
+
{
|
| 266 |
+
"type": "text",
|
| 267 |
+
"text": "We observe two issues with employing $\\mathbf { k }$ -means clustering for network quantization. ",
|
| 268 |
+
"bbox": [
|
| 269 |
+
174,
|
| 270 |
+
386,
|
| 271 |
+
725,
|
| 272 |
+
400
|
| 273 |
+
],
|
| 274 |
+
"page_idx": 2
|
| 275 |
+
},
|
| 276 |
+
{
|
| 277 |
+
"type": "text",
|
| 278 |
+
"text": "• First, although $\\mathbf { k }$ -means clustering minimizes the MSQE, it does not imply that $\\mathbf { k }$ -means clustering minimizes the performance loss due to quantization as well in neural networks. K-means clustering treats quantization errors from all network parameters with equal importance. However, quantization errors from some network parameters may degrade the performance more significantly that the others. Thus, for minimizing the loss due to quantization in neural networks, one needs to take this dissimilarity into account. Second, $\\mathbf { k }$ -means clustering does not consider any compression ratio constraint. It simply minimizes its distortion measure for a given number of clusters, i.e., for $k$ clusters. This is however suboptimal when variable-length coding follows since the compression ratio depends not only on the number of clusters but also on the sizes of the clusters and assigned codeword lengths to them, which are determined by the binary coding scheme employed after clustering. Therefore, for the optimization of network quantization given a compression ratio constraint, one need to take the impact of binary coding into account, i.e., we need to solve the quantization problem under the actual compression ratio constraint imposed by the specific binary coding scheme employed after clustering. ",
|
| 279 |
+
"bbox": [
|
| 280 |
+
215,
|
| 281 |
+
410,
|
| 282 |
+
825,
|
| 283 |
+
625
|
| 284 |
+
],
|
| 285 |
+
"page_idx": 2
|
| 286 |
+
},
|
| 287 |
+
{
|
| 288 |
+
"type": "text",
|
| 289 |
+
"text": "3 HESSIAN-WEIGHTED NETWORK QUANTIZATION",
|
| 290 |
+
"text_level": 1,
|
| 291 |
+
"bbox": [
|
| 292 |
+
174,
|
| 293 |
+
645,
|
| 294 |
+
599,
|
| 295 |
+
660
|
| 296 |
+
],
|
| 297 |
+
"page_idx": 2
|
| 298 |
+
},
|
| 299 |
+
{
|
| 300 |
+
"type": "text",
|
| 301 |
+
"text": "In this section, we analyze the impact of quantization errors on the neural network loss function and derive that the Hessian-weighted distortion measure is a relevant objective function for network quantization in order to minimize the quantization loss locally. Moreover, from this analysis, we propose Hessian-weighted $\\mathbf { k }$ -means clustering for network quantization to minimize the performance loss due to quantization in neural networks. ",
|
| 302 |
+
"bbox": [
|
| 303 |
+
173,
|
| 304 |
+
675,
|
| 305 |
+
825,
|
| 306 |
+
744
|
| 307 |
+
],
|
| 308 |
+
"page_idx": 2
|
| 309 |
+
},
|
| 310 |
+
{
|
| 311 |
+
"type": "text",
|
| 312 |
+
"text": "3.1 NETWORK MODEL ",
|
| 313 |
+
"text_level": 1,
|
| 314 |
+
"bbox": [
|
| 315 |
+
174,
|
| 316 |
+
762,
|
| 317 |
+
341,
|
| 318 |
+
776
|
| 319 |
+
],
|
| 320 |
+
"page_idx": 2
|
| 321 |
+
},
|
| 322 |
+
{
|
| 323 |
+
"type": "text",
|
| 324 |
+
"text": "We consider a general non-linear neural network that yields output $\\mathbf { y } = f ( \\mathbf { x } ; \\mathbf { w } )$ from input x, where $\\mathbf { w } = [ w _ { 1 } ~ \\cdots ~ \\bar { w } _ { N } ] ^ { T }$ is the vector consisting of all trainable network parameters in the network; $N$ is the total number of trainable parameters in the network. A loss function $l o s s ( \\mathbf { y } , \\hat { \\mathbf { y } } )$ is defined as the objective function that we aim to minimize in average, where $\\hat { \\mathbf { y } } = \\hat { \\mathbf { y } } ( \\mathbf { x } )$ is the expected (groundtruth) output for input $\\mathbf { x }$ . Cross entropy or mean square error are typical examples of a loss function. Given a training data set $\\mathcal { X } _ { \\mathrm { t r a i n } }$ , we optimize network parameters by solving the following problem, e.g., approximately by using a stochastic gradient descent (SGD) method with mini-batches: ",
|
| 325 |
+
"bbox": [
|
| 326 |
+
173,
|
| 327 |
+
787,
|
| 328 |
+
826,
|
| 329 |
+
886
|
| 330 |
+
],
|
| 331 |
+
"page_idx": 2
|
| 332 |
+
},
|
| 333 |
+
{
|
| 334 |
+
"type": "equation",
|
| 335 |
+
"img_path": "images/4cf897f52cc132902175ea070b70d5ffe6761a9a18381808a3168257903994fd.jpg",
|
| 336 |
+
"text": "$$\n\\hat { \\mathbf { w } } = \\operatorname * { a r g m i n } _ { \\mathbf { w } } L ( \\mathcal { X } _ { \\mathrm { t r a i n } } ; \\mathbf { w } ) , \\quad \\mathrm { w h e r e } \\quad L ( \\mathcal { X } ; \\mathbf { w } ) = \\frac { 1 } { | \\mathcal { X } | } \\sum _ { \\mathbf { x } \\in \\mathcal { X } } l o s s ( f ( \\mathbf { x } ; \\mathbf { w } ) , \\hat { \\mathbf { y } } ( \\mathbf { x } ) ) .\n$$",
|
| 337 |
+
"text_format": "latex",
|
| 338 |
+
"bbox": [
|
| 339 |
+
238,
|
| 340 |
+
890,
|
| 341 |
+
758,
|
| 342 |
+
928
|
| 343 |
+
],
|
| 344 |
+
"page_idx": 2
|
| 345 |
+
},
|
| 346 |
+
{
|
| 347 |
+
"type": "text",
|
| 348 |
+
"text": "3.2 HESSIAN-WEIGHTED QUANTIZATION ERROR",
|
| 349 |
+
"text_level": 1,
|
| 350 |
+
"bbox": [
|
| 351 |
+
176,
|
| 352 |
+
103,
|
| 353 |
+
517,
|
| 354 |
+
118
|
| 355 |
+
],
|
| 356 |
+
"page_idx": 3
|
| 357 |
+
},
|
| 358 |
+
{
|
| 359 |
+
"type": "text",
|
| 360 |
+
"text": "The average loss function $L ( \\mathcal { X } ; { \\mathbf w } )$ can be expanded by Taylor series with respect to w as follows: ",
|
| 361 |
+
"bbox": [
|
| 362 |
+
173,
|
| 363 |
+
128,
|
| 364 |
+
818,
|
| 365 |
+
145
|
| 366 |
+
],
|
| 367 |
+
"page_idx": 3
|
| 368 |
+
},
|
| 369 |
+
{
|
| 370 |
+
"type": "equation",
|
| 371 |
+
"img_path": "images/0cf0115483932c2ab854ba00523d226f5a158f42750dca2193f2c6200f4c180a.jpg",
|
| 372 |
+
"text": "$$\n\\delta L ( \\mathcal { X } ; \\mathbf { w } ) = \\mathbf { g } ( \\mathbf { w } ) ^ { T } \\delta \\mathbf { w } + \\frac { 1 } { 2 } \\delta \\mathbf { w } ^ { T } \\mathbf { H } ( \\mathbf { w } ) \\delta \\mathbf { w } + O ( \\| \\delta \\mathbf { w } \\| ^ { 3 } ) ,\n$$",
|
| 373 |
+
"text_format": "latex",
|
| 374 |
+
"bbox": [
|
| 375 |
+
307,
|
| 376 |
+
151,
|
| 377 |
+
689,
|
| 378 |
+
183
|
| 379 |
+
],
|
| 380 |
+
"page_idx": 3
|
| 381 |
+
},
|
| 382 |
+
{
|
| 383 |
+
"type": "text",
|
| 384 |
+
"text": "where ",
|
| 385 |
+
"bbox": [
|
| 386 |
+
174,
|
| 387 |
+
189,
|
| 388 |
+
217,
|
| 389 |
+
203
|
| 390 |
+
],
|
| 391 |
+
"page_idx": 3
|
| 392 |
+
},
|
| 393 |
+
{
|
| 394 |
+
"type": "equation",
|
| 395 |
+
"img_path": "images/bd0330d2c0abeb7b6cf161c15adb0fb52337b9dcea7d9f2b668ca85e1be371b6.jpg",
|
| 396 |
+
"text": "$$\n\\mathbf { g } ( \\mathbf { w } ) = \\frac { \\partial L ( \\boldsymbol { \\chi } ; \\mathbf { w } ) } { \\partial \\mathbf { w } } , ~ \\mathbf { H } ( \\mathbf { w } ) = \\frac { \\partial ^ { 2 } L ( \\boldsymbol { \\chi } ; \\mathbf { w } ) } { \\partial \\mathbf { w } ^ { 2 } } ;\n$$",
|
| 397 |
+
"text_format": "latex",
|
| 398 |
+
"bbox": [
|
| 399 |
+
348,
|
| 400 |
+
199,
|
| 401 |
+
648,
|
| 402 |
+
232
|
| 403 |
+
],
|
| 404 |
+
"page_idx": 3
|
| 405 |
+
},
|
| 406 |
+
{
|
| 407 |
+
"type": "text",
|
| 408 |
+
"text": "the square matrix $\\mathbf { H } ( \\mathbf { w } )$ consisting of second-order partial derivatives is called as Hessian matrix or Hessian. Assume that the loss function has reached to one of its local minima, at $\\mathbf { w } = \\hat { \\mathbf { w } }$ , after training. At local minima, gradients are all zero, i.e., we have $\\mathbf { g } ( \\hat { \\mathbf { w } } ) = \\mathbf { 0 }$ , and thus the first term in the right-hand side of (3) can be neglected at $\\mathbf { w } = \\hat { \\mathbf { w } }$ . The third term in the right-hand side of (3) is also ignored under the assumption that the average loss function is approximately quadratic at the local minimum $\\mathbf { w } = \\hat { \\mathbf { w } }$ . Finally, for simplicity, we approximate the Hessian matrix as a diagonal matrix by setting its off-diagonal terms to be zero. Then, it follows from (3) that ",
|
| 409 |
+
"bbox": [
|
| 410 |
+
173,
|
| 411 |
+
234,
|
| 412 |
+
825,
|
| 413 |
+
334
|
| 414 |
+
],
|
| 415 |
+
"page_idx": 3
|
| 416 |
+
},
|
| 417 |
+
{
|
| 418 |
+
"type": "equation",
|
| 419 |
+
"img_path": "images/eab4c11b8e469c582084bb0f0bf24ea4b5e1ac2d0ddc3b223bf50f80f9d6e617.jpg",
|
| 420 |
+
"text": "$$\n\\delta L ( \\mathcal { X } ; \\hat { \\mathbf { w } } ) \\approx \\frac { 1 } { 2 } \\sum _ { i = 1 } ^ { N } h _ { i i } ( \\hat { \\mathbf { w } } ) | \\delta \\hat { w } _ { i } | ^ { 2 } ,\n$$",
|
| 421 |
+
"text_format": "latex",
|
| 422 |
+
"bbox": [
|
| 423 |
+
385,
|
| 424 |
+
340,
|
| 425 |
+
611,
|
| 426 |
+
385
|
| 427 |
+
],
|
| 428 |
+
"page_idx": 3
|
| 429 |
+
},
|
| 430 |
+
{
|
| 431 |
+
"type": "text",
|
| 432 |
+
"text": "where $h _ { i i } ( \\hat { \\mathbf { w } } )$ is the second-order partial derivative of the average loss function with respect to $w _ { i }$ evaluated at $\\mathbf { w } = \\hat { \\mathbf { w } }$ , which is the $i$ -th diagonal element of the Hessian matrix $\\mathbf { H } ( \\hat { \\mathbf { w } } )$ . ",
|
| 433 |
+
"bbox": [
|
| 434 |
+
173,
|
| 435 |
+
391,
|
| 436 |
+
823,
|
| 437 |
+
420
|
| 438 |
+
],
|
| 439 |
+
"page_idx": 3
|
| 440 |
+
},
|
| 441 |
+
{
|
| 442 |
+
"type": "text",
|
| 443 |
+
"text": "Now, we connect (4) with the problem of network quantization by treating $\\delta \\hat { w } _ { i }$ as the quantization error of network parameter $w _ { i }$ at its local optimum $w _ { i } = \\hat { w } _ { i }$ , i.e., ",
|
| 444 |
+
"bbox": [
|
| 445 |
+
171,
|
| 446 |
+
426,
|
| 447 |
+
823,
|
| 448 |
+
455
|
| 449 |
+
],
|
| 450 |
+
"page_idx": 3
|
| 451 |
+
},
|
| 452 |
+
{
|
| 453 |
+
"type": "equation",
|
| 454 |
+
"img_path": "images/4c26afad5cdad038554168c3bef5d09821c97c554f69999db6cb5b5fb40d58ed.jpg",
|
| 455 |
+
"text": "$$\n\\delta { \\hat { w } } _ { i } = { \\bar { w } } _ { i } - { \\hat { w } } _ { i } ,\n$$",
|
| 456 |
+
"text_format": "latex",
|
| 457 |
+
"bbox": [
|
| 458 |
+
444,
|
| 459 |
+
463,
|
| 460 |
+
552,
|
| 461 |
+
479
|
| 462 |
+
],
|
| 463 |
+
"page_idx": 3
|
| 464 |
+
},
|
| 465 |
+
{
|
| 466 |
+
"type": "text",
|
| 467 |
+
"text": "where $\\bar { w } _ { i }$ is a quantized value of $\\hat { w } _ { i }$ . Finally, combining (4) and (5), we derive that the local impact of quantization on the average loss function at $\\mathbf { w } = \\hat { \\mathbf { w } }$ can be quantified approximately as follows: ",
|
| 468 |
+
"bbox": [
|
| 469 |
+
173,
|
| 470 |
+
487,
|
| 471 |
+
826,
|
| 472 |
+
516
|
| 473 |
+
],
|
| 474 |
+
"page_idx": 3
|
| 475 |
+
},
|
| 476 |
+
{
|
| 477 |
+
"type": "equation",
|
| 478 |
+
"img_path": "images/4b48eb1b4617e965dcd63755318dd6cba746f1624b5db2dbc09e069580b0fe42.jpg",
|
| 479 |
+
"text": "$$\n\\delta L ( \\mathcal { X } ; \\hat { \\mathbf { w } } ) \\approx \\frac { 1 } { 2 } \\sum _ { i = 1 } ^ { N } h _ { i i } ( \\hat { \\mathbf { w } } ) | \\hat { w } _ { i } - \\bar { w } _ { i } | ^ { 2 } .\n$$",
|
| 480 |
+
"text_format": "latex",
|
| 481 |
+
"bbox": [
|
| 482 |
+
370,
|
| 483 |
+
523,
|
| 484 |
+
625,
|
| 485 |
+
566
|
| 486 |
+
],
|
| 487 |
+
"page_idx": 3
|
| 488 |
+
},
|
| 489 |
+
{
|
| 490 |
+
"type": "text",
|
| 491 |
+
"text": "At a local minimum, the diagonal elements of Hessian, i.e., $h _ { i i } ( \\hat { \\mathbf { w } } )$ ’s, are all non-negative and thus the summation in (6) is always additive, implying that the average loss function either increases or stays the same. Therefore, the performance degradation due to quantization of a neural network can be measured approximately by the Hessian-weighted distortion as shown in (6). Further discussion on the Hessian-weighted distortion measure can be found in Appendix A.1. ",
|
| 492 |
+
"bbox": [
|
| 493 |
+
173,
|
| 494 |
+
574,
|
| 495 |
+
825,
|
| 496 |
+
645
|
| 497 |
+
],
|
| 498 |
+
"page_idx": 3
|
| 499 |
+
},
|
| 500 |
+
{
|
| 501 |
+
"type": "text",
|
| 502 |
+
"text": "3.3 HESSIAN-WEIGHTED K-MEANS CLUSTERING ",
|
| 503 |
+
"text_level": 1,
|
| 504 |
+
"bbox": [
|
| 505 |
+
174,
|
| 506 |
+
662,
|
| 507 |
+
524,
|
| 508 |
+
676
|
| 509 |
+
],
|
| 510 |
+
"page_idx": 3
|
| 511 |
+
},
|
| 512 |
+
{
|
| 513 |
+
"type": "text",
|
| 514 |
+
"text": "For notational simplicity, we use $w _ { i } \\equiv \\hat { w } _ { i }$ and $h _ { i i } \\equiv h _ { i i } ( \\hat { \\mathbf { w } } )$ from now on. The optimal clustering that minimizes the Hessian-weighted distortion measure is given by ",
|
| 515 |
+
"bbox": [
|
| 516 |
+
173,
|
| 517 |
+
688,
|
| 518 |
+
825,
|
| 519 |
+
717
|
| 520 |
+
],
|
| 521 |
+
"page_idx": 3
|
| 522 |
+
},
|
| 523 |
+
{
|
| 524 |
+
"type": "equation",
|
| 525 |
+
"img_path": "images/c2f7ff4d97336f4b88fb05cfbf4fe9643e48ddaa94bd51847faba2aac22b52c0.jpg",
|
| 526 |
+
"text": "$$\n\\underset { \\mathcal { C } _ { 1 } , \\mathcal { C } _ { 2 } , . . . , \\mathcal { C } _ { k } } { \\mathrm { a r g m i n } } \\sum _ { j = 1 } ^ { k } \\sum _ { w _ { i } \\in \\mathcal { C } _ { j } } h _ { i i } | w _ { i } - c _ { j } | ^ { 2 } , \\mathrm { ~ w h e r e ~ } c _ { j } = \\frac { \\sum _ { w _ { i } \\in \\mathcal { C } _ { j } } h _ { i i } w _ { i } } { \\sum _ { w _ { i } \\in \\mathcal { C } _ { j } } h _ { i i } } .\n$$",
|
| 527 |
+
"text_format": "latex",
|
| 528 |
+
"bbox": [
|
| 529 |
+
282,
|
| 530 |
+
723,
|
| 531 |
+
715,
|
| 532 |
+
770
|
| 533 |
+
],
|
| 534 |
+
"page_idx": 3
|
| 535 |
+
},
|
| 536 |
+
{
|
| 537 |
+
"type": "text",
|
| 538 |
+
"text": "We call this as Hessian-weighted $\\mathbf { k }$ -means clustering. Observe in (7) that we give a larger penalty for a network parameter in defining the distortion measure for clustering when its second-order partial derivative is larger, in order to avoid a large deviation from its original value, since the impact on the loss function due to quantization is expected to be larger for that parameter. ",
|
| 539 |
+
"bbox": [
|
| 540 |
+
173,
|
| 541 |
+
776,
|
| 542 |
+
825,
|
| 543 |
+
834
|
| 544 |
+
],
|
| 545 |
+
"page_idx": 3
|
| 546 |
+
},
|
| 547 |
+
{
|
| 548 |
+
"type": "text",
|
| 549 |
+
"text": "Hessian-weighted $\\mathbf { k }$ -means clustering is locally optimal in minimizing the quantization loss when fixed-length binary coding follows, where the compression ratio solely depends on the number of clusters as shown in Section 2.1. Similar to the conventional $\\mathbf { k }$ -means clustering, solving this optimization is not easy, but Lloyd’s algorithm is still applicable as an efficient heuristic solution for this problem if Hessian-weighted means are used as cluster centers instead of non-weighted regular means. ",
|
| 550 |
+
"bbox": [
|
| 551 |
+
173,
|
| 552 |
+
839,
|
| 553 |
+
825,
|
| 554 |
+
924
|
| 555 |
+
],
|
| 556 |
+
"page_idx": 3
|
| 557 |
+
},
|
| 558 |
+
{
|
| 559 |
+
"type": "text",
|
| 560 |
+
"text": "3.4 HESSIAN COMPUTATION ",
|
| 561 |
+
"text_level": 1,
|
| 562 |
+
"bbox": [
|
| 563 |
+
174,
|
| 564 |
+
103,
|
| 565 |
+
383,
|
| 566 |
+
117
|
| 567 |
+
],
|
| 568 |
+
"page_idx": 4
|
| 569 |
+
},
|
| 570 |
+
{
|
| 571 |
+
"type": "text",
|
| 572 |
+
"text": "For obtaining Hessian, one needs to evaluate the second-order partial derivative of the average loss function with respect to each of network parameters, i.e., we need to calculate ",
|
| 573 |
+
"bbox": [
|
| 574 |
+
173,
|
| 575 |
+
128,
|
| 576 |
+
825,
|
| 577 |
+
159
|
| 578 |
+
],
|
| 579 |
+
"page_idx": 4
|
| 580 |
+
},
|
| 581 |
+
{
|
| 582 |
+
"type": "equation",
|
| 583 |
+
"img_path": "images/d70a34689409e924408c4dc6bfa9673f3c016d5d55a6071073cfb4107b42041a.jpg",
|
| 584 |
+
"text": "$$\nh _ { i i } ( \\hat { \\mathbf { w } } ) = \\frac { \\partial ^ { 2 } L ( \\mathcal { X } ; \\mathbf { w } ) } { \\partial w _ { i } ^ { 2 } } \\bigg | _ { \\mathbf { w } = \\hat { \\mathbf { w } } } = \\frac { 1 } { | \\mathcal { X } | } \\frac { \\partial ^ { 2 } } { \\partial w _ { i } ^ { 2 } } \\sum _ { \\mathbf { x } \\in \\mathcal { X } } l o s s ( f ( \\mathbf { x } ; \\mathbf { w } ) , \\hat { \\mathbf { y } } ( \\mathbf { x } ) ) \\bigg | _ { \\mathbf { w } = \\hat { \\mathbf { w } } } .\n$$",
|
| 585 |
+
"text_format": "latex",
|
| 586 |
+
"bbox": [
|
| 587 |
+
259,
|
| 588 |
+
161,
|
| 589 |
+
738,
|
| 590 |
+
202
|
| 591 |
+
],
|
| 592 |
+
"page_idx": 4
|
| 593 |
+
},
|
| 594 |
+
{
|
| 595 |
+
"type": "text",
|
| 596 |
+
"text": "Recall that we are interested in only the diagonal elements of Hessian. An efficient way of computing the diagonal of Hessian is presented in Le Cun (1987); Becker & Le Cun (1988) and it is based on the back propagation method that is similar to the back propagation algorithm used for computing first-order partial derivatives (gradients). That is, computing the diagonal of Hessian is of the same order of complexity as computing gradients. ",
|
| 597 |
+
"bbox": [
|
| 598 |
+
174,
|
| 599 |
+
204,
|
| 600 |
+
825,
|
| 601 |
+
275
|
| 602 |
+
],
|
| 603 |
+
"page_idx": 4
|
| 604 |
+
},
|
| 605 |
+
{
|
| 606 |
+
"type": "text",
|
| 607 |
+
"text": "Hessian computation and our network quantization are performed after completing network training. For the data set $\\mathcal { X }$ used to compute Hessian in (8), we can either reuse a training data set or use some other data set, e.g., validation data set. We observed from our experiments that even using a small subset of the training or validation data set is sufficient to yield good approximation of Hessian for network quantization. ",
|
| 608 |
+
"bbox": [
|
| 609 |
+
174,
|
| 610 |
+
281,
|
| 611 |
+
825,
|
| 612 |
+
351
|
| 613 |
+
],
|
| 614 |
+
"page_idx": 4
|
| 615 |
+
},
|
| 616 |
+
{
|
| 617 |
+
"type": "text",
|
| 618 |
+
"text": "3.5 ALTERNATIVE OF HESSIAN ",
|
| 619 |
+
"text_level": 1,
|
| 620 |
+
"bbox": [
|
| 621 |
+
176,
|
| 622 |
+
367,
|
| 623 |
+
401,
|
| 624 |
+
381
|
| 625 |
+
],
|
| 626 |
+
"page_idx": 4
|
| 627 |
+
},
|
| 628 |
+
{
|
| 629 |
+
"type": "text",
|
| 630 |
+
"text": "Although there is an efficient way to obtain the diagonal of Hessian as discussed in the previous subsection, Hessian computation is not free. In order to avoid this additional Hessian computation, we propose to use an alternative metric instead of Hessian. In particular, we consider neural networks trained with the Adam SGD optimizer (Kingma & Ba, 2014) and propose to use some function (e.g., square root) of the second moment estimates of gradients as an alternative of Hessian. ",
|
| 631 |
+
"bbox": [
|
| 632 |
+
174,
|
| 633 |
+
392,
|
| 634 |
+
825,
|
| 635 |
+
463
|
| 636 |
+
],
|
| 637 |
+
"page_idx": 4
|
| 638 |
+
},
|
| 639 |
+
{
|
| 640 |
+
"type": "text",
|
| 641 |
+
"text": "The Adam algorithm computes adaptive learning rates for individual network parameters from the first and second moment estimates of gradients. We compare the Adam method to Newton’s optimization method using Hessian and notice that the second moment estimates of gradients in the Adam method act like the Hessian in Newton’s method. This observation leads us to use some function (e.g., square root) of the second moment estimates of gradients as an alternative of Hessian. ",
|
| 642 |
+
"bbox": [
|
| 643 |
+
174,
|
| 644 |
+
469,
|
| 645 |
+
825,
|
| 646 |
+
540
|
| 647 |
+
],
|
| 648 |
+
"page_idx": 4
|
| 649 |
+
},
|
| 650 |
+
{
|
| 651 |
+
"type": "text",
|
| 652 |
+
"text": "The advantage of using the second moment estimates from the Adam method is that they are computed while training and we can obtain them at the end of training at no additional cost. It makes Hessian-weighting more feasible for deep neural networks, which have millions of parameters. We note that similar quantities can be found and used for other SGD optimization methods using adaptive learning rates, e.g., AdaGrad (Duchi et al., 2011), Adadelta (Zeiler, 2012) and RMSProp (Tieleman & Hinton, 2012). ",
|
| 653 |
+
"bbox": [
|
| 654 |
+
174,
|
| 655 |
+
546,
|
| 656 |
+
825,
|
| 657 |
+
630
|
| 658 |
+
],
|
| 659 |
+
"page_idx": 4
|
| 660 |
+
},
|
| 661 |
+
{
|
| 662 |
+
"type": "text",
|
| 663 |
+
"text": "3.6 QUANTIZATION OF ALL LAYERS ",
|
| 664 |
+
"text_level": 1,
|
| 665 |
+
"bbox": [
|
| 666 |
+
176,
|
| 667 |
+
647,
|
| 668 |
+
434,
|
| 669 |
+
661
|
| 670 |
+
],
|
| 671 |
+
"page_idx": 4
|
| 672 |
+
},
|
| 673 |
+
{
|
| 674 |
+
"type": "text",
|
| 675 |
+
"text": "We propose quantizing the network parameters of all layers in a neural network together at once by taking Hessian-weight into account. Layer-by-layer quantization was examined in the previous work (Gong et al., 2014; Han et al., 2015a). However, e.g., in Han et al. (2015a), a larger number of bits (a larger number of clusters) are assigned to convolutional layers than fully-connected layers, which implies that they heuristically treat convolutional layers more importantly. This follows from the fact that the impact of quantization errors on the performance varies significantly across layers; some layers, e.g., convolutional layers, may be more important than the others. This concern is exactly what we can address by Hessian-weighting. ",
|
| 676 |
+
"bbox": [
|
| 677 |
+
174,
|
| 678 |
+
672,
|
| 679 |
+
825,
|
| 680 |
+
785
|
| 681 |
+
],
|
| 682 |
+
"page_idx": 4
|
| 683 |
+
},
|
| 684 |
+
{
|
| 685 |
+
"type": "text",
|
| 686 |
+
"text": "Hessian-weighting properly handles the different impact of quantization errors not only within layers but also across layers and thus it can be employed for quantizing all layers of a network together. The impact of quantization errors may vary more substantially across layers than within layers. Thus, Hessian-weighting may show more benefit in deeper neural networks. We note that Hessianweighting can still provide gain even for layer-by-layer quantization since it can address the different impact of the quantization errors of network parameters within each layer as well. ",
|
| 687 |
+
"bbox": [
|
| 688 |
+
174,
|
| 689 |
+
791,
|
| 690 |
+
825,
|
| 691 |
+
875
|
| 692 |
+
],
|
| 693 |
+
"page_idx": 4
|
| 694 |
+
},
|
| 695 |
+
{
|
| 696 |
+
"type": "text",
|
| 697 |
+
"text": "Recent neural networks are getting deeper, e.g., see Szegedy et al. (2015a;b); He et al. (2015). For such deep neural networks, quantizing network parameters of all layers together is even more advantageous since we can avoid layer-by-layer compression rate optimization. Optimizing compression ratios jointly across all individual layers (to maximize the overall compression ratio for a network) requires exponential time complexity with respect to the number of layers. This is because the total number of possible combinations of compression ratios for individual layers increases exponentially as the number of layers increases. ",
|
| 698 |
+
"bbox": [
|
| 699 |
+
176,
|
| 700 |
+
882,
|
| 701 |
+
823,
|
| 702 |
+
924
|
| 703 |
+
],
|
| 704 |
+
"page_idx": 4
|
| 705 |
+
},
|
| 706 |
+
{
|
| 707 |
+
"type": "text",
|
| 708 |
+
"text": "",
|
| 709 |
+
"bbox": [
|
| 710 |
+
174,
|
| 711 |
+
103,
|
| 712 |
+
825,
|
| 713 |
+
160
|
| 714 |
+
],
|
| 715 |
+
"page_idx": 5
|
| 716 |
+
},
|
| 717 |
+
{
|
| 718 |
+
"type": "text",
|
| 719 |
+
"text": "4 ENTROPY-CONSTRAINED NETWORK QUANTIZATION ",
|
| 720 |
+
"text_level": 1,
|
| 721 |
+
"bbox": [
|
| 722 |
+
174,
|
| 723 |
+
180,
|
| 724 |
+
633,
|
| 725 |
+
195
|
| 726 |
+
],
|
| 727 |
+
"page_idx": 5
|
| 728 |
+
},
|
| 729 |
+
{
|
| 730 |
+
"type": "text",
|
| 731 |
+
"text": "In this section, we investigate how to solve the network quantization problem under a constraint on the compression ratio. In designing network quantization schemes, we not only want to minimize the performance loss but also want to maximize the compression ratio. In Section 3, we explored how to quantify and minimize the loss due to quantization. In this section, we investigate how to take the compression ratio into account properly in the optimization of network quantization. ",
|
| 732 |
+
"bbox": [
|
| 733 |
+
174,
|
| 734 |
+
209,
|
| 735 |
+
825,
|
| 736 |
+
280
|
| 737 |
+
],
|
| 738 |
+
"page_idx": 5
|
| 739 |
+
},
|
| 740 |
+
{
|
| 741 |
+
"type": "text",
|
| 742 |
+
"text": "4.1 ENTROPY CODING ",
|
| 743 |
+
"text_level": 1,
|
| 744 |
+
"bbox": [
|
| 745 |
+
174,
|
| 746 |
+
296,
|
| 747 |
+
341,
|
| 748 |
+
310
|
| 749 |
+
],
|
| 750 |
+
"page_idx": 5
|
| 751 |
+
},
|
| 752 |
+
{
|
| 753 |
+
"type": "text",
|
| 754 |
+
"text": "After quantizing network parameters by clustering, lossless data compression by variable-length binary coding can be followed for compressing quantized values. There is a set of optimal codes that achieve the minimum average codeword length for a given source. Entropy is the theoretical limit of the average codeword length per symbol that we can achieve by lossless data compression, proved by Shannon (see, e.g., Cover & Thomas (2012, Section 5.3)). It is known that optimal codes achieve this limit with some overhead less than 1 bit when only integer-length codewords are allowed. So optimal coding is also called as entropy coding. Huffman coding is one of entropy coding schemes commonly used when the source distribution is provided (see, e.g., Cover & Thomas (2012, Section 5.6)), or can be estimated. ",
|
| 755 |
+
"bbox": [
|
| 756 |
+
173,
|
| 757 |
+
321,
|
| 758 |
+
825,
|
| 759 |
+
448
|
| 760 |
+
],
|
| 761 |
+
"page_idx": 5
|
| 762 |
+
},
|
| 763 |
+
{
|
| 764 |
+
"type": "text",
|
| 765 |
+
"text": "4.2 ENTROPY-CONSTRAINED SCALAR QUANTIZATION (ECSQ) ",
|
| 766 |
+
"text_level": 1,
|
| 767 |
+
"bbox": [
|
| 768 |
+
173,
|
| 769 |
+
463,
|
| 770 |
+
619,
|
| 771 |
+
478
|
| 772 |
+
],
|
| 773 |
+
"page_idx": 5
|
| 774 |
+
},
|
| 775 |
+
{
|
| 776 |
+
"type": "text",
|
| 777 |
+
"text": "Considering a compression ratio constraint in network quantization, we need to solve the clustering problem in (2) or (7) under the compression ratio constraint given by ",
|
| 778 |
+
"bbox": [
|
| 779 |
+
171,
|
| 780 |
+
488,
|
| 781 |
+
825,
|
| 782 |
+
518
|
| 783 |
+
],
|
| 784 |
+
"page_idx": 5
|
| 785 |
+
},
|
| 786 |
+
{
|
| 787 |
+
"type": "equation",
|
| 788 |
+
"img_path": "images/fce215dea10f2aef666cd2510533e2e5ec43acdac9604d691e4eec0a4de48ef9.jpg",
|
| 789 |
+
"text": "$$\n\\mathrm { C o m p r e s s i o n \\ r a t i o } = \\frac { b } { \\bar { b } + ( \\sum _ { i = 1 } ^ { k } b _ { i } + k b ) / N } > C , \\mathrm { w h e r e } \\bar { b } = \\frac { 1 } { N } \\sum _ { i = 1 } ^ { k } | { \\mathcal C } _ { i } | b _ { i } ,\n$$",
|
| 790 |
+
"text_format": "latex",
|
| 791 |
+
"bbox": [
|
| 792 |
+
236,
|
| 793 |
+
520,
|
| 794 |
+
759,
|
| 795 |
+
563
|
| 796 |
+
],
|
| 797 |
+
"page_idx": 5
|
| 798 |
+
},
|
| 799 |
+
{
|
| 800 |
+
"type": "text",
|
| 801 |
+
"text": "which follows from (1). This optimization problem is too complex to solve for any arbitrary variablelength binary code since the average codeword length $\\bar { b }$ can be arbitrary. However, we identify that it can be simplified if optimal codes, e.g., Huffman codes, are assumed to be used. In particular, optimal coding closely achieves the lower limit of the average source code length, i.e., entropy, and then we approximately have ",
|
| 802 |
+
"bbox": [
|
| 803 |
+
173,
|
| 804 |
+
564,
|
| 805 |
+
825,
|
| 806 |
+
633
|
| 807 |
+
],
|
| 808 |
+
"page_idx": 5
|
| 809 |
+
},
|
| 810 |
+
{
|
| 811 |
+
"type": "equation",
|
| 812 |
+
"img_path": "images/4221844f8187d14d5f594f153f8b17bebe1db581053cd634140af14bddad7001.jpg",
|
| 813 |
+
"text": "$$\n\\bar { b } \\approx H = - \\sum _ { i = 1 } ^ { k } p _ { i } \\log _ { 2 } p _ { i } ,\n$$",
|
| 814 |
+
"text_format": "latex",
|
| 815 |
+
"bbox": [
|
| 816 |
+
410,
|
| 817 |
+
632,
|
| 818 |
+
584,
|
| 819 |
+
676
|
| 820 |
+
],
|
| 821 |
+
"page_idx": 5
|
| 822 |
+
},
|
| 823 |
+
{
|
| 824 |
+
"type": "text",
|
| 825 |
+
"text": "where $H$ is the entropy of the quantized network parameters after clustering (i.e., source), given that $p _ { i } = | \\mathcal { C } _ { i } | / N$ is the ratio of the number of network parameters in cluster $\\mathcal { C } _ { i }$ to the number of all network parameters (i.e., source distribution). Moreover, assuming that $N \\gg k$ , we have ",
|
| 826 |
+
"bbox": [
|
| 827 |
+
174,
|
| 828 |
+
675,
|
| 829 |
+
825,
|
| 830 |
+
717
|
| 831 |
+
],
|
| 832 |
+
"page_idx": 5
|
| 833 |
+
},
|
| 834 |
+
{
|
| 835 |
+
"type": "equation",
|
| 836 |
+
"img_path": "images/978bd9ba430c0335cd60b99e12f43beeb59dbe2a981b8c97b573cdaf1c122edf.jpg",
|
| 837 |
+
"text": "$$\n{ \\frac { 1 } { N } } \\left( \\sum _ { i = 1 } ^ { k } b _ { i } + k b \\right) \\approx 0 ,\n$$",
|
| 838 |
+
"text_format": "latex",
|
| 839 |
+
"bbox": [
|
| 840 |
+
418,
|
| 841 |
+
719,
|
| 842 |
+
578,
|
| 843 |
+
763
|
| 844 |
+
],
|
| 845 |
+
"page_idx": 5
|
| 846 |
+
},
|
| 847 |
+
{
|
| 848 |
+
"type": "text",
|
| 849 |
+
"text": "in (9). From (10) and (11), the constraint in (9) can be altered to an entropy constraint given by ",
|
| 850 |
+
"bbox": [
|
| 851 |
+
171,
|
| 852 |
+
763,
|
| 853 |
+
795,
|
| 854 |
+
779
|
| 855 |
+
],
|
| 856 |
+
"page_idx": 5
|
| 857 |
+
},
|
| 858 |
+
{
|
| 859 |
+
"type": "equation",
|
| 860 |
+
"img_path": "images/dff05ec22f8d557766278b877d73a42101a582bf34a34b1c87ac6baff9f6a9e0.jpg",
|
| 861 |
+
"text": "$$\nH = - \\sum _ { i = 1 } ^ { k } p _ { i } \\log _ { 2 } p _ { i } < R ,\n$$",
|
| 862 |
+
"text_format": "latex",
|
| 863 |
+
"bbox": [
|
| 864 |
+
406,
|
| 865 |
+
780,
|
| 866 |
+
588,
|
| 867 |
+
824
|
| 868 |
+
],
|
| 869 |
+
"page_idx": 5
|
| 870 |
+
},
|
| 871 |
+
{
|
| 872 |
+
"type": "text",
|
| 873 |
+
"text": "where $R \\approx b / C$ . In summary, assuming that optimal coding is employed after clustering, one can approximately replace a compression ratio constraint with an entropy constraint for the clustering output. The network quantization problem is then translated into a quantization problem with an entropy constraint, which is called as entropy-constrained scalar quantization (ECSQ) in information theory. Two efficient heuristic solutions for ECSQ are proposed for network quantization in the following subsections, i.e., uniform quantization and an iterative solution similar to Lloyd’s algorithm for $\\mathbf { k }$ -means clustering. ",
|
| 874 |
+
"bbox": [
|
| 875 |
+
173,
|
| 876 |
+
825,
|
| 877 |
+
825,
|
| 878 |
+
924
|
| 879 |
+
],
|
| 880 |
+
"page_idx": 5
|
| 881 |
+
},
|
| 882 |
+
{
|
| 883 |
+
"type": "text",
|
| 884 |
+
"text": "4.3 UNIFORM QUANTIZATION ",
|
| 885 |
+
"text_level": 1,
|
| 886 |
+
"bbox": [
|
| 887 |
+
174,
|
| 888 |
+
103,
|
| 889 |
+
393,
|
| 890 |
+
117
|
| 891 |
+
],
|
| 892 |
+
"page_idx": 6
|
| 893 |
+
},
|
| 894 |
+
{
|
| 895 |
+
"type": "text",
|
| 896 |
+
"text": "It is shown in Gish & Pierce (1968) that the uniform quantizer is asymptotically optimal in minimizing the mean square quantization error for any random source with a reasonably smooth density function as the resolution becomes infinite, i.e., as the number of clusters $k \\infty$ . This asymptotic result leads us to come up with a very simple but efficient network quantization scheme as follows: ",
|
| 897 |
+
"bbox": [
|
| 898 |
+
176,
|
| 899 |
+
128,
|
| 900 |
+
823,
|
| 901 |
+
185
|
| 902 |
+
],
|
| 903 |
+
"page_idx": 6
|
| 904 |
+
},
|
| 905 |
+
{
|
| 906 |
+
"type": "text",
|
| 907 |
+
"text": "1. We first set uniformly spaced thresholds and divide network parameters into clusters. 2. After determining clusters, their quantized values (cluster centers) are obtained by taking the mean of network parameters in each cluster. ",
|
| 908 |
+
"bbox": [
|
| 909 |
+
205,
|
| 910 |
+
195,
|
| 911 |
+
825,
|
| 912 |
+
243
|
| 913 |
+
],
|
| 914 |
+
"page_idx": 6
|
| 915 |
+
},
|
| 916 |
+
{
|
| 917 |
+
"type": "text",
|
| 918 |
+
"text": "Note that one can use Hessian-weighted mean instead of non-weighted mean in computing cluster centers in the second step above in order to take the benefit of Hessian-weighting. A performance comparison of uniform quantization with non-weighted mean and uniform quantization with Hessian-weighted mean can be found in Appendix A.2. ",
|
| 919 |
+
"bbox": [
|
| 920 |
+
176,
|
| 921 |
+
253,
|
| 922 |
+
825,
|
| 923 |
+
310
|
| 924 |
+
],
|
| 925 |
+
"page_idx": 6
|
| 926 |
+
},
|
| 927 |
+
{
|
| 928 |
+
"type": "text",
|
| 929 |
+
"text": "Although uniform quantization is a straightforward method, it has never been shown before in the literature that it is actually one of the most efficient quantization schemes for neural networks when optimal variable-length coding, e.g., Huffman coding, follows. We note that uniform quantization is not always good; it is inefficient for fixed-length coding, which is also first shown in this paper. ",
|
| 930 |
+
"bbox": [
|
| 931 |
+
174,
|
| 932 |
+
318,
|
| 933 |
+
825,
|
| 934 |
+
373
|
| 935 |
+
],
|
| 936 |
+
"page_idx": 6
|
| 937 |
+
},
|
| 938 |
+
{
|
| 939 |
+
"type": "text",
|
| 940 |
+
"text": "4.4 ITERATIVE ALGORITHM TO SOLVE ECSQ ",
|
| 941 |
+
"text_level": 1,
|
| 942 |
+
"bbox": [
|
| 943 |
+
176,
|
| 944 |
+
390,
|
| 945 |
+
500,
|
| 946 |
+
404
|
| 947 |
+
],
|
| 948 |
+
"page_idx": 6
|
| 949 |
+
},
|
| 950 |
+
{
|
| 951 |
+
"type": "text",
|
| 952 |
+
"text": "Another scheme proposed to solve the ECSQ problem for network quantization is an iterative algorithm, which is similar to Lloyd’s algorithm for k-means clustering. Although this iterative solution is more complicated than the uniform quantization in Section 4.3, it finds a local optimum for a given discrete source. An iterative algorithm to solve the general ECSQ problem is provided in Chou et al. (1989). We derive a similar iterative algorithm to solve the ECSQ problem for network quantization. The main difference from the method in Chou et al. (1989) is that we minimize the Hessian-weighted distortion measure instead of the non-weighted regular distortion measure for optimal quantization. The detailed algorithm and further discussion can be found in Appendix A.3. ",
|
| 953 |
+
"bbox": [
|
| 954 |
+
174,
|
| 955 |
+
415,
|
| 956 |
+
825,
|
| 957 |
+
526
|
| 958 |
+
],
|
| 959 |
+
"page_idx": 6
|
| 960 |
+
},
|
| 961 |
+
{
|
| 962 |
+
"type": "text",
|
| 963 |
+
"text": "5 EXPERIMENTS ",
|
| 964 |
+
"text_level": 1,
|
| 965 |
+
"bbox": [
|
| 966 |
+
174,
|
| 967 |
+
546,
|
| 968 |
+
326,
|
| 969 |
+
563
|
| 970 |
+
],
|
| 971 |
+
"page_idx": 6
|
| 972 |
+
},
|
| 973 |
+
{
|
| 974 |
+
"type": "text",
|
| 975 |
+
"text": "This section presents our experiment results for the proposed network quantization schemes in three exemplary convolutional neural networks: (a) LeNet (LeCun et al., 1998) for the MNIST data set, (b) ResNet (He et al., 2015) for the CIFAR-10 data set, and (c) AlexNet (Krizhevsky et al., 2012) for the ImageNet ILSVRC-2012 data set. Our experiments can be summarized as follows: ",
|
| 976 |
+
"bbox": [
|
| 977 |
+
176,
|
| 978 |
+
577,
|
| 979 |
+
825,
|
| 980 |
+
633
|
| 981 |
+
],
|
| 982 |
+
"page_idx": 6
|
| 983 |
+
},
|
| 984 |
+
{
|
| 985 |
+
"type": "text",
|
| 986 |
+
"text": "• We employ the proposed network quantization methods to quantize all of network parameters in a network together at once, as discussed in Section 3.6. We evaluate the performance of the proposed network quantization methods with and without network pruning. For a pruned model, we need to store not only the values of unpruned parameters but also their respective indexes (locations) in the original model. For the index information, we compute index differences between unpruned network parameters in the original model and further compress them by Huffman coding as in Han et al. (2015a). For Hessian computation, 50,000 samples of the training set are reused. We also evaluate the performance when Hessian is computed with 1,000 samples only. • Finally, we evaluate the performance of our network quantization schemes using Hessian when its alternative is used instead, as discussed in Section 3.5. To this end, we retrain the considered neural networks with the Adam SGD optimizer and obtain the second moment estimates of gradients at the end of training. Then, we use the square roots of the second moment estimates instead of Hessian and evaluate the performance. ",
|
| 987 |
+
"bbox": [
|
| 988 |
+
215,
|
| 989 |
+
645,
|
| 990 |
+
825,
|
| 991 |
+
853
|
| 992 |
+
],
|
| 993 |
+
"page_idx": 6
|
| 994 |
+
},
|
| 995 |
+
{
|
| 996 |
+
"type": "text",
|
| 997 |
+
"text": "5.1 EXPERIMENT MODELS ",
|
| 998 |
+
"text_level": 1,
|
| 999 |
+
"bbox": [
|
| 1000 |
+
174,
|
| 1001 |
+
869,
|
| 1002 |
+
370,
|
| 1003 |
+
883
|
| 1004 |
+
],
|
| 1005 |
+
"page_idx": 6
|
| 1006 |
+
},
|
| 1007 |
+
{
|
| 1008 |
+
"type": "text",
|
| 1009 |
+
"text": "First, we evaluate our network quantization schemes for the MNIST data set with a simplified version of LeNet5 (LeCun et al., 1998), consisting of two convolutional layers and two fully-connected ",
|
| 1010 |
+
"bbox": [
|
| 1011 |
+
174,
|
| 1012 |
+
895,
|
| 1013 |
+
823,
|
| 1014 |
+
924
|
| 1015 |
+
],
|
| 1016 |
+
"page_idx": 6
|
| 1017 |
+
},
|
| 1018 |
+
{
|
| 1019 |
+
"type": "image",
|
| 1020 |
+
"img_path": "images/0f02110779a331f89eeb3818d8dbeb7701d7362e4161826728462a4771c35568.jpg",
|
| 1021 |
+
"image_caption": [
|
| 1022 |
+
"Figure 1: Accuracy versus average codeword length per network parameter after network quantization for 32-layer ResNet. "
|
| 1023 |
+
],
|
| 1024 |
+
"image_footnote": [],
|
| 1025 |
+
"bbox": [
|
| 1026 |
+
220,
|
| 1027 |
+
103,
|
| 1028 |
+
774,
|
| 1029 |
+
455
|
| 1030 |
+
],
|
| 1031 |
+
"page_idx": 7
|
| 1032 |
+
},
|
| 1033 |
+
{
|
| 1034 |
+
"type": "text",
|
| 1035 |
+
"text": "layers followed by a soft-max layer. It has total 431,080 parameters and achieves $9 9 . 2 5 \\%$ accuracy. \nFor a pruned model, we prune $91 \\%$ of the original network parameters and fine-tune the rest. ",
|
| 1036 |
+
"bbox": [
|
| 1037 |
+
176,
|
| 1038 |
+
534,
|
| 1039 |
+
820,
|
| 1040 |
+
563
|
| 1041 |
+
],
|
| 1042 |
+
"page_idx": 7
|
| 1043 |
+
},
|
| 1044 |
+
{
|
| 1045 |
+
"type": "text",
|
| 1046 |
+
"text": "Second, we experiment our network quantization schemes for the CIFAR-10 data set (Krizhevsky, 2009) with a pre-trained 32-layer ResNet (He et al., 2015). The 32-layer ResNet consists of 464,154 parameters in total and achieves $9 2 . 5 8 \\%$ accuracy. For a pruned model, we prune $80 \\%$ of the original network parameters and fine-tune the rest. ",
|
| 1047 |
+
"bbox": [
|
| 1048 |
+
174,
|
| 1049 |
+
569,
|
| 1050 |
+
825,
|
| 1051 |
+
625
|
| 1052 |
+
],
|
| 1053 |
+
"page_idx": 7
|
| 1054 |
+
},
|
| 1055 |
+
{
|
| 1056 |
+
"type": "text",
|
| 1057 |
+
"text": "Third, we evaluate our network quantization schemes with AlexNet (Krizhevsky et al., 2012) for the ImageNet ILSVRC-2012 data set (Russakovsky et al., 2015). We obtain a pre-trained AlexNet Caffe model, which achieves $5 7 . 1 6 \\%$ top-1 accuracy. For a pruned model, we prune $89 \\%$ parameters and fine-tune the rest. In fine-tuning, the Adam SGD optimizer is used in order to avoid the computation of Hessian by utilizing its alternative (see Section 3.5). However, the pruned model does not recover the original accuracy after fine-tuning with the Adam method; the top-1 accuracy recovered after pruning and fine-tuning is $5 6 . 0 0 \\%$ . We are able to find a better pruned model achieving the original accuracy by pruning and retraining iteratively (Han et al., 2015b), which is however not used here. ",
|
| 1058 |
+
"bbox": [
|
| 1059 |
+
174,
|
| 1060 |
+
632,
|
| 1061 |
+
825,
|
| 1062 |
+
743
|
| 1063 |
+
],
|
| 1064 |
+
"page_idx": 7
|
| 1065 |
+
},
|
| 1066 |
+
{
|
| 1067 |
+
"type": "text",
|
| 1068 |
+
"text": "5.2 EXPERIMENT RESULTS ",
|
| 1069 |
+
"text_level": 1,
|
| 1070 |
+
"bbox": [
|
| 1071 |
+
176,
|
| 1072 |
+
768,
|
| 1073 |
+
372,
|
| 1074 |
+
782
|
| 1075 |
+
],
|
| 1076 |
+
"page_idx": 7
|
| 1077 |
+
},
|
| 1078 |
+
{
|
| 1079 |
+
"type": "text",
|
| 1080 |
+
"text": "We first present the quantization results without pruning for 32-layer ResNet in Figure 1, where the accuracy of 32-layer ResNet is plotted against the average codeword length per network parameter after quantization. When fixed-length coding is employed, the proposed Hessian-weighted $\\mathbf { k }$ -means clustering method performs the best, as expected. Observe that Hessian-weighted k-means clustering yields better accuracy than others even after fine-tuning. On the other hand, when Huffman coding is employed, uniform quantization and the iterative algorithm for ECSQ outperform Hessian-weighted $\\mathbf { k }$ -means clustering and $\\mathbf { k }$ -means clustering. However, these two ECSQ solutions underperform Hessian-weighted $\\mathbf { k }$ -means clustering and even k-means clustering when fixed-length coding is employed since they are optimized for optimal variable-length coding. ",
|
| 1081 |
+
"bbox": [
|
| 1082 |
+
174,
|
| 1083 |
+
797,
|
| 1084 |
+
825,
|
| 1085 |
+
924
|
| 1086 |
+
],
|
| 1087 |
+
"page_idx": 7
|
| 1088 |
+
},
|
| 1089 |
+
{
|
| 1090 |
+
"type": "image",
|
| 1091 |
+
"img_path": "images/aa4bb651d105cb01aae732df71e9e8bbcb93abbb14511240683c400c0b09510e.jpg",
|
| 1092 |
+
"image_caption": [
|
| 1093 |
+
"Figure 2: Accuracy versus average codeword length per network parameter after network quantization, Huffman coding and fine-tuning for LeNet and 32-layer ResNet when Hessian is computed with 50,000 or 1,000 samples and when the square roots of the second moment estimates of gradients are used instead of Hessian as an alternative. "
|
| 1094 |
+
],
|
| 1095 |
+
"image_footnote": [],
|
| 1096 |
+
"bbox": [
|
| 1097 |
+
220,
|
| 1098 |
+
102,
|
| 1099 |
+
774,
|
| 1100 |
+
275
|
| 1101 |
+
],
|
| 1102 |
+
"page_idx": 8
|
| 1103 |
+
},
|
| 1104 |
+
{
|
| 1105 |
+
"type": "text",
|
| 1106 |
+
"text": "Figure 2 shows the performance of Hessian-weighted k-means clustering when Hessian is computed with a small number of samples (1,000 samples). Observe that even using the Hessian computed with a small number of samples yields almost the same performance. We also show the performance of Hessian-weighted k-means clustering when an alternative of Hessian is used instead of Hessian as explained in Section 3.5. In particular, the square roots of the second moment estimates of gradients are used instead of Hessian, and using this alternative provides similar performance to using Hessian. ",
|
| 1107 |
+
"bbox": [
|
| 1108 |
+
174,
|
| 1109 |
+
371,
|
| 1110 |
+
825,
|
| 1111 |
+
455
|
| 1112 |
+
],
|
| 1113 |
+
"page_idx": 8
|
| 1114 |
+
},
|
| 1115 |
+
{
|
| 1116 |
+
"type": "text",
|
| 1117 |
+
"text": "In Table 1, we summarize the compression ratios that we can achieve with different network quantization methods for pruned models. The original network parameters are 32-bit float numbers. Using the simple uniform quantization followed by Huffman coding, we achieve the compression ratios of 51.25, 22.17 and 40.65 (i.e., the compressed model sizes are $1 . 9 5 \\%$ , $4 . 5 1 \\%$ and $2 . 4 6 \\%$ of the original model sizes) for LeNet, 32-layer ResNet and AlexNet, respectively, at no or marginal performance loss. Observe that the loss in the compressed AlexNet is mainly due to pruning. Here, we also compare our network quantization results to the ones in Han et al. (2015a). Note that layer-bylayer quantization with $\\mathbf { k }$ -means clustering is evaluated in Han et al. (2015a) while our quantization schemes including $\\mathbf { k }$ -means clustering are employed to quantize network parameters of all layers together at once (see Section 3.6). ",
|
| 1118 |
+
"bbox": [
|
| 1119 |
+
174,
|
| 1120 |
+
463,
|
| 1121 |
+
825,
|
| 1122 |
+
602
|
| 1123 |
+
],
|
| 1124 |
+
"page_idx": 8
|
| 1125 |
+
},
|
| 1126 |
+
{
|
| 1127 |
+
"type": "text",
|
| 1128 |
+
"text": "6 CONCLUSION ",
|
| 1129 |
+
"text_level": 1,
|
| 1130 |
+
"bbox": [
|
| 1131 |
+
174,
|
| 1132 |
+
622,
|
| 1133 |
+
316,
|
| 1134 |
+
638
|
| 1135 |
+
],
|
| 1136 |
+
"page_idx": 8
|
| 1137 |
+
},
|
| 1138 |
+
{
|
| 1139 |
+
"type": "text",
|
| 1140 |
+
"text": "This paper investigates the quantization problem of network parameters in deep neural networks. We identify the suboptimality of the conventional quantization method using $\\mathbf { k }$ -means clustering and newly design network quantization schemes so that they can minimize the performance loss due to quantization given a compression ratio constraint. In particular, we analytically show that Hessian can be used as a measure of the importance of network parameters and propose to minimize Hessianweighted quantization errors in average for clustering network parameters to quantize. Hessianweighting is beneficial in quantizing all of the network parameters together at once since it can handle the different impact of quantization errors properly not only within layers but also across layers. Furthermore, we make a connection from the network quantization problem to the entropyconstrained data compression problem in information theory and push the compression ratio to the limit that information theory provides. Two efficient heuristic solutions are presented to this end, i.e., uniform quantization and an iterative solution for ECSQ. Our experiment results show that the proposed network quantization schemes provide considerable gain over the conventional method using $\\mathbf { k }$ -means clustering, in particular for large and deep neural networks. ",
|
| 1141 |
+
"bbox": [
|
| 1142 |
+
174,
|
| 1143 |
+
655,
|
| 1144 |
+
825,
|
| 1145 |
+
849
|
| 1146 |
+
],
|
| 1147 |
+
"page_idx": 8
|
| 1148 |
+
},
|
| 1149 |
+
{
|
| 1150 |
+
"type": "text",
|
| 1151 |
+
"text": "REFERENCES ",
|
| 1152 |
+
"text_level": 1,
|
| 1153 |
+
"bbox": [
|
| 1154 |
+
176,
|
| 1155 |
+
871,
|
| 1156 |
+
284,
|
| 1157 |
+
886
|
| 1158 |
+
],
|
| 1159 |
+
"page_idx": 8
|
| 1160 |
+
},
|
| 1161 |
+
{
|
| 1162 |
+
"type": "text",
|
| 1163 |
+
"text": "Sajid Anwar, Kyuyeon Hwang, and Wonyong Sung. Fixed point optimization of deep convolutional neural networks for object recognition. In IEEE International Conference on Acoustics, Speech ",
|
| 1164 |
+
"bbox": [
|
| 1165 |
+
176,
|
| 1166 |
+
896,
|
| 1167 |
+
823,
|
| 1168 |
+
922
|
| 1169 |
+
],
|
| 1170 |
+
"page_idx": 8
|
| 1171 |
+
},
|
| 1172 |
+
{
|
| 1173 |
+
"type": "table",
|
| 1174 |
+
"img_path": "images/75ef6c6336b067eb67eed3fe4f7d6f839ba7046aab303f56c64ed357f5350d3c.jpg",
|
| 1175 |
+
"table_caption": [
|
| 1176 |
+
"Table 1: Summary of network quantization results with Huffman coding for pruned models. "
|
| 1177 |
+
],
|
| 1178 |
+
"table_footnote": [],
|
| 1179 |
+
"table_body": "<table><tr><td colspan=\"3\"></td><td>Accuracy %</td><td>Compression ratio</td></tr><tr><td rowspan=\"6\">LeNet</td><td colspan=\"2\">Original model</td><td>99.25</td><td>-</td></tr><tr><td colspan=\"2\">Pruned model</td><td>99.27</td><td>10.13</td></tr><tr><td rowspan=\"3\">Pruning + Quantization all layers + Huffman coding</td><td>k-means Hessian-weighted k-means</td><td>99.27</td><td>44.58</td></tr><tr><td></td><td>99.27</td><td>47.16</td></tr><tr><td>Uniform quantization</td><td>99.28</td><td>51.25</td></tr><tr><td colspan=\"2\">Iterative ECSQ Deep compression (Han et al.,2015a)</td><td>99.27 99.26</td><td>49.01 39.00</td></tr><tr><td rowspan=\"6\">ResNet</td><td colspan=\"2\">Original model</td><td>92.58</td><td>-</td></tr><tr><td rowspan=\"3\">Pruned model Pruning + Quantization all layers</td><td>k-means</td><td>92.58</td><td>4.52</td></tr><tr><td></td><td>92.64</td><td>18.25</td></tr><tr><td>Hessian-weighted k-means</td><td>92.67</td><td>20.51</td></tr><tr><td rowspan=\"3\">+ Huffman coding</td><td>Uniform quantization</td><td>92.68</td><td>22.17</td></tr><tr><td>Iterative ECSQ</td><td>92.73</td><td>21.01</td></tr><tr><td colspan=\"2\">Deep compression (Han et al.,2015a) Original model</td><td>N/A</td><td>N/A</td></tr><tr><td rowspan=\"5\">AlexNet</td><td rowspan=\"2\">Pruned model</td><td>k-means</td><td>57.16 56.00</td><td>1 7.91</td></tr><tr><td></td><td>56.12</td><td>30.53</td></tr><tr><td rowspan=\"2\">Pruning + Quantization all layers + Huffman coding</td><td>Alt-Hessian-weighted k-means Uniform quantization</td><td>56.04</td><td>33.71</td></tr><tr><td></td><td>56.20</td><td>40.65</td></tr><tr><td colspan=\"2\">Deep compression (Han et al., 2015a)</td><td>57.22</td><td>35.00</td></tr></table>",
|
| 1180 |
+
"bbox": [
|
| 1181 |
+
183,
|
| 1182 |
+
140,
|
| 1183 |
+
812,
|
| 1184 |
+
449
|
| 1185 |
+
],
|
| 1186 |
+
"page_idx": 9
|
| 1187 |
+
},
|
| 1188 |
+
{
|
| 1189 |
+
"type": "text",
|
| 1190 |
+
"text": "and Signal Processing, pp. 1131–1135, 2015. ",
|
| 1191 |
+
"bbox": [
|
| 1192 |
+
191,
|
| 1193 |
+
474,
|
| 1194 |
+
488,
|
| 1195 |
+
491
|
| 1196 |
+
],
|
| 1197 |
+
"page_idx": 9
|
| 1198 |
+
},
|
| 1199 |
+
{
|
| 1200 |
+
"type": "text",
|
| 1201 |
+
"text": "Sue Becker and Yann Le Cun. Improving the convergence of back-propagation learning with second order methods. In Proceedings of the Connectionist Models Summer School, pp. 29–37. San Matteo, CA: Morgan Kaufmann, 1988. ",
|
| 1202 |
+
"bbox": [
|
| 1203 |
+
178,
|
| 1204 |
+
502,
|
| 1205 |
+
823,
|
| 1206 |
+
545
|
| 1207 |
+
],
|
| 1208 |
+
"page_idx": 9
|
| 1209 |
+
},
|
| 1210 |
+
{
|
| 1211 |
+
"type": "text",
|
| 1212 |
+
"text": "Philip A Chou, Tom Lookabaugh, and Robert M Gray. Entropy-constrained vector quantization. IEEE Transactions on Acoustics, Speech, and Signal Processing, 37(1):31–42, 1989. ",
|
| 1213 |
+
"bbox": [
|
| 1214 |
+
173,
|
| 1215 |
+
556,
|
| 1216 |
+
823,
|
| 1217 |
+
585
|
| 1218 |
+
],
|
| 1219 |
+
"page_idx": 9
|
| 1220 |
+
},
|
| 1221 |
+
{
|
| 1222 |
+
"type": "text",
|
| 1223 |
+
"text": "Matthieu Courbariaux, Jean-Pierre David, and Yoshua Bengio. Training deep neural networks with low precision multiplications. arXiv preprint arXiv:1412.7024, 2014. ",
|
| 1224 |
+
"bbox": [
|
| 1225 |
+
173,
|
| 1226 |
+
597,
|
| 1227 |
+
825,
|
| 1228 |
+
626
|
| 1229 |
+
],
|
| 1230 |
+
"page_idx": 9
|
| 1231 |
+
},
|
| 1232 |
+
{
|
| 1233 |
+
"type": "text",
|
| 1234 |
+
"text": "Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in Neural Information Processing Systems, pp. 3123–3131, 2015. ",
|
| 1235 |
+
"bbox": [
|
| 1236 |
+
173,
|
| 1237 |
+
637,
|
| 1238 |
+
825,
|
| 1239 |
+
680
|
| 1240 |
+
],
|
| 1241 |
+
"page_idx": 9
|
| 1242 |
+
},
|
| 1243 |
+
{
|
| 1244 |
+
"type": "text",
|
| 1245 |
+
"text": "Thomas M Cover and Joy A Thomas. Elements of information theory. John Wiley & Sons, 2012. ",
|
| 1246 |
+
"bbox": [
|
| 1247 |
+
174,
|
| 1248 |
+
691,
|
| 1249 |
+
812,
|
| 1250 |
+
708
|
| 1251 |
+
],
|
| 1252 |
+
"page_idx": 9
|
| 1253 |
+
},
|
| 1254 |
+
{
|
| 1255 |
+
"type": "text",
|
| 1256 |
+
"text": "John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011. ",
|
| 1257 |
+
"bbox": [
|
| 1258 |
+
173,
|
| 1259 |
+
718,
|
| 1260 |
+
820,
|
| 1261 |
+
748
|
| 1262 |
+
],
|
| 1263 |
+
"page_idx": 9
|
| 1264 |
+
},
|
| 1265 |
+
{
|
| 1266 |
+
"type": "text",
|
| 1267 |
+
"text": "Herbert Gish and John Pierce. Asymptotically efficient quantizing. IEEE Transactions on Information Theory, 14(5):676–683, 1968. ",
|
| 1268 |
+
"bbox": [
|
| 1269 |
+
173,
|
| 1270 |
+
760,
|
| 1271 |
+
823,
|
| 1272 |
+
787
|
| 1273 |
+
],
|
| 1274 |
+
"page_idx": 9
|
| 1275 |
+
},
|
| 1276 |
+
{
|
| 1277 |
+
"type": "text",
|
| 1278 |
+
"text": "Yunchao Gong, Liu Liu, Ming Yang, and Lubomir Bourdev. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014. ",
|
| 1279 |
+
"bbox": [
|
| 1280 |
+
173,
|
| 1281 |
+
800,
|
| 1282 |
+
823,
|
| 1283 |
+
829
|
| 1284 |
+
],
|
| 1285 |
+
"page_idx": 9
|
| 1286 |
+
},
|
| 1287 |
+
{
|
| 1288 |
+
"type": "text",
|
| 1289 |
+
"text": "Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In Proceedings of the 32nd International Conference on Machine Learning, pp. 1737–1746, 2015. ",
|
| 1290 |
+
"bbox": [
|
| 1291 |
+
174,
|
| 1292 |
+
840,
|
| 1293 |
+
825,
|
| 1294 |
+
883
|
| 1295 |
+
],
|
| 1296 |
+
"page_idx": 9
|
| 1297 |
+
},
|
| 1298 |
+
{
|
| 1299 |
+
"type": "text",
|
| 1300 |
+
"text": "Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015a. ",
|
| 1301 |
+
"bbox": [
|
| 1302 |
+
176,
|
| 1303 |
+
895,
|
| 1304 |
+
823,
|
| 1305 |
+
924
|
| 1306 |
+
],
|
| 1307 |
+
"page_idx": 9
|
| 1308 |
+
},
|
| 1309 |
+
{
|
| 1310 |
+
"type": "text",
|
| 1311 |
+
"text": "Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In Advances in Neural Information Processing Systems, pp. 1135–1143, 2015b. ",
|
| 1312 |
+
"bbox": [
|
| 1313 |
+
176,
|
| 1314 |
+
103,
|
| 1315 |
+
823,
|
| 1316 |
+
146
|
| 1317 |
+
],
|
| 1318 |
+
"page_idx": 10
|
| 1319 |
+
},
|
| 1320 |
+
{
|
| 1321 |
+
"type": "text",
|
| 1322 |
+
"text": "Babak Hassibi and David G Stork. Second order derivatives for network pruning: Optimal brain surgeon. In Advances in Neural Information Processing Systems, pp. 164–171, 1993. ",
|
| 1323 |
+
"bbox": [
|
| 1324 |
+
171,
|
| 1325 |
+
155,
|
| 1326 |
+
823,
|
| 1327 |
+
184
|
| 1328 |
+
],
|
| 1329 |
+
"page_idx": 10
|
| 1330 |
+
},
|
| 1331 |
+
{
|
| 1332 |
+
"type": "text",
|
| 1333 |
+
"text": "Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015. ",
|
| 1334 |
+
"bbox": [
|
| 1335 |
+
173,
|
| 1336 |
+
193,
|
| 1337 |
+
823,
|
| 1338 |
+
222
|
| 1339 |
+
],
|
| 1340 |
+
"page_idx": 10
|
| 1341 |
+
},
|
| 1342 |
+
{
|
| 1343 |
+
"type": "text",
|
| 1344 |
+
"text": "Max Jaderberg, Andrea Vedaldi, and Andrew Zisserman. Speeding up convolutional neural networks with low rank expansions. In Proceedings of the British Machine Vision Conference, 2014. ",
|
| 1345 |
+
"bbox": [
|
| 1346 |
+
174,
|
| 1347 |
+
231,
|
| 1348 |
+
823,
|
| 1349 |
+
261
|
| 1350 |
+
],
|
| 1351 |
+
"page_idx": 10
|
| 1352 |
+
},
|
| 1353 |
+
{
|
| 1354 |
+
"type": "text",
|
| 1355 |
+
"text": "Yong-Deok Kim, Eunhyeok Park, Sungjoo Yoo, Taelim Choi, Lu Yang, and Dongjun Shin. Compression of deep convolutional neural networks for fast and low power mobile applications. arXiv preprint arXiv:1511.06530, 2015. ",
|
| 1356 |
+
"bbox": [
|
| 1357 |
+
174,
|
| 1358 |
+
268,
|
| 1359 |
+
826,
|
| 1360 |
+
311
|
| 1361 |
+
],
|
| 1362 |
+
"page_idx": 10
|
| 1363 |
+
},
|
| 1364 |
+
{
|
| 1365 |
+
"type": "text",
|
| 1366 |
+
"text": "Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. ",
|
| 1367 |
+
"bbox": [
|
| 1368 |
+
174,
|
| 1369 |
+
320,
|
| 1370 |
+
825,
|
| 1371 |
+
349
|
| 1372 |
+
],
|
| 1373 |
+
"page_idx": 10
|
| 1374 |
+
},
|
| 1375 |
+
{
|
| 1376 |
+
"type": "text",
|
| 1377 |
+
"text": "Alex Krizhevsky. Learning multiple layers of features from tiny images. 2009. ",
|
| 1378 |
+
"bbox": [
|
| 1379 |
+
173,
|
| 1380 |
+
358,
|
| 1381 |
+
692,
|
| 1382 |
+
375
|
| 1383 |
+
],
|
| 1384 |
+
"page_idx": 10
|
| 1385 |
+
},
|
| 1386 |
+
{
|
| 1387 |
+
"type": "text",
|
| 1388 |
+
"text": "Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pp. 1097–1105, 2012. ",
|
| 1389 |
+
"bbox": [
|
| 1390 |
+
174,
|
| 1391 |
+
382,
|
| 1392 |
+
826,
|
| 1393 |
+
426
|
| 1394 |
+
],
|
| 1395 |
+
"page_idx": 10
|
| 1396 |
+
},
|
| 1397 |
+
{
|
| 1398 |
+
"type": "text",
|
| 1399 |
+
"text": "Yann Le Cun. Modeles connexionnistes de l’apprentissage \\` . PhD thesis, Paris 6, 1987. ",
|
| 1400 |
+
"bbox": [
|
| 1401 |
+
173,
|
| 1402 |
+
434,
|
| 1403 |
+
738,
|
| 1404 |
+
450
|
| 1405 |
+
],
|
| 1406 |
+
"page_idx": 10
|
| 1407 |
+
},
|
| 1408 |
+
{
|
| 1409 |
+
"type": "text",
|
| 1410 |
+
"text": "Vadim Lebedev and Victor Lempitsky. Fast convnets using group-wise brain damage. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2554–2564, 2016. ",
|
| 1411 |
+
"bbox": [
|
| 1412 |
+
173,
|
| 1413 |
+
459,
|
| 1414 |
+
825,
|
| 1415 |
+
488
|
| 1416 |
+
],
|
| 1417 |
+
"page_idx": 10
|
| 1418 |
+
},
|
| 1419 |
+
{
|
| 1420 |
+
"type": "text",
|
| 1421 |
+
"text": "Vadim Lebedev, Yaroslav Ganin, Maksim Rakhuba, Ivan Oseledets, and Victor Lempitsky. Speeding-up convolutional neural networks using fine-tuned CP-decomposition. arXiv preprint arXiv:1412.6553, 2014. ",
|
| 1422 |
+
"bbox": [
|
| 1423 |
+
174,
|
| 1424 |
+
497,
|
| 1425 |
+
825,
|
| 1426 |
+
540
|
| 1427 |
+
],
|
| 1428 |
+
"page_idx": 10
|
| 1429 |
+
},
|
| 1430 |
+
{
|
| 1431 |
+
"type": "text",
|
| 1432 |
+
"text": "Yann LeCun, John S Denker, Sara A Solla, Richard E Howard, and Lawrence D Jackel. Optimal brain damage. In Advances in Neural Information Processing Systems, pp. 598–605, 1989. ",
|
| 1433 |
+
"bbox": [
|
| 1434 |
+
173,
|
| 1435 |
+
549,
|
| 1436 |
+
825,
|
| 1437 |
+
579
|
| 1438 |
+
],
|
| 1439 |
+
"page_idx": 10
|
| 1440 |
+
},
|
| 1441 |
+
{
|
| 1442 |
+
"type": "text",
|
| 1443 |
+
"text": "Yann LeCun, L´eon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. ",
|
| 1444 |
+
"bbox": [
|
| 1445 |
+
174,
|
| 1446 |
+
587,
|
| 1447 |
+
823,
|
| 1448 |
+
617
|
| 1449 |
+
],
|
| 1450 |
+
"page_idx": 10
|
| 1451 |
+
},
|
| 1452 |
+
{
|
| 1453 |
+
"type": "text",
|
| 1454 |
+
"text": "Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436–444, 2015. ",
|
| 1455 |
+
"bbox": [
|
| 1456 |
+
174,
|
| 1457 |
+
625,
|
| 1458 |
+
823,
|
| 1459 |
+
655
|
| 1460 |
+
],
|
| 1461 |
+
"page_idx": 10
|
| 1462 |
+
},
|
| 1463 |
+
{
|
| 1464 |
+
"type": "text",
|
| 1465 |
+
"text": "Darryl D Lin, Sachin S Talathi, and V Sreekanth Annapureddy. Fixed point quantization of deep convolutional networks. arXiv preprint arXiv:1511.06393, 2015a. ",
|
| 1466 |
+
"bbox": [
|
| 1467 |
+
173,
|
| 1468 |
+
662,
|
| 1469 |
+
825,
|
| 1470 |
+
693
|
| 1471 |
+
],
|
| 1472 |
+
"page_idx": 10
|
| 1473 |
+
},
|
| 1474 |
+
{
|
| 1475 |
+
"type": "text",
|
| 1476 |
+
"text": "Zhouhan Lin, Matthieu Courbariaux, Roland Memisevic, and Yoshua Bengio. Neural networks with few multiplications. arXiv preprint arXiv:1510.03009, 2015b. ",
|
| 1477 |
+
"bbox": [
|
| 1478 |
+
171,
|
| 1479 |
+
700,
|
| 1480 |
+
823,
|
| 1481 |
+
731
|
| 1482 |
+
],
|
| 1483 |
+
"page_idx": 10
|
| 1484 |
+
},
|
| 1485 |
+
{
|
| 1486 |
+
"type": "text",
|
| 1487 |
+
"text": "Baoyuan Liu, Min Wang, Hassan Foroosh, Marshall Tappen, and Marianna Pensky. Sparse convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 806–814, 2015. ",
|
| 1488 |
+
"bbox": [
|
| 1489 |
+
176,
|
| 1490 |
+
739,
|
| 1491 |
+
823,
|
| 1492 |
+
782
|
| 1493 |
+
],
|
| 1494 |
+
"page_idx": 10
|
| 1495 |
+
},
|
| 1496 |
+
{
|
| 1497 |
+
"type": "text",
|
| 1498 |
+
"text": "Michael C Mozer and Paul Smolensky. Skeletonization: A technique for trimming the fat from a network via relevance assessment. In Advances in Neural Information Processing Systems, pp. 107–115, 1989. ",
|
| 1499 |
+
"bbox": [
|
| 1500 |
+
173,
|
| 1501 |
+
791,
|
| 1502 |
+
823,
|
| 1503 |
+
833
|
| 1504 |
+
],
|
| 1505 |
+
"page_idx": 10
|
| 1506 |
+
},
|
| 1507 |
+
{
|
| 1508 |
+
"type": "text",
|
| 1509 |
+
"text": "Alexander Novikov, Dmitrii Podoprikhin, Anton Osokin, and Dmitry P Vetrov. Tensorizing neural networks. In Advances in Neural Information Processing Systems, pp. 442–450, 2015. ",
|
| 1510 |
+
"bbox": [
|
| 1511 |
+
169,
|
| 1512 |
+
843,
|
| 1513 |
+
825,
|
| 1514 |
+
872
|
| 1515 |
+
],
|
| 1516 |
+
"page_idx": 10
|
| 1517 |
+
},
|
| 1518 |
+
{
|
| 1519 |
+
"type": "text",
|
| 1520 |
+
"text": "Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. XNOR-Net: Imagenet classification using binary convolutional neural networks. arXiv preprint arXiv:1603.05279, 2016. ",
|
| 1521 |
+
"bbox": [
|
| 1522 |
+
174,
|
| 1523 |
+
881,
|
| 1524 |
+
825,
|
| 1525 |
+
922
|
| 1526 |
+
],
|
| 1527 |
+
"page_idx": 10
|
| 1528 |
+
},
|
| 1529 |
+
{
|
| 1530 |
+
"type": "text",
|
| 1531 |
+
"text": "Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015. ",
|
| 1532 |
+
"bbox": [
|
| 1533 |
+
178,
|
| 1534 |
+
103,
|
| 1535 |
+
823,
|
| 1536 |
+
146
|
| 1537 |
+
],
|
| 1538 |
+
"page_idx": 11
|
| 1539 |
+
},
|
| 1540 |
+
{
|
| 1541 |
+
"type": "text",
|
| 1542 |
+
"text": "Tara N Sainath, Brian Kingsbury, Vikas Sindhwani, Ebru Arisoy, and Bhuvana Ramabhadran. Lowrank matrix factorization for deep neural network training with high-dimensional output targets. In IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 6655–6659, 2013. ",
|
| 1543 |
+
"bbox": [
|
| 1544 |
+
174,
|
| 1545 |
+
155,
|
| 1546 |
+
825,
|
| 1547 |
+
210
|
| 1548 |
+
],
|
| 1549 |
+
"page_idx": 11
|
| 1550 |
+
},
|
| 1551 |
+
{
|
| 1552 |
+
"type": "text",
|
| 1553 |
+
"text": "Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. ",
|
| 1554 |
+
"bbox": [
|
| 1555 |
+
176,
|
| 1556 |
+
219,
|
| 1557 |
+
820,
|
| 1558 |
+
250
|
| 1559 |
+
],
|
| 1560 |
+
"page_idx": 11
|
| 1561 |
+
},
|
| 1562 |
+
{
|
| 1563 |
+
"type": "text",
|
| 1564 |
+
"text": "Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–9, 2015a. ",
|
| 1565 |
+
"bbox": [
|
| 1566 |
+
173,
|
| 1567 |
+
257,
|
| 1568 |
+
826,
|
| 1569 |
+
314
|
| 1570 |
+
],
|
| 1571 |
+
"page_idx": 11
|
| 1572 |
+
},
|
| 1573 |
+
{
|
| 1574 |
+
"type": "text",
|
| 1575 |
+
"text": "Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. arXiv preprint arXiv:1512.00567, 2015b. ",
|
| 1576 |
+
"bbox": [
|
| 1577 |
+
174,
|
| 1578 |
+
323,
|
| 1579 |
+
823,
|
| 1580 |
+
353
|
| 1581 |
+
],
|
| 1582 |
+
"page_idx": 11
|
| 1583 |
+
},
|
| 1584 |
+
{
|
| 1585 |
+
"type": "text",
|
| 1586 |
+
"text": "Cheng Tai, Tong Xiao, Xiaogang Wang, et al. Convolutional neural networks with low-rank regularization. arXiv preprint arXiv:1511.06067, 2015. ",
|
| 1587 |
+
"bbox": [
|
| 1588 |
+
174,
|
| 1589 |
+
361,
|
| 1590 |
+
823,
|
| 1591 |
+
390
|
| 1592 |
+
],
|
| 1593 |
+
"page_idx": 11
|
| 1594 |
+
},
|
| 1595 |
+
{
|
| 1596 |
+
"type": "text",
|
| 1597 |
+
"text": "Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 4(2), 2012. ",
|
| 1598 |
+
"bbox": [
|
| 1599 |
+
173,
|
| 1600 |
+
398,
|
| 1601 |
+
826,
|
| 1602 |
+
440
|
| 1603 |
+
],
|
| 1604 |
+
"page_idx": 11
|
| 1605 |
+
},
|
| 1606 |
+
{
|
| 1607 |
+
"type": "text",
|
| 1608 |
+
"text": "Vincent Vanhoucke, Andrew Senior, and Mark Z Mao. Improving the speed of neural networks on CPUs. In Deep Learning and Unsupervised Feature Learning Workshop, NIPS, 2011. ",
|
| 1609 |
+
"bbox": [
|
| 1610 |
+
174,
|
| 1611 |
+
450,
|
| 1612 |
+
825,
|
| 1613 |
+
479
|
| 1614 |
+
],
|
| 1615 |
+
"page_idx": 11
|
| 1616 |
+
},
|
| 1617 |
+
{
|
| 1618 |
+
"type": "text",
|
| 1619 |
+
"text": "Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in Neural Information Processing Systems, pp. 2074–2082, 2016. ",
|
| 1620 |
+
"bbox": [
|
| 1621 |
+
176,
|
| 1622 |
+
488,
|
| 1623 |
+
825,
|
| 1624 |
+
530
|
| 1625 |
+
],
|
| 1626 |
+
"page_idx": 11
|
| 1627 |
+
},
|
| 1628 |
+
{
|
| 1629 |
+
"type": "text",
|
| 1630 |
+
"text": "Jian Xue, Jinyu Li, and Yifan Gong. Restructuring of deep neural network acoustic models with singular value decomposition. In INTERSPEECH, pp. 2365–2369, 2013. ",
|
| 1631 |
+
"bbox": [
|
| 1632 |
+
169,
|
| 1633 |
+
540,
|
| 1634 |
+
823,
|
| 1635 |
+
569
|
| 1636 |
+
],
|
| 1637 |
+
"page_idx": 11
|
| 1638 |
+
},
|
| 1639 |
+
{
|
| 1640 |
+
"type": "text",
|
| 1641 |
+
"text": "Zichao Yang, Marcin Moczulski, Misha Denil, Nando de Freitas, Alex Smola, Le Song, and Ziyu Wang. Deep fried convnets. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1476–1483, 2015. ",
|
| 1642 |
+
"bbox": [
|
| 1643 |
+
176,
|
| 1644 |
+
577,
|
| 1645 |
+
821,
|
| 1646 |
+
619
|
| 1647 |
+
],
|
| 1648 |
+
"page_idx": 11
|
| 1649 |
+
},
|
| 1650 |
+
{
|
| 1651 |
+
"type": "text",
|
| 1652 |
+
"text": "Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012. ",
|
| 1653 |
+
"bbox": [
|
| 1654 |
+
173,
|
| 1655 |
+
628,
|
| 1656 |
+
825,
|
| 1657 |
+
659
|
| 1658 |
+
],
|
| 1659 |
+
"page_idx": 11
|
| 1660 |
+
},
|
| 1661 |
+
{
|
| 1662 |
+
"type": "text",
|
| 1663 |
+
"text": "A APPENDIX ",
|
| 1664 |
+
"text_level": 1,
|
| 1665 |
+
"bbox": [
|
| 1666 |
+
176,
|
| 1667 |
+
102,
|
| 1668 |
+
297,
|
| 1669 |
+
117
|
| 1670 |
+
],
|
| 1671 |
+
"page_idx": 12
|
| 1672 |
+
},
|
| 1673 |
+
{
|
| 1674 |
+
"type": "text",
|
| 1675 |
+
"text": "A.1 FURTHER DISCUSSION ON THE HESSIAN-WEIGHTED QUANTIZATION ERROR",
|
| 1676 |
+
"text_level": 1,
|
| 1677 |
+
"bbox": [
|
| 1678 |
+
176,
|
| 1679 |
+
132,
|
| 1680 |
+
738,
|
| 1681 |
+
147
|
| 1682 |
+
],
|
| 1683 |
+
"page_idx": 12
|
| 1684 |
+
},
|
| 1685 |
+
{
|
| 1686 |
+
"type": "text",
|
| 1687 |
+
"text": "The diagonal approximation for Hessian simplifies the optimization problem as well as its solution for network quantization. This simplification comes with some performance loss. We conjecture that the loss due to this approximation is small. The reason is that the contributions from off-diagonal terms are not always additive and their summation may end up with a small value. However, diagonal terms are all non-negative and therefore their contributions are always additive. We do not verify this conjecture in this paper since solving the problem without diagonal approximation is too complex; we even need to compute the whole Hessian matrix, which is also too costly. ",
|
| 1688 |
+
"bbox": [
|
| 1689 |
+
174,
|
| 1690 |
+
159,
|
| 1691 |
+
825,
|
| 1692 |
+
256
|
| 1693 |
+
],
|
| 1694 |
+
"page_idx": 12
|
| 1695 |
+
},
|
| 1696 |
+
{
|
| 1697 |
+
"type": "text",
|
| 1698 |
+
"text": "Observe that the relation of the Hessian-weighted distortion measure to the quantization loss holds for any model for which the objective function can be approximated as a quadratic function with respect to the parameters to quantize in the model. Hence, the quantization methods proposed in this paper to minimize the Hessian-weighted distortion measure are not specific to neural networks but are generally applicable to quantization of parameters of any model whose objective function is locally quadratic with respect to its parameters approximately. ",
|
| 1699 |
+
"bbox": [
|
| 1700 |
+
174,
|
| 1701 |
+
263,
|
| 1702 |
+
825,
|
| 1703 |
+
347
|
| 1704 |
+
],
|
| 1705 |
+
"page_idx": 12
|
| 1706 |
+
},
|
| 1707 |
+
{
|
| 1708 |
+
"type": "text",
|
| 1709 |
+
"text": "Finally, we do not consider the interactions between quantization and retraining in our formulation in Section 3.2. We analyze the expected loss due to quantization assuming no further retraining and focus on finding optimal network quantization schemes that minimize the performance loss. In our experiments, however, we further fine-tune the quantized values (cluster centers) so that we can recover the loss due to quantization and improve the performance. ",
|
| 1710 |
+
"bbox": [
|
| 1711 |
+
174,
|
| 1712 |
+
353,
|
| 1713 |
+
825,
|
| 1714 |
+
424
|
| 1715 |
+
],
|
| 1716 |
+
"page_idx": 12
|
| 1717 |
+
},
|
| 1718 |
+
{
|
| 1719 |
+
"type": "text",
|
| 1720 |
+
"text": "A.2 EXPERIMENT RESULTS FOR UNIFORM QUANTIZATION ",
|
| 1721 |
+
"text_level": 1,
|
| 1722 |
+
"bbox": [
|
| 1723 |
+
174,
|
| 1724 |
+
440,
|
| 1725 |
+
588,
|
| 1726 |
+
454
|
| 1727 |
+
],
|
| 1728 |
+
"page_idx": 12
|
| 1729 |
+
},
|
| 1730 |
+
{
|
| 1731 |
+
"type": "text",
|
| 1732 |
+
"text": "We compare uniform quantization with non-weighted mean and uniform quantization with Hessianweighted mean in Figure 3, which shows that uniform quantization with Hessian-weighted mean slightly outperforms uniform quantization with non-weighted mean. ",
|
| 1733 |
+
"bbox": [
|
| 1734 |
+
176,
|
| 1735 |
+
465,
|
| 1736 |
+
823,
|
| 1737 |
+
508
|
| 1738 |
+
],
|
| 1739 |
+
"page_idx": 12
|
| 1740 |
+
},
|
| 1741 |
+
{
|
| 1742 |
+
"type": "image",
|
| 1743 |
+
"img_path": "images/71d3f9dc398040954824911ecd91549b4c8c773c75021d93c434abcf1a0e7041.jpg",
|
| 1744 |
+
"image_caption": [
|
| 1745 |
+
"Figure 3: Accuracy versus average codeword length per network parameter after network quantization, Huffman coding and fine-tuning for 32-layer ResNet when uniform quantization with nonweighted mean and uniform quantization with Hessian-weighted mean are used. "
|
| 1746 |
+
],
|
| 1747 |
+
"image_footnote": [],
|
| 1748 |
+
"bbox": [
|
| 1749 |
+
222,
|
| 1750 |
+
522,
|
| 1751 |
+
774,
|
| 1752 |
+
694
|
| 1753 |
+
],
|
| 1754 |
+
"page_idx": 12
|
| 1755 |
+
},
|
| 1756 |
+
{
|
| 1757 |
+
"type": "text",
|
| 1758 |
+
"text": "A.3 FURTHER DISCUSSION ON THE ITERATIVE ALGORITHM FOR ECSQ ",
|
| 1759 |
+
"text_level": 1,
|
| 1760 |
+
"bbox": [
|
| 1761 |
+
174,
|
| 1762 |
+
775,
|
| 1763 |
+
679,
|
| 1764 |
+
790
|
| 1765 |
+
],
|
| 1766 |
+
"page_idx": 12
|
| 1767 |
+
},
|
| 1768 |
+
{
|
| 1769 |
+
"type": "text",
|
| 1770 |
+
"text": "In order to solve the ECSQ problem for network quantization, we define a Lagrangian cost function: ",
|
| 1771 |
+
"bbox": [
|
| 1772 |
+
171,
|
| 1773 |
+
800,
|
| 1774 |
+
821,
|
| 1775 |
+
815
|
| 1776 |
+
],
|
| 1777 |
+
"page_idx": 12
|
| 1778 |
+
},
|
| 1779 |
+
{
|
| 1780 |
+
"type": "equation",
|
| 1781 |
+
"img_path": "images/a16d4643bc28e703df053c08e73a57fca0fd7caf602e3c118ef1ae7af1a7bc04.jpg",
|
| 1782 |
+
"text": "$$\nJ _ { \\lambda } ( \\mathcal { C } _ { 1 } , \\mathcal { C } _ { 2 } , \\ldots , \\mathcal { C } _ { k } ) = D + \\lambda H = \\frac { 1 } { N } \\sum _ { j = 1 } ^ { k } \\sum _ { w _ { i } \\in \\mathcal { C } _ { j } } \\underbrace { ( h _ { i i } | w _ { i } - c _ { j } | ^ { 2 } - \\lambda \\log _ { 2 } p _ { j } ) } _ { = d _ { \\lambda } ( i , j ) } ,\n$$",
|
| 1783 |
+
"text_format": "latex",
|
| 1784 |
+
"bbox": [
|
| 1785 |
+
250,
|
| 1786 |
+
818,
|
| 1787 |
+
746,
|
| 1788 |
+
869
|
| 1789 |
+
],
|
| 1790 |
+
"page_idx": 12
|
| 1791 |
+
},
|
| 1792 |
+
{
|
| 1793 |
+
"type": "text",
|
| 1794 |
+
"text": "where ",
|
| 1795 |
+
"bbox": [
|
| 1796 |
+
174,
|
| 1797 |
+
872,
|
| 1798 |
+
217,
|
| 1799 |
+
886
|
| 1800 |
+
],
|
| 1801 |
+
"page_idx": 12
|
| 1802 |
+
},
|
| 1803 |
+
{
|
| 1804 |
+
"type": "equation",
|
| 1805 |
+
"img_path": "images/0ebcf2d0db4359aaca9cc5ff63701362d65e3d30c534fc00dbf665cc864cf2c2.jpg",
|
| 1806 |
+
"text": "$$\nD = \\frac { 1 } { N } \\sum _ { j = 1 } ^ { k } \\sum _ { w _ { i } \\in \\mathcal { C } _ { j } } h _ { i i } | w _ { i } - c _ { j } | ^ { 2 } , ~ H = - \\sum _ { j = 1 } ^ { k } p _ { j } \\log _ { 2 } p _ { j } .\n$$",
|
| 1807 |
+
"text_format": "latex",
|
| 1808 |
+
"bbox": [
|
| 1809 |
+
308,
|
| 1810 |
+
882,
|
| 1811 |
+
687,
|
| 1812 |
+
928
|
| 1813 |
+
],
|
| 1814 |
+
"page_idx": 12
|
| 1815 |
+
},
|
| 1816 |
+
{
|
| 1817 |
+
"type": "text",
|
| 1818 |
+
"text": "Algorithm 1 Iterative solution for entropy-constrained network quantization ",
|
| 1819 |
+
"text_level": 1,
|
| 1820 |
+
"bbox": [
|
| 1821 |
+
174,
|
| 1822 |
+
103,
|
| 1823 |
+
676,
|
| 1824 |
+
118
|
| 1825 |
+
],
|
| 1826 |
+
"page_idx": 13
|
| 1827 |
+
},
|
| 1828 |
+
{
|
| 1829 |
+
"type": "text",
|
| 1830 |
+
"text": "Initialization: $n \\gets 0$ ",
|
| 1831 |
+
"bbox": [
|
| 1832 |
+
191,
|
| 1833 |
+
121,
|
| 1834 |
+
336,
|
| 1835 |
+
133
|
| 1836 |
+
],
|
| 1837 |
+
"page_idx": 13
|
| 1838 |
+
},
|
| 1839 |
+
{
|
| 1840 |
+
"type": "text",
|
| 1841 |
+
"text": "clusters: $c _ { 1 } ^ { ( 0 ) } , \\ldots , c _ { k } ^ { ( 0 ) }$ ",
|
| 1842 |
+
"bbox": [
|
| 1843 |
+
202,
|
| 1844 |
+
133,
|
| 1845 |
+
517,
|
| 1846 |
+
150
|
| 1847 |
+
],
|
| 1848 |
+
"page_idx": 13
|
| 1849 |
+
},
|
| 1850 |
+
{
|
| 1851 |
+
"type": "text",
|
| 1852 |
+
"text": "Initialize the proportions of $k$ 1 kclusters (set all of them to be the same initially): $p _ { 1 } ^ { ( 0 ) } , \\ldots , p _ { k } ^ { ( 0 ) }$ repeat ",
|
| 1853 |
+
"bbox": [
|
| 1854 |
+
191,
|
| 1855 |
+
151,
|
| 1856 |
+
810,
|
| 1857 |
+
180
|
| 1858 |
+
],
|
| 1859 |
+
"page_idx": 13
|
| 1860 |
+
},
|
| 1861 |
+
{
|
| 1862 |
+
"type": "text",
|
| 1863 |
+
"text": "Assignment: ",
|
| 1864 |
+
"text_level": 1,
|
| 1865 |
+
"bbox": [
|
| 1866 |
+
205,
|
| 1867 |
+
181,
|
| 1868 |
+
295,
|
| 1869 |
+
194
|
| 1870 |
+
],
|
| 1871 |
+
"page_idx": 13
|
| 1872 |
+
},
|
| 1873 |
+
{
|
| 1874 |
+
"type": "text",
|
| 1875 |
+
"text": "for all network parameters $i = 1 N$ do ",
|
| 1876 |
+
"bbox": [
|
| 1877 |
+
223,
|
| 1878 |
+
194,
|
| 1879 |
+
501,
|
| 1880 |
+
208
|
| 1881 |
+
],
|
| 1882 |
+
"page_idx": 13
|
| 1883 |
+
},
|
| 1884 |
+
{
|
| 1885 |
+
"type": "text",
|
| 1886 |
+
"text": "Assign $w _ { i }$ to the cluster $j$ that minimizes the individual Lagrangian cost as follows: ",
|
| 1887 |
+
"bbox": [
|
| 1888 |
+
235,
|
| 1889 |
+
208,
|
| 1890 |
+
785,
|
| 1891 |
+
223
|
| 1892 |
+
],
|
| 1893 |
+
"page_idx": 13
|
| 1894 |
+
},
|
| 1895 |
+
{
|
| 1896 |
+
"type": "equation",
|
| 1897 |
+
"img_path": "images/b763577a2c95d751b99e8bada6f9c2f096fdc90c21064320d0285c5e5b1fd0ea.jpg",
|
| 1898 |
+
"text": "$$\n\\mathcal { C } _ { l } ^ { ( n + 1 ) } \\gets \\mathcal { C } _ { l } ^ { ( n + 1 ) } \\cup \\{ w _ { i } \\} \\quad \\mathrm { f o r } \\ l = \\arg \\operatorname* { m i n } _ { j } \\left\\{ h _ { i i } | w _ { i } - c _ { j } ^ { ( n ) } | ^ { 2 } - \\lambda \\log _ { 2 } p _ { j } ^ { ( n ) } \\right\\}\n$$",
|
| 1899 |
+
"text_format": "latex",
|
| 1900 |
+
"bbox": [
|
| 1901 |
+
279,
|
| 1902 |
+
228,
|
| 1903 |
+
784,
|
| 1904 |
+
260
|
| 1905 |
+
],
|
| 1906 |
+
"page_idx": 13
|
| 1907 |
+
},
|
| 1908 |
+
{
|
| 1909 |
+
"type": "text",
|
| 1910 |
+
"text": "end for ",
|
| 1911 |
+
"bbox": [
|
| 1912 |
+
222,
|
| 1913 |
+
267,
|
| 1914 |
+
274,
|
| 1915 |
+
280
|
| 1916 |
+
],
|
| 1917 |
+
"page_idx": 13
|
| 1918 |
+
},
|
| 1919 |
+
{
|
| 1920 |
+
"type": "text",
|
| 1921 |
+
"text": "Update: ",
|
| 1922 |
+
"bbox": [
|
| 1923 |
+
207,
|
| 1924 |
+
281,
|
| 1925 |
+
264,
|
| 1926 |
+
295
|
| 1927 |
+
],
|
| 1928 |
+
"page_idx": 13
|
| 1929 |
+
},
|
| 1930 |
+
{
|
| 1931 |
+
"type": "text",
|
| 1932 |
+
"text": "for all clusters $j = 1 k$ do ",
|
| 1933 |
+
"bbox": [
|
| 1934 |
+
220,
|
| 1935 |
+
296,
|
| 1936 |
+
418,
|
| 1937 |
+
309
|
| 1938 |
+
],
|
| 1939 |
+
"page_idx": 13
|
| 1940 |
+
},
|
| 1941 |
+
{
|
| 1942 |
+
"type": "text",
|
| 1943 |
+
"text": "Update the cluster center and the proportion of cluster $j$ : ",
|
| 1944 |
+
"bbox": [
|
| 1945 |
+
240,
|
| 1946 |
+
309,
|
| 1947 |
+
611,
|
| 1948 |
+
324
|
| 1949 |
+
],
|
| 1950 |
+
"page_idx": 13
|
| 1951 |
+
},
|
| 1952 |
+
{
|
| 1953 |
+
"type": "equation",
|
| 1954 |
+
"img_path": "images/2f33e3111f8d0d75dc4af7a90c454ccf671577f72bb63f19c9750d305e955e45.jpg",
|
| 1955 |
+
"text": "$$\nc _ { j } ^ { ( n + 1 ) } \\gets \\frac { \\sum _ { w _ { i } \\in \\mathcal { C } _ { j } ^ { ( n + 1 ) } } h _ { i i } w _ { i } } { \\sum _ { w _ { i } \\in \\mathcal { C } _ { j } ^ { ( n + 1 ) } } h _ { i i } } \\mathrm { a n d } p _ { j } ^ { ( n + 1 ) } \\gets \\frac { | \\mathcal { C } _ { j } ^ { ( n + 1 ) } | } { N }\n$$",
|
| 1956 |
+
"text_format": "latex",
|
| 1957 |
+
"bbox": [
|
| 1958 |
+
346,
|
| 1959 |
+
329,
|
| 1960 |
+
715,
|
| 1961 |
+
375
|
| 1962 |
+
],
|
| 1963 |
+
"page_idx": 13
|
| 1964 |
+
},
|
| 1965 |
+
{
|
| 1966 |
+
"type": "text",
|
| 1967 |
+
"text": "end for ",
|
| 1968 |
+
"text_level": 1,
|
| 1969 |
+
"bbox": [
|
| 1970 |
+
222,
|
| 1971 |
+
382,
|
| 1972 |
+
274,
|
| 1973 |
+
395
|
| 1974 |
+
],
|
| 1975 |
+
"page_idx": 13
|
| 1976 |
+
},
|
| 1977 |
+
{
|
| 1978 |
+
"type": "text",
|
| 1979 |
+
"text": "$n \\gets n + 1$ until Lagrangian cost function $J _ { \\lambda }$ decreases less than some threshold ",
|
| 1980 |
+
"bbox": [
|
| 1981 |
+
189,
|
| 1982 |
+
397,
|
| 1983 |
+
645,
|
| 1984 |
+
424
|
| 1985 |
+
],
|
| 1986 |
+
"page_idx": 13
|
| 1987 |
+
},
|
| 1988 |
+
{
|
| 1989 |
+
"type": "text",
|
| 1990 |
+
"text": "The entropy-constrained network quantization problem is then reduced to find $k$ partitions (clusters) $\\mathcal { C } _ { 1 } , \\mathcal { C } _ { 2 } , \\ldots , \\mathcal { C } _ { k }$ that minimize the Lagrangian cost function as follows: ",
|
| 1991 |
+
"bbox": [
|
| 1992 |
+
171,
|
| 1993 |
+
454,
|
| 1994 |
+
823,
|
| 1995 |
+
483
|
| 1996 |
+
],
|
| 1997 |
+
"page_idx": 13
|
| 1998 |
+
},
|
| 1999 |
+
{
|
| 2000 |
+
"type": "equation",
|
| 2001 |
+
"img_path": "images/81f7758df14b383aba95428604029bd2cb1dab29191a927e518fd42d68d62fc9.jpg",
|
| 2002 |
+
"text": "$$\n\\operatorname * { a r g m i n } _ { \\mathcal { C } _ { 1 } , \\mathcal { C } _ { 2 } , \\ldots , \\mathcal { C } _ { k } } J _ { \\lambda } ( \\mathcal { C } _ { 1 } , \\mathcal { C } _ { 2 } , \\ldots , \\mathcal { C } _ { k } ) .\n$$",
|
| 2003 |
+
"text_format": "latex",
|
| 2004 |
+
"bbox": [
|
| 2005 |
+
398,
|
| 2006 |
+
489,
|
| 2007 |
+
598,
|
| 2008 |
+
517
|
| 2009 |
+
],
|
| 2010 |
+
"page_idx": 13
|
| 2011 |
+
},
|
| 2012 |
+
{
|
| 2013 |
+
"type": "text",
|
| 2014 |
+
"text": "A heuristic iterative algorithm to solve this method of Lagrange multipliers for network quantization is presented in Algorithm 1. It is similar to Lloyd’s algorithm for $\\mathbf { k }$ -means clustering. The key difference is how to partition network parameters at the assignment step. In Lloyd’s algorithm, the Euclidean distance (quantization error) is minimized. For ECSQ, the individual Lagrangian cost function, i.e., $d _ { \\lambda } ( i , j )$ in (12), is minimized instead, which includes both quantization error and expected codeword length after entropy coding. ",
|
| 2015 |
+
"bbox": [
|
| 2016 |
+
173,
|
| 2017 |
+
522,
|
| 2018 |
+
825,
|
| 2019 |
+
608
|
| 2020 |
+
],
|
| 2021 |
+
"page_idx": 13
|
| 2022 |
+
}
|
| 2023 |
+
]
|
parse/train/rJ8uNptgl/rJ8uNptgl_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/rJ8uNptgl/rJ8uNptgl_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
vlm/train/4fLr7H5D_eT/0.png
ADDED
|
Git LFS Details
|
vlm/train/4fLr7H5D_eT/1.png
ADDED
|
Git LFS Details
|
vlm/train/4fLr7H5D_eT/10.png
ADDED
|
Git LFS Details
|
vlm/train/4fLr7H5D_eT/11.png
ADDED
|
Git LFS Details
|
vlm/train/4fLr7H5D_eT/12.png
ADDED
|
Git LFS Details
|
vlm/train/4fLr7H5D_eT/13.png
ADDED
|
Git LFS Details
|
vlm/train/4fLr7H5D_eT/2.png
ADDED
|
Git LFS Details
|
vlm/train/4fLr7H5D_eT/3.png
ADDED
|
Git LFS Details
|
vlm/train/4fLr7H5D_eT/4.png
ADDED
|
Git LFS Details
|
vlm/train/4fLr7H5D_eT/5.png
ADDED
|
Git LFS Details
|
vlm/train/4fLr7H5D_eT/6.png
ADDED
|
Git LFS Details
|