ZHANGYUXUAN-zR commited on
Commit
5a257a5
·
verified ·
1 Parent(s): f44e0b0

Add files using upload-large-folder tool

Browse files
parse/train/S1EHOsC9tX/S1EHOsC9tX.md ADDED
@@ -0,0 +1,381 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TOWARDS THE FIRST ADVERSARIALLY ROBUST NEURAL NETWORK MODEL ON MNIST
2
+
3
+ Lukas Schott1-3∗, Jonas Rauber1-3∗, Matthias Bethge1,3,4† & Wieland Brendel1,3†
4
+
5
+ 1Centre for Integrative Neuroscience, University of Tübingen 2International Max Planck Research School for Intelligent Systems 3Bernstein Center for Computational Neuroscience Tübingen 4Max Planck Institute for Biological Cybernetics ∗Joint first authors †Joint senior authors firstname.lastname@bethgelab.org
6
+
7
+ # ABSTRACT
8
+
9
+ Despite much effort, deep neural networks remain highly susceptible to tiny input perturbations and even for MNIST, one of the most common toy datasets in computer vision, no neural network model exists for which adversarial perturbations are large and make semantic sense to humans. We show that even the widely recognized and by far most successful $L _ { \infty }$ defense by Madry et al. (1) has lower $L _ { 0 }$ robustness than undefended networks and is still highly susceptible to $L _ { 2 }$ perturbations, (2) classifies unrecognizable images with high certainty, (3) performs not much better than simple input binarization and (4) features adversarial perturbations that make little sense to humans. These results suggest that MNIST is far from being solved in terms of adversarial robustness. We present a novel robust classification model that performs analysis by synthesis using learned class-conditional data distributions. We derive bounds on the robustness and go to great length to empirically evaluate our model using maximally effective adversarial attacks by (a) applying decision-based, score-based, gradient-based and transfer-based attacks for several different $L _ { p }$ norms, (b) by designing a new attack that exploits the structure of our defended model and (c) by devising a novel decision-based attack that seeks to minimize the number of perturbed pixels $( L _ { 0 } )$ . The results suggest that our approach yields state-of-the-art robustness on MNIST against $L _ { 0 }$ , $L _ { 2 }$ and $L _ { \infty }$ perturbations and we demonstrate that most adversarial examples are strongly perturbed towards the perceptual boundary between the original and the adversarial class.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Deep neural networks (DNNs) are strikingly susceptible to minimal adversarial perturbations (Szegedy et al., 2013), perturbations that are (almost) imperceptible to humans but which can switch the class prediction of DNNs to basically any desired target class.
14
+
15
+ One key problem in finding successful defenses is the difficulty of reliably evaluating model robustness. It has been shown time and again (Athalye et al., 2018; Athalye & Carlini, 2018; Brendel & Bethge, 2017) that basically all defenses previously proposed did not increase model robustness but prevented existing attacks from finding minimal adversarial examples, the most common reason being masking of the gradients on which most attacks rely. The few verifiable defenses can only guarantee robustness within a small linear regime around the data points (Hein & Andriushchenko, 2017; Raghunathan et al., 2018).
16
+
17
+ The only defense currently considered effective (Athalye et al., 2018) is a particular type of adversarial training (Madry et al., 2018). On MNIST, as of today this method is able to reach an accuracy of $8 8 . 7 9 \%$ for adversarial perturbations with an $L _ { \infty }$ norm bounded by $\epsilon = 0 . 3$ (Zheng et al., 2018). In other words, if we allow an attacker to perturb the brightness of each pixel by up to 0.3 (range $[ 0 , 1 ] \cdot$ ), then he can only trick the model on $\approx 1 0 \%$ of the samples. This is a great success, but does the model really learn more causal features to classify MNIST? We here demonstrate that this is not the case: For one, the defense by Madry et al. (SOTA on $L _ { \infty }$ ) has lower $L _ { 0 }$ robustness than undefended networks and is still highly susceptible in the $L _ { 2 }$ metric. Second, the robustness results by Madry et al. can also be achieved with a simple input quantization because of the binary nature of single pixels in MNIST (which are typically either completely black or white) (Schmidt et al., 2018). Third, it is straight-forward to find unrecognizable images that are classified as a digit with high certainty. Finally, the minimum adversarial examples we find for the defense by Madry et al. make little to no sense to humans.
18
+
19
+ Taken together, even MNIST cannot be considered solved with respect to adversarial robustness. By “solved” we mean a model that reaches at least $9 9 \%$ accuracy (see accuracy-vs-robustness trade-off (Tsipras et al., 2018; Bubeck et al., 2018)) and whose adversarial examples carry semantic meaning to humans (by which we mean that they start looking like samples that could belong to either class). Hence, despite the fact that MNIST is considered “too easy” by many and a mere toy example, finding adversarially robust models on MNIST is still an open problem.
20
+
21
+ A potential solution we explore in this paper is inspired by unrecognizable images (Nguyen et al., 2015) or distal adversarials. Distal adversarials are images that do not resemble images from the training set but which typically look like noise while still being classified by the model with high confidence. It seems difficult to prevent such images in feedforward networks as we have little control over how inputs are classified that are far outside of the training domain. In contrast, generative models can learn the distribution of their inputs and are thus able to gauge their confidence accordingly. By additionally learning the image distribution within each class we can check that the classification makes sense in terms of the image features being present in the input (e.g. an image of a bus should contain actual bus features). Following this line of thought from an information-theoretic perspective, one arrives at the well-known concept of Bayesian classifiers. We here introduce a fine-tuned variant based on variational autoencoders (Kingma & Welling, 2013) that combines robustness with high accuracy.
22
+
23
+ In summary, the contributions of this paper are as follows:
24
+
25
+ • We show that MNIST is unsolved from the point of adversarial robustness: the SOTA defense of Madry et al. (2018) is still highly vulnerable to tiny perturbations that are meaningless to humans. • We introduce a new robust classification model and derive instance-specific robustness guarantees. • We develop a strong attack that leverages the generative structure of our classification model. • We introduce a novel decision-based attack that minimizes $L _ { 0 }$ . We perform an extensive evaluation of our defense across many attacks to show that it surpasses SOTA on $L _ { 0 }$ , $L _ { 2 }$ and $L _ { \infty }$ and features many adversarials that carry semantic meaning to humans.
26
+
27
+ We have evaluated the proposed defense to the best of our knowledge, but we are aware of the (currently unavoidable) limitations of evaluating robustness. We will release the model architecture and trained weights as a friendly invitation to fellow researchers to evaluate our model independently.
28
+
29
+ # 2 RELATED WORK
30
+
31
+ The many defenses against adversarial attacks can roughly be subdivided into four categories:
32
+
33
+ Adversarial training: The training data is augmented with adversarial examples to make models more robust (Madry et al., 2018; Szegedy et al., 2013; Tramèr et al., 2017; Ilyas et al., 2017).
34
+ • Manifold projections: An input sample is projected onto a learned data manifold (Samangouei et al., 2018; Ilyas et al., 2017; Shen et al., 2017; Song et al., 2018).
35
+ • Stochasticity: Certain inputs or hidden activations are shuffled or randomized (Prakash et al., 2018; Dhillon et al., 2018; Xie et al., 2018).
36
+ • Preprocessing: Inputs or hidden activations are quantized, projected into a different representation or are otherwise preprocessed (Buckman et al., 2018; Guo et al., 2018; Kabilan et al., 2018).
37
+
38
+ There has been much work showing that basically all defenses suggested so far in the literature do not substantially increase robustness over undefended neural networks (Athalye et al., 2018; Brendel &
39
+
40
+ I. Optimize latent distribution ${ \sf p } ( { \sf z } | { \bf x } )$ in each digit model to find likelihood of sample $\pmb { \times }$ under each model.
41
+
42
+ ![](images/a1900f6d7878a40da8f00957ea6774192c941212763f3d514524a019725cea47.jpg)
43
+ II. Decide based on most likely class
44
+ Figure 1: Overview over model architecture. In a nutshell: I) for each sample x we compute a lower bound on the log-likelihood (ELBO) under each class using gradient descent in the latent space. II) A class-dependent scalar weighting of the class-conditional ELBOs forms the final class prediction.
45
+
46
+ Bethge, 2017). The only widely accepted exception according to Athalye et al. (2018) is the defense by Madry et al. (2018) which is based on data augmentation with adversarials found by iterative projected gradient descent with random starting points. However, as we see in the results section, this defense is limited to the metric it is trained on $( L _ { \infty } )$ and it is straight-forward to generate small adversarial perturbations that carry little semantic meaning for humans.
47
+
48
+ Some other defenses have been based on generative models. Typically these defenses use the generative model to project onto the (learned) manifold of “natural” inputs. This includes in particular DefenseGAN (Samangouei et al., 2018), Adversarial Perturbation Elimination GAN (Shen et al., 2017) and Robust Manifold Defense (Ilyas et al., 2017), all of which project an image onto the manifold defined by a generator network $G$ . The generated image is then classified by a discriminator in the usual way. A similar idea is used by PixelDefend (Song et al., 2018) which uses an autoregressive probabilistic method to learn the data manifold. Other ideas in similar directions include the use of denoising autoencoders (Liao et al., 2017) as well as MagNets (Meng & Chen, 2017), which projects or rejects inputs depending on their distance to the data manifold. All of these proposed defenses except for the defense by Ilyas et al. (2017) have been tested by Athalye et al. (2018); Athalye & Carlini (2018); Carlini & Wagner (2017) and others, and shown to be ineffective. It is straight-forward to understand why: For one, many adversarials still look like normal data points to humans. Second, the classifier on top of the projected image is as vulnerable to adversarial examples as before. Hence, for any data set with a natural amount of variation there will almost always be a certain perturbation against which the classifier is vulnerable and which can be induced by the right inputs.
49
+
50
+ We here follow a different approach by modeling the input distribution within each class (instead of modeling a single distribution for the complete data), and by classifying a new sample according to the class under which it has the highest likelihood. This approach, commonly referred to as a Bayesian classifier, gets away without any additional and vulnerable classifier. A very different but related approach is the work by George et al. (2017) which suggested a generative compositional model of digits to solve cluttered digit scenes like Captchas (adversarial robustness was not evaluated).
51
+
52
+ # 3 MODEL DESCRIPTION
53
+
54
+ Intuitively, we want to learn a causal model of the inputs (Schölkopf, 2017). Consider a cat: we want a model to learn that cats have four legs and two pointed ears, and then use this model to check whether a given input can be generated with these features. This intuition can be formalized as follows. Let $\left( \mathbf { x } , y \right)$ with $\mathbf { x } \in \mathbb { R } ^ { N }$ be an input-label datum. Instead of directly learning a posterior $p ( y | \mathbf { x } )$ from inputs to labels we now learn generative distributions $p ( \mathbf { x } | y )$ and classify new inputs using Bayes formula,
55
+
56
+ $$
57
+ p ( y | \mathbf x ) = \frac { p ( \mathbf x | y ) p ( y ) } { p ( \mathbf x ) } \propto p ( \mathbf x | y ) p ( y ) .
58
+ $$
59
+
60
+ The label distribution $p ( y )$ can be estimated from the training data. To learn the class-conditional sample distributions $p ( \mathbf { x } | y )$ we use variational autoencoders (VAEs) (Kingma & Welling, 2013). VAEs estimate the log-likelihood $\log p ( \mathbf { x } )$ by learning a probabilistic generative model $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$
61
+
62
+ with latent variables $\mathbf { z } \sim p ( \mathbf { z } )$ and parameters $\theta$ (see Appendix A.3 for the full derivation). For class-conditional VAEs we can derive a lower bound on the log-likelihood $\log p ( \mathbf { x } | y )$ as
63
+
64
+ $$
65
+ \begin{array} { r } { \log p ( \mathbf { x } | y ) \geq \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } , y ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } , y ) \right] - \mathcal { D } _ { K L } \left[ q _ { \phi } ( \mathbf { z } | \mathbf { x } , y ) | | p ( \mathbf { z } ) \right] = : \ell _ { y } ( \mathbf { x } ) , } \end{array}
66
+ $$
67
+
68
+ where $p ( \mathbf { z } ) = \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } )$ is a simple normal prior and $q _ { \phi } ( \mathbf { z } | \mathbf { x } , y )$ is the variational posterior with parameters $\phi$ . The first term on the RHS is basically a reconstruction error while the second term on the RHS is the mismatch between the variational and the true posterior. The term on the RHS is the so-called evidence lower bound (ELBO) on the log-likelihood (Kingma & Welling, 2013). We implement the conditional distributions $p _ { \theta } ( \mathbf { x } | \mathbf { z } , y )$ and $q _ { \phi } ( \mathbf { z } | \mathbf { x } , y )$ as normal distributions for which the means are parametrized as DNNs (all details and hyperparameters are reported in Appendix A.7).
69
+
70
+ Our Analysis by Synthesis model (ABS) is illustrated in Figure 1. It combines several elements to simultaneously achieve high accuracy and robustness against adversarial perturbations:
71
+
72
+ • Class-conditional distributions: For each class $y$ we train a variational autoencoder $\mathrm { V A E } _ { y }$ on the samples of class $y$ to learn the class-conditional distribution $p ( \mathbf { x } | y )$ . This allows us to estimate a lower bound $\ell _ { y } ( \mathbf { x } )$ on the log-likelihood of sample $\mathbf { x }$ under each class $y$ .
73
+
74
+ • Optimization-based inference: The variational inference $q _ { \phi } ( \mathbf { z } | \mathbf { x } , y )$ is itself a neural network susceptible to adversarial perturbations. We therefore only use variational inference during training and perform “exact” inference over $p _ { \theta } ( \mathbf { x } | \mathbf { z } , y )$ during evaluation. This “exact” inference is implemented using gradient descent in the latent space (with fixed posterior width) to find the optimal $\mathbf { z } _ { y }$ which maximizes the lower bound on the log-likelihood for each class:
75
+
76
+ $$
77
+ \ell _ { y } ^ { * } ( \mathbf { x } ) = \mathop { \operatorname* { m a x } } _ { \mathbf { z } } ~ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } , y ) - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] .
78
+ $$
79
+
80
+ Note that we replaced the expectation in equation 2 with a maximum likelihood sample to avoid stochastic sampling and to simplify optimization. To avoid local minima we evaluate 8000 random points in the latent space of each VAE, from which we pick the best as a starting point for a gradient descent with 50 iterations using the Adam optimizer (Kingma & Ba, 2014).
81
+
82
+ • Classification and confidence: Finally, to perform the actual classification, we scale all $\ell _ { y } ^ { * } ( \mathbf x )$ with a factor $\alpha$ , exponentiate, add an offset $\eta$ and divide by the total evidence (like in a softmax),
83
+
84
+ $$
85
+ p ( y | \mathbf { x } ) = \left( e ^ { \alpha \ell _ { y } ^ { * } ( \mathbf { x } ) } + \eta \right) / \sum _ { c } \left( e ^ { \alpha \ell _ { c } ^ { * } ( \mathbf { x } ) } + \eta \right) .
86
+ $$
87
+
88
+ We introduced $\eta$ for the following reason: even on points far outside the data domain, where all likelihoods $q ( \mathbf { x } , y ) = e ^ { \alpha \ell _ { y } ^ { * } ( \mathbf { x } ) } + \eta$ are small, the standard softmax $( \eta = 0$ ) can lead to sharp posteriors $p ( y | \mathbf { x } )$ with high confidence scores for one class. This behavior is in stark contrast to humans, who would report a uniform distribution over classes for unrecognizable images. To model this behavior we set $\eta > 0$ : in this case the posterior $p ( y | \mathbf { x } )$ converges to a uniform distribution whenever the maximum $q ( \mathbf { x } , y )$ gets small relative to $\eta$ . We chose $\eta$ such that the median confidence $p ( \boldsymbol { y } | \mathbf { x } )$ is 0.9 for the predicted class on clean test samples. Furthermore, for a better comparison with cross-entropy trained networks, the scale $\alpha$ is trained to minimize the cross-entropy loss. We also tested this graded softmax in standard feedforward CNNs but did not find any improvement with respect to unrecognizable images.
89
+
90
+ Binarization (Binary ABS only): The pixel intensities of MNIST images are almost binary. We exploit this by projecting the intensity $b$ of each pixel to 0 if $b < 0 . 5$ or 1 if $b \geq 0 . 5$ during testing.
91
+
92
+ • Discriminative finetuning (Binary ABS only): To improve the accuracy of the Binary ABS model we multiply $\ell _ { y } ^ { * } ( \mathbf x )$ with an additional class-dependent scalar $\gamma _ { y }$ . The scalars are learned discriminatively (see A.7) and reach values in the range $\gamma _ { y } \in [ 0 . 9 6 , 1 . 0 6 ]$ for all classes $y$ .
93
+
94
+ On important ingredient for the robustness of the ABS model is the Gaussian posterior in the reconstruction term which ensures that small changes in the input (in terms of L2) can only entail small changes to the posterior likelihood and thus to the model decision.
95
+
96
+ # 4 TIGHT ESTIMATES OF THE LOWER BOUND FOR ADVERSARIAL EXAMPLES
97
+
98
+ The decision of the model depends on the likelihood in each class, which for clean samples is mostly dominated by the posterior likelihood $p ( \mathbf { x } | \mathbf { z } )$ . Because we chose this posterior to be Gaussian, the
99
+
100
+ class-conditional likelihoods can only change gracefully with changes in $\mathbf { x }$ , a property which allows us to derive lower bounds on the model robustness. To see this, note that equation 3 can be written as,
101
+
102
+ $$
103
+ \ell _ { c } ^ { * } ( \mathbf { x } ) = \underset { \mathbf { z } } { \mathrm { m a x } } - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] - \frac { 1 } { 2 \sigma ^ { 2 } } \left. \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right. _ { 2 } ^ { 2 } + C ,
104
+ $$
105
+
106
+ where we absorbed the normalization constants of $p ( \mathbf { x } | \mathbf { z } )$ into $C$ and $\mathbf { G } _ { c } ( \mathbf { z } )$ is the mean of $p ( \mathbf { x } | \mathbf { z } , c )$ Let $y$ be the ground-truth class and let $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ be the optimal latent for the clean sample $\mathbf { x }$ for class $y$ . We can then estimate a lower bound on $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ for a perturbation $\pmb { \delta }$ with size $\epsilon = { \left\| \delta \right\| } _ { 2 }$ (see derivation in Appendix A.4),
107
+
108
+ $$
109
+ \ell _ { y } ^ { * } ( \mathbf { x } + \boldsymbol { \delta } ) \geq \ell _ { y } ^ { * } ( \mathbf { x } ) - \frac { 1 } { \sigma ^ { 2 } } \epsilon \| \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } \| _ { 2 } - \frac { 1 } { 2 \sigma ^ { 2 } } \epsilon ^ { 2 } + C .
110
+ $$
111
+
112
+ Likewise, we can derive an upper bound of $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ for all other classes $c \neq y$ (see Appendix A.5),
113
+
114
+ $$
115
+ \ell _ { c } ^ { * } ( \mathbf { x } + \delta ) \leq - { \mathcal { D } _ { K L } } \left[ { \mathcal { N } } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | { \mathcal { N } } ( \mathbf { 0 } , \mathbb { 1 } ) \right] + C - \left\{ \begin{array} { l l } { \frac { 1 } { 2 \sigma ^ { 2 } } ( d _ { c } - \epsilon ) ^ { 2 } } & { \mathrm { i f ~ } d _ { c } \geq \epsilon } \\ { 0 } & { \mathrm { e l s e } } \end{array} \right. .
116
+ $$
117
+
118
+ for $d _ { c } = \operatorname* { m i n } _ { z } \left\| \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right\| _ { 2 }$ . Now we can find $\epsilon$ for a given image $\mathbf { x }$ by equating $( 7 ) = ( 6 )$ ,
119
+
120
+ $$
121
+ \epsilon _ { x } = \underset { c \neq y } { \mathrm { m i n } } \mathrm { m a x } \left. 0 , \frac { d _ { c } + \ell _ { y } ^ { \ast } ( \mathbf { x } ) - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] } { 2 ( d _ { c } + \| \mathbf { G } _ { y } ( \mathbf { z _ { x } ^ { \ast } } ) - \mathbf { x } \| _ { 2 } ) } \right. .
122
+ $$
123
+
124
+ Note that one assumption we make is that we can find the global minimum of $\| \mathbf G _ { c } ( \mathbf z ) - \mathbf x \| _ { 2 } ^ { 2 }$ . In practice we generally find a very tight estimate of the global minimum (and thus the lower bound) because we optimize in a smooth and low-dimensional space and because we perform an additional brute-force sampling step. We provide quantitative values for $\epsilon$ in section 7.
125
+
126
+ # 5 ADVERSARIAL ATTACKS
127
+
128
+ Reliably evaluating model robustness is difficult because each attack only provides an upper bound on the size of the adversarial perturbations (Uesato et al., 2018). To make this bound as tight as possible we apply many different attacks and choose the best one for each sample and model combination (using the implementations in Foolbox v1.3 (Rauber et al., 2017) which often perform internal hyperparameter optimization). We also created a novel decision-based $L _ { 0 }$ attack as well as a customized attack that specifically exploits the structure of our model. Nevertheless, we cannot rule out that more effective attacks exist and we will release the trained model for future testing.
129
+
130
+ Latent Descent attack This novel attack exploits the structure of the ABS model. Let $\mathbf { x } _ { t }$ be the perturbed sample $\mathbf { x }$ in iteration $t$ . We perform variational inference $p ( \mathbf { z } | \mathbf { x } _ { t } , y ) = \mathcal { N } ( \mu _ { y } ( \mathbf { x } _ { t } ) , \sigma _ { q } I )$ to find the most likely class $\tilde { y }$ that is different from the ground-truth class. We then make a step towards the maximum likelihood posterior $p ( \mathbf { x } | \mathbf { z } , \tilde { y } )$ of that class which we denote as $\tilde { \mathbf { x } } _ { \tilde { y } }$ ,
131
+
132
+ $$
133
+ \mathbf { x } _ { t } \mapsto ( 1 - \epsilon ) \mathbf { x } _ { t } + \epsilon \tilde { \mathbf { x } } _ { \tilde { y } } .
134
+ $$
135
+
136
+ We choose $\epsilon = 1 0 ^ { - 2 }$ and iterate until we find an adversarial. For a more precise estimate we perform a subsequent binary search of 10 steps within the last $\epsilon$ interval. Finally, we perform another binary search between the adversarial and the original image to reduce the perturbation as much as possible.
137
+
138
+ Decision-based attacks We use several decision-based attacks because they do not rely on gradient information and are thus insensitive to gradient masking or missing gradients. In particular, we apply the Boundary Attack (Brendel et al., 2018), which is competitive with gradient-based attacks in minimizing the $L _ { 2 }$ norm, and introduce the Pointwise Attack, a novel decision-based attack that greedily minimizes the $L _ { 0 }$ norm. It first adds salt-and-pepper noise until the image is misclassified and then repeatedly iterates over all perturbed pixels, resetting them to the clean image if the perturbed image stays adversarial. The attack ends when no pixel can be reset anymore. We provide an implementation of the attack in Foolbox (Rauber et al., 2017). Finally, we apply two simple noise attacks, the Gaussian Noise attack and the Salt&Pepper Noise attack as baselines.
139
+
140
+ ![](images/31e1d5c0e54ed82339b82da9e0b5f791b5262e09844f1e5f313156c66951af0a.jpg)
141
+ Figure 2: Accuracy-distortion plots for each distance metric and all models. In (b) we see that a threshold at 0.3 favors Madry et al. while a threshold of 0.35 would have favored the Binary ABS.
142
+
143
+ Transfer-based attacks Transfer attacks also don’t rely on gradients of the target model but instead compute them on a substitute: given an input $\mathbf { x }$ we first compute adversarial perturbations $\pmb { \delta }$ on the substitute using different gradient-based attacks ( $\ L _ { 2 }$ and $L _ { \infty }$ Basic Iterative Method (BIM), Fast Gradient Sign Method (FGSM) and $L _ { 2 }$ Fast Gradient Method) and then perform a line search to find the smallest $\epsilon$ for which ${ \bf x } + \epsilon \delta$ (clipped to the range [0, 1]) is still an adversarial for the target model.
144
+
145
+ Gradient-based attacks We apply the Momentum Iterative Method (MIM) (Dong et al., 2017) that won the NIPS 2017 adversarial attack challenge, the Basic Iterative Method (BIM) (Kurakin et al., 2016) (also known as Projected Gradient Descent (PGD))—for both the $L _ { 2 }$ and the $L _ { \infty }$ norm—as well as the Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2014) and its $L _ { 2 }$ variant, the Fast Gradient Method (FGM). For models with input binarization (Binary CNN, Binary ABS), we obtain gradients using the straight-through estimator (Bengio et al., 2013).
146
+
147
+ Score-based attacks We additionally run all attacks listed under Gradient-based attacks using numerically estimated gradients (possible for all models). We use a simple coordinate-wise finite difference method (NES estimates (Ilyas et al., 2018) performed comparable or worse) and repeat the attacks with different values for the step size of the gradient estimator.
148
+
149
+ Postprocessing (binary models only) For models with input binarization (sec. 6) we postprocess all adversarials by setting pixel intensities either to the corresponding value of the clean image or the binarization threshold (0.5). This reduces the perturbation size without changing model decisions.
150
+
151
+ # 6 EXPERIMENTS
152
+
153
+ We compare our ABS model as well as two ablations—ABS with input binarization during test time (Binary ABS) and a CNN with input binarization during train and test time (Binary CNN)—against three other models: the SOTA $L _ { \infty }$ defense (Madry et al., 2018)1, a Nearest Neighbour (NN) model (as a somewhat robust but not accurate baseline) and a vanilla CNN (as an accurate but not robust baseline), see Appendix A.7. We run all attacks (see sec. 5) against all applicable models.
154
+
155
+ For each model and $L _ { p }$ norm, we show how the accuracy of the models decreases with increasing adversarial perturbation size (Figure 2) and report two metrics: the median adversarial distance (Table 1, left values) and the model’s accuracy against bounded adversarial perturbations (Table 1, right values). The median of the perturbation sizes (Table 1, left values) is robust to outliers and summarizes most of the distributions quite well. It represents the perturbation size for which the particular model achieves $5 0 \%$ accuracy and does not require the choice of a threshold. Clean samples that are already misclassified are counted as adversarials with a perturbation size equal to 0, failed attacks as $\infty$ . The commonly reported model accuracy on bounded adversarial perturbations, on the other hand, requires a metric-specific threshold that can bias the results. We still report it (Table 1, right values) for completeness and set $\epsilon _ { L _ { 2 } } = 1 . 5$ , $\epsilon _ { L _ { \infty } } = 0 . 3$ and $\epsilon _ { L _ { 0 } } = 1 2 $ as thresholds.
156
+
157
+ <table><tr><td></td><td>CNN</td><td>Binary CNN</td><td>Nearest Neighbor</td><td>Madry et al.</td><td>Binary ABS</td><td>ABS</td></tr><tr><td>Clean</td><td>99.1%</td><td>98.5%</td><td>96.9%</td><td>98.8%</td><td>99.0%</td><td>99.0%</td></tr><tr><td>L2-metric (ε = 1.5)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Transfer Attacks</td><td>1.1/14%</td><td>1.4 /38%</td><td>5.4/90%</td><td>3.7/94%</td><td>2.5/86%</td><td>4.6 /94%</td></tr><tr><td>Gaussian Noise</td><td>5.2/96%</td><td>3.4/92%</td><td>0/91%</td><td>5.4/96%</td><td>5.6/89%</td><td>10.9/98%</td></tr><tr><td>Boundary Attack</td><td>1.2/ 21%</td><td>3.3/84%</td><td>2.9/73%</td><td>1.4/37%</td><td>6.0/91%</td><td>2.6/83%</td></tr><tr><td>Pointwise Attack</td><td>3.4/91%</td><td>1.9 /71%</td><td>3.5/89%</td><td>1.9 /71%</td><td>3.1/86%</td><td>4.6 /94%</td></tr><tr><td>FGM</td><td>1.4/48%</td><td>1.4/50%</td><td></td><td>080/96%</td><td></td><td></td></tr><tr><td>FGM w/ GE</td><td>1.4/42%</td><td>2.8/51%</td><td>3.7/79%</td><td>8/88%</td><td>1.9 /68%</td><td>3.5/89%</td></tr><tr><td>DeepFool</td><td>1.2/18%</td><td>1.0 /11%</td><td></td><td>9.0/91%</td><td></td><td></td></tr><tr><td>DeepFool w/ GE</td><td>1.3 /30%</td><td>0.9/ 5%</td><td>1.6/ 55%</td><td>5.1/90%</td><td>1.4 / 41%</td><td>2.4/83%</td></tr><tr><td>L2 BIM</td><td>1.1/13%</td><td>1.0 /11%</td><td></td><td>4.8/88%</td><td></td><td></td></tr><tr><td>L2 BIM w/ GE</td><td>1.1/37%</td><td>00/50%</td><td>1.7 / 62%</td><td>3.4/88%</td><td>1.6 / 63%</td><td>3.1/87%</td></tr><tr><td>Latent Descent Attack</td><td></td><td></td><td></td><td></td><td>2.6/97%</td><td>2.7/85%</td></tr><tr><td>All L2 Attacks</td><td>1.1/ 8%</td><td>0.9/ 3%</td><td>1.5/53%</td><td>1.4/35%</td><td>1.3/39%</td><td>2.3 / 80%</td></tr><tr><td>Lo-metric (ε= 0.3)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Transfer Attacks</td><td>0.08/0%</td><td>0.44/ 85%</td><td></td><td>0.42/78%</td><td>0.39 /92%</td><td>0.49 /88%</td><td>0.34 / 73%</td></tr><tr><td>FGSM</td><td>0.10/ 4%</td><td>0.43 / 77%</td><td></td><td></td><td>0.45/93%</td><td></td><td></td></tr><tr><td>FGSM w/GE</td><td>0.10 /21%</td><td>0.42/ 71%</td><td></td><td>0.38/68%</td><td>0.47/89%</td><td>60.49/85%</td><td>0.27 /34%</td></tr><tr><td>LoDeepFool</td><td>0.08/ 0%</td><td>0.38 /74%</td><td></td><td></td><td>0.42/90%</td><td></td><td></td></tr><tr><td>LDeepFool w/ GE</td><td>0.09/ 0%</td><td>0.37 / 67%</td><td></td><td>0.21/26%</td><td>0.53/90%</td><td>0.46 /78%</td><td>0.27/39%</td></tr><tr><td>BIM</td><td>0.08/ 0%</td><td>0.36/ 70%</td><td></td><td></td><td>0.36 /90%</td><td></td><td></td></tr><tr><td>BIM w/ GE</td><td>0.08/37%</td><td></td><td>0/70%</td><td>0.25 /43%</td><td>0.46 /89%</td><td>0.49 /86%</td><td>0.25 /13%</td></tr><tr><td>MIM</td><td>0.08/ 0%</td><td></td><td>0.37 / 71%</td><td></td><td>0.34/90%</td><td></td><td></td></tr><tr><td>MIM w/ GE</td><td>0.09 /36%</td><td></td><td>00/69%</td><td>0.19 /26%</td><td>0.36 /89%</td><td>0.46 /85%</td><td>0.26 /17%</td></tr><tr><td>All L Attacks</td><td>0.08/0%</td><td>0.34/ 64%</td><td></td><td>0.19 /22%</td><td>0.34/88%</td><td>0.44 / 77%</td><td>0.23/ 8%</td></tr><tr><td>Lo-metric (ε = 12)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Salt&amp;Pepper Noise</td><td>44.0 /91%</td><td></td><td></td><td>44.0/88% 161.0/88%</td><td></td><td></td><td>13.5 /56% 146.0/94% 165.0/94%</td></tr><tr><td>Pointwise Attack 10x</td><td>9.0/19%</td><td></td><td>11.0 /39%</td><td>10.0/34%</td><td>4.0/0%</td><td>22.0/77%</td><td>16.5/69%</td></tr><tr><td>All Lo Attacks</td><td>9.0/19%</td><td></td><td>11.0 /38%</td><td>10.0 /34%</td><td>4.0/ 0%</td><td>21.5 / 77%</td><td>16.5 /69%</td></tr></table>
158
+
159
+ Table 1: Results for different models, adversarial attacks and distance metrics. Each entry shows the median adversarial distance across all samples (left value, black) as well as the model’s accuracy against adversarial perturbations bounded by the thresholds $\epsilon _ { L _ { 2 } } = 1 . 5$ , $\epsilon _ { L _ { \infty } } = 0 . 3$ and $\epsilon _ { L _ { 0 } } = 1 2 $ (right value, gray). $" \mathrm { { w } } / G E ^ { \prime \prime }$ indicates attacks that use numerical gradient estimation.
160
+
161
+ # 7 RESULTS
162
+
163
+ Minimal Adversarials Our robustness evaluation results of all models are reported in Table 1 and Figure 2. All models except the Nearest Neighbour classifier perform close to $9 9 \%$ accuracy on clean test samples. We report results for three different norms: $L _ { 2 }$ , $L _ { \infty }$ and $L _ { 0 }$ .
164
+
165
+ • For $L _ { 2 }$ our ABS model outperforms all other models by a large margin. • For $L _ { \infty }$ , our Binary ABS model is state-of-the-art in terms of median perturbation size. In terms of accuracy (perturbations $< 0 . 3$ ), Madry et al. seems more robust. However, as revealed by the accuracy-distortion curves in Figure 2, this is an artifact of the specific threshold (Madry et al. is optimized for 0.3). A slightly larger one (e.g. 0.35) would strongly favor the Binary ABS model. For $L _ { 0 }$ , both ABS and Binary ABS are much more robust than all other models. Interestingly, the model by Madry et al. is the least robust, even less than the baseline CNN.
166
+
167
+ In Figure 3 we show adversarial examples. For each sample we show the minimally perturbed $L _ { 2 }$ adversarial found by any attack. Adversarials for the baseline CNN and the Binary CNN are almost imperceptible. The Nearest Neighbour model, almost by design, exposes (some) adversarials that interpolate between two numbers. The model by Madry et al. requires perturbations that are clearly visible but make little semantic sense to humans. Finally, adversarials generated for the ABS models are semantically meaningful for humans and are sitting close to the perceptual boundary between the original and the adversarial class. For a more thorough comparison see appendix Figures 5, 6 and 7.
168
+
169
+ ![](images/2050236d39352c084225b9a3c6d1d1b0d0826bc1abe36b8365760d1bf9cd0286.jpg)
170
+ Figure 3: Adversarial examples for the ABS models are perceptually meaningful: For each sample (randomly chosen from each class) we show the minimally perturbed $L _ { 2 }$ adversarial found by any attack. Our ABS models have clearly visible and often semantically meaningful adversarials. Madry et al. requires perturbations that are clearly visible, but their semantics are less clear.
171
+
172
+ Lower bounds on Robustness For the ABS models and the $L _ { 2 }$ metric we estimate a lower bound of the robustness. The lower bound for the mean perturbation2 for the MNIST test set is $\epsilon =$ $0 . 6 9 0 \pm 0 . 0 0 5$ for the ABS and $\epsilon = 0 . 6 0 1 \pm 0 . 0 0 5$ for the binary ABS. We estimated the error by using different random seeds for our optimization procedure and standard error propagation over 10 runs. With adversarial training Hein & Andriushchenko (2017) achieve a mean $L _ { 2 }$ robustness guarantee of $\epsilon = 0 . 4 8$ while reaching $9 9 \%$ accuracy. In the $\operatorname { \cal L } _ { i n f }$ metric we find a median robustness of 0.06.
173
+
174
+ Distal Adversarials We probe the behavior of CNN, Madry et al. and our ABS model outside the data distribution. We start from random noise images and perform gradient ascent to maximize the output probability of a fixed label until $p ( y | \mathbf { x } ) \geq 0 . 9$ (as computed by the modified softmax from equation (8)). The results are visualized in Figure 4. Standard CNNs and Madry et al.
175
+
176
+ ![](images/c8f3113024f130c8e0fad974ba0554d281ee5ce73dba0a086729e894ec68bf76.jpg)
177
+ Figure 4: Images of ones classified with a probability above $90 \%$ .
178
+
179
+ provide high confidence class probabilities for unrecognizable images. Our ABS model does not provide high confidence predictions in out-of-distribution regions.
180
+
181
+ # 8 DISCUSSION & CONCLUSION
182
+
183
+ In this paper we demonstrated that, despite years of work, we as a community failed to create neural networks that can be considered robust on MNIST from the point of human perception. In particular, we showed that even today’s best defense is susceptible to small adversarial perturbations that make little to no semantic sense to humans. We presented a new approach based on analysis by synthesis that seeks to explain its inference by means of the actual image features. We performed an extensive analysis to show that minimal adversarial perturbations in this model are large across all tested $L _ { p }$ norms and semantically meaningful to humans. Note that our architecture derives its robustness from its design and does not require any additionally training with adversarial examples.
184
+
185
+ We acknowledge that it is not easy to reliably evaluate a model’s adversarial robustness and most defenses proposed in the literature have later been shown to be ineffective. In particular, the structure of the ABS model prevents the computation of gradients which might give the model an unfair advantage. We put a lot of effort into an extensive evaluation of adversarial robustness using a large collection of powerful attacks, including one specifically designed to be particularly effective against the ABS model (the Latent Descent attack), and we will release the model architecture and trained weights as a friendly invitation to fellow researchers to evaluate our model.
186
+
187
+ Looking at the results of individual attacks (Table 1) we find that there is no single attack that works best on all models, thus highlighting the importance for a broad range of attacks. Without the Boundary Attack, for example, Madry et al. would have looked more robust to $L _ { 2 }$ adversarials than it is. For similar reasons Figure 6b of Madry et al. (2018) reports a median $L _ { 2 }$ perturbation size larger than 5, compared to the 1.4 achieved by the Boundary Attack. Moreover,the combination of all attacks of one metric $( A l l L _ { 2 } / L _ { \infty } / L _ { 0 }$ Attacks) is often better than any individual attack, indicating that different attacks are optimal on different samples.
188
+
189
+ Our conceptual implementation of the ABS model with one VAE per class neither scales efficiently to more classes nor to more complex datasets (a preliminary experiment on CIFAR10 provided only $54 \%$ test accuracy). However, first experiments on two class CIFAR indicate that the proposed model is also robust on CIFAR (we reach a median L2 robustness of 2.6 compared to 0.8 for a vanilla CNN, see Appendix A.1) for details). To increase the accuracy, there are many ways in which the ABS model can be improved, ranging from better and faster generative models (e.g. flow-based) to better training procedures.
190
+
191
+ In a nutshell, we demonstrated that MNIST is still not solved from the point of adversarial robustness and showed that our novel approach based on analysis by synthesis has great potential to reduce the vulnerability against adversarial attacks and to align machine perception with human perception.
192
+
193
+ # ACKNOWLEDGMENTS
194
+
195
+ This work has been funded, in part, by the German Federal Ministry of Education and Research (BMBF) through the Bernstein Computational Neuroscience Program Tübingen (FKZ: 01GQ1002) as well as the German Research Foundation (DFG CRC 1233 on “Robust Vision”). The authors thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting L.S. and J.R.; J.R. acknowledges support by the Bosch Forschungsstiftung (Stifterverband, T113/30057/17); W.B. was supported by the Carl Zeiss Foundation (0563-2.8/558/3); M.B. acknowledges support by the Centre for Integrative Neuroscience Tübingen (EXC 307); W.B. and M.B. were supported by the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior / Interior Business Center (DoI/IBC) contract number D16PC00003.
196
+
197
+ # REFERENCES
198
+
199
+ Anish Athalye and Nicholas Carlini. On the robustness of the cvpr 2018 white-box adversarial example defenses. arXiv preprint arXiv:1804.03286, 2018.
200
+
201
+ Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. arXiv preprint arXiv:1802.00420, 2018.
202
+
203
+ Yoshua Bengio, Nicholas Léonard, and Aaron Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
204
+
205
+ W. Brendel and M. Bethge. Comment on “biologically inspired protection of deep networks from adversarial attacks”. arXiv preprint arXiv:1704.01547, 2017.
206
+
207
+ Wieland Brendel, Jonas Rauber, and Matthias Bethge. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\equiv$ SyZI0GWCZ.
208
+
209
+ Sébastien Bubeck, Eric Price, and Ilya Razenshteyn. Adversarial examples from computational constraints. arXiv preprint arXiv:1805.10204, 2018.
210
+
211
+ Jacob Buckman, Aurko Roy, Colin Raffel, and Ian Goodfellow. Thermometer encoding: One hot way to resist adversarial examples. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ S18Su--CW.
212
+
213
+ Nicholas Carlini and David Wagner. Magnet and" efficient defenses against adversarial attacks" are not robust to adversarial examples. arXiv preprint arXiv:1711.08478, 2017.
214
+
215
+ Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015.
216
+
217
+ Guneet S. Dhillon, Kamyar Azizzadenesheli, Jeremy D. Bernstein, Jean Kossaifi, Aran Khanna, Zachary C. Lipton, and Animashree Anandkumar. Stochastic activation pruning for robust adversarial defense. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ H1uR4GZRZ.
218
+
219
+ Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Xiaolin Hu, Jianguo Li, and Jun Zhu. Boosting adversarial attacks with momentum. arxiv preprint. arXiv preprint arXiv:1710.06081, 2017.
220
+
221
+ Dileep George, Wolfgang Lehrach, Ken Kansky, Miguel Lázaro-Gredilla, Christopher Laan, Bhaskara Marthi, Xinghua Lou, Zhaoshi Meng, Yi Liu, Huayan Wang, Alex Lavin, and D. Scott Phoenix. A generative vision model that trains with high data efficiency and breaks text-based captchas. Science, 358(6368), 2017. ISSN 0036-8075. doi: 10.1126/science.aag2612. URL http://science.sciencemag.org/content/ 358/6368/eaag2612.
222
+
223
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
224
+
225
+ Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens van der Maaten. Countering adversarial images using input transformations. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ SyJ7ClWCb.
226
+
227
+ Matthias Hein and Maksym Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In Advances in Neural Information Processing Systems 30, pp. 2266–2276. Curran Associates, Inc., 2017.
228
+
229
+ Andrew Ilyas, Ajil Jalal, Eirini Asteri, Constantinos Daskalakis, and Alexandros G Dimakis. The robust manifold defense: Adversarial training using generative models. arXiv preprint arXiv:1712.09196, 2017.
230
+
231
+ Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. arXiv preprint arXiv:1804.08598, 2018.
232
+
233
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
234
+
235
+ Vishaal Munusamy Kabilan, Brandon Morris, and Anh Nguyen. Vectordefense: Vectorization as a defense to adversarial examples. arXiv preprint arXiv:1804.08529, 2018.
236
+
237
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
238
+
239
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
240
+
241
+ Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
242
+
243
+ Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Jun Zhu, and Xiaolin Hu. Defense against adversarial attacks using high-level representation guided denoiser. arXiv preprint arXiv:1712.02976, 2017.
244
+
245
+ Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rJzIBfZAb.
246
+
247
+ Dongyu Meng and Hao Chen. Magnet: a two-pronged defense against adversarial examples. In Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, pp. 135–147. ACM, 2017.
248
+
249
+ Anh Nguyen, Jason Yosinski, and Jeff Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015.
250
+
251
+ Aaditya Prakash, Nick Moran, Solomon Garber, Antonella DiLillo, and James Storer. Deflecting adversarial attacks with pixel deflection. arXiv preprint arXiv:1801.08926, 2018.
252
+
253
+ Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. In International Conference on Learning Representations, 2018. URL https://openreview.net/ forum?id $\equiv$ Bys4ob-Rb.
254
+
255
+ Jonas Rauber, Wieland Brendel, and Matthias Bethge. Foolbox: A python toolbox to benchmark the robustness of machine learning models. arXiv preprint arXiv:1707.04131, 2017. URL http://arxiv.org/abs/ 1707.04131.
256
+
257
+ Pouya Samangouei, Maya Kabkab, and Rama Chellappa. Defense-GAN: Protecting classifiers against adversarial attacks using generative models. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ BkJ3ibb0-.
258
+
259
+ Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarially robust generalization requires more data. CoRR, abs/1804.11285, 2018. URL http://arxiv.org/abs/ 1804.11285.
260
+
261
+ Bernhard Schölkopf. Causal learning, 2017. URL https://icml.cc/Conferences/2017/ Schedule?showEvent $= 9 3 1$ . Thirty-fourth International Conference on Machine Learning.
262
+
263
+ Shiwei Shen, Guoqing Jin, Ke Gao, and Yongdong Zhang. Ape-gan: Adversarial perturbation elimination with gan. arXiv preprint arXiv:1707.05474, 2017.
264
+
265
+ Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. Pixeldefend: Leveraging generative models to understand and defend against adversarial examples. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ rJUYGxbCW.
266
+
267
+ Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
268
+
269
+ Florian Tramèr, Alexey Kurakin, Nicolas Papernot, Ian Goodfellow, Dan Boneh, and Patrick McDaniel. Ensemble adversarial training: Attacks and defenses. arXiv preprint arXiv:1705.07204, 2017.
270
+
271
+ Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. There is no free lunch in adversarial robustness (but there are unexpected benefits). arXiv preprint arXiv:1805.12152, 2018.
272
+
273
+ Jonathan Uesato, Brendan O’Donoghue, Pushmeet Kohli, and Aaron van den Oord. Adversarial risk and the dangers of evaluating against weak attacks. In Proceedings of the 35th International Conference on Machine Learning, 2018. URL http://proceedings.mlr.press/v80/uesato18a.html.
274
+
275
+ Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. In International Conference on Learning Representations, 2018. URL https: //openreview.net/forum?id $=$ Sk9yuql0Z.
276
+
277
+ Tianhang Zheng, Changyou Chen, and Kui Ren. Distributionally adversarial attack. arXiv preprint arXiv:1808.05537, 2018.
278
+
279
+ A APPENDIX
280
+
281
+ # A.1 TWO CLASS CIFAR
282
+
283
+ We estimate the robustness of our ABS model on two class CIFAR (airplane vs. automobile). Preliminary results suggest that our robustness is not limited to MNIST.
284
+
285
+ In order to adapt to CIFAR, we modified the ABS slightly by modifying encoder and decoder to fit $( 3 2 \mathbf { x } 3 2 \mathbf { x } 3 )$ CIFAR images. We also increased the number of dimensions in the latent space form 8 to 20.
286
+
287
+ Table 2: Accuracy and estimated robustness on two class CIFAR.
288
+
289
+ <table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>CNN</td><td rowspan=1 colspan=1>ABS</td></tr><tr><td rowspan=1 colspan=1>Accuracy</td><td rowspan=1 colspan=1>97.1%</td><td rowspan=1 colspan=1>89.7%</td></tr><tr><td rowspan=1 colspan=1>Median L2 distance</td><td rowspan=1 colspan=1>0.8 (with BIM)</td><td rowspan=1 colspan=1>2.5 (with Latent Descent attack)</td></tr></table>
290
+
291
+ ![](images/f2c2215e969989fcff32b66fab4888a7211e5709c96d577613dc748835c56871.jpg)
292
+ Figure 5: $L _ { 0 }$ error quantiles: We always choose the minimally perturbed $L _ { 0 }$ adversarial found by any attack for each model. For an unbiased selection, we then randomly sample images within four error quantiles $( 0 - 2 5 \%$ , $2 5 - 5 0 \%$ , $5 0 - 7 5 \%$ , and $7 5 - 1 0 0 \%$ ). Where $1 0 0 \%$ corresponds to the maximal (over samples) minimum (over attacks) perturbation found for each model.
293
+
294
+ ![](images/adf9262d9d71e9d2691d3450efa107bd89491ad2e14a6e18ffeb47e2e3833d79.jpg)
295
+ Figure 6: $L _ { 2 }$ error quantiles: We always choose the minimally perturbed $L _ { 2 }$ adversarial found by any attack for each model. For an unbiased selection, we then randomly sample 4 images within four error quantiles $( 0 - 2 5 \%$ , $2 5 - 5 0 \%$ , $5 0 - 7 5 \%$ , and $7 5 - 1 0 0 \%$ ).
296
+
297
+ ![](images/acb1eabcb2b672e4a0d2866f27b01a0ef53e9773644fa476db4d28ff5422cf38.jpg)
298
+ Figure 7: $L _ { \infty }$ error quantiles: We always choose the minimally perturbed $L _ { \infty }$ adversarial found by any attack for each model. For an unbiased selection, we then randomly sample images within four error quantiles $( 0 - 2 5 \%$ , $2 5 - 5 0 \%$ , $5 0 - 7 5 \%$ , and $7 5 - 1 0 0 \%$ ).
299
+
300
+ ![](images/3e1cc30a68110e0676390688fa99754311dae38ae3a8956e61f85761e8dd8fa2.jpg)
301
+ Figure 8: Distribution of minimal adversarials for each model and distance metric. In (b) we see that a threshold at 0.3 favors Madry et al. while a threshold of 0.35 would have favored the Binary ABS.
302
+
303
+ # A.3 DERIVATION I
304
+
305
+ Derivation of the ELBO in equation 2.
306
+
307
+ $$
308
+ \log p _ { \boldsymbol \theta } ( \mathbf { x } ) = \log \int \mathbf { d z } p _ { \boldsymbol \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) ,
309
+ $$
310
+
311
+ where $p ( \mathbf { z } ) = \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } )$ is a simple normal prior. Based on the idea of importance sampling using a variational posterior $q _ { \phi } ( { \bf z } | { \bf x } )$ with parameters $\phi$ and using Jensen’s inequality we arrive at
312
+
313
+ $$
314
+ \begin{array} { r l } & { = \log \int \mathrm { d } z \frac { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) , } \\ & { = \log \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \frac { p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] , } \\ & { \geq \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log \frac { p _ { \theta } ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] , } \\ & { = \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) + \log \frac { p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \right] , } \\ & { = \mathbb { E } _ { \mathbf { z } \sim q _ { \phi } ( \mathbf { z } | \mathbf { x } ) } \left[ \log p _ { \theta } ( \mathbf { x } | \mathbf { z } ) \right] - \mathcal { D } _ { K L } \left[ q _ { \phi } ( \mathbf { z } | \mathbf { x } ) \right] \left. p ( \mathbf { z } ) \right] . } \end{array}
315
+ $$
316
+
317
+ This lower bound is commonly referred to as ELBO.
318
+
319
+ # A.4 DERIVATION II: LOWER BOUND FOR $L _ { 2 }$ ROBUSTNESS ESTIMATION
320
+
321
+ Derivation of equation 6. Starting from equation 3 we find that for a perturbation $\pmb { \delta }$ with size $\epsilon = { \left\| \delta \right\| } _ { 2 }$ of sample $\mathbf { x }$ the lower bound $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ can itself be bounded by,
322
+
323
+ $$
324
+ \begin{array} { r l r } { { \ell _ { y } ^ { * } ( \mathbf x + \delta ) = \operatorname* { m a x } _ { \mathbf z } - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } } \\ & { } & { \geq - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z _ { \mathbf x } ^ { * } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z _ { \mathbf x } ^ { * } ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } \end{array}
325
+ $$
326
+
327
+ where $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ is the optimal latent vector for the clean sample $\mathbf { x }$ for class $_ y$ ,
328
+
329
+ $$
330
+ \begin{array} { r l } & { = \ell _ { y } ^ { * } ( \mathbf { x } ) + \frac { 1 } { \sigma ^ { 2 } } \boldsymbol { \delta } ^ { \top } ( \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ) - \frac { 1 } { 2 \sigma ^ { 2 } } \boldsymbol { \epsilon } ^ { 2 } + C , } \\ & { \geq \ell _ { y } ^ { * } ( \mathbf { x } ) - \frac { 1 } { \sigma ^ { 2 } } \boldsymbol { \epsilon } \| \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } \| _ { 2 } - \frac { 1 } { 2 \sigma ^ { 2 } } \boldsymbol { \epsilon } ^ { 2 } + C . } \end{array}
331
+ $$
332
+
333
+ A.5 DERIVATION III: UPPER BOUND FOR $L _ { 2 }$ ROBUSTNESS ESTIMATION
334
+
335
+ Derivation of equation 7.
336
+
337
+ $$
338
+ \begin{array} { r l r } { { \ell _ { c } ^ { * } ( \mathbf { x } + \delta ) = \operatorname* { m a x } _ { \mathbf { \mu } _ { \mathbf { z } } } - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \mathbf { G } _ { y } ( \mathbf { z } ) - \mathbf { x } - \delta _ { 2 } ^ { 2 } + C , } } \\ & { } & { \leq - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] + C - \underset { \mathbf { z } } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } - \delta _ { 2 } ^ { 2 } , } \\ & { } & { \leq - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] + C - \underset { \mathbf { z } , \delta } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } - \delta _ { 2 } ^ { 2 } , } \\ & { } & { = - \mathcal { D } _ { K L } [ \mathcal { N } ( \mathbf { 0 } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] + C - \{ \frac { 1 } { 2 \sigma ^ { 2 } } ( d _ { c } - \epsilon ) ^ { 2 } \quad \mathrm { i f ~ } d _ { c } \geq \epsilon . } \end{array}
339
+ $$
340
+
341
+ for $d _ { c } = \mathrm { m i n } _ { z } \left. \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right. _ { 2 }$ . The last equation comes from the solution of the constrained optimization problem $\operatorname* { m i n } _ { d } ( d - \epsilon ) ^ { 2 } d$ s.t. $d > d _ { c }$ . Note that a tighter bound might be achieved by assuming single $\pmb { \delta }$ for upper and lower bound.
342
+
343
+ # A.6 $L _ { \infty }$ ROBUSTNESS ESTIMATION
344
+
345
+ We proceed in the same way as for $L _ { 2 }$ . Starting again from
346
+
347
+ $$
348
+ \ell _ { c } ^ { * } ( \mathbf { x } ) = \underset { \mathbf { z } } { \mathrm { m a x } } - \mathcal { D } _ { K L } \left[ \mathcal { N } ( \mathbf { z } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) \right] - \frac { 1 } { 2 \sigma ^ { 2 } } \left. \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \right. _ { 2 } ^ { 2 } + C ,
349
+ $$
350
+
351
+ let $_ y$ be the predicted class and let $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ be the optimal latent for the clean sample $\mathbf { x }$ for class $y$ . We can then estimate a lower bound on $\ell _ { y } ^ { * } ( \mathbf { x } + \delta )$ for a perturbation $\pmb { \delta }$ with size $\epsilon = \| \pmb { \delta } \| _ { \infty }$ ,
352
+
353
+ $$
354
+ \begin{array} { r l r } { { \ell _ { y } ^ { * } ( \mathbf x + \delta ) = \operatorname* { m a x } _ { \mathbf z } - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } } \\ & { } & { \geq - { \mathcal { D } _ { K L } } [ \mathcal { N } ( \mathbf z _ { \mathbf x } ^ { * } , \sigma _ { q } \mathbb { 1 } ) | | \mathcal { N } ( \mathbf { 0 } , \mathbb { 1 } ) ] - \frac { 1 } { 2 \sigma ^ { 2 } } \| \mathbf { G } _ { y } ( \mathbf z _ { \mathbf x } ^ { * } ) - \mathbf x - \delta \| _ { 2 } ^ { 2 } + C , } \end{array}
355
+ $$
356
+
357
+ where $\mathbf { z } _ { \mathbf { x } } ^ { \ast }$ is the optimal latent for the clean sample $\mathbf { x }$ for class $y$ .
358
+
359
+ $$
360
+ \begin{array} { l } { \displaystyle = \ell _ { y } ^ { * } ( \mathbf { x } ) + \frac { 1 } { \sigma ^ { 2 } } \delta ^ { \top } ( \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ) - \frac { 1 } { 2 \sigma ^ { 2 } } \| \delta \| _ { 2 } ^ { 2 } + C , } \\ { \displaystyle \geq \ell _ { y } ^ { * } ( \mathbf { x } ) + C + \frac { 1 } { 2 \sigma ^ { 2 } } \operatorname* { m i n } \left( 2 \delta ^ { \top } ( \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ) - \| \delta \| _ { 2 } ^ { 2 } \right) , } \\ { \displaystyle = \ell _ { y } ^ { * } ( \mathbf { x } ) + C + \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \operatorname* { m i n } \left( 2 \delta _ { i } [ \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ] _ { i } - \delta _ { i } ^ { 2 } \right) , } \\ { \displaystyle = \ell _ { y } ^ { * } ( \mathbf { x } ) + C + \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \left\{ \left[ \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } \right] _ { i } ^ { 2 } \right. \qquad \mathrm { i f ~ } [ \mathbf { G } _ { y } ( \mathbf { z } _ { \mathbf { x } } ^ { * } ) - \mathbf { x } ] _ { i } | \leq \epsilon \ . } \end{array}
361
+ $$
362
+
363
+ Similarly, we can estimate an upper bound on $\ell _ { c } ^ { * } ( \mathbf { x } + \delta )$ on all other classes $c \neq y$ ,
364
+
365
+ $$
366
+ \begin{array} { l } { { \displaystyle \ell _ { c } ^ { * } ( { \bf x } + \delta ) \leq - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) ] + C - \underset { \bf z } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } { \bf G } _ { c } ( { \bf z } ) - { \bf x } - \delta _ { 2 } ^ { 2 } , } } \\ { { \displaystyle \leq - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) + C - \underset { \bf z , \delta } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } { \bf G } _ { c } ( { \bf z } ) - { \bf x } - \delta _ { 2 } ^ { 2 } , } } \\ { ~ } \\ { { \displaystyle = - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) + C - \underset { \bf z } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \underset { \sigma _ { i } } { \operatorname* { m i n } } ( [ { \bf G } _ { c } ( { \bf z } ) - { \bf x } ] _ { i } - \delta _ { i } ) ^ { 2 } , } } \\ { { \displaystyle = - \mathcal { D } _ { K L } [ \boldsymbol { \cal N } ( { \bf 0 } , \sigma _ { q } { \bf 1 } ) ] \boldsymbol { \cal N } ( { \bf 0 } , { \bf 1 } ) + C } ~ } \\ \displaystyle ~ - \underset { \bf z } { \operatorname* { m i n } } \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i } \{ \begin{array} { l l } { \displaystyle 0 ( \mathbf { E } _ { y } ( { \bf z } _ { \mathbf { x } } ^ { * } ) - { \bf x } ) _ { i } - \boldsymbol { \cal K } ^ { 2 } \} } & { { \displaystyle \mathrm { i f } [ \mathbf { G } _ { y } ( { \bf z } _ { \mathbf { x } } ^ { * } ) - { \bf x } ] _ { i } \leq \epsilon } } \\ \displaystyle ( [ \end{array} \end{array}
367
+ $$
368
+
369
+ In this case there is no closed-form solution for the minimization problem on the RHS (in terms of the minimum of $\| \mathbf { G } _ { c } ( \mathbf { z } ) - \mathbf { x } \| _ { 2 } )$ but we can still compute the solution for each given $\epsilon$ which allows us perform a line search along $\epsilon$ to find the point where equation $1 3 =$ equation 14.
370
+
371
+ # A.7 MODEL & TRAINING DETAILS
372
+
373
+ Hyperparameters and training details for the ABS model The binary ABS and ABS have the same weights and architecture: The encoder has 4 layers with kernel s $\mathrm { i z e s } = [ 5 , 4 , 3 , 5 ]$ , strides $= [ 1 , 2 , 2 , 1 ]$ and feature map sizes $=$ [32, 32, 64, 2∗8]. The first 3 layers have ELU activation functions (Clevert et al., 2015), the last layer is linear. All except the last layer use Batch Normalization (Ioffe & Szegedy, 2015). The Decoder architecture has also 4 layers with kernel $\mathrm { s i z e s } = [ 4 , 5 , 5 , 3 ]$ , strides $= [ 1 , 2 , 2 , 1 ]$ and feature map size $=$ [32, 16, 16, 1]. The first 3 layers have ELU activation functions, the last layer has a sigmoid activation function, and all layers except the last one use Batch Normalization.
374
+
375
+ We trained the VAEs with the Adam optimizer (Kingma & Ba, 2014). We tuned the dimension $L$ of the latent space of the class-conditional VAEs (ending up with $L = 8$ ) to achieve $9 9 \%$ test error; started with a high weight for the KL-divergence term at the beginning of training (which was gradually decreased from a factor of 10 to 1 over 50 epochs); estimated the weighting $\gamma = [ 1 , 0 . 9 6 , 1 . 0 0 1 , 1 . 0 6 , 0 . 9 8 , 0 . 9 6 , 1 . 0 3 , 1 , 1 , 1 ]$ of the lower bound via a line search on the training accuracy. The parameters maximizing the test cross entropy3 and providing a median confidence of $p ( y | x ) = 0 . 9$ for our modified softmax (equation 8) are $\eta = 0 . 0 0 0 0 3 9$ and $\alpha = 4 4 0$ . For our latent prior, we chose $\sigma _ { q } = 1$ and for the posterior width we choose $\sigma = 1 / \sqrt { 2 }$
376
+
377
+ Hyperparameters for the CNNs The CNN and Binary CNN share the same architecture but have different weights. The architecture has kernel size $\mathfrak { s } = [ 5 , 4 , 3 , 5 ]$ , strides $= [ 1 , 2 , 2 , 1 ]$ , and feature map sizes $= [ 2 0 , 7 0 , 2 5 6 , 1 0 ]$ . All layers use ELU activation functions and all layers except the last one apply Batch Normalization. The CNNs are both trained on the cross entropy loss with the Adam optimizer (Kingma & Ba, 2014). The parameters maximizing the test cross entropy and providing a median confidence of $p ( y | x ) = 0 . 9$ of the CNN for our modified softmax (equation 8) are $\eta = 1 4 3 9 0 0$ and $\alpha = 1$ .
378
+
379
+ Hyperparameters for Madry et al. We adapted the pre-trained model provided by Madry et al4. Basically the architecture contains two convolutional, two pooling and two fully connected layers. The network is trained on clean and adversarial examples minimizing the cross cross-entropy loss. The parameters maximizing the test cross entropy and providing a median confidence of $p ( y | x ) = 0 . 9$ for our modified softmax (equation 8) are $\eta = 6 0$ and $\alpha = 1$ .
380
+
381
+ Hyperparameters for the Nearest Neighbour classifier For a comparison with neural networks, we imitate logits by replacing them with the negative minimal distance between the input and all samples within each class. The parameters maximizing the test cross entropy and providing a median confidence of $\hat { p ( y | x ) } = 0 . 9$ for our modified softmax (equation 8) are $\eta = 0 . 0 0 0 0 0 0 0 0 0 0 0 0 4$ and $\alpha = 5$ .
parse/train/S1EHOsC9tX/S1EHOsC9tX_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/S1EHOsC9tX/S1EHOsC9tX_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/S1EHOsC9tX/S1EHOsC9tX_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SOVSJZ9PTO7/SOVSJZ9PTO7.md ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # JAKET: JOINT PRE-TRAINING OF KNOWLEDGE GRAPH AND LANGUAGE UNDERSTANDING
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Knowledge graphs (KGs) contain rich information about world knowledge, entities, and relations. Thus, they can be great supplements to existing pre-trained language models. However, it remains a challenge to efficiently integrate information from KG into language modeling. And the understanding of a knowledge graph requires related context. We propose a novel joint pre-training framework, JAKET, to model both the knowledge graph and language. The knowledge module and language module provide essential information to mutually assist each other: the knowledge module produces embeddings for entities in text while the language module generates context-aware initial embeddings for entities and relations in the graph. Our design enables the pre-trained model to easily adapt to unseen knowledge graphs in new domains. Experimental results on several knowledge-aware NLP tasks show that our proposed framework achieves superior performance by effectively leveraging knowledge in language understanding.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Pre-trained language models (PLM) leverage large-scale unlabeled corpora to conduct selfsupervised training. They have achieved remarkable performance in various NLP tasks, exemplified by BERT (Devlin et al., 2018), RoBERTa (Liu et al., 2019b), XLNet (Yang et al., 2019), and GPT series (Radford et al., 2018; 2019; Brown et al., 2020). It has been shown that PLMs can effectively characterize linguistic patterns in text and generate high-quality context-aware representations (Liu et al., 2019a). However, these models struggle to grasp world knowledge about entities and relations (Poerner et al., 2019; Talmor et al., 2019), which are very important in language understanding.
12
+
13
+ Knowledge graphs (KGs) represent entities and relations in a structural way. They can also solve the sparsity problem in text modeling. For instance, a language model may require tens of instances of the phrase “labrador is a kind of dog” in its training corpus before it implicitly learns this fact. In comparison, a knowledge graph can use two entity nodes “labrador”, “dog” and a relation edge “is a” between these nodes to precisely represent this fact.
14
+
15
+ Recently, some efforts have been made to integrate knowledge graphs into PLM. Most of them combine the token representations in PLM with representations of aligned KG entities. The entity embeddings in those methods are either pre-computed based on an external source by a separate model (Zhang et al., 2019; Peters et al., 2019), which may not be easily aligned with the language representation space, or directly learned as model parameters (Fevry et al., 2020; Verga et al., 2020), ´ which often have an over-parameterization issue due to the large number of entities. Moreover, all the previous works share a common challenge: when the pre-trained model is fine-tuned in a new domain with a previously unseen knowledge graph, it struggles to adapt to the new entities, relations and structure.
16
+
17
+ Therefore, we propose JAKET, a Joint pre-trAining framework for KnowledgE graph and Text. Our framework contains a knowledge module and a language module, which mutually assist each other by providing required information to achieve more effective semantic analysis. The knowledge module leverages a graph attention network (Velickovi ˇ c et al., 2017) to provide structure-aware ´ entity embeddings for language modeling. And the language module produces contextual representations as initial embeddings for KG entities and relations given their descriptive text. Thus, in both modules, content understanding is based on related knowledge and rich context. On one hand, the joint pre-training effectively projects entities/relations and text into a shared semantic latent space, which eases the semantic matching between them. On the other hand, as the knowledge module produces representations from descriptive text, it solves the over-parameterization issue since entity embeddings are no longer part of the model’s parameters.
18
+
19
+ ![](images/d75ec8d15bb5fcf1057623901e30bba7e571be215ebe614dc8d2a3f56ad143d4.jpg)
20
+ Figure 1: A simple illustration on the novelty of our proposed model JAKET.
21
+
22
+ In order to solve the cyclic dependency between the two modules, we propose a novel two-step language module $\mathrm { L M _ { 1 } }$ and $\mathrm { L M _ { 2 } }$ , respectively. $\mathrm { L M _ { 1 } }$ provides embeddings for both $\mathrm { L M _ { 2 } }$ and KG. The entity embeddings from KG are also fed into $\mathrm { L M _ { 2 } }$ , which produces the final representation. $\mathrm { L M _ { 1 } }$ and $\mathrm { L M _ { 2 } }$ can be easily established as the first several transformer layers and the rest layers of a pre-trained language model such as BERT and RoBERTa. Furthermore, we design an entity context embedding memory with periodic update which speeds up the pre-training by $1 5 \mathrm { x }$ .
23
+
24
+ The pre-training tasks are all self-supervised, including entity category classification and relation type prediction for the knowledge module, and masked token prediction and masked entity prediction for the language module.
25
+
26
+ A great benefit of our framework is that it can easily adapt to unseen knowledge graphs in the finetuning phase. As the initial embeddings of entities and relations come from their descriptive text, JAKET is not confined to any fixed KG. With the learned ability to integrate structural information during pre-training, the framework is extensible to novel knowledge graphs with previously unseen entities and relations, as illustrated in Figure 1.
27
+
28
+ We conduct empirical studies on several knowledge-aware natural language understanding (NLU) tasks, including few-shot relation classification, question answering and entity classification. The results show that JAKET achieves the best performance compared with strong baseline methods on all the tasks, including those with a previously unseen knowledge graph.
29
+
30
+ # 2 RELATED WORK
31
+
32
+ Pre-trained language models have been shown to be very effective in various NLP tasks, including ELMo (Peters et al., 2018), GPT (Radford et al., 2018), BERT (Devlin et al., 2018), RoBERTa (Liu et al., 2019b) and XLNet (Yang et al., 2019). Built upon large-scale corpora, these pretrained models learn effective representations for various semantic structures and linguistic relationships. They are trained on self-supervised tasks like masked language modeling and next sentence prediction.
33
+
34
+ Recently, a lot of efforts have been made on investigating how to integrate knowledge into PLMs (Levine et al., 2019; Soares et al., 2019; Liu et al., 2020; Guu et al., 2020). These approaches can be grouped into two categories:
35
+
36
+ 1. Explicitly injecting entity representation into the language model, where the representations are either pre-computed from external sources (Zhang et al., 2019; Peters et al., 2019) or directly learned as model parameters (Fevry et al., 2020; Verga et al., 2020). For example, ERNIE (THU) (Zhang ´ et al., 2019) pre-trains the entity embeddings on a knowledge graph using TransE (Bordes et al., 2013), while EAE (Fevry et al., 2020) learns the representation from pre-training objectives with ´ all the other model parameters. K-BERT (Liu et al., 2020) represents the entities by the embeddings of surface form tokens (i.e. entity names), which contains much less semantic information compared with description text. Moreover, it only injects KG during fine-tuning phase instead of joint-pretraining KG and text.
37
+
38
+ ![](images/4c1b0dc1b98394928e923da03630cc0b2655eb6e5246fca863a80c2278321057.jpg)
39
+ Figure 2: A demonstration for the structure of JAKET, where the language module is on the left side marked green while the knowledge module is on the right side marked blue. Symbol $\textcircled{8}$ indicates the steps to compute context representations introduced in Section 3.4. “QX”, “PX” and $\mathbf { \vec { \tau } } ^ { 6 } \mathbf { C } \mathbf { X } ^ { \mathbf { \vec { \tau } } }$ are the indices for entities, relations and categories in KG respectively. Entity mentions in text are underlined and italicized such as Sun.
40
+
41
+ 2. Implicitly modeling knowledge information, including entity-level masked language modeling (Sun et al., 2019b; Shen et al., 2020), entity-based replacement prediction (Xiong et al., 2019) and knowledge embedding loss as regularization (Wang et al., 2019b). For example, besides tokenlevel masked language modeling, ERNIE (Baidu) (Sun et al., 2019b) uses phrase-level and entitylevel masking to predict all the masked slots. KEPLER (Wang et al., 2019b) calculates entity embeddings using a pre-trained language model based on the description text, which is similar to our work. However, they use the entity embeddings for the knowledge graph completion task instead of injecting them into the language model.
42
+
43
+ Some works (Ding et al., 2019; Lv et al., 2020) investigated the combination of GNN and PLM. For example, Lv et al. (2020) uses XLNet to generate initial node representation based on node context and feeds them into a GNN. However, these approaches do not integrate knowledge into language modeling, and they are designed for specific NLP tasks such as reading comprehension or commonsense reasoning. In comparison, we jointly pre-train both the knowledge graph representation and language modeling and target for general knowledge-aware NLU tasks.
44
+
45
+ # 3 METHOD
46
+
47
+ In this section, we introduce the JAKET framework of joint pre-training knowledge graph and language understanding. We begin by defining the mathematical notations, and then present our model architecture with the knowledge module and language module. Finally, we introduce how to pretrain our model and fine-tune it for downstream tasks. The framework is illustrated in Figure 2.
48
+
49
+ # 3.1 DEFINITION
50
+
51
+ A knowledge graph is denoted by $\mathcal { K } \mathcal { G } = ( \mathcal { E } , \mathcal { R } , \mathcal { T } )$ , where $\mathcal { E } = \{ e _ { 1 } \ldots e _ { N } \}$ is the set of entities and $\mathcal { R } = \{ r _ { 1 } . . . r _ { P } \}$ is the set of relations. $\mathcal { T } = \{ ( e _ { t _ { i } ^ { 1 } } , r _ { t _ { i } ^ { 2 } } , e _ { t _ { i } ^ { 3 } } ) | 1 \leq i \leq T , e _ { t _ { i } ^ { 1 } } , e _ { t _ { i } ^ { 3 } } \in \mathcal { E } , r _ { t _ { i } ^ { 2 } } \in \mathcal { R } \}$ stands for the set of head-relation-tail triplets. $N _ { v } = \{ ( r , u ) | ( v , r , u ) \in \mathcal { T } \}$ represents the set of neighboring relations and entities of an entity $v$ .
52
+
53
+ We define $\nu = \{ [ \mathrm { M A S K } ]$ , [CLS], [EOS], $w _ { 1 } \ldots . w _ { V } \}$ as a vocabulary of tokens and the contextual text $\mathbf { x } = [ x _ { 1 } , x _ { 2 } , \dots , x _ { L } ]$ as a sequence of tokens where $x _ { i } \in \mathcal V$ . In the vocabulary, [MASK] is the special token for masked language modeling (Devlin et al., 2018) and [CLS], [EOS] are the special tokens indicating the beginning and end of the sequence. We define $F$ as the dimension of token embeddings, which is equal to the dimension of entity/relation embeddings from the KG.
54
+
55
+ The text $\mathbf { x }$ has a list of entity mentions $\textbf { m } = \ [ m _ { 1 } , \dots , m _ { M } ]$ , where each mention $\begin{array} { r l } { m _ { i } } & { { } = } \end{array}$ $( e _ { m _ { i } } , s _ { m _ { i } } , o _ { m _ { i } } )$ : $e _ { m _ { i } }$ is the corresponding entity and $s _ { m _ { i } } , o _ { m _ { i } }$ are the start and end index of this mention in the context. In other words, $[ x _ { s _ { m _ { i } } } , \ldots , x _ { o _ { m _ { i } } } ]$ is linked with entity ${ e _ { m _ { i } } } ^ { 1 }$ . We assume the span of mentions are disjoint for a given text sequence.
56
+
57
+ As entities in the knowledge graph are represented by nodes without context, we use entity description text to describe the concept and meaning of entities. For each entity $e _ { i }$ , its description text $\mathbf { x } ^ { e _ { i } }$ describes this entity. The mention of $e _ { i }$ in $\mathbf { x } ^ { e _ { i } }$ is denoted as $m ^ { e _ { i } } = ( e _ { i } , s _ { i } ^ { e } , o _ { i } ^ { e } )$ , similarly defined as above. For instance, the description text for the entity “sun” can be “[CLS] The Sun is the star at the center of the Solar System [EOS]”. Then the mention is $m ^ { S u n } = ( S u n , 3 , 3 )$ . If there are multiple mentions of $e _ { i }$ in its description text, we choose the first one. If there’s no mention of $e _ { i }$ in its description text, we set $s _ { i } ^ { e } = o _ { i } ^ { e } = 1$ . Similarly, we define relation description text as the text that can describe each relation.
58
+
59
+ # 3.2 KNOWLEDGE MODULE
60
+
61
+ The goal of the knowledge module (KM) is to model the knowledge graph to generate knowledgebased entity representations.
62
+
63
+ To compute entity node embeddings, we employ the graph attention network (GAT) (Velickovi ˇ c´ et al., 2017), which uses the self-attention mechanism to specify different weights for different neighboring nodes. However, the vanilla GAT is designed for homogeneous graphs with singlerelation edges. To leverage the multi-relational information, we adopt the idea of composition operator (Vashishth et al., 2019) to compose entity embeddings and relation embeddings. In detail, in the $l$ -th layer of LM, we update the embedding $\overline { { E _ { v } ^ { ( l ) } } }$ of entity $v$ as follows:
64
+
65
+ $$
66
+ \begin{array} { r l } & { E _ { v } ^ { ( l ) } = \mathrm { L a y e r N o r m } \left( \displaystyle \bigoplus _ { k = 1 } ^ { K } \sigma \left( \sum _ { ( r , u ) \in \mathcal { N } _ { v } } \alpha _ { v , r , u } ^ { k } W ^ { k } f ( E _ { u } ^ { ( l - 1 ) } , R _ { r } ) \right) + E _ { v } ^ { ( l - 1 ) } \right) } \\ & { \alpha _ { v , r , u } ^ { k } = \frac { \displaystyle \exp \Big ( \mathrm { L e a k y R e L U ~ } \Big ( \mathbf { a } ^ { T } \left[ W ^ { k } E _ { v } ^ { ( l - 1 ) } \oplus W ^ { k } f ( E _ { u } ^ { ( l - 1 ) } , R _ { r } ) \right] \Big ) \Big ) \Big ) } { \sum _ { ( r ^ { \prime } , u ^ { \prime } ) \in \mathcal { N } _ { v } } \exp \Big ( \mathrm { L e a k y R e L U ~ } \Big ( \mathbf { a } ^ { T } \left[ W ^ { k } E _ { u } ^ { ( l - 1 ) } \oplus W ^ { k } f ( E _ { u ^ { \prime } } ^ { ( l - 1 ) } , R _ { r ^ { \prime } } ) \right] \Big ) \Big ) } } \end{array}
67
+ $$
68
+
69
+ where LayerNorm stands for layer normalization (Ba et al., 2016). $\oplus$ means concatenation and $K$ is the number of attention heads. $W ^ { k }$ is the model parameter and $R _ { r }$ is the embedding of relation $r$ . Note that the relation embeddings are shared across different layers. The function $f ( \cdot , \cdot ) : \mathbb { R } ^ { F } \times$ $\mathbb { R } ^ { F } \to \mathbb { R } ^ { F }$ merges a pair of entity and relation embeddings into one representation. Here, we set $f ( x , y ) = x + y$ inspired by TransE (Bordes et al., 2013). More complicated functions like MLP network can also be applied.
70
+
71
+ The initial entity embeddings $E ^ { ( 0 ) }$ and relation embeddings $R$ are generated from our language module, which will be introduced in Section 3.4. Then, the output entity embeddings from the last GAT layer are used as the final entity representations $E ^ { \mathrm { K M } }$ . Note that the knowledge graph can be very large, making the embedding update over all the entities in Equation (1) not tractable. Thus we follow the minibatch setting (Hamilton et al., 2017): given a set of input entities, we perform neighborhood sampling to generate their multi-hop neighbor sets and we compute representations only on the entities and relations that are necessary for the embedding update.
72
+
73
+ # 3.3 LANGUAGE MODULE
74
+
75
+ The goal of the language module (LM) is to model text data and learn context-aware representations. The language module can be any model for language understanding, e.g. BERT (Devlin et al., 2018). In this work, we use the pre-trained model RoBERTa-base (Liu et al., 2019b) as the language module.
76
+
77
+ # 3.4 SOLVING THE CYCLIC DEPENDENCY
78
+
79
+ In our framework, the knowledge and language modules mutually benefit each other: the language module LM outputs context-aware embedding to initialize the embeddings of entities and relations in the knowledge graph given the description text; the knowledge module (KM) outputs knowledgebased entity embeddings for the language module.
80
+
81
+ However, there exists a cyclic dependency which prevents computation and optimization in this design. To solve this problem, we propose a decomposed language module which includes two language models: $\mathrm { L M _ { 1 } }$ and $\mathrm { L M _ { 2 } }$ . We employ the first 6 layers of RoBERTa as $\mathrm { L M _ { 1 } }$ and the remaining 6 layers as $\mathrm { L M _ { 2 } }$ . The computation proceeds as follows:
82
+
83
+ 1. $\mathrm { L M _ { 1 } }$ operates on the input text $\mathbf { x }$ and generates contextual embeddings $Z$ .
84
+ 2. $\mathrm { L M _ { 1 } }$ generates initial entity and relation embeddings for KM given description text.
85
+ 3. KM produces its output entity embeddings to be combined with $Z$ and sent into $\mathrm { L M _ { 2 } }$ .
86
+ 4. $\mathrm { L M _ { 2 } }$ produces the final embeddings of $\mathbf { x }$ , which includes both contextual and knowledge
87
+ information.
88
+
89
+ In detail, in step 1, suppose the context $\mathbf { x }$ is embedded as $X ^ { e m b e d }$ . $\mathrm { L M _ { 1 } }$ takes $X ^ { e m b e d }$ as input and outputs hidden representations $Z = \operatorname { L M } _ { 1 } ( X ^ { e m b e d } )$ .
90
+
91
+ In step 2, suppose $\mathbf { x } ^ { e _ { j } }$ is the entity description text for entity $e _ { j }$ , and the corresponding mention is ${underline { m } } ^ { e _ { j } } = ( e _ { j } , s _ { j } ^ { e } , o _ { j } ^ { e } )$ . $\mathrm { L M _ { 1 } }$ takes the embedding of $\mathbf { x } ^ { e _ { j } }$ and produces the contextual embedding $Z ^ { e _ { j } }$ . Then, the average of embeddings at position $s _ { j } ^ { e }$ and $o _ { j } ^ { e }$ is used as the initial entity embedding of $e _ { j }$ , i.e. $E _ { j } ^ { ( 0 ) } = ( Z _ { s _ { j } ^ { e } } ^ { e _ { j } } + Z _ { o _ { j } ^ { e } } ^ { e _ { j } } ) / 2$ . The knowledge graph relation embeddings $R$ are generated in a similar way using its description text.
92
+
93
+ In step 3, KM computes the final entity embeddings $E ^ { \mathrm { K M } }$ , which is then combined with the output $Z$ from $\mathrm { L M _ { 1 } }$ . In detail, suppose the mentions in $\mathbf { x }$ are $\mathbf { m } = [ m _ { 1 } , \dots , m _ { M } ]$ . $Z$ and $E ^ { \mathrm { K M } }$ are combined at positions of mentions:
94
+
95
+ $$
96
+ Z _ { k } ^ { m e r g e } = \left\{ \begin{array} { c l } { { Z _ { k } + E _ { e _ { m _ { i } } } ^ { \mathrm { K M } } } } & { { \mathrm { i f } \exists i \mathrm { s . t . } s _ { m _ { i } } \le k \le o _ { m _ { i } } } } \\ { { Z _ { k } } } & { { \mathrm { o t h e r w i s e } } } \end{array} \right.
97
+ $$
98
+
99
+ where $E _ { e _ { m _ { i } } } ^ { \mathrm { K M } }$ is the output embedding of entity $e _ { m _ { i } }$ from KM. Then we apply layer normalization (Ba et al., 2016) on $Z ^ { m e r g e }$ : $Z ^ { \prime } = \mathrm { L a y e r N o r m } ( Z ^ { m e r g e } )$ . Finally, $Z ^ { \prime }$ is fed into $\mathrm { L M _ { 2 } }$ .
100
+
101
+ In step 4, $\mathrm { L M _ { 2 } }$ operates on the input $Z ^ { \prime }$ and obtains the final embeddings $Z ^ { \mathrm { L M } } = \mathrm { L M } _ { 2 } ( Z ^ { \prime } )$ . The four steps are marked by the symbol $\textcircled{8}$ in Figure 2 for better illustration.
102
+
103
+ # 3.5 ENTITY CONTEXT EMBEDDING MEMORY
104
+
105
+ Many knowledge graphs contain a large number of entities. Thus, even for one sentence, the number of entities plus their multi-hop neighbors can grow exponentially with the number of layers in the graph neural network. As a result, it’s very time-consuming for the language module to compute context embeddings based on the description text of all involved entities in a batch on the fly.
106
+
107
+ To solve this problem, we construct an entity context embedding memory, $E ^ { c o n t e x t }$ , to store the initial embeddings of all KG entities. Firstly, the language module pre-computes the context embeddings for all entities and places them into the memory. The knowledge module only needs to retrieve required embeddings from the memory instead of computing them, i.e. E(0) ← Econtext.
108
+
109
+ However, as embeddings in the memory are computed from the “old” (initial) language module while the token embeddings during training are computed from the updated language module, there will be an undesired discrepancy. Thus, we propose to update the whole embedding memory $E ^ { c o n t e x t }$ with the current language module every $T ( i )$ steps, where $i$ is the number of times that the memory has been updated (starting from 0). $T ( i )$ is set as follows:
110
+
111
+ $$
112
+ T ( i ) = \mathrm { m i n } ( I _ { i n i t } * a ^ { \lfloor i / r \rfloor } , I _ { m a x } )
113
+ $$
114
+
115
+ where $I _ { i n i t }$ is the initial number of steps before the first update and $a$ is the increasing ratio of updating intervals. $r$ is the number of repeated times of the current updating interval. $I _ { m a x }$ is the maximum number of steps between updates. $\lfloor \cdot \rfloor$ means the operation of rounding down. In our experiments, we set $I _ { i n i t } = 1 0 , a = 2 , r = 3 , I _ { m a x } = 5 0 0$ , and the corresponding sequence of $T$ is $[ 1 0 , 1 0 , 1 0 , 2 0 , 2 0 , 2 0 , 4 0 , 4 0 , 4 0 , . . . , 5 0 0 , 5 0 0 ]$ . Note that we choose $a > 1$ because the model parameters usually change less as training proceeds.
116
+
117
+ Moreover, we propose a momentum update to make $E ^ { c o n t e x t }$ evolve more smoothly. Suppose the newly calculated embedding memory by LM is $E _ { n e w } ^ { c o n t e x t }$ , then the updating rule is:
118
+
119
+ $$
120
+ E ^ { c o n t e x t } \gets m E ^ { c o n t e x t } + ( 1 - m ) E _ { n e w } ^ { c o n t e x t } ,
121
+ $$
122
+
123
+ where $m \in [ 0 , 1 )$ is a momentum coefficient which is set as 0.8 in experiment.
124
+
125
+ This memory design speeds up our model by about $1 5 \mathrm { x }$ during pre-training while keeping the effectiveness of entity context embeddings. For consideration of efficiency, we use relation embeddings only during fine-tuning.
126
+
127
+ # 3.6 PRE-TRAINING
128
+
129
+ During pre-training, both the knowledge module and language module are optimized based on several self-supervised learning tasks listed below. The examples of all the training tasks are shown in Figure 2.
130
+
131
+ At each pre-training step, we first sample a batch of root entities and perform random-walk sampling on each root entity. The sampled entities are fed into KM for the following two tasks.
132
+
133
+ Entity category prediction. The knowledge module is trained to predict the category label of entities based on the output entity embeddings $E ^ { \mathrm { K M } }$ . The loss function is cross-entropy for multiclass classification, denoted as $\mathcal { L } _ { c }$ .
134
+
135
+ Relation type prediction. KM is also trained to predict the relation type between a given entity pair based on $\bar { E } ^ { \bar { \mathsf { K M } } }$ . The loss function is cross-entropy for multi-class classification, denoted as $\mathcal { L } _ { r }$ .
136
+
137
+ Then, we uniformly sample a batch of text sequences and their entities for the following two tasks.
138
+
139
+ Masked token prediction. Similar to BERT, We randomly mask tokens in the sequence and predict the original tokens based on the output $Z ^ { \mathrm { L M } }$ of the language module. We denote the loss as $\scriptstyle { \mathcal { L } } _ { t }$ .
140
+
141
+ Masked entity prediction. The language module is also trained to predict the corresponding entity of a given mention. For the input text, we randomly remove $1 5 \%$ of the mentions $\mathbf { m }$ . Then for each removed mention $m _ { r } = ( e _ { r } , s _ { r } , o _ { r } )$ , the model predicts the masked entity $e _ { r }$ based on the mention’s embedding. In detail, it predicts the entity whose embedding in $E ^ { c o n t e x t }$ is closest to $q = g ( ( Z _ { s _ { r } } ^ { \mathrm { L M } } + Z _ { o _ { r } } ^ { \mathrm { L M } } ) / 2 )$ , where osed by $g ( x ) = \mathrm { G E L U } ( x W _ { 1 } ) W _ { 2 }$ is a transformation function. GELU is an016). Since the number of entities can be very large, we use $e _ { r }$ ’s neighbours and other randomly sampled entities as negative samples. The loss function $\mathcal { L } _ { e }$ is cross entropy based on the inner product between $q$ and each candidate entity’s embedding. Figure 2 shows an concrete example, where the mention “Earth” is not marked in the input text since it’s masked and the task is to link the mention “Earth” to entity “Q2: Earth”.
142
+
143
+ # 3.7 FINE-TUNING
144
+
145
+ During fine-tuning, our model supports using either the knowledge graph employed during pretraining or a novel custom knowledge graph with previously unseen entities2. If a custom KG is used, the entity context embedding memory is recomputed by the pre-trained language module using the new entity description text. In this work, we do not update the entity context memory during fine-tuning for consideration of efficiency. We also compute the relation context embedding memory using the pre-trained language model.
146
+
147
+ # 4 EXPERIMENT
148
+
149
+ # 4.1 BASIC SETTINGS
150
+
151
+ Data for Pre-training. We use the English Wikipedia as the text corpus, Wikidata (Vrandeciˇ c &´ Krotzsch, 2014) as the knowledge graph, and SLING (Ringgaard et al., 2017) to identify entity men- ¨ tions. For each entity, we use the first 64 consecutive tokens of its Wikipedia page as its description text and we filter out entities without a corresponding Wikipedia page. We also remove entities that
152
+
153
+ <table><tr><td>Model</td><td>5-way1-shot</td><td>5-way 5-shot</td><td>10-way 1-shot</td></tr><tr><td>PAIR (BERT)*</td><td>85.7</td><td>89.5</td><td>76.8</td></tr><tr><td>PAIR (RoBERTa)</td><td>86.4</td><td>90.3</td><td>77.3</td></tr><tr><td>PAIR (RoBERTa+GNN)</td><td>86.3</td><td>-</td><td>-</td></tr><tr><td>PAIR (RoBERTa+GNN+M)</td><td>86.9</td><td>■</td><td>-</td></tr><tr><td>PAIR (KnowBERT)</td><td>86.2</td><td>90.3</td><td>77.0</td></tr><tr><td>PAIR (JAKET)</td><td>87.4</td><td>92.1</td><td>78.9</td></tr></table>
154
+
155
+ Table 1: Accuracy results on the dev set of FewRel 1.0. $\star$ indicates the results are taken from Gao et al. (2019). PAIR is the framework proposed by Gao et al. (2019).
156
+
157
+ have fewer than 5 neighbors in the Wikidata KG and fewer than 5 mentions in the Wikipedia corpus. The final knowledge graph contains 3,657,658 entities, 799 relations and 20,113,978 triplets. We use the instance of relation to find the category of each entity. In total, 3,039,909 entities have category labels of 19,901 types. The text corpus contains about 4 billion tokens.
158
+
159
+ Implementation Details. We initialize the language module with the pre-trained RoBERTabase (Liu et al., 2019b) model. The knowledge module is initialized randomly. Our implementation is based on the HuggingFace framework (Wolf et al., 2019) and DGL (Wang et al., 2019a). For the knowledge module, we use a 2-layer graph neural network, which aggregates 2-hop neighbors. The number of sampled neighbors in each hop is 10. More details are presented in the Appendix.
160
+
161
+ Baselines. We compare our proposed model JAKET with the pre-trained RoBERTa-base (Liu et al., 2019b) and two variants of our model: RoBERTa $^ +$ GNN and RoBERTa+GNN+M. The two models have the same model structure as JAKET, but they are not pre-trained on our data. Moreover, the entity and relation context embedding memories of RoBERTa+GNN are randomly generated while the memories of RoBERT $\mathsf { \Omega } _ { \mathsf { l } + \mathsf { G N N + M } }$ are computed by RoBERTa.
162
+
163
+ # 4.2 DOWNSTREAM TASKS
164
+
165
+ Few-shot Relation Classification. Relation classification requires the model to predict the relation between two entities in text. Few-shot relation classification takes the $N$ -way $K$ -shot setting. Relations in the test set are not seen in the training set. For each query instance, $N$ relations with $K$ supporting examples for each relation are given. The model is required to classify the instance into one of the $N$ relations based on the $N \times K$ samples. In this paper we evaluate our model on FewRel (Han et al., 2018), which is a widely used benchmark dataset for few-shot relation classification, containing 100 relations and 70,000 instances.
166
+
167
+ We use the pre-trained knowledge graph for FewRel as it comes with entity mentions from Wikidata knowledge graph. To predict the relation label, we build a sequence classification layer on top of the output of LM. More specifically, we use the PAIR framework proposed by Gao et al. (2019), which pairs each query instance with all the supporting instances, concatenate each pair as one sequence, and send the concatenated sequence to our sequence classification model to get the score of the two instances expressing the same relation. We do not use relation embeddings in this task to avoid information leakage.
168
+
169
+ As shown in Table 1, our model achieves the best results in all three few-shot settings. Comparing the results between RoBERTa and RoBERTa $^ +$ GNN, we see that adding GNN with randomly generated entity features does not improve the performance. The difference between RoBERTa $+$ GNN+M and RoBERTa $^ +$ GNN demonstrates the importance of generating context embedding memory by the language module, while JAKET can further improve the performance by pre-training. We also compare with a strong knowledge-enhanced PLM KnowBERT (Peters et al., 2019), which is also pretrained on English Wikipedia and Wikidata KG. The results show that JAKET consistently outperform KnowBERT in different few-shot settings.
170
+
171
+ KGQA. The Question Answering over KG (KGQA) task is to answer natural language questions related to a knowledge graph. The answer to each question is an entity in the KG. This task requires an understanding over the question and reasoning over multiple entities and relations.
172
+
173
+ We use the vanilla version of the MetaQA (Zhang et al., 2017) dataset, which contains questions requiring multi-hop reasoning over a novel movie-domain knowledge graph. The KG contains $1 3 5 \mathrm { k }$ triplets, $4 3 \mathrm { k }$ entities and 9 relations. Each question is provided with one entity mention and the question is named as a $k$ -hop question if the answer entity is a $k$ -hop neighbor of the question entity. We define all the $k$ -hop neighbor entities of the question entity as the candidate entities for the question. We also consider a more realistic setting where we simulate an incomplete KG by randomly dropping a triplet with a probability $5 0 \%$ . This setting is called $K G \ – 5 O \%$ , compared with the full KG setting KG-Full. For each entity, we randomly sample one question containing it as the entity’s description context. We manually write the description for each relation since the number of relations is very small. We use the output embedding of [CLS] token from LM as the question embedding, and then find the entity with the closest context embedding.
174
+
175
+ Table 2: Results on the MetaQA dataset over 1- hop and 2-hop questions under KG-Full and $K G .$ - $50 \%$ settings. $\mathbf { R o B + G + M }$ is the abbreviation for the baseline model RoBERT $\mathbf { \pi } _ { 1 + \mathrm { G N N } + \mathrm { M } }$ .
176
+
177
+ <table><tr><td rowspan="2">Model</td><td colspan="2">KG-Full</td><td colspan="2">KG-50%</td></tr><tr><td>1-hop</td><td>2-hop</td><td>1-hop</td><td>2-hop</td></tr><tr><td>RoBERTa</td><td>90.2</td><td>70.8</td><td>61.5</td><td>39.3</td></tr><tr><td>RoB+G+M</td><td>91.4</td><td>72.6</td><td>62.5</td><td>40.8</td></tr><tr><td> JAKET</td><td>93.9</td><td>73.2</td><td>63.1</td><td>41.9</td></tr></table>
178
+
179
+ Table 3: Results on the entity classification task over an unseen Wikidata knowledge graph. $\mathbf { R o B + G + M }$ is the abbreviation for the baseline model RoBERT $\mathrm { _ { 1 + G N N + M } }$ .
180
+
181
+ <table><tr><td>Model</td><td>100%</td><td>20%</td><td>5%</td></tr><tr><td>GNN</td><td>48.2</td><td>-</td><td>-</td></tr><tr><td>RoBERTa</td><td>33.4</td><td>1</td><td>1</td></tr><tr><td>RoB+G+M</td><td>79.1</td><td>66.7</td><td>53.5</td></tr><tr><td>JAKET</td><td>81.6</td><td>70.6</td><td>58.4</td></tr></table>
182
+
183
+ As shown in Table 2, RoBERT $\mathbf { \Lambda } _ { 1 + \mathbf { G N N + M } }$ outperforms RoBERTa, demonstrating the effectiveness of $_ { \mathrm { K M + L M } }$ structure. JAKET further improves the accuracy by $0 . 6 \%$ to $2 . 5 \%$ under both KG settings, showing the benefits of our proposed joint pre-training.3
184
+
185
+ Entity Classification. To further evaluate our model’s capability to reason over unseen knowledge graphs, we design an entity classification task. Here, the model is given a portion of the Wikidata knowledge graph unseen during pre-training, denoted as $\kappa \mathcal { G } ^ { \prime }$ . It needs to predict the category labels of these novel entities. The entity context embeddings are obtained in the same way as in pretraining. The relation context embeddings are generated by its surface text. The number of entities and relations in the $\kappa \mathcal { G } ^ { \prime }$ are 23,046 and 316 respectively. The number of triplets is 38,060. Among them, 16,529 entities have 1,291 distinct category labels. We conduct experiments under a semisupervised transductive setting by splitting the entities in $\kappa \mathcal { G } ^ { \prime }$ into train/dev/test splits of $20 \%$ , $20 \%$ and $60 \%$ . To test the robustness of models to the size of training data, we evaluate models when using $20 \%$ and $5 \%$ of the original training set.
186
+
187
+ In this task, RoBERTa takes the entity description text as input for label prediction while neglecting the structure information of KG. JAKET and RoBERTa $+ \mathrm { G N N + M }$ make predictions based on the entity representation output from the knowledge module. We also include GNN as a baseline, which uses the same GAT-based structure as our knowledge module, but with randomly initialized model parameters and context embedding memory. GNN then employs the final entity representations for entity category prediction.
188
+
189
+ As shown in Table 3, our model achieves the best performance under all the settings. The performance of GNN or RoBERTa alone is significantly lower than JAKET and RoBERTa $^ +$ GNN+M, which demonstrates the importance of integrating both context and knowledge information using our proposed framework. Also, the gap between JAKET and RoBERTa $+ \mathrm { G N N + M }$ increases when there’s less training data, showing that the joint pre-training can reduce the model’s dependence on downstream training data.
190
+
191
+ # 5 CONCLUSION
192
+
193
+ This paper presents a novel framework, JAKET, to jointly pre-train models for knowledge graph and language understanding. Under our framework, the knowledge module and language module both provide essential information for each other. After pre-training, JAKET can quickly adapt to unseen knowledge graphs in new domains. Moreover, we design the entity context embedding memory which speeds up the pre-training by 15x. Experiments show that JAKET outperforms baseline methods in several knowledge-aware NLU tasks: few-shot relation classification, KGQA and entity classification. In the future, we plan to extend our framework to natural language generation tasks.
194
+
195
+ # REFERENCES
196
+
197
+ Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
198
+
199
+ Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In Advances in neural information processing systems, pp. 2787–2795, 2013.
200
+
201
+ Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020.
202
+
203
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
204
+
205
+ Ming Ding, Chang Zhou, Qibin Chen, Hongxia Yang, and Jie Tang. Cognitive graph for multi-hop reading comprehension at scale. arXiv preprint arXiv:1905.05460, 2019.
206
+
207
+ Thibault Fevry, Livio Baldini Soares, Nicholas FitzGerald, Eunsol Choi, and Tom Kwiatkowski. En-´ tities as experts: Sparse memory access with entity supervision. arXiv preprint arXiv:2004.07202, 2020.
208
+
209
+ Tianyu Gao, Xu Han, Hao Zhu, Zhiyuan Liu, Peng Li, Maosong Sun, and Jie Zhou. Fewrel 2.0: Towards more challenging few-shot relation classification. arXiv preprint arXiv:1910.07124, 2019.
210
+
211
+ Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909, 2020.
212
+
213
+ Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in neural information processing systems, pp. 1024–1034, 2017.
214
+
215
+ Xu Han, Hao Zhu, Pengfei Yu, Ziyun Wang, Yuan Yao, Zhiyuan Liu, and Maosong Sun. Fewrel: A large-scale supervised few-shot relation classification dataset with state-of-the-art evaluation. arXiv preprint arXiv:1810.10147, 2018.
216
+
217
+ Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016.
218
+
219
+ Yoav Levine, Barak Lenz, Or Dagan, Dan Padnos, Or Sharir, Shai Shalev-Shwartz, Amnon Shashua, and Yoav Shoham. Sensebert: Driving some sense into bert. arXiv preprint arXiv:1908.05646, 2019.
220
+
221
+ Nelson F Liu, Matt Gardner, Yonatan Belinkov, Matthew E Peters, and Noah A Smith. Linguistic knowledge and transferability of contextual representations. arXiv preprint arXiv:1903.08855, 2019a.
222
+
223
+ Weijie Liu, Peng Zhou, Zhe Zhao, Zhiruo Wang, Qi Ju, Haotang Deng, and Ping Wang. K-bert: Enabling language representation with knowledge graph. In AAAI, pp. 2901–2908, 2020.
224
+
225
+ Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019b.
226
+
227
+ Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
228
+
229
+ Shangwen Lv, Daya Guo, Jingjing Xu, Duyu Tang, Nan Duan, Ming Gong, Linjun Shou, Daxin Jiang, Guihong Cao, and Songlin Hu. Graph-based reasoning over heterogeneous external knowledge for commonsense question answering. In AAAI, pp. 8449–8456, 2020.
230
+
231
+ Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018.
232
+
233
+ Matthew E. Peters, Mark Neumann, Robert L Logan, Roy Schwartz, Vidur Joshi, Sameer Singh, and Noah A. Smith. Knowledge enhanced contextual word representations. In EMNLP, 2019.
234
+
235
+ Nina Poerner, Ulli Waltinger, and Hinrich Schutze. Bert is not a knowledge base (yet): Factual ¨ knowledge vs. name-based reasoning in unsupervised qa. arXiv preprint arXiv:1911.03681, 2019.
236
+
237
+ Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training, 2018.
238
+
239
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9, 2019.
240
+
241
+ Michael Ringgaard, Rahul Gupta, and Fernando CN Pereira. Sling: A framework for frame semantic parsing. arXiv preprint arXiv:1710.07032, 2017.
242
+
243
+ Tao Shen, Yi Mao, Pengcheng He, Guodong Long, Adam Trischler, and Weizhu Chen. Exploiting structured knowledge in text via graph-guided representation learning. arXiv preprint arXiv:2004.14224, 2020.
244
+
245
+ Livio Baldini Soares, Nicholas FitzGerald, Jeffrey Ling, and Tom Kwiatkowski. Matching the blanks: Distributional similarity for relation learning. arXiv preprint arXiv:1906.03158, 2019.
246
+
247
+ Haitian Sun, Bhuwan Dhingra, Manzil Zaheer, Kathryn Mazaitis, Ruslan Salakhutdinov, and William W Cohen. Open domain question answering using early fusion of knowledge bases and text. arXiv preprint arXiv:1809.00782, 2018.
248
+
249
+ Haitian Sun, Tania Bedrax-Weiss, and William W Cohen. Pullnet: Open domain question answering with iterative retrieval on knowledge bases and text. arXiv preprint arXiv:1904.09537, 2019a.
250
+
251
+ Yu Sun, Shuohuan Wang, Yukun Li, Shikun Feng, Xuyi Chen, Han Zhang, Xin Tian, Danxiang Zhu, Hao Tian, and Hua Wu. Ernie: Enhanced representation through knowledge integration. arXiv preprint arXiv:1904.09223, 2019b.
252
+
253
+ Alon Talmor, Yanai Elazar, Yoav Goldberg, and Jonathan Berant. olmpics–on what language model pre-training captures. arXiv preprint arXiv:1912.13283, 2019.
254
+
255
+ Shikhar Vashishth, Soumya Sanyal, Vikram Nitin, and Partha Talukdar. Composition-based multirelational graph convolutional networks. arXiv preprint arXiv:1911.03082, 2019.
256
+
257
+ Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
258
+
259
+ Pat Verga, Haitian Sun, Livio Baldini Soares, and William W Cohen. Facts as experts: Adaptable and interpretable neural memory over symbolic knowledge. arXiv preprint arXiv:2007.00849, 2020.
260
+
261
+ Denny Vrandeciˇ c and Markus Kr ´ otzsch. Wikidata: a free collaborative knowledgebase. ¨ Communications of the ACM, 57(10):78–85, 2014.
262
+
263
+ Minjie Wang, Lingfan Yu, Da Zheng, Quan Gan, Yu Gai, Zihao Ye, Mufei Li, Jinjing Zhou, Qi Huang, Chao Ma, et al. Deep graph library: Towards efficient and scalable deep learning on graphs. arXiv preprint arXiv:1909.01315, 2019a.
264
+
265
+ Xiaozhi Wang, Tianyu Gao, Zhaocheng Zhu, Zhiyuan Liu, Juanzi Li, and Jian Tang. Kepler: A unified model for knowledge embedding and pre-trained language representation. arXiv preprint arXiv:1911.06136, 2019b.
266
+
267
+ Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick´ von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Huggingface’s transformers: Stateof-the-art natural language processing. ArXiv, abs/1910.03771, 2019.
268
+
269
+ Wenhan Xiong, Jingfei Du, William Yang Wang, and Veselin Stoyanov. Pretrained encyclopedia: Weakly supervised knowledge-pretrained language model. arXiv preprint arXiv:1912.09637, 2019.
270
+
271
+ Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. In Advances in neural information processing systems, pp. 5753–5763, 2019.
272
+
273
+ Yuyu Zhang, Hanjun Dai, Zornitsa Kozareva, Alexander J Smola, and Le Song. Variational reasoning for question answering with knowledge graph. arXiv preprint arXiv:1709.04071, 2017.
274
+
275
+ Zhengyan Zhang, Xu Han, Zhiyuan Liu, Xin Jiang, Maosong Sun, and Qun Liu. Ernie: Enhanced language representation with informative entities. arXiv preprint arXiv:1905.07129, 2019.
276
+
277
+ # A APPENDIX
278
+
279
+ # A.1 IMPLEMENTATION DETAILS
280
+
281
+ The dimension of hidden states in the knowledge module is 768, the same as RoBERTa-base, and the number of attention heads is 8. During pre-training, the batch size and length of text sequences are 1024 and 512 respectively. The batch size of KG entities is 16,384. The number of training epochs is 8. JAKET is optimized by AdamW (Loshchilov & Hutter, 2017) using the following parameters: $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } ~ = ~ 0 . 9 9 9$ , $\epsilon = 1 \mathrm { e } { - } 8$ , and weight decay of 0.01. The learning rate of the language module is warmed up over the first 3,000 steps to a peak value of 1e-5, and then linearly decayed. The learning rate of our knowledge module starts from 1e-4 and then linearly decayed.
282
+
283
+ # A.2 COMPUTATION ANALYSIS
284
+
285
+ The computation of the KG module is much less than the LM module. For BERT-base or RoBERTabase, the number of inference computation flops (#flops) over each sequence (length 128) is over 22 billion [1, 2]. Here, we theoretically compute the number of flops of the KG module as follows: The sequence length $N = 1 2 8$ , and hidden dimension $H = 7 6 8$ . The number of entities in a sequence is usually less than $N / 5$ . The number of sampled neighbors per entity $r = 1 0$ . And the number of layers of the GNN based KG module $L = 2$ . It follows that the #flops of KG module is about $N / 5 \stackrel { \bullet } { \times } r ^ { L } \times 2 H ^ { 2 } \approx 3$ billion, less than $1 / 7$ of LM computation. If we set $r = 5$ , the #flops can be further reduced to about $1 / 3 0$ of LM computation.
286
+
287
+ During pre-training, another computation overhead is entity context embedding memory update (Section 3.5): Firstly, the number of entities is about 3 million and the update step interval is 500. Thus for each step on average the model processes the description text of $3 \mathrm { e } 6 / 5 0 0 = 6 \mathrm { e } 3$ entities. Secondly, the length of description text is 64, much smaller than the length of input text 512, and we only use LM1 (the first half of LM module) for entity context embedding generation, which saves half of the computation time compared to using the whole LM module. Thirdly, the embedding update only requires forward propagation, costing only half of computation compared to training process which requires both forward and backward propagation. Thus, generating context embedding of 6k entities consumes about the same number of flops as training $6 0 \bar { 0 } 0 0 \times 6 4 / ( 5 1 2 \times 2 \times 2 ) \approx 2 0 \bar { 0 }$ input texts, much smaller than the batch size 1024. In short, the entity context embedding memory update only costs $2 0 0 / 1 0 2 4 \approx 1 / 5$ additional computation. Note this computation overhead only exists during pre-training, since entity embedding memory is not updated when fine-tuning.
parse/train/SOVSJZ9PTO7/SOVSJZ9PTO7_content_list.json ADDED
@@ -0,0 +1,1569 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "JAKET: JOINT PRE-TRAINING OF KNOWLEDGE GRAPH AND LANGUAGE UNDERSTANDING ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 823,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous authors Paper under double-blind review ",
17
+ "bbox": [
18
+ 183,
19
+ 171,
20
+ 398,
21
+ 198
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 234,
32
+ 544,
33
+ 251
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Knowledge graphs (KGs) contain rich information about world knowledge, entities, and relations. Thus, they can be great supplements to existing pre-trained language models. However, it remains a challenge to efficiently integrate information from KG into language modeling. And the understanding of a knowledge graph requires related context. We propose a novel joint pre-training framework, JAKET, to model both the knowledge graph and language. The knowledge module and language module provide essential information to mutually assist each other: the knowledge module produces embeddings for entities in text while the language module generates context-aware initial embeddings for entities and relations in the graph. Our design enables the pre-trained model to easily adapt to unseen knowledge graphs in new domains. Experimental results on several knowledge-aware NLP tasks show that our proposed framework achieves superior performance by effectively leveraging knowledge in language understanding. ",
40
+ "bbox": [
41
+ 233,
42
+ 265,
43
+ 764,
44
+ 444
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 468,
55
+ 336,
56
+ 484
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Pre-trained language models (PLM) leverage large-scale unlabeled corpora to conduct selfsupervised training. They have achieved remarkable performance in various NLP tasks, exemplified by BERT (Devlin et al., 2018), RoBERTa (Liu et al., 2019b), XLNet (Yang et al., 2019), and GPT series (Radford et al., 2018; 2019; Brown et al., 2020). It has been shown that PLMs can effectively characterize linguistic patterns in text and generate high-quality context-aware representations (Liu et al., 2019a). However, these models struggle to grasp world knowledge about entities and relations (Poerner et al., 2019; Talmor et al., 2019), which are very important in language understanding. ",
63
+ "bbox": [
64
+ 174,
65
+ 498,
66
+ 825,
67
+ 597
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Knowledge graphs (KGs) represent entities and relations in a structural way. They can also solve the sparsity problem in text modeling. For instance, a language model may require tens of instances of the phrase “labrador is a kind of dog” in its training corpus before it implicitly learns this fact. In comparison, a knowledge graph can use two entity nodes “labrador”, “dog” and a relation edge “is a” between these nodes to precisely represent this fact. ",
74
+ "bbox": [
75
+ 174,
76
+ 603,
77
+ 825,
78
+ 672
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Recently, some efforts have been made to integrate knowledge graphs into PLM. Most of them combine the token representations in PLM with representations of aligned KG entities. The entity embeddings in those methods are either pre-computed based on an external source by a separate model (Zhang et al., 2019; Peters et al., 2019), which may not be easily aligned with the language representation space, or directly learned as model parameters (Fevry et al., 2020; Verga et al., 2020), ´ which often have an over-parameterization issue due to the large number of entities. Moreover, all the previous works share a common challenge: when the pre-trained model is fine-tuned in a new domain with a previously unseen knowledge graph, it struggles to adapt to the new entities, relations and structure. ",
85
+ "bbox": [
86
+ 174,
87
+ 680,
88
+ 825,
89
+ 805
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Therefore, we propose JAKET, a Joint pre-trAining framework for KnowledgE graph and Text. Our framework contains a knowledge module and a language module, which mutually assist each other by providing required information to achieve more effective semantic analysis. The knowledge module leverages a graph attention network (Velickovi ˇ c et al., 2017) to provide structure-aware ´ entity embeddings for language modeling. And the language module produces contextual representations as initial embeddings for KG entities and relations given their descriptive text. Thus, in both modules, content understanding is based on related knowledge and rich context. On one hand, the joint pre-training effectively projects entities/relations and text into a shared semantic latent space, which eases the semantic matching between them. On the other hand, as the knowledge module produces representations from descriptive text, it solves the over-parameterization issue since entity embeddings are no longer part of the model’s parameters. ",
96
+ "bbox": [
97
+ 174,
98
+ 811,
99
+ 823,
100
+ 924
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "image",
106
+ "img_path": "images/d75ec8d15bb5fcf1057623901e30bba7e571be215ebe614dc8d2a3f56ad143d4.jpg",
107
+ "image_caption": [
108
+ "Figure 1: A simple illustration on the novelty of our proposed model JAKET. "
109
+ ],
110
+ "image_footnote": [],
111
+ "bbox": [
112
+ 232,
113
+ 107,
114
+ 758,
115
+ 238
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "",
122
+ "bbox": [
123
+ 174,
124
+ 295,
125
+ 823,
126
+ 337
127
+ ],
128
+ "page_idx": 1
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "In order to solve the cyclic dependency between the two modules, we propose a novel two-step language module $\\mathrm { L M _ { 1 } }$ and $\\mathrm { L M _ { 2 } }$ , respectively. $\\mathrm { L M _ { 1 } }$ provides embeddings for both $\\mathrm { L M _ { 2 } }$ and KG. The entity embeddings from KG are also fed into $\\mathrm { L M _ { 2 } }$ , which produces the final representation. $\\mathrm { L M _ { 1 } }$ and $\\mathrm { L M _ { 2 } }$ can be easily established as the first several transformer layers and the rest layers of a pre-trained language model such as BERT and RoBERTa. Furthermore, we design an entity context embedding memory with periodic update which speeds up the pre-training by $1 5 \\mathrm { x }$ . ",
133
+ "bbox": [
134
+ 174,
135
+ 344,
136
+ 825,
137
+ 428
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "The pre-training tasks are all self-supervised, including entity category classification and relation type prediction for the knowledge module, and masked token prediction and masked entity prediction for the language module. ",
144
+ "bbox": [
145
+ 174,
146
+ 435,
147
+ 823,
148
+ 477
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "A great benefit of our framework is that it can easily adapt to unseen knowledge graphs in the finetuning phase. As the initial embeddings of entities and relations come from their descriptive text, JAKET is not confined to any fixed KG. With the learned ability to integrate structural information during pre-training, the framework is extensible to novel knowledge graphs with previously unseen entities and relations, as illustrated in Figure 1. ",
155
+ "bbox": [
156
+ 174,
157
+ 484,
158
+ 823,
159
+ 554
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "We conduct empirical studies on several knowledge-aware natural language understanding (NLU) tasks, including few-shot relation classification, question answering and entity classification. The results show that JAKET achieves the best performance compared with strong baseline methods on all the tasks, including those with a previously unseen knowledge graph. ",
166
+ "bbox": [
167
+ 176,
168
+ 560,
169
+ 825,
170
+ 617
171
+ ],
172
+ "page_idx": 1
173
+ },
174
+ {
175
+ "type": "text",
176
+ "text": "2 RELATED WORK ",
177
+ "text_level": 1,
178
+ "bbox": [
179
+ 176,
180
+ 635,
181
+ 344,
182
+ 651
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "Pre-trained language models have been shown to be very effective in various NLP tasks, including ELMo (Peters et al., 2018), GPT (Radford et al., 2018), BERT (Devlin et al., 2018), RoBERTa (Liu et al., 2019b) and XLNet (Yang et al., 2019). Built upon large-scale corpora, these pretrained models learn effective representations for various semantic structures and linguistic relationships. They are trained on self-supervised tasks like masked language modeling and next sentence prediction. ",
189
+ "bbox": [
190
+ 174,
191
+ 672,
192
+ 825,
193
+ 742
194
+ ],
195
+ "page_idx": 1
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "Recently, a lot of efforts have been made on investigating how to integrate knowledge into PLMs (Levine et al., 2019; Soares et al., 2019; Liu et al., 2020; Guu et al., 2020). These approaches can be grouped into two categories: ",
200
+ "bbox": [
201
+ 174,
202
+ 750,
203
+ 825,
204
+ 791
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "1. Explicitly injecting entity representation into the language model, where the representations are either pre-computed from external sources (Zhang et al., 2019; Peters et al., 2019) or directly learned as model parameters (Fevry et al., 2020; Verga et al., 2020). For example, ERNIE (THU) (Zhang ´ et al., 2019) pre-trains the entity embeddings on a knowledge graph using TransE (Bordes et al., 2013), while EAE (Fevry et al., 2020) learns the representation from pre-training objectives with ´ all the other model parameters. K-BERT (Liu et al., 2020) represents the entities by the embeddings of surface form tokens (i.e. entity names), which contains much less semantic information compared with description text. Moreover, it only injects KG during fine-tuning phase instead of joint-pretraining KG and text. ",
211
+ "bbox": [
212
+ 173,
213
+ 797,
214
+ 825,
215
+ 924
216
+ ],
217
+ "page_idx": 1
218
+ },
219
+ {
220
+ "type": "image",
221
+ "img_path": "images/4c1b0dc1b98394928e923da03630cc0b2655eb6e5246fca863a80c2278321057.jpg",
222
+ "image_caption": [
223
+ "Figure 2: A demonstration for the structure of JAKET, where the language module is on the left side marked green while the knowledge module is on the right side marked blue. Symbol $\\textcircled{8}$ indicates the steps to compute context representations introduced in Section 3.4. “QX”, “PX” and $\\mathbf { \\vec { \\tau } } ^ { 6 } \\mathbf { C } \\mathbf { X } ^ { \\mathbf { \\vec { \\tau } } }$ are the indices for entities, relations and categories in KG respectively. Entity mentions in text are underlined and italicized such as Sun. "
224
+ ],
225
+ "image_footnote": [],
226
+ "bbox": [
227
+ 181,
228
+ 101,
229
+ 820,
230
+ 309
231
+ ],
232
+ "page_idx": 2
233
+ },
234
+ {
235
+ "type": "text",
236
+ "text": "2. Implicitly modeling knowledge information, including entity-level masked language modeling (Sun et al., 2019b; Shen et al., 2020), entity-based replacement prediction (Xiong et al., 2019) and knowledge embedding loss as regularization (Wang et al., 2019b). For example, besides tokenlevel masked language modeling, ERNIE (Baidu) (Sun et al., 2019b) uses phrase-level and entitylevel masking to predict all the masked slots. KEPLER (Wang et al., 2019b) calculates entity embeddings using a pre-trained language model based on the description text, which is similar to our work. However, they use the entity embeddings for the knowledge graph completion task instead of injecting them into the language model. ",
237
+ "bbox": [
238
+ 173,
239
+ 406,
240
+ 825,
241
+ 518
242
+ ],
243
+ "page_idx": 2
244
+ },
245
+ {
246
+ "type": "text",
247
+ "text": "Some works (Ding et al., 2019; Lv et al., 2020) investigated the combination of GNN and PLM. For example, Lv et al. (2020) uses XLNet to generate initial node representation based on node context and feeds them into a GNN. However, these approaches do not integrate knowledge into language modeling, and they are designed for specific NLP tasks such as reading comprehension or commonsense reasoning. In comparison, we jointly pre-train both the knowledge graph representation and language modeling and target for general knowledge-aware NLU tasks. ",
248
+ "bbox": [
249
+ 174,
250
+ 525,
251
+ 825,
252
+ 609
253
+ ],
254
+ "page_idx": 2
255
+ },
256
+ {
257
+ "type": "text",
258
+ "text": "3 METHOD ",
259
+ "text_level": 1,
260
+ "bbox": [
261
+ 176,
262
+ 619,
263
+ 282,
264
+ 636
265
+ ],
266
+ "page_idx": 2
267
+ },
268
+ {
269
+ "type": "text",
270
+ "text": "In this section, we introduce the JAKET framework of joint pre-training knowledge graph and language understanding. We begin by defining the mathematical notations, and then present our model architecture with the knowledge module and language module. Finally, we introduce how to pretrain our model and fine-tune it for downstream tasks. The framework is illustrated in Figure 2. ",
271
+ "bbox": [
272
+ 174,
273
+ 651,
274
+ 825,
275
+ 708
276
+ ],
277
+ "page_idx": 2
278
+ },
279
+ {
280
+ "type": "text",
281
+ "text": "3.1 DEFINITION ",
282
+ "text_level": 1,
283
+ "bbox": [
284
+ 174,
285
+ 727,
286
+ 299,
287
+ 741
288
+ ],
289
+ "page_idx": 2
290
+ },
291
+ {
292
+ "type": "text",
293
+ "text": "A knowledge graph is denoted by $\\mathcal { K } \\mathcal { G } = ( \\mathcal { E } , \\mathcal { R } , \\mathcal { T } )$ , where $\\mathcal { E } = \\{ e _ { 1 } \\ldots e _ { N } \\}$ is the set of entities and $\\mathcal { R } = \\{ r _ { 1 } . . . r _ { P } \\}$ is the set of relations. $\\mathcal { T } = \\{ ( e _ { t _ { i } ^ { 1 } } , r _ { t _ { i } ^ { 2 } } , e _ { t _ { i } ^ { 3 } } ) | 1 \\leq i \\leq T , e _ { t _ { i } ^ { 1 } } , e _ { t _ { i } ^ { 3 } } \\in \\mathcal { E } , r _ { t _ { i } ^ { 2 } } \\in \\mathcal { R } \\}$ stands for the set of head-relation-tail triplets. $N _ { v } = \\{ ( r , u ) | ( v , r , u ) \\in \\mathcal { T } \\}$ represents the set of neighboring relations and entities of an entity $v$ . ",
294
+ "bbox": [
295
+ 174,
296
+ 752,
297
+ 825,
298
+ 811
299
+ ],
300
+ "page_idx": 2
301
+ },
302
+ {
303
+ "type": "text",
304
+ "text": "We define $\\nu = \\{ [ \\mathrm { M A S K } ]$ , [CLS], [EOS], $w _ { 1 } \\ldots . w _ { V } \\}$ as a vocabulary of tokens and the contextual text $\\mathbf { x } = [ x _ { 1 } , x _ { 2 } , \\dots , x _ { L } ]$ as a sequence of tokens where $x _ { i } \\in \\mathcal V$ . In the vocabulary, [MASK] is the special token for masked language modeling (Devlin et al., 2018) and [CLS], [EOS] are the special tokens indicating the beginning and end of the sequence. We define $F$ as the dimension of token embeddings, which is equal to the dimension of entity/relation embeddings from the KG. ",
305
+ "bbox": [
306
+ 174,
307
+ 818,
308
+ 825,
309
+ 888
310
+ ],
311
+ "page_idx": 2
312
+ },
313
+ {
314
+ "type": "text",
315
+ "text": "The text $\\mathbf { x }$ has a list of entity mentions $\\textbf { m } = \\ [ m _ { 1 } , \\dots , m _ { M } ]$ , where each mention $\\begin{array} { r l } { m _ { i } } & { { } = } \\end{array}$ $( e _ { m _ { i } } , s _ { m _ { i } } , o _ { m _ { i } } )$ : $e _ { m _ { i } }$ is the corresponding entity and $s _ { m _ { i } } , o _ { m _ { i } }$ are the start and end index of this mention in the context. In other words, $[ x _ { s _ { m _ { i } } } , \\ldots , x _ { o _ { m _ { i } } } ]$ is linked with entity ${ e _ { m _ { i } } } ^ { 1 }$ . We assume the span of mentions are disjoint for a given text sequence. ",
316
+ "bbox": [
317
+ 173,
318
+ 895,
319
+ 825,
320
+ 924
321
+ ],
322
+ "page_idx": 2
323
+ },
324
+ {
325
+ "type": "text",
326
+ "text": "",
327
+ "bbox": [
328
+ 173,
329
+ 103,
330
+ 823,
331
+ 132
332
+ ],
333
+ "page_idx": 3
334
+ },
335
+ {
336
+ "type": "text",
337
+ "text": "As entities in the knowledge graph are represented by nodes without context, we use entity description text to describe the concept and meaning of entities. For each entity $e _ { i }$ , its description text $\\mathbf { x } ^ { e _ { i } }$ describes this entity. The mention of $e _ { i }$ in $\\mathbf { x } ^ { e _ { i } }$ is denoted as $m ^ { e _ { i } } = ( e _ { i } , s _ { i } ^ { e } , o _ { i } ^ { e } )$ , similarly defined as above. For instance, the description text for the entity “sun” can be “[CLS] The Sun is the star at the center of the Solar System [EOS]”. Then the mention is $m ^ { S u n } = ( S u n , 3 , 3 )$ . If there are multiple mentions of $e _ { i }$ in its description text, we choose the first one. If there’s no mention of $e _ { i }$ in its description text, we set $s _ { i } ^ { e } = o _ { i } ^ { e } = 1$ . Similarly, we define relation description text as the text that can describe each relation. ",
338
+ "bbox": [
339
+ 174,
340
+ 138,
341
+ 825,
342
+ 251
343
+ ],
344
+ "page_idx": 3
345
+ },
346
+ {
347
+ "type": "text",
348
+ "text": "3.2 KNOWLEDGE MODULE ",
349
+ "text_level": 1,
350
+ "bbox": [
351
+ 174,
352
+ 267,
353
+ 375,
354
+ 281
355
+ ],
356
+ "page_idx": 3
357
+ },
358
+ {
359
+ "type": "text",
360
+ "text": "The goal of the knowledge module (KM) is to model the knowledge graph to generate knowledgebased entity representations. ",
361
+ "bbox": [
362
+ 173,
363
+ 292,
364
+ 821,
365
+ 321
366
+ ],
367
+ "page_idx": 3
368
+ },
369
+ {
370
+ "type": "text",
371
+ "text": "To compute entity node embeddings, we employ the graph attention network (GAT) (Velickovi ˇ c´ et al., 2017), which uses the self-attention mechanism to specify different weights for different neighboring nodes. However, the vanilla GAT is designed for homogeneous graphs with singlerelation edges. To leverage the multi-relational information, we adopt the idea of composition operator (Vashishth et al., 2019) to compose entity embeddings and relation embeddings. In detail, in the $l$ -th layer of LM, we update the embedding $\\overline { { E _ { v } ^ { ( l ) } } }$ of entity $v$ as follows: ",
372
+ "bbox": [
373
+ 174,
374
+ 327,
375
+ 825,
376
+ 410
377
+ ],
378
+ "page_idx": 3
379
+ },
380
+ {
381
+ "type": "equation",
382
+ "img_path": "images/0164d7967fae26f90ff7521f2e93320a251dcfc9d67b9ca6abd2673b02a4d1ec.jpg",
383
+ "text": "$$\n\\begin{array} { r l } & { E _ { v } ^ { ( l ) } = \\mathrm { L a y e r N o r m } \\left( \\displaystyle \\bigoplus _ { k = 1 } ^ { K } \\sigma \\left( \\sum _ { ( r , u ) \\in \\mathcal { N } _ { v } } \\alpha _ { v , r , u } ^ { k } W ^ { k } f ( E _ { u } ^ { ( l - 1 ) } , R _ { r } ) \\right) + E _ { v } ^ { ( l - 1 ) } \\right) } \\\\ & { \\alpha _ { v , r , u } ^ { k } = \\frac { \\displaystyle \\exp \\Big ( \\mathrm { L e a k y R e L U ~ } \\Big ( \\mathbf { a } ^ { T } \\left[ W ^ { k } E _ { v } ^ { ( l - 1 ) } \\oplus W ^ { k } f ( E _ { u } ^ { ( l - 1 ) } , R _ { r } ) \\right] \\Big ) \\Big ) \\Big ) } { \\sum _ { ( r ^ { \\prime } , u ^ { \\prime } ) \\in \\mathcal { N } _ { v } } \\exp \\Big ( \\mathrm { L e a k y R e L U ~ } \\Big ( \\mathbf { a } ^ { T } \\left[ W ^ { k } E _ { u } ^ { ( l - 1 ) } \\oplus W ^ { k } f ( E _ { u ^ { \\prime } } ^ { ( l - 1 ) } , R _ { r ^ { \\prime } } ) \\right] \\Big ) \\Big ) } } \\end{array}\n$$",
384
+ "text_format": "latex",
385
+ "bbox": [
386
+ 238,
387
+ 414,
388
+ 759,
389
+ 510
390
+ ],
391
+ "page_idx": 3
392
+ },
393
+ {
394
+ "type": "text",
395
+ "text": "where LayerNorm stands for layer normalization (Ba et al., 2016). $\\oplus$ means concatenation and $K$ is the number of attention heads. $W ^ { k }$ is the model parameter and $R _ { r }$ is the embedding of relation $r$ . Note that the relation embeddings are shared across different layers. The function $f ( \\cdot , \\cdot ) : \\mathbb { R } ^ { F } \\times$ $\\mathbb { R } ^ { F } \\to \\mathbb { R } ^ { F }$ merges a pair of entity and relation embeddings into one representation. Here, we set $f ( x , y ) = x + y$ inspired by TransE (Bordes et al., 2013). More complicated functions like MLP network can also be applied. ",
396
+ "bbox": [
397
+ 173,
398
+ 513,
399
+ 825,
400
+ 597
401
+ ],
402
+ "page_idx": 3
403
+ },
404
+ {
405
+ "type": "text",
406
+ "text": "The initial entity embeddings $E ^ { ( 0 ) }$ and relation embeddings $R$ are generated from our language module, which will be introduced in Section 3.4. Then, the output entity embeddings from the last GAT layer are used as the final entity representations $E ^ { \\mathrm { K M } }$ . Note that the knowledge graph can be very large, making the embedding update over all the entities in Equation (1) not tractable. Thus we follow the minibatch setting (Hamilton et al., 2017): given a set of input entities, we perform neighborhood sampling to generate their multi-hop neighbor sets and we compute representations only on the entities and relations that are necessary for the embedding update. ",
407
+ "bbox": [
408
+ 174,
409
+ 604,
410
+ 825,
411
+ 703
412
+ ],
413
+ "page_idx": 3
414
+ },
415
+ {
416
+ "type": "text",
417
+ "text": "3.3 LANGUAGE MODULE ",
418
+ "text_level": 1,
419
+ "bbox": [
420
+ 176,
421
+ 719,
422
+ 362,
423
+ 733
424
+ ],
425
+ "page_idx": 3
426
+ },
427
+ {
428
+ "type": "text",
429
+ "text": "The goal of the language module (LM) is to model text data and learn context-aware representations. The language module can be any model for language understanding, e.g. BERT (Devlin et al., 2018). In this work, we use the pre-trained model RoBERTa-base (Liu et al., 2019b) as the language module. ",
430
+ "bbox": [
431
+ 174,
432
+ 746,
433
+ 825,
434
+ 801
435
+ ],
436
+ "page_idx": 3
437
+ },
438
+ {
439
+ "type": "text",
440
+ "text": "3.4 SOLVING THE CYCLIC DEPENDENCY ",
441
+ "text_level": 1,
442
+ "bbox": [
443
+ 176,
444
+ 819,
445
+ 464,
446
+ 833
447
+ ],
448
+ "page_idx": 3
449
+ },
450
+ {
451
+ "type": "text",
452
+ "text": "In our framework, the knowledge and language modules mutually benefit each other: the language module LM outputs context-aware embedding to initialize the embeddings of entities and relations in the knowledge graph given the description text; the knowledge module (KM) outputs knowledgebased entity embeddings for the language module. ",
453
+ "bbox": [
454
+ 174,
455
+ 844,
456
+ 823,
457
+ 901
458
+ ],
459
+ "page_idx": 3
460
+ },
461
+ {
462
+ "type": "text",
463
+ "text": "However, there exists a cyclic dependency which prevents computation and optimization in this design. To solve this problem, we propose a decomposed language module which includes two language models: $\\mathrm { L M _ { 1 } }$ and $\\mathrm { L M _ { 2 } }$ . We employ the first 6 layers of RoBERTa as $\\mathrm { L M _ { 1 } }$ and the remaining 6 layers as $\\mathrm { L M _ { 2 } }$ . The computation proceeds as follows: ",
464
+ "bbox": [
465
+ 174,
466
+ 103,
467
+ 825,
468
+ 160
469
+ ],
470
+ "page_idx": 4
471
+ },
472
+ {
473
+ "type": "text",
474
+ "text": "1. $\\mathrm { L M _ { 1 } }$ operates on the input text $\\mathbf { x }$ and generates contextual embeddings $Z$ . \n2. $\\mathrm { L M _ { 1 } }$ generates initial entity and relation embeddings for KM given description text. \n3. KM produces its output entity embeddings to be combined with $Z$ and sent into $\\mathrm { L M _ { 2 } }$ . \n4. $\\mathrm { L M _ { 2 } }$ produces the final embeddings of $\\mathbf { x }$ , which includes both contextual and knowledge \ninformation. ",
475
+ "bbox": [
476
+ 209,
477
+ 171,
478
+ 821,
479
+ 263
480
+ ],
481
+ "page_idx": 4
482
+ },
483
+ {
484
+ "type": "text",
485
+ "text": "In detail, in step 1, suppose the context $\\mathbf { x }$ is embedded as $X ^ { e m b e d }$ . $\\mathrm { L M _ { 1 } }$ takes $X ^ { e m b e d }$ as input and outputs hidden representations $Z = \\operatorname { L M } _ { 1 } ( X ^ { e m b e d } )$ . ",
486
+ "bbox": [
487
+ 173,
488
+ 275,
489
+ 823,
490
+ 306
491
+ ],
492
+ "page_idx": 4
493
+ },
494
+ {
495
+ "type": "text",
496
+ "text": "In step 2, suppose $\\mathbf { x } ^ { e _ { j } }$ is the entity description text for entity $e _ { j }$ , and the corresponding mention is ${underline { m } } ^ { e _ { j } } = ( e _ { j } , s _ { j } ^ { e } , o _ { j } ^ { e } )$ . $\\mathrm { L M _ { 1 } }$ takes the embedding of $\\mathbf { x } ^ { e _ { j } }$ and produces the contextual embedding $Z ^ { e _ { j } }$ . Then, the average of embeddings at position $s _ { j } ^ { e }$ and $o _ { j } ^ { e }$ is used as the initial entity embedding of $e _ { j }$ , i.e. $E _ { j } ^ { ( 0 ) } = ( Z _ { s _ { j } ^ { e } } ^ { e _ { j } } + Z _ { o _ { j } ^ { e } } ^ { e _ { j } } ) / 2$ . The knowledge graph relation embeddings $R$ are generated in a similar way using its description text. ",
497
+ "bbox": [
498
+ 173,
499
+ 311,
500
+ 825,
501
+ 391
502
+ ],
503
+ "page_idx": 4
504
+ },
505
+ {
506
+ "type": "text",
507
+ "text": "In step 3, KM computes the final entity embeddings $E ^ { \\mathrm { K M } }$ , which is then combined with the output $Z$ from $\\mathrm { L M _ { 1 } }$ . In detail, suppose the mentions in $\\mathbf { x }$ are $\\mathbf { m } = [ m _ { 1 } , \\dots , m _ { M } ]$ . $Z$ and $E ^ { \\mathrm { K M } }$ are combined at positions of mentions: ",
508
+ "bbox": [
509
+ 174,
510
+ 396,
511
+ 825,
512
+ 439
513
+ ],
514
+ "page_idx": 4
515
+ },
516
+ {
517
+ "type": "equation",
518
+ "img_path": "images/ed0b8a3553b594109f081d9a25e8ca346ce514b0b97cfc20b61b61f3cf13156d.jpg",
519
+ "text": "$$\nZ _ { k } ^ { m e r g e } = \\left\\{ \\begin{array} { c l } { { Z _ { k } + E _ { e _ { m _ { i } } } ^ { \\mathrm { K M } } } } & { { \\mathrm { i f } \\exists i \\mathrm { s . t . } s _ { m _ { i } } \\le k \\le o _ { m _ { i } } } } \\\\ { { Z _ { k } } } & { { \\mathrm { o t h e r w i s e } } } \\end{array} \\right.\n$$",
520
+ "text_format": "latex",
521
+ "bbox": [
522
+ 312,
523
+ 448,
524
+ 674,
525
+ 483
526
+ ],
527
+ "page_idx": 4
528
+ },
529
+ {
530
+ "type": "text",
531
+ "text": "where $E _ { e _ { m _ { i } } } ^ { \\mathrm { K M } }$ is the output embedding of entity $e _ { m _ { i } }$ from KM. Then we apply layer normalization (Ba et al., 2016) on $Z ^ { m e r g e }$ : $Z ^ { \\prime } = \\mathrm { L a y e r N o r m } ( Z ^ { m e r g e } )$ . Finally, $Z ^ { \\prime }$ is fed into $\\mathrm { L M _ { 2 } }$ . ",
532
+ "bbox": [
533
+ 176,
534
+ 492,
535
+ 825,
536
+ 525
537
+ ],
538
+ "page_idx": 4
539
+ },
540
+ {
541
+ "type": "text",
542
+ "text": "In step 4, $\\mathrm { L M _ { 2 } }$ operates on the input $Z ^ { \\prime }$ and obtains the final embeddings $Z ^ { \\mathrm { L M } } = \\mathrm { L M } _ { 2 } ( Z ^ { \\prime } )$ . The four steps are marked by the symbol $\\textcircled{8}$ in Figure 2 for better illustration. ",
543
+ "bbox": [
544
+ 174,
545
+ 530,
546
+ 821,
547
+ 560
548
+ ],
549
+ "page_idx": 4
550
+ },
551
+ {
552
+ "type": "text",
553
+ "text": "3.5 ENTITY CONTEXT EMBEDDING MEMORY ",
554
+ "text_level": 1,
555
+ "bbox": [
556
+ 176,
557
+ 579,
558
+ 501,
559
+ 593
560
+ ],
561
+ "page_idx": 4
562
+ },
563
+ {
564
+ "type": "text",
565
+ "text": "Many knowledge graphs contain a large number of entities. Thus, even for one sentence, the number of entities plus their multi-hop neighbors can grow exponentially with the number of layers in the graph neural network. As a result, it’s very time-consuming for the language module to compute context embeddings based on the description text of all involved entities in a batch on the fly. ",
566
+ "bbox": [
567
+ 174,
568
+ 604,
569
+ 825,
570
+ 662
571
+ ],
572
+ "page_idx": 4
573
+ },
574
+ {
575
+ "type": "text",
576
+ "text": "To solve this problem, we construct an entity context embedding memory, $E ^ { c o n t e x t }$ , to store the initial embeddings of all KG entities. Firstly, the language module pre-computes the context embeddings for all entities and places them into the memory. The knowledge module only needs to retrieve required embeddings from the memory instead of computing them, i.e. E(0) ← Econtext. ",
577
+ "bbox": [
578
+ 173,
579
+ 669,
580
+ 825,
581
+ 727
582
+ ],
583
+ "page_idx": 4
584
+ },
585
+ {
586
+ "type": "text",
587
+ "text": "However, as embeddings in the memory are computed from the “old” (initial) language module while the token embeddings during training are computed from the updated language module, there will be an undesired discrepancy. Thus, we propose to update the whole embedding memory $E ^ { c o n t e x t }$ with the current language module every $T ( i )$ steps, where $i$ is the number of times that the memory has been updated (starting from 0). $T ( i )$ is set as follows: ",
588
+ "bbox": [
589
+ 173,
590
+ 733,
591
+ 825,
592
+ 804
593
+ ],
594
+ "page_idx": 4
595
+ },
596
+ {
597
+ "type": "equation",
598
+ "img_path": "images/2346856986ab3e5e537f2955783a8ded841705177f320d152a288edc4a780d4f.jpg",
599
+ "text": "$$\nT ( i ) = \\mathrm { m i n } ( I _ { i n i t } * a ^ { \\lfloor i / r \\rfloor } , I _ { m a x } )\n$$",
600
+ "text_format": "latex",
601
+ "bbox": [
602
+ 387,
603
+ 811,
604
+ 611,
605
+ 832
606
+ ],
607
+ "page_idx": 4
608
+ },
609
+ {
610
+ "type": "text",
611
+ "text": "where $I _ { i n i t }$ is the initial number of steps before the first update and $a$ is the increasing ratio of updating intervals. $r$ is the number of repeated times of the current updating interval. $I _ { m a x }$ is the maximum number of steps between updates. $\\lfloor \\cdot \\rfloor$ means the operation of rounding down. In our experiments, we set $I _ { i n i t } = 1 0 , a = 2 , r = 3 , I _ { m a x } = 5 0 0$ , and the corresponding sequence of $T$ is $[ 1 0 , 1 0 , 1 0 , 2 0 , 2 0 , 2 0 , 4 0 , 4 0 , 4 0 , . . . , 5 0 0 , 5 0 0 ]$ . Note that we choose $a > 1$ because the model parameters usually change less as training proceeds. ",
612
+ "bbox": [
613
+ 173,
614
+ 839,
615
+ 825,
616
+ 924
617
+ ],
618
+ "page_idx": 4
619
+ },
620
+ {
621
+ "type": "text",
622
+ "text": "Moreover, we propose a momentum update to make $E ^ { c o n t e x t }$ evolve more smoothly. Suppose the newly calculated embedding memory by LM is $E _ { n e w } ^ { c o n t e x t }$ , then the updating rule is: ",
623
+ "bbox": [
624
+ 169,
625
+ 103,
626
+ 823,
627
+ 133
628
+ ],
629
+ "page_idx": 5
630
+ },
631
+ {
632
+ "type": "equation",
633
+ "img_path": "images/ecaf1e92109aabde48724f97170d0d8403222b0430c3d8fa03dba6dd48734afb.jpg",
634
+ "text": "$$\nE ^ { c o n t e x t } \\gets m E ^ { c o n t e x t } + ( 1 - m ) E _ { n e w } ^ { c o n t e x t } ,\n$$",
635
+ "text_format": "latex",
636
+ "bbox": [
637
+ 361,
638
+ 138,
639
+ 635,
640
+ 156
641
+ ],
642
+ "page_idx": 5
643
+ },
644
+ {
645
+ "type": "text",
646
+ "text": "where $m \\in [ 0 , 1 )$ is a momentum coefficient which is set as 0.8 in experiment. ",
647
+ "bbox": [
648
+ 176,
649
+ 162,
650
+ 691,
651
+ 178
652
+ ],
653
+ "page_idx": 5
654
+ },
655
+ {
656
+ "type": "text",
657
+ "text": "This memory design speeds up our model by about $1 5 \\mathrm { x }$ during pre-training while keeping the effectiveness of entity context embeddings. For consideration of efficiency, we use relation embeddings only during fine-tuning. ",
658
+ "bbox": [
659
+ 176,
660
+ 184,
661
+ 825,
662
+ 227
663
+ ],
664
+ "page_idx": 5
665
+ },
666
+ {
667
+ "type": "text",
668
+ "text": "3.6 PRE-TRAINING ",
669
+ "text_level": 1,
670
+ "bbox": [
671
+ 174,
672
+ 243,
673
+ 318,
674
+ 258
675
+ ],
676
+ "page_idx": 5
677
+ },
678
+ {
679
+ "type": "text",
680
+ "text": "During pre-training, both the knowledge module and language module are optimized based on several self-supervised learning tasks listed below. The examples of all the training tasks are shown in Figure 2. ",
681
+ "bbox": [
682
+ 174,
683
+ 270,
684
+ 825,
685
+ 311
686
+ ],
687
+ "page_idx": 5
688
+ },
689
+ {
690
+ "type": "text",
691
+ "text": "At each pre-training step, we first sample a batch of root entities and perform random-walk sampling on each root entity. The sampled entities are fed into KM for the following two tasks. ",
692
+ "bbox": [
693
+ 173,
694
+ 319,
695
+ 823,
696
+ 347
697
+ ],
698
+ "page_idx": 5
699
+ },
700
+ {
701
+ "type": "text",
702
+ "text": "Entity category prediction. The knowledge module is trained to predict the category label of entities based on the output entity embeddings $E ^ { \\mathrm { K M } }$ . The loss function is cross-entropy for multiclass classification, denoted as $\\mathcal { L } _ { c }$ . ",
703
+ "bbox": [
704
+ 176,
705
+ 353,
706
+ 821,
707
+ 396
708
+ ],
709
+ "page_idx": 5
710
+ },
711
+ {
712
+ "type": "text",
713
+ "text": "Relation type prediction. KM is also trained to predict the relation type between a given entity pair based on $\\bar { E } ^ { \\bar { \\mathsf { K M } } }$ . The loss function is cross-entropy for multi-class classification, denoted as $\\mathcal { L } _ { r }$ . ",
714
+ "bbox": [
715
+ 173,
716
+ 404,
717
+ 821,
718
+ 431
719
+ ],
720
+ "page_idx": 5
721
+ },
722
+ {
723
+ "type": "text",
724
+ "text": "Then, we uniformly sample a batch of text sequences and their entities for the following two tasks. ",
725
+ "bbox": [
726
+ 174,
727
+ 438,
728
+ 816,
729
+ 452
730
+ ],
731
+ "page_idx": 5
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "Masked token prediction. Similar to BERT, We randomly mask tokens in the sequence and predict the original tokens based on the output $Z ^ { \\mathrm { L M } }$ of the language module. We denote the loss as $\\scriptstyle { \\mathcal { L } } _ { t }$ . ",
736
+ "bbox": [
737
+ 176,
738
+ 459,
739
+ 820,
740
+ 488
741
+ ],
742
+ "page_idx": 5
743
+ },
744
+ {
745
+ "type": "text",
746
+ "text": "Masked entity prediction. The language module is also trained to predict the corresponding entity of a given mention. For the input text, we randomly remove $1 5 \\%$ of the mentions $\\mathbf { m }$ . Then for each removed mention $m _ { r } = ( e _ { r } , s _ { r } , o _ { r } )$ , the model predicts the masked entity $e _ { r }$ based on the mention’s embedding. In detail, it predicts the entity whose embedding in $E ^ { c o n t e x t }$ is closest to $q = g ( ( Z _ { s _ { r } } ^ { \\mathrm { L M } } + Z _ { o _ { r } } ^ { \\mathrm { L M } } ) / 2 )$ , where osed by $g ( x ) = \\mathrm { G E L U } ( x W _ { 1 } ) W _ { 2 }$ is a transformation function. GELU is an016). Since the number of entities can be very large, we use $e _ { r }$ ’s neighbours and other randomly sampled entities as negative samples. The loss function $\\mathcal { L } _ { e }$ is cross entropy based on the inner product between $q$ and each candidate entity’s embedding. Figure 2 shows an concrete example, where the mention “Earth” is not marked in the input text since it’s masked and the task is to link the mention “Earth” to entity “Q2: Earth”. ",
747
+ "bbox": [
748
+ 173,
749
+ 494,
750
+ 825,
751
+ 633
752
+ ],
753
+ "page_idx": 5
754
+ },
755
+ {
756
+ "type": "text",
757
+ "text": "3.7 FINE-TUNING ",
758
+ "text_level": 1,
759
+ "bbox": [
760
+ 176,
761
+ 650,
762
+ 310,
763
+ 665
764
+ ],
765
+ "page_idx": 5
766
+ },
767
+ {
768
+ "type": "text",
769
+ "text": "During fine-tuning, our model supports using either the knowledge graph employed during pretraining or a novel custom knowledge graph with previously unseen entities2. If a custom KG is used, the entity context embedding memory is recomputed by the pre-trained language module using the new entity description text. In this work, we do not update the entity context memory during fine-tuning for consideration of efficiency. We also compute the relation context embedding memory using the pre-trained language model. ",
770
+ "bbox": [
771
+ 174,
772
+ 676,
773
+ 825,
774
+ 761
775
+ ],
776
+ "page_idx": 5
777
+ },
778
+ {
779
+ "type": "text",
780
+ "text": "4 EXPERIMENT ",
781
+ "text_level": 1,
782
+ "bbox": [
783
+ 176,
784
+ 781,
785
+ 316,
786
+ 797
787
+ ],
788
+ "page_idx": 5
789
+ },
790
+ {
791
+ "type": "text",
792
+ "text": "4.1 BASIC SETTINGS ",
793
+ "text_level": 1,
794
+ "bbox": [
795
+ 176,
796
+ 805,
797
+ 333,
798
+ 820
799
+ ],
800
+ "page_idx": 5
801
+ },
802
+ {
803
+ "type": "text",
804
+ "text": "Data for Pre-training. We use the English Wikipedia as the text corpus, Wikidata (Vrandeciˇ c &´ Krotzsch, 2014) as the knowledge graph, and SLING (Ringgaard et al., 2017) to identify entity men- ¨ tions. For each entity, we use the first 64 consecutive tokens of its Wikipedia page as its description text and we filter out entities without a corresponding Wikipedia page. We also remove entities that ",
805
+ "bbox": [
806
+ 174,
807
+ 832,
808
+ 823,
809
+ 887
810
+ ],
811
+ "page_idx": 5
812
+ },
813
+ {
814
+ "type": "table",
815
+ "img_path": "images/49b53856b75428c9170704a8f6885bccd91b2ec29e26e368ad3ea9d949c2fa29.jpg",
816
+ "table_caption": [],
817
+ "table_footnote": [],
818
+ "table_body": "<table><tr><td>Model</td><td>5-way1-shot</td><td>5-way 5-shot</td><td>10-way 1-shot</td></tr><tr><td>PAIR (BERT)*</td><td>85.7</td><td>89.5</td><td>76.8</td></tr><tr><td>PAIR (RoBERTa)</td><td>86.4</td><td>90.3</td><td>77.3</td></tr><tr><td>PAIR (RoBERTa+GNN)</td><td>86.3</td><td>-</td><td>-</td></tr><tr><td>PAIR (RoBERTa+GNN+M)</td><td>86.9</td><td>■</td><td>-</td></tr><tr><td>PAIR (KnowBERT)</td><td>86.2</td><td>90.3</td><td>77.0</td></tr><tr><td>PAIR (JAKET)</td><td>87.4</td><td>92.1</td><td>78.9</td></tr></table>",
819
+ "bbox": [
820
+ 233,
821
+ 99,
822
+ 764,
823
+ 202
824
+ ],
825
+ "page_idx": 6
826
+ },
827
+ {
828
+ "type": "text",
829
+ "text": "Table 1: Accuracy results on the dev set of FewRel 1.0. $\\star$ indicates the results are taken from Gao et al. (2019). PAIR is the framework proposed by Gao et al. (2019). ",
830
+ "bbox": [
831
+ 173,
832
+ 212,
833
+ 821,
834
+ 241
835
+ ],
836
+ "page_idx": 6
837
+ },
838
+ {
839
+ "type": "text",
840
+ "text": "have fewer than 5 neighbors in the Wikidata KG and fewer than 5 mentions in the Wikipedia corpus. The final knowledge graph contains 3,657,658 entities, 799 relations and 20,113,978 triplets. We use the instance of relation to find the category of each entity. In total, 3,039,909 entities have category labels of 19,901 types. The text corpus contains about 4 billion tokens. ",
841
+ "bbox": [
842
+ 173,
843
+ 252,
844
+ 825,
845
+ 308
846
+ ],
847
+ "page_idx": 6
848
+ },
849
+ {
850
+ "type": "text",
851
+ "text": "Implementation Details. We initialize the language module with the pre-trained RoBERTabase (Liu et al., 2019b) model. The knowledge module is initialized randomly. Our implementation is based on the HuggingFace framework (Wolf et al., 2019) and DGL (Wang et al., 2019a). For the knowledge module, we use a 2-layer graph neural network, which aggregates 2-hop neighbors. The number of sampled neighbors in each hop is 10. More details are presented in the Appendix. ",
852
+ "bbox": [
853
+ 174,
854
+ 315,
855
+ 823,
856
+ 385
857
+ ],
858
+ "page_idx": 6
859
+ },
860
+ {
861
+ "type": "text",
862
+ "text": "Baselines. We compare our proposed model JAKET with the pre-trained RoBERTa-base (Liu et al., 2019b) and two variants of our model: RoBERTa $^ +$ GNN and RoBERTa+GNN+M. The two models have the same model structure as JAKET, but they are not pre-trained on our data. Moreover, the entity and relation context embedding memories of RoBERTa+GNN are randomly generated while the memories of RoBERT $\\mathsf { \\Omega } _ { \\mathsf { l } + \\mathsf { G N N + M } }$ are computed by RoBERTa. ",
863
+ "bbox": [
864
+ 174,
865
+ 392,
866
+ 825,
867
+ 462
868
+ ],
869
+ "page_idx": 6
870
+ },
871
+ {
872
+ "type": "text",
873
+ "text": "4.2 DOWNSTREAM TASKS ",
874
+ "text_level": 1,
875
+ "bbox": [
876
+ 176,
877
+ 479,
878
+ 366,
879
+ 493
880
+ ],
881
+ "page_idx": 6
882
+ },
883
+ {
884
+ "type": "text",
885
+ "text": "Few-shot Relation Classification. Relation classification requires the model to predict the relation between two entities in text. Few-shot relation classification takes the $N$ -way $K$ -shot setting. Relations in the test set are not seen in the training set. For each query instance, $N$ relations with $K$ supporting examples for each relation are given. The model is required to classify the instance into one of the $N$ relations based on the $N \\times K$ samples. In this paper we evaluate our model on FewRel (Han et al., 2018), which is a widely used benchmark dataset for few-shot relation classification, containing 100 relations and 70,000 instances. ",
886
+ "bbox": [
887
+ 173,
888
+ 505,
889
+ 825,
890
+ 603
891
+ ],
892
+ "page_idx": 6
893
+ },
894
+ {
895
+ "type": "text",
896
+ "text": "We use the pre-trained knowledge graph for FewRel as it comes with entity mentions from Wikidata knowledge graph. To predict the relation label, we build a sequence classification layer on top of the output of LM. More specifically, we use the PAIR framework proposed by Gao et al. (2019), which pairs each query instance with all the supporting instances, concatenate each pair as one sequence, and send the concatenated sequence to our sequence classification model to get the score of the two instances expressing the same relation. We do not use relation embeddings in this task to avoid information leakage. ",
897
+ "bbox": [
898
+ 174,
899
+ 609,
900
+ 825,
901
+ 707
902
+ ],
903
+ "page_idx": 6
904
+ },
905
+ {
906
+ "type": "text",
907
+ "text": "As shown in Table 1, our model achieves the best results in all three few-shot settings. Comparing the results between RoBERTa and RoBERTa $^ +$ GNN, we see that adding GNN with randomly generated entity features does not improve the performance. The difference between RoBERTa $+$ GNN+M and RoBERTa $^ +$ GNN demonstrates the importance of generating context embedding memory by the language module, while JAKET can further improve the performance by pre-training. We also compare with a strong knowledge-enhanced PLM KnowBERT (Peters et al., 2019), which is also pretrained on English Wikipedia and Wikidata KG. The results show that JAKET consistently outperform KnowBERT in different few-shot settings. ",
908
+ "bbox": [
909
+ 173,
910
+ 713,
911
+ 825,
912
+ 827
913
+ ],
914
+ "page_idx": 6
915
+ },
916
+ {
917
+ "type": "text",
918
+ "text": "KGQA. The Question Answering over KG (KGQA) task is to answer natural language questions related to a knowledge graph. The answer to each question is an entity in the KG. This task requires an understanding over the question and reasoning over multiple entities and relations. ",
919
+ "bbox": [
920
+ 174,
921
+ 833,
922
+ 825,
923
+ 875
924
+ ],
925
+ "page_idx": 6
926
+ },
927
+ {
928
+ "type": "text",
929
+ "text": "We use the vanilla version of the MetaQA (Zhang et al., 2017) dataset, which contains questions requiring multi-hop reasoning over a novel movie-domain knowledge graph. The KG contains $1 3 5 \\mathrm { k }$ triplets, $4 3 \\mathrm { k }$ entities and 9 relations. Each question is provided with one entity mention and the question is named as a $k$ -hop question if the answer entity is a $k$ -hop neighbor of the question entity. We define all the $k$ -hop neighbor entities of the question entity as the candidate entities for the question. We also consider a more realistic setting where we simulate an incomplete KG by randomly dropping a triplet with a probability $5 0 \\%$ . This setting is called $K G \\ – 5 O \\%$ , compared with the full KG setting KG-Full. For each entity, we randomly sample one question containing it as the entity’s description context. We manually write the description for each relation since the number of relations is very small. We use the output embedding of [CLS] token from LM as the question embedding, and then find the entity with the closest context embedding. ",
930
+ "bbox": [
931
+ 176,
932
+ 881,
933
+ 823,
934
+ 924
935
+ ],
936
+ "page_idx": 6
937
+ },
938
+ {
939
+ "type": "table",
940
+ "img_path": "images/47ac22bc4c6e3c6d36c975716f069658b4e18a580582d7155e7264824816301b.jpg",
941
+ "table_caption": [
942
+ "Table 2: Results on the MetaQA dataset over 1- hop and 2-hop questions under KG-Full and $K G .$ - $50 \\%$ settings. $\\mathbf { R o B + G + M }$ is the abbreviation for the baseline model RoBERT $\\mathbf { \\pi } _ { 1 + \\mathrm { G N N } + \\mathrm { M } }$ . "
943
+ ],
944
+ "table_footnote": [],
945
+ "table_body": "<table><tr><td rowspan=\"2\">Model</td><td colspan=\"2\">KG-Full</td><td colspan=\"2\">KG-50%</td></tr><tr><td>1-hop</td><td>2-hop</td><td>1-hop</td><td>2-hop</td></tr><tr><td>RoBERTa</td><td>90.2</td><td>70.8</td><td>61.5</td><td>39.3</td></tr><tr><td>RoB+G+M</td><td>91.4</td><td>72.6</td><td>62.5</td><td>40.8</td></tr><tr><td> JAKET</td><td>93.9</td><td>73.2</td><td>63.1</td><td>41.9</td></tr></table>",
946
+ "bbox": [
947
+ 173,
948
+ 101,
949
+ 501,
950
+ 180
951
+ ],
952
+ "page_idx": 7
953
+ },
954
+ {
955
+ "type": "table",
956
+ "img_path": "images/37acaa8a4d770f829592d249cffebe33679d5e7e5468d8167c8616cf5779f080.jpg",
957
+ "table_caption": [
958
+ "Table 3: Results on the entity classification task over an unseen Wikidata knowledge graph. $\\mathbf { R o B + G + M }$ is the abbreviation for the baseline model RoBERT $\\mathrm { _ { 1 + G N N + M } }$ . "
959
+ ],
960
+ "table_footnote": [],
961
+ "table_body": "<table><tr><td>Model</td><td>100%</td><td>20%</td><td>5%</td></tr><tr><td>GNN</td><td>48.2</td><td>-</td><td>-</td></tr><tr><td>RoBERTa</td><td>33.4</td><td>1</td><td>1</td></tr><tr><td>RoB+G+M</td><td>79.1</td><td>66.7</td><td>53.5</td></tr><tr><td>JAKET</td><td>81.6</td><td>70.6</td><td>58.4</td></tr></table>",
962
+ "bbox": [
963
+ 545,
964
+ 103,
965
+ 799,
966
+ 178
967
+ ],
968
+ "page_idx": 7
969
+ },
970
+ {
971
+ "type": "text",
972
+ "text": "",
973
+ "bbox": [
974
+ 173,
975
+ 262,
976
+ 825,
977
+ 375
978
+ ],
979
+ "page_idx": 7
980
+ },
981
+ {
982
+ "type": "text",
983
+ "text": "As shown in Table 2, RoBERT $\\mathbf { \\Lambda } _ { 1 + \\mathbf { G N N + M } }$ outperforms RoBERTa, demonstrating the effectiveness of $_ { \\mathrm { K M + L M } }$ structure. JAKET further improves the accuracy by $0 . 6 \\%$ to $2 . 5 \\%$ under both KG settings, showing the benefits of our proposed joint pre-training.3 ",
984
+ "bbox": [
985
+ 176,
986
+ 381,
987
+ 823,
988
+ 422
989
+ ],
990
+ "page_idx": 7
991
+ },
992
+ {
993
+ "type": "text",
994
+ "text": "Entity Classification. To further evaluate our model’s capability to reason over unseen knowledge graphs, we design an entity classification task. Here, the model is given a portion of the Wikidata knowledge graph unseen during pre-training, denoted as $\\kappa \\mathcal { G } ^ { \\prime }$ . It needs to predict the category labels of these novel entities. The entity context embeddings are obtained in the same way as in pretraining. The relation context embeddings are generated by its surface text. The number of entities and relations in the $\\kappa \\mathcal { G } ^ { \\prime }$ are 23,046 and 316 respectively. The number of triplets is 38,060. Among them, 16,529 entities have 1,291 distinct category labels. We conduct experiments under a semisupervised transductive setting by splitting the entities in $\\kappa \\mathcal { G } ^ { \\prime }$ into train/dev/test splits of $20 \\%$ , $20 \\%$ and $60 \\%$ . To test the robustness of models to the size of training data, we evaluate models when using $20 \\%$ and $5 \\%$ of the original training set. ",
995
+ "bbox": [
996
+ 173,
997
+ 430,
998
+ 825,
999
+ 569
1000
+ ],
1001
+ "page_idx": 7
1002
+ },
1003
+ {
1004
+ "type": "text",
1005
+ "text": "In this task, RoBERTa takes the entity description text as input for label prediction while neglecting the structure information of KG. JAKET and RoBERTa $+ \\mathrm { G N N + M }$ make predictions based on the entity representation output from the knowledge module. We also include GNN as a baseline, which uses the same GAT-based structure as our knowledge module, but with randomly initialized model parameters and context embedding memory. GNN then employs the final entity representations for entity category prediction. ",
1006
+ "bbox": [
1007
+ 174,
1008
+ 575,
1009
+ 825,
1010
+ 660
1011
+ ],
1012
+ "page_idx": 7
1013
+ },
1014
+ {
1015
+ "type": "text",
1016
+ "text": "As shown in Table 3, our model achieves the best performance under all the settings. The performance of GNN or RoBERTa alone is significantly lower than JAKET and RoBERTa $^ +$ GNN+M, which demonstrates the importance of integrating both context and knowledge information using our proposed framework. Also, the gap between JAKET and RoBERTa $+ \\mathrm { G N N + M }$ increases when there’s less training data, showing that the joint pre-training can reduce the model’s dependence on downstream training data. ",
1017
+ "bbox": [
1018
+ 174,
1019
+ 666,
1020
+ 825,
1021
+ 750
1022
+ ],
1023
+ "page_idx": 7
1024
+ },
1025
+ {
1026
+ "type": "text",
1027
+ "text": "5 CONCLUSION ",
1028
+ "text_level": 1,
1029
+ "bbox": [
1030
+ 176,
1031
+ 760,
1032
+ 318,
1033
+ 776
1034
+ ],
1035
+ "page_idx": 7
1036
+ },
1037
+ {
1038
+ "type": "text",
1039
+ "text": "This paper presents a novel framework, JAKET, to jointly pre-train models for knowledge graph and language understanding. Under our framework, the knowledge module and language module both provide essential information for each other. After pre-training, JAKET can quickly adapt to unseen knowledge graphs in new domains. Moreover, we design the entity context embedding memory which speeds up the pre-training by 15x. Experiments show that JAKET outperforms baseline methods in several knowledge-aware NLU tasks: few-shot relation classification, KGQA and entity classification. In the future, we plan to extend our framework to natural language generation tasks. ",
1040
+ "bbox": [
1041
+ 174,
1042
+ 791,
1043
+ 825,
1044
+ 888
1045
+ ],
1046
+ "page_idx": 7
1047
+ },
1048
+ {
1049
+ "type": "text",
1050
+ "text": "REFERENCES ",
1051
+ "text_level": 1,
1052
+ "bbox": [
1053
+ 174,
1054
+ 102,
1055
+ 287,
1056
+ 118
1057
+ ],
1058
+ "page_idx": 8
1059
+ },
1060
+ {
1061
+ "type": "text",
1062
+ "text": "Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016. ",
1063
+ "bbox": [
1064
+ 173,
1065
+ 126,
1066
+ 823,
1067
+ 155
1068
+ ],
1069
+ "page_idx": 8
1070
+ },
1071
+ {
1072
+ "type": "text",
1073
+ "text": "Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In Advances in neural information processing systems, pp. 2787–2795, 2013. ",
1074
+ "bbox": [
1075
+ 176,
1076
+ 162,
1077
+ 823,
1078
+ 205
1079
+ ],
1080
+ "page_idx": 8
1081
+ },
1082
+ {
1083
+ "type": "text",
1084
+ "text": "Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. ",
1085
+ "bbox": [
1086
+ 174,
1087
+ 213,
1088
+ 823,
1089
+ 256
1090
+ ],
1091
+ "page_idx": 8
1092
+ },
1093
+ {
1094
+ "type": "text",
1095
+ "text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. ",
1096
+ "bbox": [
1097
+ 169,
1098
+ 265,
1099
+ 823,
1100
+ 294
1101
+ ],
1102
+ "page_idx": 8
1103
+ },
1104
+ {
1105
+ "type": "text",
1106
+ "text": "Ming Ding, Chang Zhou, Qibin Chen, Hongxia Yang, and Jie Tang. Cognitive graph for multi-hop reading comprehension at scale. arXiv preprint arXiv:1905.05460, 2019. ",
1107
+ "bbox": [
1108
+ 171,
1109
+ 301,
1110
+ 823,
1111
+ 330
1112
+ ],
1113
+ "page_idx": 8
1114
+ },
1115
+ {
1116
+ "type": "text",
1117
+ "text": "Thibault Fevry, Livio Baldini Soares, Nicholas FitzGerald, Eunsol Choi, and Tom Kwiatkowski. En-´ tities as experts: Sparse memory access with entity supervision. arXiv preprint arXiv:2004.07202, 2020. ",
1118
+ "bbox": [
1119
+ 174,
1120
+ 338,
1121
+ 825,
1122
+ 381
1123
+ ],
1124
+ "page_idx": 8
1125
+ },
1126
+ {
1127
+ "type": "text",
1128
+ "text": "Tianyu Gao, Xu Han, Hao Zhu, Zhiyuan Liu, Peng Li, Maosong Sun, and Jie Zhou. Fewrel 2.0: Towards more challenging few-shot relation classification. arXiv preprint arXiv:1910.07124, 2019. ",
1129
+ "bbox": [
1130
+ 174,
1131
+ 388,
1132
+ 823,
1133
+ 433
1134
+ ],
1135
+ "page_idx": 8
1136
+ },
1137
+ {
1138
+ "type": "text",
1139
+ "text": "Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrievalaugmented language model pre-training. arXiv preprint arXiv:2002.08909, 2020. ",
1140
+ "bbox": [
1141
+ 173,
1142
+ 440,
1143
+ 821,
1144
+ 470
1145
+ ],
1146
+ "page_idx": 8
1147
+ },
1148
+ {
1149
+ "type": "text",
1150
+ "text": "Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in neural information processing systems, pp. 1024–1034, 2017. ",
1151
+ "bbox": [
1152
+ 171,
1153
+ 478,
1154
+ 821,
1155
+ 507
1156
+ ],
1157
+ "page_idx": 8
1158
+ },
1159
+ {
1160
+ "type": "text",
1161
+ "text": "Xu Han, Hao Zhu, Pengfei Yu, Ziyun Wang, Yuan Yao, Zhiyuan Liu, and Maosong Sun. Fewrel: A large-scale supervised few-shot relation classification dataset with state-of-the-art evaluation. arXiv preprint arXiv:1810.10147, 2018. ",
1162
+ "bbox": [
1163
+ 176,
1164
+ 515,
1165
+ 821,
1166
+ 558
1167
+ ],
1168
+ "page_idx": 8
1169
+ },
1170
+ {
1171
+ "type": "text",
1172
+ "text": "Dan Hendrycks and Kevin Gimpel. Gaussian error linear units (gelus). arXiv preprint arXiv:1606.08415, 2016. ",
1173
+ "bbox": [
1174
+ 169,
1175
+ 565,
1176
+ 825,
1177
+ 594
1178
+ ],
1179
+ "page_idx": 8
1180
+ },
1181
+ {
1182
+ "type": "text",
1183
+ "text": "Yoav Levine, Barak Lenz, Or Dagan, Dan Padnos, Or Sharir, Shai Shalev-Shwartz, Amnon Shashua, and Yoav Shoham. Sensebert: Driving some sense into bert. arXiv preprint arXiv:1908.05646, 2019. ",
1184
+ "bbox": [
1185
+ 176,
1186
+ 603,
1187
+ 823,
1188
+ 645
1189
+ ],
1190
+ "page_idx": 8
1191
+ },
1192
+ {
1193
+ "type": "text",
1194
+ "text": "Nelson F Liu, Matt Gardner, Yonatan Belinkov, Matthew E Peters, and Noah A Smith. Linguistic knowledge and transferability of contextual representations. arXiv preprint arXiv:1903.08855, 2019a. ",
1195
+ "bbox": [
1196
+ 174,
1197
+ 654,
1198
+ 823,
1199
+ 696
1200
+ ],
1201
+ "page_idx": 8
1202
+ },
1203
+ {
1204
+ "type": "text",
1205
+ "text": "Weijie Liu, Peng Zhou, Zhe Zhao, Zhiruo Wang, Qi Ju, Haotang Deng, and Ping Wang. K-bert: Enabling language representation with knowledge graph. In AAAI, pp. 2901–2908, 2020. ",
1206
+ "bbox": [
1207
+ 173,
1208
+ 704,
1209
+ 823,
1210
+ 734
1211
+ ],
1212
+ "page_idx": 8
1213
+ },
1214
+ {
1215
+ "type": "text",
1216
+ "text": "Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019b. ",
1217
+ "bbox": [
1218
+ 176,
1219
+ 742,
1220
+ 823,
1221
+ 785
1222
+ ],
1223
+ "page_idx": 8
1224
+ },
1225
+ {
1226
+ "type": "text",
1227
+ "text": "Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017. ",
1228
+ "bbox": [
1229
+ 171,
1230
+ 792,
1231
+ 825,
1232
+ 821
1233
+ ],
1234
+ "page_idx": 8
1235
+ },
1236
+ {
1237
+ "type": "text",
1238
+ "text": "Shangwen Lv, Daya Guo, Jingjing Xu, Duyu Tang, Nan Duan, Ming Gong, Linjun Shou, Daxin Jiang, Guihong Cao, and Songlin Hu. Graph-based reasoning over heterogeneous external knowledge for commonsense question answering. In AAAI, pp. 8449–8456, 2020. ",
1239
+ "bbox": [
1240
+ 174,
1241
+ 829,
1242
+ 821,
1243
+ 873
1244
+ ],
1245
+ "page_idx": 8
1246
+ },
1247
+ {
1248
+ "type": "text",
1249
+ "text": "Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018. ",
1250
+ "bbox": [
1251
+ 174,
1252
+ 882,
1253
+ 825,
1254
+ 922
1255
+ ],
1256
+ "page_idx": 8
1257
+ },
1258
+ {
1259
+ "type": "text",
1260
+ "text": "Matthew E. Peters, Mark Neumann, Robert L Logan, Roy Schwartz, Vidur Joshi, Sameer Singh, and Noah A. Smith. Knowledge enhanced contextual word representations. In EMNLP, 2019. ",
1261
+ "bbox": [
1262
+ 173,
1263
+ 103,
1264
+ 823,
1265
+ 133
1266
+ ],
1267
+ "page_idx": 9
1268
+ },
1269
+ {
1270
+ "type": "text",
1271
+ "text": "Nina Poerner, Ulli Waltinger, and Hinrich Schutze. Bert is not a knowledge base (yet): Factual ¨ knowledge vs. name-based reasoning in unsupervised qa. arXiv preprint arXiv:1911.03681, 2019. ",
1272
+ "bbox": [
1273
+ 171,
1274
+ 142,
1275
+ 823,
1276
+ 172
1277
+ ],
1278
+ "page_idx": 9
1279
+ },
1280
+ {
1281
+ "type": "text",
1282
+ "text": "Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training, 2018. ",
1283
+ "bbox": [
1284
+ 174,
1285
+ 181,
1286
+ 821,
1287
+ 212
1288
+ ],
1289
+ "page_idx": 9
1290
+ },
1291
+ {
1292
+ "type": "text",
1293
+ "text": "Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8):9, 2019. ",
1294
+ "bbox": [
1295
+ 173,
1296
+ 220,
1297
+ 823,
1298
+ 251
1299
+ ],
1300
+ "page_idx": 9
1301
+ },
1302
+ {
1303
+ "type": "text",
1304
+ "text": "Michael Ringgaard, Rahul Gupta, and Fernando CN Pereira. Sling: A framework for frame semantic parsing. arXiv preprint arXiv:1710.07032, 2017. ",
1305
+ "bbox": [
1306
+ 173,
1307
+ 260,
1308
+ 825,
1309
+ 290
1310
+ ],
1311
+ "page_idx": 9
1312
+ },
1313
+ {
1314
+ "type": "text",
1315
+ "text": "Tao Shen, Yi Mao, Pengcheng He, Guodong Long, Adam Trischler, and Weizhu Chen. Exploiting structured knowledge in text via graph-guided representation learning. arXiv preprint arXiv:2004.14224, 2020. ",
1316
+ "bbox": [
1317
+ 174,
1318
+ 299,
1319
+ 825,
1320
+ 342
1321
+ ],
1322
+ "page_idx": 9
1323
+ },
1324
+ {
1325
+ "type": "text",
1326
+ "text": "Livio Baldini Soares, Nicholas FitzGerald, Jeffrey Ling, and Tom Kwiatkowski. Matching the blanks: Distributional similarity for relation learning. arXiv preprint arXiv:1906.03158, 2019. ",
1327
+ "bbox": [
1328
+ 169,
1329
+ 352,
1330
+ 823,
1331
+ 382
1332
+ ],
1333
+ "page_idx": 9
1334
+ },
1335
+ {
1336
+ "type": "text",
1337
+ "text": "Haitian Sun, Bhuwan Dhingra, Manzil Zaheer, Kathryn Mazaitis, Ruslan Salakhutdinov, and William W Cohen. Open domain question answering using early fusion of knowledge bases and text. arXiv preprint arXiv:1809.00782, 2018. ",
1338
+ "bbox": [
1339
+ 174,
1340
+ 391,
1341
+ 823,
1342
+ 435
1343
+ ],
1344
+ "page_idx": 9
1345
+ },
1346
+ {
1347
+ "type": "text",
1348
+ "text": "Haitian Sun, Tania Bedrax-Weiss, and William W Cohen. Pullnet: Open domain question answering with iterative retrieval on knowledge bases and text. arXiv preprint arXiv:1904.09537, 2019a. ",
1349
+ "bbox": [
1350
+ 171,
1351
+ 444,
1352
+ 823,
1353
+ 474
1354
+ ],
1355
+ "page_idx": 9
1356
+ },
1357
+ {
1358
+ "type": "text",
1359
+ "text": "Yu Sun, Shuohuan Wang, Yukun Li, Shikun Feng, Xuyi Chen, Han Zhang, Xin Tian, Danxiang Zhu, Hao Tian, and Hua Wu. Ernie: Enhanced representation through knowledge integration. arXiv preprint arXiv:1904.09223, 2019b. ",
1360
+ "bbox": [
1361
+ 174,
1362
+ 483,
1363
+ 823,
1364
+ 526
1365
+ ],
1366
+ "page_idx": 9
1367
+ },
1368
+ {
1369
+ "type": "text",
1370
+ "text": "Alon Talmor, Yanai Elazar, Yoav Goldberg, and Jonathan Berant. olmpics–on what language model pre-training captures. arXiv preprint arXiv:1912.13283, 2019. ",
1371
+ "bbox": [
1372
+ 171,
1373
+ 537,
1374
+ 823,
1375
+ 566
1376
+ ],
1377
+ "page_idx": 9
1378
+ },
1379
+ {
1380
+ "type": "text",
1381
+ "text": "Shikhar Vashishth, Soumya Sanyal, Vikram Nitin, and Partha Talukdar. Composition-based multirelational graph convolutional networks. arXiv preprint arXiv:1911.03082, 2019. ",
1382
+ "bbox": [
1383
+ 171,
1384
+ 575,
1385
+ 823,
1386
+ 606
1387
+ ],
1388
+ "page_idx": 9
1389
+ },
1390
+ {
1391
+ "type": "text",
1392
+ "text": "Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017. ",
1393
+ "bbox": [
1394
+ 171,
1395
+ 616,
1396
+ 823,
1397
+ 645
1398
+ ],
1399
+ "page_idx": 9
1400
+ },
1401
+ {
1402
+ "type": "text",
1403
+ "text": "Pat Verga, Haitian Sun, Livio Baldini Soares, and William W Cohen. Facts as experts: Adaptable and interpretable neural memory over symbolic knowledge. arXiv preprint arXiv:2007.00849, 2020. ",
1404
+ "bbox": [
1405
+ 173,
1406
+ 655,
1407
+ 823,
1408
+ 698
1409
+ ],
1410
+ "page_idx": 9
1411
+ },
1412
+ {
1413
+ "type": "text",
1414
+ "text": "Denny Vrandeciˇ c and Markus Kr ´ otzsch. Wikidata: a free collaborative knowledgebase. ¨ Communications of the ACM, 57(10):78–85, 2014. ",
1415
+ "bbox": [
1416
+ 173,
1417
+ 708,
1418
+ 821,
1419
+ 737
1420
+ ],
1421
+ "page_idx": 9
1422
+ },
1423
+ {
1424
+ "type": "text",
1425
+ "text": "Minjie Wang, Lingfan Yu, Da Zheng, Quan Gan, Yu Gai, Zihao Ye, Mufei Li, Jinjing Zhou, Qi Huang, Chao Ma, et al. Deep graph library: Towards efficient and scalable deep learning on graphs. arXiv preprint arXiv:1909.01315, 2019a. ",
1426
+ "bbox": [
1427
+ 174,
1428
+ 747,
1429
+ 823,
1430
+ 790
1431
+ ],
1432
+ "page_idx": 9
1433
+ },
1434
+ {
1435
+ "type": "text",
1436
+ "text": "Xiaozhi Wang, Tianyu Gao, Zhaocheng Zhu, Zhiyuan Liu, Juanzi Li, and Jian Tang. Kepler: A unified model for knowledge embedding and pre-trained language representation. arXiv preprint arXiv:1911.06136, 2019b. ",
1437
+ "bbox": [
1438
+ 171,
1439
+ 800,
1440
+ 823,
1441
+ 843
1442
+ ],
1443
+ "page_idx": 9
1444
+ },
1445
+ {
1446
+ "type": "text",
1447
+ "text": "Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick´ von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Huggingface’s transformers: Stateof-the-art natural language processing. ArXiv, abs/1910.03771, 2019. ",
1448
+ "bbox": [
1449
+ 176,
1450
+ 854,
1451
+ 825,
1452
+ 924
1453
+ ],
1454
+ "page_idx": 9
1455
+ },
1456
+ {
1457
+ "type": "text",
1458
+ "text": "Wenhan Xiong, Jingfei Du, William Yang Wang, and Veselin Stoyanov. Pretrained encyclopedia: Weakly supervised knowledge-pretrained language model. arXiv preprint arXiv:1912.09637, 2019. ",
1459
+ "bbox": [
1460
+ 174,
1461
+ 103,
1462
+ 823,
1463
+ 145
1464
+ ],
1465
+ "page_idx": 10
1466
+ },
1467
+ {
1468
+ "type": "text",
1469
+ "text": "Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Russ R Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. In Advances in neural information processing systems, pp. 5753–5763, 2019. ",
1470
+ "bbox": [
1471
+ 178,
1472
+ 155,
1473
+ 821,
1474
+ 198
1475
+ ],
1476
+ "page_idx": 10
1477
+ },
1478
+ {
1479
+ "type": "text",
1480
+ "text": "Yuyu Zhang, Hanjun Dai, Zornitsa Kozareva, Alexander J Smola, and Le Song. Variational reasoning for question answering with knowledge graph. arXiv preprint arXiv:1709.04071, 2017. ",
1481
+ "bbox": [
1482
+ 174,
1483
+ 207,
1484
+ 823,
1485
+ 234
1486
+ ],
1487
+ "page_idx": 10
1488
+ },
1489
+ {
1490
+ "type": "text",
1491
+ "text": "Zhengyan Zhang, Xu Han, Zhiyuan Liu, Xin Jiang, Maosong Sun, and Qun Liu. Ernie: Enhanced language representation with informative entities. arXiv preprint arXiv:1905.07129, 2019. ",
1492
+ "bbox": [
1493
+ 176,
1494
+ 244,
1495
+ 821,
1496
+ 272
1497
+ ],
1498
+ "page_idx": 10
1499
+ },
1500
+ {
1501
+ "type": "text",
1502
+ "text": "A APPENDIX ",
1503
+ "text_level": 1,
1504
+ "bbox": [
1505
+ 176,
1506
+ 300,
1507
+ 297,
1508
+ 315
1509
+ ],
1510
+ "page_idx": 10
1511
+ },
1512
+ {
1513
+ "type": "text",
1514
+ "text": "A.1 IMPLEMENTATION DETAILS ",
1515
+ "text_level": 1,
1516
+ "bbox": [
1517
+ 176,
1518
+ 330,
1519
+ 406,
1520
+ 344
1521
+ ],
1522
+ "page_idx": 10
1523
+ },
1524
+ {
1525
+ "type": "text",
1526
+ "text": "The dimension of hidden states in the knowledge module is 768, the same as RoBERTa-base, and the number of attention heads is 8. During pre-training, the batch size and length of text sequences are 1024 and 512 respectively. The batch size of KG entities is 16,384. The number of training epochs is 8. JAKET is optimized by AdamW (Loshchilov & Hutter, 2017) using the following parameters: $\\beta _ { 1 } = 0 . 9$ , $\\beta _ { 2 } ~ = ~ 0 . 9 9 9$ , $\\epsilon = 1 \\mathrm { e } { - } 8$ , and weight decay of 0.01. The learning rate of the language module is warmed up over the first 3,000 steps to a peak value of 1e-5, and then linearly decayed. The learning rate of our knowledge module starts from 1e-4 and then linearly decayed. ",
1527
+ "bbox": [
1528
+ 174,
1529
+ 356,
1530
+ 825,
1531
+ 454
1532
+ ],
1533
+ "page_idx": 10
1534
+ },
1535
+ {
1536
+ "type": "text",
1537
+ "text": "A.2 COMPUTATION ANALYSIS ",
1538
+ "text_level": 1,
1539
+ "bbox": [
1540
+ 176,
1541
+ 472,
1542
+ 397,
1543
+ 486
1544
+ ],
1545
+ "page_idx": 10
1546
+ },
1547
+ {
1548
+ "type": "text",
1549
+ "text": "The computation of the KG module is much less than the LM module. For BERT-base or RoBERTabase, the number of inference computation flops (#flops) over each sequence (length 128) is over 22 billion [1, 2]. Here, we theoretically compute the number of flops of the KG module as follows: The sequence length $N = 1 2 8$ , and hidden dimension $H = 7 6 8$ . The number of entities in a sequence is usually less than $N / 5$ . The number of sampled neighbors per entity $r = 1 0$ . And the number of layers of the GNN based KG module $L = 2$ . It follows that the #flops of KG module is about $N / 5 \\stackrel { \\bullet } { \\times } r ^ { L } \\times 2 H ^ { 2 } \\approx 3$ billion, less than $1 / 7$ of LM computation. If we set $r = 5$ , the #flops can be further reduced to about $1 / 3 0$ of LM computation. ",
1550
+ "bbox": [
1551
+ 174,
1552
+ 497,
1553
+ 825,
1554
+ 608
1555
+ ],
1556
+ "page_idx": 10
1557
+ },
1558
+ {
1559
+ "type": "text",
1560
+ "text": "During pre-training, another computation overhead is entity context embedding memory update (Section 3.5): Firstly, the number of entities is about 3 million and the update step interval is 500. Thus for each step on average the model processes the description text of $3 \\mathrm { e } 6 / 5 0 0 = 6 \\mathrm { e } 3$ entities. Secondly, the length of description text is 64, much smaller than the length of input text 512, and we only use LM1 (the first half of LM module) for entity context embedding generation, which saves half of the computation time compared to using the whole LM module. Thirdly, the embedding update only requires forward propagation, costing only half of computation compared to training process which requires both forward and backward propagation. Thus, generating context embedding of 6k entities consumes about the same number of flops as training $6 0 \\bar { 0 } 0 0 \\times 6 4 / ( 5 1 2 \\times 2 \\times 2 ) \\approx 2 0 \\bar { 0 }$ input texts, much smaller than the batch size 1024. In short, the entity context embedding memory update only costs $2 0 0 / 1 0 2 4 \\approx 1 / 5$ additional computation. Note this computation overhead only exists during pre-training, since entity embedding memory is not updated when fine-tuning. ",
1561
+ "bbox": [
1562
+ 174,
1563
+ 616,
1564
+ 825,
1565
+ 782
1566
+ ],
1567
+ "page_idx": 10
1568
+ }
1569
+ ]
parse/train/SOVSJZ9PTO7/SOVSJZ9PTO7_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SOVSJZ9PTO7/SOVSJZ9PTO7_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/Syx6bz-Ab/Syx6bz-Ab.md ADDED
@@ -0,0 +1,297 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SEQ2SQL: GENERATING STRUCTURED QUERIES FROM NATURAL LANGUAGE USING REINFORCEMENT LEARNING
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Relational databases store a significant amount of the worlds data. However, accessing this data currently requires users to understand a query language such as SQL. We propose Seq2SQL, a deep neural network for translating natural language questions to corresponding SQL queries. Our model uses rewards from inthe-loop query execution over the database to learn a policy to generate the query, which contains unordered parts that are less suitable for optimization via cross entropy loss. Moreover, Seq2SQL leverages the structure of SQL to prune the space of generated queries and significantly simplify the generation problem. In addition to the model, we release WikiSQL, a dataset of 80654 hand-annotated examples of questions and SQL queries distributed across 24241 tables from Wikipedia that is an order of magnitude larger than comparable datasets. By applying policybased reinforcement learning with a query execution environment to WikiSQL, $\mathrm { S e q } 2 \mathrm { S Q L }$ outperforms a state-of-the-art semantic parser, improving execution accuracy from $3 5 . 9 \%$ to $5 9 . 4 \%$ and logical form accuracy from $2 3 . 4 \%$ to $4 8 . 3 \%$ .
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Relational databases store a vast amount of today’s information and provide the foundation of applications such as medical records (Hillestad et al., 2005), financial markets (Beck et al., 2000), and customer relations management (Ngai et al., 2009). However, accessing relational databases requires an understanding of query languages such as SQL, which, while powerful, is difficult to master. Natural language interfaces (NLI), a research area at the intersection of natural language processing and human-computer interactions, seeks to provide means for humans to interact with computers through the use of natural language (Androutsopoulos et al., 1995). We investigate one particular aspect of NLI applied to relational databases: translating natural language questions to SQL queries.
12
+
13
+ Our main contributions in this work are two-fold. First, we introduce Seq2SQL, a deep neural network for translating natural language questions to corresponding SQL queries. Seq2SQL, shown in Figure 1, consists of three components that leverage the structure of SQL to prune the output space of generated queries. Moreover, it uses policy-based reinforcement learning (RL) to generate the conditions of the query, which are unsuitable for optimization using cross entropy loss due to their unordered nature. We train Seq2SQL using a mixed objective, combining cross entropy losses and RL rewards from in-the-loop query execution on a database. These characteristics allow Seq2SQL to achieve state-of-the-art results on query generation.
14
+
15
+ Next, we release WikiSQL, a corpus of 80654 hand-annotated instances of natural language questions, SQL queries, and SQL tables extracted from 24241 HTML tables from Wikipedia. WikiSQL is an order of magnitude larger than previous semantic parsing datasets that provide logical forms along with natural language utterances. We release the tables used in WikiSQL both in raw JSON format as well as in the form of a SQL database. Along with WikiSQL, we release a query execution engine for the database used for in-the-loop query execution to learn the policy. On WikiSQL, Seq2SQL outperforms a previously state-of-the-art semantic parsing model by Dong & Lapata (2016), which obtains $3 5 . 9 \%$ execution accuracy, as well as an augmented pointer network baseline, which obtains $5 3 . 3 \%$ execution accuracy. By leveraging the inherent structure of
16
+
17
+ ![](images/53258bbee644902935761ee927252fc96f07924299c5d3d2c8ef333907c00f58.jpg)
18
+ Figure 1: $\mathrm { S e q } 2 \mathrm { S Q L }$ takes as input a question and the columns of a table. It generates the corresponding SQL query, which, during training, is executed against a database. The result of the execution is utilized as the reward to train the reinforcement learning algorithm.
19
+
20
+ <table><tr><td rowspan=1 colspan=6>Table:CFLDraft Question:</td></tr><tr><td rowspan=1 colspan=1>Pick #</td><td rowspan=1 colspan=1>CFL Team</td><td rowspan=1 colspan=1>Player</td><td rowspan=1 colspan=1>Position</td><td rowspan=1 colspan=1>College</td><td rowspan=1 colspan=1>How many CFL teamsare from York College?</td></tr><tr><td rowspan=1 colspan=1>27</td><td rowspan=1 colspan=1>Hamilton Tiger-Cats</td><td rowspan=1 colspan=1>Connor Healy</td><td rowspan=1 colspan=1>DB</td><td rowspan=1 colspan=1>Wilfrid Laurier</td><td rowspan=6 colspan=1>SQL:SELECT COUNT CFL Team FROMCFLDraft WHERE College = &quot;York&quot;Result:②</td></tr><tr><td rowspan=1 colspan=1>28</td><td rowspan=1 colspan=1>Calgary Stampeders</td><td rowspan=1 colspan=1>Anthony Forgone</td><td rowspan=1 colspan=1>OL</td><td rowspan=1 colspan=1>York</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>29</td><td rowspan=2 colspan=1>Ottawa Renegades</td><td rowspan=2 colspan=1>L.P. Ladouceur</td><td rowspan=2 colspan=1>DT</td><td rowspan=2 colspan=1>California</td></tr><tr><td rowspan=1 colspan=1>SELECT COUNT CFL Team FROMCFLDraft WHERE College = &quot;York&quot;</td></tr><tr><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>Toronto Argonauts</td><td rowspan=1 colspan=1>Frank Hoffman</td><td rowspan=1 colspan=1>DL</td><td rowspan=1 colspan=1>York</td></tr><tr><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>..</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>…</td></tr></table>
21
+
22
+ Figure 2: An example in WikiSQL. The inputs consist of a table and a question. The outputs consist of a ground truth SQL query and the corresponding result from execution.
23
+
24
+ SQL queries and applying policy gradient methods using reward signals from live query execution, Seq2SQL achieves state-of-the-art performance on WikiSQL, obtaining $5 9 . 4 \%$ execution accuracy.
25
+
26
+ # 2 MODEL
27
+
28
+ The WikiSQL task is to generate a SQL query from a natural language question and table schema. Our baseline model is the attentional sequence to sequence neural semantic parser proposed by Dong & Lapata (2016) that achieves state-of-the-art performance on a host of semantic parsing datasets without using hand-engineered grammar. However, the output space of the softmax in their Seq2Seq model is unnecessarily large for this task. In particular, we can limit the output space of the generated sequence to the union of the table schema, question utterance, and SQL key words. The resulting model is similar to a pointer network (Vinyals et al., 2015) with augmented inputs. We first describe the augmented pointer network model, then address its limitations in our definition of Seq2SQL, particularly with respect to generating unordered query conditions.
29
+
30
+ # 2.1 AUGMENTED POINTER NETWORK
31
+
32
+ The augmented pointer network generates the SQL query token-by-token by selecting from an input sequence. In our case, the input sequence is the concatenation of the column names, required for the selection column and the condition columns of the query, the question, required for the conditions of the query, and the limited vocabulary of the SQL language such as SELECT, COUNT etc. In the example shown in Figure 2, the column name tokens consist of “Pick”, “#”, “CFL”, “Team” etc.; the question tokens consist of “How”, “many”, “CFL”, “teams” etc.; the SQL tokens consist of SELECT, WHERE, COUNT, MIN, MAX etc. With this augmented input sequence, the pointer network can produce the SQL query by selecting exclusively from the input.
33
+
34
+ Suppose we have a list of $N$ table columns and a question such as in Figure 2, and want to produce the corresponding SQL query. Let $\boldsymbol { x } _ { j } ^ { \mathrm { c } } = [ x _ { j , 1 } ^ { \mathrm { c } } , x _ { j , 2 } ^ { \mathrm { c } } , . . . x _ { j , T _ { j } } ^ { \mathrm { c } } ]$ denote the sequence of words in the name of the $j$ th column, where $\boldsymbol { x } _ { j , i } ^ { \mathrm { c } }$ represents the ith word in the $j$ th column and $T _ { j }$ represents the total number of words in the $j$ th column. Similarly, let $x ^ { \mathrm { q } }$ and $x ^ { \mathrm { s } }$ respectively denote the sequence of words in the question and the set of unique words in the SQL vocabulary.
35
+
36
+ We define the input sequence $x$ as the concatenation of all the column names, the question, and the SQL vocabulary:
37
+
38
+ $$
39
+ x = [ < \mathrm { c o l } > ; x _ { 1 } ^ { \mathrm { c } } ; x _ { 2 } ^ { \mathrm { c } } ; . . . ; x _ { N } ^ { \mathrm { c } } ; < \mathrm { s q l } > ; x ^ { \mathrm { s } } ; < \mathrm { q u e s t i o n } > ; x ^ { \mathrm { q } } ]
40
+ $$
41
+
42
+ where $[ a ; b ]$ denotes the concatenation between the sequences $a$ and $b$ and we add sentinel tokens between neighbouring sequences to demarcate the boundaries.
43
+
44
+ The network first encodes $x$ using a two-layer, bidirectional Long Short-Term Memory network (Hochreiter & Schmidhuber, 1997). The input to the encoder are the embeddings corresponding to words in the input sequence. We denote the output of the encoder by $h ^ { \mathrm { e n c } }$ , where $h _ { t } ^ { \mathrm { e n c } }$ is the state of the encoder corresponding to the $t ^ { \mathrm { { t h } } }$ word in the input sequence. For brevity, we do not write out the LSTM equations, which are described by Hochreiter & Schmidhuber (1997). We then apply a pointer network similar to that proposed by Vinyals et al. (2015) to the input encodings $h ^ { \mathrm { e n c } }$ .
45
+
46
+ The decoder network uses a two layer, unidirectional LSTM. During each decoder step $s$ , the decoder LSTM takes as input $y _ { s - 1 }$ , the query token generated during the previous decoding step, and outputs the state $g _ { s }$ . Next, the decoder produces a scalar attention score $\alpha _ { s , t } ^ { \mathrm { p t r } }$ for each position $t$ of the input sequence:
47
+
48
+ $$
49
+ \alpha _ { s , t } ^ { \mathrm { p t r } } = W ^ { \mathrm { p t r } } \mathrm { t a n h } \left( U ^ { \mathrm { p t r } } g _ { s } + V ^ { \mathrm { p t r } } h _ { t } \right)
50
+ $$
51
+
52
+ We choose the input token with the highest score as the next token of the generated SQL query, $y _ { s } = \mathrm { a r g m a x } ( \alpha _ { s } ^ { \mathrm { p t r } } )$ .
53
+
54
+ # 2.2 SEQ2SQL
55
+
56
+ While the augmented pointer network can solve the SQL generation problem, it does not leverage the structure inherent in SQL. Typically, a SQL query such as that shown in Figure 3 consists of three components. The first component is the aggregation operator, in this case COUNT, which produces a summary of the rows selected by the query. Alternatively the query may request no summary statistics, in which case an aggregation operator is not provided. The second component is the SELECT column(s), in this case Engine, which identifies the column(s) that are to be included in the returned results. The third
57
+
58
+ ![](images/27a29333845bc236fce3fc23e6b9beb4b328686d46fb7dfd5b082cd1c1a0765f.jpg)
59
+ Figure 3: The $\mathrm { S e q } 2 \mathrm { S Q L }$ model has three components, corresponding to the three parts of a SQL query (right). The input to the model are the question (top left) and the table column names (bottom left).
60
+
61
+ component is the WHERE clause of the query, in this case WHERE Driver $=$ Val Musetti, which contains conditions by which to filter the rows. Here, we keep rows in which the driver is “Val Musetti”.
62
+
63
+ Seq2SQL, as shown in Figure 3, has three parts that correspond to the aggregation operator, the SELECT column, and the WHERE clause. First, the network classifies an aggregation operation for the query, with the addition of a null operation that corresponds to no aggregation. Next, the network points to a column in the input table corresponding to the SELECT column. Finally, the network generates the conditions for the query using a pointer network. The first two components are supervised using cross entropy loss, whereas the third generation component is trained using policy gradient to address the unordered nature of query conditions (we explain this in the subsequent WHERE Clause section). Utilizing the structure of SQL allows $\mathrm { S e q } 2 \mathrm { S Q L }$ to further prune the output space of queries, which leads to higher performance than Seq2Seq and the augmented pointer network.
64
+
65
+ Aggregation Operation. The aggregation operation depends on the question. For the example shown in Figure 3, the correct operator is COUNT because the question asks for “How many”. To compute the aggregation operation, we first compute the scalar attention for each tth token in the input sequence. We normalize the vector of scores $\alpha _ { t } ^ { \mathrm { i n p } } = W ^ { \mathrm { i n p } } h _ { t } ^ { \mathrm { e n c } }$ , $\alpha ^ { \mathrm { i n p } } = [ \alpha _ { 1 } ^ { \mathrm { i n p } } , \alpha _ { 2 } ^ { \mathrm { i n p } } , \ldots ]$ produce a distribution over the input encodings, $\beta ^ { \mathrm { i n p } } = \mathrm { s o f t m a x } \left( \alpha ^ { \mathrm { i n p } } \right)$ . The input representation $\kappa ^ { \mathrm { a g g } }$ is the sum over the input encodings $h ^ { \mathrm { e n c } }$ weighted by the normalized scores $\beta ^ { \mathrm { i n p } }$ :
66
+
67
+ $$
68
+ \kappa ^ { \mathrm { a g g } } = \sum _ { t } \beta _ { t } ^ { \mathrm { i n p } } h _ { t } ^ { \mathrm { e n c } }
69
+ $$
70
+
71
+ Let $\alpha ^ { \mathrm { a g g } }$ denote the scores over the aggregation operations such as COUNT, MIN, MAX, and the noaggregation operation NULL. We compute $\alpha ^ { \mathrm { a g g } }$ by applying a multi-layer perceptron to the input
72
+
73
+ $$
74
+ \alpha ^ { \mathrm { a g g } } = W ^ { \mathrm { a g g } } \operatorname { t a n h } \left( V ^ { \mathrm { a g g } } \kappa ^ { \mathrm { a g g } } + b ^ { \mathrm { a g g } } \right) + c ^ { \mathrm { a g g } }
75
+ $$
76
+
77
+ We apply the softmax function to obtain the distribution over the set of possible aggregation operations $\beta ^ { \mathrm { a g g } } = \mathrm { s o f t m a x } \left( \alpha ^ { \mathrm { a g g } } \right)$ . We use cross entropy loss $L ^ { \mathrm { a g g } }$ for the aggregation operation.
78
+
79
+ SELECT Column. The selection column depends on the table columns as well as the question. Namely, for the example in Figure 3, “How many engine types” indicates that we need to retrieve the “Engine” column. SELECT column prediction is then a matching problem, solvable using a pointer: given the list of column representations and a question representation, we select the column that best matches the question.
80
+
81
+ In order to produce the representations for the columns, we first encode each column name with a LSTM. The representation of a particular column $j , e _ { j } ^ { \mathrm { c } }$ , is given by:
82
+
83
+ $$
84
+ h _ { j , t } ^ { \mathrm { c } } = \mathrm { L S T M } \left( \operatorname { e m b } \left( x _ { j , t } ^ { \mathrm { c } } \right) , h _ { j , t - 1 } ^ { \mathrm { c } } \right) \qquad e _ { j } ^ { \mathrm { c } } = h _ { j , T _ { j } } ^ { \mathrm { c } }
85
+ $$
86
+
87
+ Here, $h _ { j , t } ^ { \mathrm { c } }$ denotes the tth encoder state of the $j$ th column. We take the last encoder state to be $e _ { j } ^ { \mathrm { c } }$ column $j$ ’s representation.
88
+
89
+ To construct a representation for the question, we compute another input representation $\kappa ^ { \mathrm { s e l } }$ using the same architecture as for $\kappa ^ { \mathrm { a g g } }$ (Equation 3) but with untied weights. Finally, we apply a multi-layer perceptron over the column representations, conditioned on the input representation, to compute the a score for each column $j$ :
90
+
91
+ $$
92
+ \alpha _ { j } ^ { \mathrm { s e l } } = W ^ { \mathrm { s e l } } \operatorname { t a n h } \left( V ^ { \mathrm { s e l } } \kappa ^ { \mathrm { s e l } } + V ^ { \mathrm { c } } e _ { j } ^ { \mathrm { c } } \right)
93
+ $$
94
+
95
+ We normalize the scores with a softmax function to produce a distribution over the possible SELECT columns $\beta ^ { \mathrm { s e l } } =$ softmax $\left( \alpha ^ { \mathrm { { s e l } } } \right)$ . For the example shown in Figure 3, the distribution is over the columns “Entrant”, “Constructor”, “Chassis”, “Engine”, “No”, and the ground truth SELECT column “Driver”. We train the SELECT network using cross entropy loss $L ^ { \mathrm { { \bar { s e l } } } }$ .
96
+
97
+ WHERE Clause. We can train the WHERE clause using a pointer decoder similar to that described in Section 2.1. However, there is a limitation in using the cross entropy loss to optimize the network: the WHERE conditions of a query can be swapped and the query yield the same result. Suppose we have the question “which men are older than $1 8 ^ { \circ }$ and the queries SELECT name FROM insurance WHERE age $\mathrm { ~ ~ { ~ \geq ~ } ~ } { \mathrm { ~ \perp ~ 8 ~ } }$ AND gender $=$ "male" and SELECT name FROM insurance WHERE gender $=$ "male" AND age $\mathrm { ~ ~ { ~ \geq ~ } ~ } \mathbb { 1 } \mathrm { 8 }$ . Both queries obtain the correct execution result despite not having exact string match. If the former is provided as the ground truth, using cross entropy loss to supervise the generation would then wrongly penalize the latter. To address this problem, we apply reinforcement learning to learn a policy to directly optimize the expected correctness of the execution result (Equation 7).
98
+
99
+ Instead of teacher forcing at each step of query generation, we sample from the output distribution to obtain the next token. At the end of the generation procedure, we execute the generated SQL query against the database to obtain a reward. Let $y = \mathring [ y ^ { 1 } , y ^ { 2 } , . . . , y ^ { T } ]$ denote the sequence of generated tokens in the WHERE clause. Let $q \left( y \right)$ denote the query generated by the model and $q _ { g }$ denote the ground truth query corresponding to the question. We define the reward $R \left( q \left( y \right) , q _ { g } \right)$ as
100
+
101
+ $$
102
+ R \left( q \left( y \right) , q _ { g } \right) = \left\{ \begin{array} { l l } { - 2 , } & { \mathrm { i f ~ } q \left( y \right) \mathrm { ~ i s ~ n o t ~ a ~ v a l i d ~ S Q L ~ q u e r y } } \\ { - 1 , } & { \mathrm { i f ~ } q \left( y \right) \mathrm { ~ i s ~ a ~ v a l i d ~ S Q L ~ q u e r y ~ a n d ~ e x e c u t e s ~ t o ~ a n ~ i n c o r r e c t ~ r e s u l t } } \\ { + 1 , } & { \mathrm { i f ~ } q \left( y \right) \mathrm { ~ i s ~ a ~ v a l i d ~ S Q L ~ q u e r y ~ a n d ~ e x e c u t e s ~ t o ~ t h e ~ c o r r e c t ~ r e s u l t } } \end{array} \right.
103
+ $$
104
+
105
+ The loss, $L ^ { \mathrm { w h e } } = - \mathbb { E } _ { y } [ R \left( q \left( y \right) , q _ { g } \right) ]$ , is the negative expected reward over possible WHERE clauses.
106
+ We derive the policy gradient for $L ^ { \mathrm { w h e } }$ as shown by Sutton et al. (2000) and Schulman et al. (2015).
107
+
108
+ $$
109
+ \begin{array} { r c l } { \nabla L _ { \Theta } ^ { \mathrm { w h e } } } & { = } & { - \nabla _ { \Theta } \left( \mathbb { E } _ { y \sim p _ { y } } \left[ R \left( q \left( \boldsymbol { y } \right) , q _ { g } \right) \right] \right) } \\ & { = } & { - \mathbb { E } _ { y \sim p _ { y } } \left[ R \left( q \left( \boldsymbol { y } \right) , q _ { g } \right) \nabla _ { \Theta } \sum _ { t } \left( \log p _ { y } \left( y _ { t } ; \Theta \right) \right) \right] } \\ & { \approx } & { - R \left( q \left( \boldsymbol { y } \right) , q _ { g } \right) \nabla _ { \Theta } \sum _ { t } \left( \log p _ { y } \left( y _ { t } ; \Theta \right) \right) } \end{array}
110
+ $$
111
+
112
+ Here, $p _ { y } ( y _ { t } )$ denotes the probability of choosing token $y _ { t }$ during time step $t$ . In equation 10, we approximate the expected gradient using a single Monte-Carlo sample $y$
113
+
114
+ Mixed Objective Function. We train the model using gradient descent to minimize the objective function $\dot { L } = L ^ { \mathrm { a g g } } + L ^ { \mathrm { s e l } } + L ^ { \mathrm { w h e } }$ . Consequently, the total gradient is the equally weighted sum of the gradients from the cross entropy loss in predicting the SELECT column, from the cross entropy loss in predicting the aggregation operation, and from policy learning.
115
+
116
+ # 3 WIKISQL
117
+
118
+ WikiSQL is a collection of questions, corresponding SQL queries, and SQL tables. A single example in WikiSQL, shown in Figure 2, contains a table, a SQL query, and the natural language question corresponding to the SQL query. Table 1 shows how WikiSQL compares to related datasets. Namely, WikiSQL is the largest hand-annotated semantic parsing dataset to date - it is an order of magnitude larger than other datasets that have logical forms, either in terms of the number of examples or the number of tables. The queries in WikiSQL span over a large number of tables and hence presents an
119
+
120
+ ![](images/adbcb4d9e44352d24300f8a4b23f8bc6c9413df72e38d90548a15bfeeb2243d7.jpg)
121
+ Figure 4: Distribution of questions in WikiSQL.
122
+
123
+ unique challenge: the model must be able to not only generalize to new queries, but to new table schema. Finally, WikiSQL contains realistic data extracted from the web. This is evident in the distributions of the number of columns, the lengths of questions, and the length of queries, respectively shown in Figure 5. Another indicator of the variety of questions in the dataset is the distribution of question types, shown in Figure 4.
124
+
125
+ ![](images/7d88f8a70db87dd519843bb04c6b7ff79703cb5ff66e6c9a778cf054a8facf3b.jpg)
126
+ Figure 5: Distribution of table, question, query sizes in WikiSQL.
127
+
128
+ We collect WikiSQL by crowd-sourcing on Amazon Mechanical Turk in two phases. First, a worker paraphrases a generated question for a table. We form the generated question using a template, filled using a randomly generated SQL query. We ensure the validity and complexity of the tables by keeping only those that are legitimate database tables and sufficiently large in the number of rows and columns. Next, two other workers verify that the paraphrase has the same meaning as the generated question. We discard paraphrases that do not show enough variation, as measured by the character edit distance from the generated question, as well as those both workers deemed incorrect during verification. Section A of the Appendix contains more details on the collection of WikiSQL. We make available examples of the interface used during the paraphrase phase and during the verification phase in the supplementary materials. The dataset is available for download at [MASK].
129
+
130
+ The tables, their paraphrases, and SQL queries are randomly slotted into train, dev, and test splits, such that each table is present in exactly one split. In addition to the raw tables, queries, results, and natural utterances, we also release a corresponding SQL database and query execution engine.
131
+
132
+ # 3.1 EVALUATION
133
+
134
+ Let $N$ denote the total number of examples in the dataset, $N _ { \mathrm { e x } }$ the number of queries that, when executed, result in the correct result, and $N _ { \mathrm { l f } }$ the number of queries has exact string match with the ground truth query used to collect the paraphrase. We evaluate using the execution accuracy metric $\begin{array} { r l r } { \mathrm { A c c } _ { \mathrm { e x } } } & { { } = } & { \frac { N _ { \mathrm { e x } } } { N } } \end{array}$ . One downside of $\operatorname { A c c } _ { \mathrm { e x } }$ is that it is possible to construct a SQL query that does not correspond to the question but nevertheless obtains the same result. For example, the two queries SELECT COUNT(name)
135
+
136
+ <table><tr><td>Dataset</td><td>Size</td><td>LF</td><td>Schema</td></tr><tr><td>WikiSQL</td><td>80654</td><td>yes</td><td>24241</td></tr><tr><td>Geoquery</td><td>880</td><td>yes</td><td>8</td></tr><tr><td>ATIS</td><td>5871</td><td>yes</td><td>141</td></tr><tr><td>Freebase917</td><td>917</td><td>yes</td><td>81*</td></tr><tr><td>Overnight</td><td>26098</td><td>yes</td><td>8</td></tr><tr><td>WebQuestions</td><td>5810</td><td>no</td><td>2420</td></tr><tr><td>WikiTableQuestions</td><td>22033</td><td>no</td><td>2108</td></tr></table>
137
+
138
+ Table 1: Comparison between WikiSQL and existing datasets. The datasets are GeoQuery880 (Tang & Mooney, 2001), ATIS (Price, 1990), Free917 (Cai & Yates, 2013), Overnight (Wang et al., 2015), WebQuestions (Berant et al., 2013), and WikiTableQuestions (Pasupat & Liang, 2015). “Size” denotes the number of examples in the dataset. “LF” indicates whether it has annotated logical forms. “Schema” denotes the number of tables. ATIS is presented as a slot filling task. Each Freebase API page is counted as a separate domain.
139
+
140
+ WHERE $\mathrm { S S N } ~ = ~ 1 2 3$ and SELECT COUNT(SSN) WHERE $\mathrm { S S N } ~ = ~ 1 2 3$ produce the same result if no two people with different names share the SSN 123. Hence, we also use the logical form accuracy $\textstyle \operatorname { A c c } _ { \mathrm { l f } } = { \frac { N _ { \mathrm { l f } } } { N } }$ . However, as we showed in Section 2.2, $\operatorname { A c c } _ { \mathrm { l f } }$ incorrectly penalizes queries that achieve the correct result but do not have exact string match with the ground truth query. Due to these observations, we use both metrics to evaluate the models.
141
+
142
+ # 4 EXPERIMENTS
143
+
144
+ We tokenize the dataset using Stanford CoreNLP (Manning et al., 2014). We use the normalized tokens for training and revert into original gloss before outputting the query so that generated queries are executable on the database. We use fixed GloVe word embeddings (Pennington et al., 2014) and character n-gram embeddings (Hashimoto et al., 2016). Let $w _ { x } ^ { \mathrm { g } }$ denote the GloVe embedding and $w _ { x } ^ { \mathrm { c } }$ the character embedding for word $x$ . Here, $w _ { x } ^ { \mathrm { c } }$ is the mean of the embeddings of all the character ngrams in $x$ . For words that have neither word nor character embeddings, we assign the zero vector. All networks are run for a maximum of 300 epochs with early stopping on dev split execution accuracy. We train using ADAM (Kingma & Ba, 2014) and regularize using dropout (Srivastava et al., 2014). All recurrent layers have a hidden size of 200 units and are followed by a dropout of 0.3. We implement all models using PyTorch 1. To train Seq2SQL, we first train a version in which the WHERE clause is supervised via teacher forcing (i.e. the policy is not learned from scratch) and then continue training using reinforcement learning. In order to obtain the rewards described in Section 2.2, we use the query execution engine described in Section 3.
145
+
146
+ # 4.1 RESULT
147
+
148
+ We compare results against the attentional sequence to sequence neural semantic parser proposed by Dong & Lapata (2016). This model achieves state of the art results on a variety of semantic parsing datasets, outperforming a host of non-neural semantic parsers despite not using hand-engineered grammars. To make this baseline even more competitive on our new dataset, we augment their input with the table schema such that the model can generalize to new tables. We describe this baseline in detail in Section 2 of the Appendix. Table 2 compares the performance of the three models.
149
+
150
+ Table 2: Performance on WikiSQL. Both metrics are defined in Section 3.1. For $\mathrm { S e q } 2 \mathrm { S Q L }$ (no RL), the WHERE clause is supervised via teacher forcing as opposed to reinforcement learning.
151
+
152
+ <table><tr><td>Model</td><td>Dev AcClf</td><td>Dev AcCex</td><td>Test Accf</td><td>Test AcCex</td></tr><tr><td>Baseline (Dong &amp; Lapata, 2016)</td><td>23.3%</td><td>37.0%</td><td>23.4%</td><td>35.9%</td></tr><tr><td>Aug Ptr Network</td><td>44.1%</td><td>53.8%</td><td>43.3%</td><td>53.3%</td></tr><tr><td>Seq2SQL (no RL)</td><td>48.2%</td><td>58.1%</td><td>47.4%</td><td>57.1%</td></tr><tr><td>Seq2SQL</td><td>49.5%</td><td>60.8%</td><td>48.3%</td><td> 59.4%</td></tr></table>
153
+
154
+ Reducing the output space by utilizing the augmented pointer network improves upon the baseline by $1 7 . 4 \%$ . Leveraging the structure of SQL queries leads to another improvement of $3 . 8 \%$ , as is shown by the performance of Seq2SQL without RL compared to the augmented pointer network. Finally, training using reinforcement learning based on rewards from in-the-loop query executions on a database leads to another performance increase of $2 . 3 \%$ , as is shown by the performance of the full Seq2SQL model.
155
+
156
+ # 4.2 ANALYSIS
157
+
158
+ Limiting the output space via pointer network leads to more accurate conditions. Compared to the baseline, the augmented pointer network generates higher quality WHERE clause. For example, for “in how many districts was a successor seated on march 4, 1850?”, the baseline generates the condition successor seated $=$ seated march 4 whereas Seq2SQL generates successor seated $=$ seated march 4 1850. Similarly, for “what’s doug battaglia’s pick number?”, the baseline generates Player $=$ doug whereas Seq2SQL generates Player $=$ doug battaglia. The conditions tend to contain rare words (e.g. “ $\cdot 1 8 5 0 ^ { \cdot 9 } )$ , but the baseline is inclined to produce common words in the training corpus, such as “march” and “4” for date, or “doug” for name. The pointer is less affected since it selects exclusively from the input.
159
+
160
+ Incorporating structure reduces invalid queries. Seq2SQL without RL directly predicts selection and aggregation and reduces invalid SQL queries generated from $7 . 9 \%$ t o $4 . 8 \%$ . A large quantity of invalid queries result from column names – the generated
161
+
162
+ Table 3: Performance on the COUNT operator.
163
+
164
+ <table><tr><td>Model</td><td>Precision</td><td>Recall</td><td>F1</td></tr><tr><td>Aug Ptr Network</td><td>66.3%</td><td>64.4%</td><td>65.4%</td></tr><tr><td>Seq2SQL</td><td>72.6%</td><td>66.2%</td><td>69.2%</td></tr></table>
165
+
166
+ query refers to selection columns that are not present in the table. This is particularly helpful when the column name contain many tokens, such as “Miles $\left( \mathrm { k m } \right) ^ { \ast }$ , which has 4 tokens. Introducing a classifier for the aggregation also reduces the error rate. Table 3 shows that adding the aggregation classifier improves the precision, recall, and F1 for predicting the COUNT operator. For more queries produced by the different models, please see Section 3 of the Appendix.
167
+
168
+ RL generates higher quality WHERE clause that are ordered differently than ground truth. Training with policy-based RL obtains correct results in which the order of conditions is differs from the ground truth query. For example, for “in what district was the democratic candidate first elected in 1992?”, the ground truth conditions are First elected $= \ 1 9 9 2$ AND Party $=$ Democratic whereas Seq2SQL generates Party $=$ Democratic AND First elected $= \ 1 9 9 2$ . When Seq2SQL is correct and Seq2SQL without RL is not, the latter tends to produce an incorrect WHERE clause. For example, for the rather complex question “what is the race name of the 12th round trenton, new jersey race where a.j. foyt had the pole position?”, Seq2SQL trained without RL generates WHERE rnd $\qquad = \quad \pm 2$ and track $\ u = \ a \cdot \dot { \ u } $ . foyt AND pole position $=$ a.j. foyt whereas Seq2SQL trained with RL correctly generates WHERE rnd $\qquad = \quad \pm 2$ AND pole position $\ u = \hat { \ u } \hat { \mathrm { ~ \bf ~ d ~ } } \cdot \dot { \mathrm { ~ \bf ~ J ~ } }$ . foyt.
169
+
170
+ # 5 RELATED WORK
171
+
172
+ Semantic Parsing. In semantic parsing for question answering (QA), natural language questions are parsed into logical forms that are then executed on a knowledge graph (Zelle & Mooney, 1996; Wong & Mooney, 2007; Zettlemoyer & Collins, 2005; 2007). Other works in semantic parsing focus on learning parsers without relying on annotated logical forms by leveraging conversational logs (Artzi & Zettlemoyer, 2011), demonstrations (Artzi & Zettlemoyer, 2013), distant supervision (Cai & Yates, 2013; Reddy et al., 2014), and question-answer pairs (Liang et al., 2011). Semantic parsing systems are typically constrained to a single schema and require hand-curated grammars to perform well2. Pasupat & Liang (2015) addresses the single-schema limitation by proposing the floating parser, which generalizes to unseen web tables on the WikiTableQuestions task. Our approach is similar in that it generalizes to new table schema. However, we do not require access to table content, conversion of table to an additional graph, hand-engineered features, nor handengineered grammar.
173
+
174
+ Semantic parsing datasets. Previous semantic parsing systems were designed to answer complex and compositional questions over closed-domain, fixed-schema datasets such as GeoQuery (Tang & Mooney, 2001) and ATIS (Price, 1990). Researchers also investigated QA over subsets of largescale knowledge graphs such as DBPedia (Starc & Mladenic, 2017) and Freebase (Cai & Yates, 2013; Berant et al., 2013). The dataset “Overnight” (Wang et al., 2015) uses a similar crowdsourcing process to build a dataset of natural language question, logical form pairs, but has only 8 domains. WikiTableQuestions (Pasupat & Liang, 2015) is a collection of question and answers, also over a large quantity of tables extracted from Wikipedia. However, it does not provide logical forms whereas WikiSQL does. WikiTableQuestions focuses on the task of QA over noisy web tables, whereas WikiSQL focuses on generating SQL queries for questions over relational database tables. We intend to build a natural language interface for databases, and do not use table content apart from evaluation.
175
+
176
+ Representation learning for sequence generation. Dong & Lapata (2016)’s attentional sequence to sequence neural semantic parser, which we use as the baseline, achieves state-of-the-art results on a variety of semantic parsing datasets despite not utilizing hand-engineered grammar. Unlike their model, Seq2SQL uses pointer based generation akin to Vinyals et al. (2015) to achieve higher performance, especially in generating queries with rare words and column names. Pointer models have also been successfully applied to tasks such as language modeling (Merity et al., 2017), summarization (Gu et al., 2016), combinatorial optimization (Bello et al., 2017), and question answering (Seo et al., 2017; Xiong et al., 2017). Another interesting neural semantic parsing model is the Neural Programmar by Neelakantan et al. (2017). Our approach is different than their work in that we do not require access to the table content during inference, which may be unavailable due to privacy concerns. We also do not hand-engineer model architecture for query execution and instead leverage existing database engines to perform efficient query execution. In contrast to both Dong & Lapata (2016) and Neelakantan et al. (2017), we train our model using policy-based RL, which helps Seq2SQL achieve state-of-the-art performance.
177
+
178
+ Natural language interface for databases. One of the prominent works in natural language interfaces is PRECISE (Popescu et al., 2003), which translates questions to SQL queries and identifies questions that it is not confident about. Giordani & Moschitti (2012) translate questions to SQL by first generating candidate queries from a grammar then ranking them using tree kernels. Both of these approaches rely on high quality grammar and are not suitable for tasks that require generalization to new schema. Iyer et al. (2017) also translate to SQL, but with a Seq2Seq model that is further improved with human feedback. Seq2SQL outperforms Seq2Seq and uses reinforcement learning instead of human feedback during training.
179
+
180
+ # 6 CONCLUSION
181
+
182
+ We proposed Seq2SQL, a deep neural network for translating questions to SQL queries. Our model leverages the structure of SQL queries to reduce the output space of the model. To train Seq2SQL, we applied in-the-loop query execution to learn a policy for generating the conditions of the SQL query, which is unordered and unsuitable for optimization via cross entropy loss. We also introduced WikiSQL, a dataset of questions and SQL queries that is an order of magnitude larger than comparable datasets. Finally, we showed that $\mathrm { S e q } 2 \mathrm { S Q L }$ outperforms a state-of-the-art semantic parser on WikiSQL, improving execution accuracy from $3 5 . 9 \%$ to $5 9 . 4 \%$ and logical form accuracy from $2 3 . 4 \%$ to $4 8 . 3 \%$ .
183
+
184
+ REFERENCES
185
+ I. Androutsopoulos, G.D. Ritchie, and P. Thanisch. Natural language interfaces to databases - an introduction. 1995.
186
+ Yoav Artzi and Luke S. Zettlemoyer. Bootstrapping semantic parsers from conversations. In EMNLP, 2011.
187
+ Yoav Artzi and Luke S. Zettlemoyer. Weakly supervised learning of semantic parsers for mapping instructions to actions. TACL, 1:49–62, 2013.
188
+ Thorsten Beck, Asli Demirguc¸-Kunt, and Ross Levine. A new database on the structure and devel- ¨ opment of the financial sector. The World Bank Economic Review, 14(3):597–605, 2000.
189
+ Irwan Bello, Hieu Pham, Quoc V. Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. ICLR, 2017.
190
+ Jonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. Semantic parsing on freebase from question-answer pairs. In EMNLP, 2013.
191
+ Chandra Bhagavatula, Thanapon Noraset, and Doug Downey. Methods for exploring and mining tables on wikipedia. In IDEA@KDD, 2013.
192
+ Qingqing Cai and Alexander Yates. Large-scale semantic parsing via schema matching and lexicon extension. In ACL, 2013.
193
+ Li Dong and Mirella Lapata. Language to logical form with neural attention. ACL, 2016.
194
+ Alessandra Giordani and Alessandro Moschitti. Translating questions to SQL queries with generative parsers discriminatively reranked. In COLING, 2012.
195
+ Jiatao Gu, Zhengdong Lu, Hang Li, and Victor O. K. Li. Incorporating copying mechanism in sequence-to-sequence learning. ACL, 2016.
196
+ Kazuma Hashimoto, Caiming Xiong, Yoshimasa Tsuruoka, and Richard Socher. A Joint Many-Task Model: Growing a Neural Network for Multiple NLP Tasks. arXiv, cs.CL 1611.01587, 2016.
197
+ Richard Hillestad, James Bigelow, Anthony Bower, Federico Girosi, Robin Meili, Richard Scoville, and Roger Taylor. Can electronic medical record systems transform health care? potential health benefits, savings, and costs. Health affairs, 24(5):1103–1117, 2005.
198
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. Neural computation, 1997.
199
+ Srinivasan Iyer, Ioannis Konstas, Alvin Cheung, Jayant Krishnamurthy, and Luke Zettlemoyer. Learning a neural semantic parser from user feedback. In ACL, 2017.
200
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv, abs/1412.6980, 2014.
201
+ Percy Liang, Michael I. Jordan, and Dan Klein. Learning dependency-based compositional semantics. Computational Linguistics, 39:389–446, 2011.
202
+ Christopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David McClosky. The Stanford CoreNLP natural language processing toolkit. In Association for Computational Linguistics (ACL) System Demonstrations, pp. 55–60, 2014.
203
+ Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. ICLR, 2017.
204
+ Arvind Neelakantan, Quoc V. Le, Mart´ın Abadi, Andrew McCallum, and Dario Amodei. Learning a natural language interface with neural programmer. In ICLR, 2017.
205
+ Eric WT Ngai, Li Xiu, and Dorothy CK Chau. Application of data mining techniques in customer relationship management: A literature review and classification. Expert systems with applications, 36(2):2592–2602, 2009.
206
+
207
+ Panupong Pasupat and Percy Liang. Compositional semantic parsing on semi-structured tables. In ACL, 2015.
208
+
209
+ Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
210
+
211
+ Ana-Maria Popescu, Oren Etzioni, and Henry Kautz. Towards a theory of natural language interfaces to databases. In Proceedings of the 8th International Conference on Intelligent User Interfaces, pp. 149–157. ACM, 2003.
212
+
213
+ Patti J. Price. Evaluation of spoken language systems: The ATIS domain. 1990.
214
+
215
+ Siva Reddy, Mirella Lapata, and Mark Steedman. Large-scale semantic parsing without questionanswer pairs. TACL, 2:377–392, 2014.
216
+
217
+ John Schulman, Nicolas Heess, Theophane Weber, and Pieter Abbeel. Gradient estimation using stochastic computation graphs. In NIPS, 2015.
218
+
219
+ Min Joon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. ICLR, 2017.
220
+
221
+ 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:1929–1958, 2014.
222
+
223
+ Janez Starc and Dunja Mladenic. Joint learning of ontology and semantic parser from text. Intelligent Data Analysis, 21:19–38, 2017.
224
+
225
+ Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pp. 1057–1063, 2000.
226
+
227
+ Lappoon R. Tang and Raymond J. Mooney. Using multiple clause constructors in inductive logic programming for semantic parsing. In ECML, 2001.
228
+
229
+ Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In NIPS, 2015.
230
+
231
+ Yushi Wang, Jonathan Berant, and Percy Liang. Building a semantic parser overnight. In ACL, 2015.
232
+
233
+ Yuk Wah Wong and Raymond J. Mooney. Learning synchronous grammars for semantic parsing with lambda calculus. In ACL, 2007.
234
+
235
+ Caiming Xiong, Victor Zhong, and Richard Socher. Dynamic coattention networks for question answering. ICLR, 2017.
236
+
237
+ John M. Zelle and Raymond J. Mooney. Learning to parse database queries using inductive logic programming. In AAAI/IAAI, Vol. 2, 1996.
238
+
239
+ Luke S. Zettlemoyer and Michael Collins. Learning to map sentences to logical form: Structured classification with probabilistic categorial grammars. In Uncertainty in Artificial Intelligence, 2005.
240
+
241
+ Luke S. Zettlemoyer and Michael Collins. Online learning of relaxed ccg grammars for parsing to logical form. In EMNLP-CoNLL, 2007.
242
+
243
+ # A COLLECTION OF WIKISQL
244
+
245
+ WikiSQL is collected in a paraphrase phases as well as a verification phase. In the paraphrase phase, we use tables extracted from Wikipedia by Bhagavatula et al. (2013) and remove small tables according to the following criteria:
246
+
247
+ • the number of cells in each row is not the same • the content in a cell exceed 50 characters • a header cell is empty • the table has less than 5 rows or 5 columns • over $40 \%$ of the cells of a row contain identical content
248
+
249
+ We also remove the last row of a table because a large quantity of HTML tables tend to have summary statistics in the last row, and hence the last row does not adhere to the table schema defined by the header row.
250
+
251
+ For each of the table that passes the above criteria, we randomly generate 6 SQL queries according to the following rules:
252
+
253
+ • the query follows the format SELECT agg op agg col from table where cond1 col cond1 op cond1 AND cond2 col cond2 op cond2 ... • the aggregation operator agg op can be empty or COUNT. In the event that the aggregation column agg col is numeric, agg op can additionally be one of MAX and MIN • the condition operator cond op is $=$ . In the event that the corresponding condition column cond col is numeric, cond op can additionally be one of $>$ and $<$ • the condition cond can be any possible value present in the table under the corresponding cond col. In the event that cond col is numerical, cond can be any numerical value sampled from the range from the minimum value in the column to the maximum value in the column.
254
+
255
+ We only generate queries that produce a non-empty result set. To enforce succinct queries, we remove conditions from the generated queries if doing so does not change the execution result.
256
+
257
+ For each query, we generate a crude question using a template and obtain a human paraphrase via crowdsourcing on Amazon Mechanical Turk. In each Amazon Mechanical Turk HIT, a worker is shown the first 4 rows of the table as well as its generated questions and asked to paraphrase each question.
258
+
259
+ After obtaining natural language utterances from the paraphrase phase, we give each questionparaphrase pair to two other workers in the verification phase to verify that the paraphrase and the original question contain the same meaning.
260
+
261
+ We then filter the initial collection of paraphrases using the following criteria:
262
+
263
+ • the paraphrase must be deemed correct by at least one worker during the verification phrase • the paraphrase must be sufficiently different from the generated question, with a characterlevel edit distance greater than 10
264
+
265
+ # B ATTENTIONAL SEQ2SEQ NEURAL SEMANTIC PARSER BASELINE
266
+
267
+ We employ the attentional sequence to sequence model for the baseline. This model by Dong & Lapata (2016) achieves state of the art results on a variety of semantic parsing datasets despite not using hand-engineered grammar. We implement a variant using OpenNMT and a global attention encoder-decoder architecture (with input feeding) described by Luong et al.
268
+
269
+ We use the same two-layer, bidirectional, stacked LSTM encoder as described previously. The decoder is almost identical to that described by Equation 2 of the paper, with the sole difference coming from input feeding.
270
+
271
+ $$
272
+ g _ { s } = \mathrm { L S T M } \left( \left[ \operatorname { e m b } \left( y _ { s - 1 } \right) ; \kappa _ { s - 1 } ^ { \mathrm { d e c } } \right] , g _ { s - 1 } \right)
273
+ $$
274
+
275
+ where $\kappa _ { s } ^ { \mathrm { d e c } }$ is the attentional context over the input sequence during the sth decoding step, computed as
276
+
277
+ $$
278
+ \alpha _ { s , t } ^ { \mathrm { d e c } } = h _ { s } ^ { \mathrm { d e c } } \left( W ^ { \mathrm { d e c } } h _ { t } ^ { \mathrm { e n c } } \right) ^ { \intercal } \qquad \beta _ { s } ^ { \mathrm { d e c } } = \mathrm { s o f t m a x } \left( \alpha _ { s } ^ { \mathrm { d e c } } \right)
279
+ $$
280
+
281
+ $$
282
+ \kappa _ { s } = \sum _ { t } \beta _ { s , t } h _ { t } ^ { \mathrm { e n c } }
283
+ $$
284
+
285
+ To produce the output token during the sth decoder step, the concatenation of the decoder state and the attention context is given to a final linear layer to produce a distribution $\alpha ^ { \mathrm { d e c } }$ over words in the target vocabulary
286
+
287
+ $$
288
+ \alpha ^ { \mathrm { d e c } } = \mathrm { s o f t m a x } \left( U ^ { \mathrm { d e c } } [ h _ { s } ^ { \mathrm { d e c } } ; \kappa _ { s } ^ { \mathrm { d e c } } ] \right)
289
+ $$
290
+
291
+ During training, teacher forcing is used. During inference, a beam size of 5 is used and generated unknown words are replaced by the input words with the highest attention weight.
292
+
293
+ # C PREDICTIONS BY SEQ2SQL
294
+
295
+ Table 4: Examples predictions by the models on the dev split. Q denotes the natural language question and G denotes the corresponding ground truth query. P, ${ \bf \vec { S } } ^ { \prime }$ , and S denote, respectively, the queries produced by the Augmented Pointer Network, Seq2SQL without reinforcement learning, Seq2SQL. We omit the FROM table part of the query for succinctness.
296
+
297
+ <table><tr><td>Q</td><td colspan="16">when connecticut &amp; villanova are the regular season winner how many tournament venues (city)are there?</td></tr><tr><td></td><td colspan="11">SELECT COUNT tournament player (city) WHERE regular season winner city )= connecticut &amp; villanova</td></tr><tr><td>P S</td><td></td><td colspan="3">COUNT tournament venue</td><td></td><td>(city)</td><td></td><td></td><td colspan="3"></td></tr><tr><td></td><td>SELECT COUNT</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>WHERE tournament winner = connecticut &amp; villanova</td></tr><tr><td>S G</td><td>SELECT SELECT COUNT</td><td>tournament venue</td><td>tournament venue</td><td></td><td></td><td>(city) (city)</td><td></td><td>WHERE regular season winner</td><td></td><td>WHERE regular season winner = connecticut &amp; villanova connecticut &amp; villanova</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Q P</td><td colspan="8">what are the aggregate scores of those races where the first leg results are O-1?</td><td colspan="2"></td></tr><tr><td>S</td><td>SELECT aggregate WHERE 1st</td><td></td><td></td><td></td><td></td><td>=0-1</td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT</td><td>COUNT agg.</td><td></td><td></td><td></td><td></td><td>score WHERE 1st leg = 0-1</td><td></td><td></td><td></td></tr><tr><td>G</td><td>SELECT agg. SELECT agg.</td><td>score WHERE</td><td>score WHERE 1st leg = 0-1</td><td>1st leg = 0-1</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td colspan="8"></td><td colspan="2"></td></tr><tr><td>Q P</td><td colspan="8">what is the race name of the l2th round trenton, new jersey race where a.j.foyt had the pole position?</td><td colspan="2"></td></tr><tr><td>S</td><td colspan="8">SELECT race name WHERE location = 12th AND round position = a.j.</td><td colspan="2">foyt,new jersey AND foyt AND pole position = a.j. foyt</td></tr><tr><td>S</td><td colspan="7">SELECT race name WHERE rnd = 12 AND track = a.j. f SELECT = 12 AND pole position = a.j.</td><td colspan="2">foyt</td></tr><tr><td>G</td><td colspan="7">race name rnd SELECT race name WHERE rnd = 12 :AND pole position = a.j.</td><td colspan="2">foyt</td></tr><tr><td>Q</td><td colspan="7"></td><td colspan="2"></td></tr><tr><td>P</td><td>what city is on 89.9?</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT city WHERE frequency = 89.9 SELECT city of license WHERE frequency = 89.9</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT city of license WHERE frequency</td><td></td><td></td><td></td><td></td><td></td><td>= 89.9</td><td></td><td></td><td></td></tr><tr><td>G</td><td>SELECT city of license WHERE frequency</td><td></td><td></td><td></td><td></td><td></td><td>=89.9</td><td></td><td></td><td></td></tr><tr><td>Q</td><td>how many voters from the bronx voted for the socialist party?</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>P</td><td>SELECT MIN % party = socialist</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S&#x27; S</td><td>SELECT COUNT the bronx where the bronx = socialist</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>G</td><td>SELECT COUNT the bronx WHERE the bronx = socialist SELECT the bronx WHERE party = socialist</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td colspan="8">in what year did a plymouth vehicle win on february 9 ?</td><td colspan="2"></td></tr><tr><td>Q P</td><td colspan="8">SELECT MIN year (km) WHERE date = february 9 AND race time = plymouth 9</td><td colspan="2"></td></tr><tr><td>S</td><td>SELECT</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT</td><td>year (km)</td><td></td><td></td><td></td><td></td><td></td><td></td><td>year(km) WHERE date = plymouth 9 AND race time = february 9</td><td></td><td></td></tr><tr><td>G</td><td>SELECT year (km)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>WHERE date = plymouth 9 AND race time= february 9 WHERE manufacturer = plymouth AND date = february 9</td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
parse/train/Syx6bz-Ab/Syx6bz-Ab_content_list.json ADDED
@@ -0,0 +1,1432 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "SEQ2SQL: GENERATING STRUCTURED QUERIES FROM NATURAL LANGUAGE USING REINFORCEMENT LEARNING ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 174,
8
+ 98,
9
+ 821,
10
+ 171
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous authors Paper under double-blind review ",
17
+ "bbox": [
18
+ 183,
19
+ 195,
20
+ 398,
21
+ 223
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 260,
32
+ 544,
33
+ 275
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Relational databases store a significant amount of the worlds data. However, accessing this data currently requires users to understand a query language such as SQL. We propose Seq2SQL, a deep neural network for translating natural language questions to corresponding SQL queries. Our model uses rewards from inthe-loop query execution over the database to learn a policy to generate the query, which contains unordered parts that are less suitable for optimization via cross entropy loss. Moreover, Seq2SQL leverages the structure of SQL to prune the space of generated queries and significantly simplify the generation problem. In addition to the model, we release WikiSQL, a dataset of 80654 hand-annotated examples of questions and SQL queries distributed across 24241 tables from Wikipedia that is an order of magnitude larger than comparable datasets. By applying policybased reinforcement learning with a query execution environment to WikiSQL, $\\mathrm { S e q } 2 \\mathrm { S Q L }$ outperforms a state-of-the-art semantic parser, improving execution accuracy from $3 5 . 9 \\%$ to $5 9 . 4 \\%$ and logical form accuracy from $2 3 . 4 \\%$ to $4 8 . 3 \\%$ . ",
40
+ "bbox": [
41
+ 233,
42
+ 292,
43
+ 764,
44
+ 487
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 516,
55
+ 336,
56
+ 531
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Relational databases store a vast amount of today’s information and provide the foundation of applications such as medical records (Hillestad et al., 2005), financial markets (Beck et al., 2000), and customer relations management (Ngai et al., 2009). However, accessing relational databases requires an understanding of query languages such as SQL, which, while powerful, is difficult to master. Natural language interfaces (NLI), a research area at the intersection of natural language processing and human-computer interactions, seeks to provide means for humans to interact with computers through the use of natural language (Androutsopoulos et al., 1995). We investigate one particular aspect of NLI applied to relational databases: translating natural language questions to SQL queries. ",
63
+ "bbox": [
64
+ 174,
65
+ 547,
66
+ 825,
67
+ 674
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Our main contributions in this work are two-fold. First, we introduce Seq2SQL, a deep neural network for translating natural language questions to corresponding SQL queries. Seq2SQL, shown in Figure 1, consists of three components that leverage the structure of SQL to prune the output space of generated queries. Moreover, it uses policy-based reinforcement learning (RL) to generate the conditions of the query, which are unsuitable for optimization using cross entropy loss due to their unordered nature. We train Seq2SQL using a mixed objective, combining cross entropy losses and RL rewards from in-the-loop query execution on a database. These characteristics allow Seq2SQL to achieve state-of-the-art results on query generation. ",
74
+ "bbox": [
75
+ 174,
76
+ 680,
77
+ 825,
78
+ 791
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Next, we release WikiSQL, a corpus of 80654 hand-annotated instances of natural language questions, SQL queries, and SQL tables extracted from 24241 HTML tables from Wikipedia. WikiSQL is an order of magnitude larger than previous semantic parsing datasets that provide logical forms along with natural language utterances. We release the tables used in WikiSQL both in raw JSON format as well as in the form of a SQL database. Along with WikiSQL, we release a query execution engine for the database used for in-the-loop query execution to learn the policy. On WikiSQL, Seq2SQL outperforms a previously state-of-the-art semantic parsing model by Dong & Lapata (2016), which obtains $3 5 . 9 \\%$ execution accuracy, as well as an augmented pointer network baseline, which obtains $5 3 . 3 \\%$ execution accuracy. By leveraging the inherent structure of ",
85
+ "bbox": [
86
+ 174,
87
+ 799,
88
+ 823,
89
+ 924
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "image",
95
+ "img_path": "images/53258bbee644902935761ee927252fc96f07924299c5d3d2c8ef333907c00f58.jpg",
96
+ "image_caption": [
97
+ "Figure 1: $\\mathrm { S e q } 2 \\mathrm { S Q L }$ takes as input a question and the columns of a table. It generates the corresponding SQL query, which, during training, is executed against a database. The result of the execution is utilized as the reward to train the reinforcement learning algorithm. "
98
+ ],
99
+ "image_footnote": [],
100
+ "bbox": [
101
+ 261,
102
+ 103,
103
+ 738,
104
+ 212
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "table",
110
+ "img_path": "images/19f0c041eee32873dc3d412f6d95b302457fb5afb4842bc8525a32b514166532.jpg",
111
+ "table_caption": [],
112
+ "table_footnote": [],
113
+ "table_body": "<table><tr><td rowspan=1 colspan=6>Table:CFLDraft Question:</td></tr><tr><td rowspan=1 colspan=1>Pick #</td><td rowspan=1 colspan=1>CFL Team</td><td rowspan=1 colspan=1>Player</td><td rowspan=1 colspan=1>Position</td><td rowspan=1 colspan=1>College</td><td rowspan=1 colspan=1>How many CFL teamsare from York College?</td></tr><tr><td rowspan=1 colspan=1>27</td><td rowspan=1 colspan=1>Hamilton Tiger-Cats</td><td rowspan=1 colspan=1>Connor Healy</td><td rowspan=1 colspan=1>DB</td><td rowspan=1 colspan=1>Wilfrid Laurier</td><td rowspan=6 colspan=1>SQL:SELECT COUNT CFL Team FROMCFLDraft WHERE College = &quot;York&quot;Result:②</td></tr><tr><td rowspan=1 colspan=1>28</td><td rowspan=1 colspan=1>Calgary Stampeders</td><td rowspan=1 colspan=1>Anthony Forgone</td><td rowspan=1 colspan=1>OL</td><td rowspan=1 colspan=1>York</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=2 colspan=1>29</td><td rowspan=2 colspan=1>Ottawa Renegades</td><td rowspan=2 colspan=1>L.P. Ladouceur</td><td rowspan=2 colspan=1>DT</td><td rowspan=2 colspan=1>California</td></tr><tr><td rowspan=1 colspan=1>SELECT COUNT CFL Team FROMCFLDraft WHERE College = &quot;York&quot;</td></tr><tr><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>Toronto Argonauts</td><td rowspan=1 colspan=1>Frank Hoffman</td><td rowspan=1 colspan=1>DL</td><td rowspan=1 colspan=1>York</td></tr><tr><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>..</td><td rowspan=1 colspan=1>.</td><td rowspan=1 colspan=1>…</td></tr></table>",
114
+ "bbox": [
115
+ 179,
116
+ 282,
117
+ 816,
118
+ 383
119
+ ],
120
+ "page_idx": 1
121
+ },
122
+ {
123
+ "type": "text",
124
+ "text": "Figure 2: An example in WikiSQL. The inputs consist of a table and a question. The outputs consist of a ground truth SQL query and the corresponding result from execution. ",
125
+ "bbox": [
126
+ 173,
127
+ 392,
128
+ 823,
129
+ 420
130
+ ],
131
+ "page_idx": 1
132
+ },
133
+ {
134
+ "type": "text",
135
+ "text": "SQL queries and applying policy gradient methods using reward signals from live query execution, Seq2SQL achieves state-of-the-art performance on WikiSQL, obtaining $5 9 . 4 \\%$ execution accuracy. ",
136
+ "bbox": [
137
+ 173,
138
+ 426,
139
+ 823,
140
+ 455
141
+ ],
142
+ "page_idx": 1
143
+ },
144
+ {
145
+ "type": "text",
146
+ "text": "2 MODEL ",
147
+ "text_level": 1,
148
+ "bbox": [
149
+ 176,
150
+ 474,
151
+ 267,
152
+ 491
153
+ ],
154
+ "page_idx": 1
155
+ },
156
+ {
157
+ "type": "text",
158
+ "text": "The WikiSQL task is to generate a SQL query from a natural language question and table schema. Our baseline model is the attentional sequence to sequence neural semantic parser proposed by Dong & Lapata (2016) that achieves state-of-the-art performance on a host of semantic parsing datasets without using hand-engineered grammar. However, the output space of the softmax in their Seq2Seq model is unnecessarily large for this task. In particular, we can limit the output space of the generated sequence to the union of the table schema, question utterance, and SQL key words. The resulting model is similar to a pointer network (Vinyals et al., 2015) with augmented inputs. We first describe the augmented pointer network model, then address its limitations in our definition of Seq2SQL, particularly with respect to generating unordered query conditions. ",
159
+ "bbox": [
160
+ 174,
161
+ 506,
162
+ 825,
163
+ 632
164
+ ],
165
+ "page_idx": 1
166
+ },
167
+ {
168
+ "type": "text",
169
+ "text": "2.1 AUGMENTED POINTER NETWORK ",
170
+ "text_level": 1,
171
+ "bbox": [
172
+ 176,
173
+ 647,
174
+ 449,
175
+ 661
176
+ ],
177
+ "page_idx": 1
178
+ },
179
+ {
180
+ "type": "text",
181
+ "text": "The augmented pointer network generates the SQL query token-by-token by selecting from an input sequence. In our case, the input sequence is the concatenation of the column names, required for the selection column and the condition columns of the query, the question, required for the conditions of the query, and the limited vocabulary of the SQL language such as SELECT, COUNT etc. In the example shown in Figure 2, the column name tokens consist of “Pick”, “#”, “CFL”, “Team” etc.; the question tokens consist of “How”, “many”, “CFL”, “teams” etc.; the SQL tokens consist of SELECT, WHERE, COUNT, MIN, MAX etc. With this augmented input sequence, the pointer network can produce the SQL query by selecting exclusively from the input. ",
182
+ "bbox": [
183
+ 174,
184
+ 672,
185
+ 825,
186
+ 785
187
+ ],
188
+ "page_idx": 1
189
+ },
190
+ {
191
+ "type": "text",
192
+ "text": "Suppose we have a list of $N$ table columns and a question such as in Figure 2, and want to produce the corresponding SQL query. Let $\\boldsymbol { x } _ { j } ^ { \\mathrm { c } } = [ x _ { j , 1 } ^ { \\mathrm { c } } , x _ { j , 2 } ^ { \\mathrm { c } } , . . . x _ { j , T _ { j } } ^ { \\mathrm { c } } ]$ denote the sequence of words in the name of the $j$ th column, where $\\boldsymbol { x } _ { j , i } ^ { \\mathrm { c } }$ represents the ith word in the $j$ th column and $T _ { j }$ represents the total number of words in the $j$ th column. Similarly, let $x ^ { \\mathrm { q } }$ and $x ^ { \\mathrm { s } }$ respectively denote the sequence of words in the question and the set of unique words in the SQL vocabulary. ",
193
+ "bbox": [
194
+ 174,
195
+ 791,
196
+ 825,
197
+ 864
198
+ ],
199
+ "page_idx": 1
200
+ },
201
+ {
202
+ "type": "text",
203
+ "text": "We define the input sequence $x$ as the concatenation of all the column names, the question, and the SQL vocabulary: ",
204
+ "bbox": [
205
+ 173,
206
+ 871,
207
+ 825,
208
+ 898
209
+ ],
210
+ "page_idx": 1
211
+ },
212
+ {
213
+ "type": "equation",
214
+ "img_path": "images/ccccffe6238c5f4efed8c7439812634760bd20aef2cee48af6bd2250ccbfa68f.jpg",
215
+ "text": "$$\nx = [ < \\mathrm { c o l } > ; x _ { 1 } ^ { \\mathrm { c } } ; x _ { 2 } ^ { \\mathrm { c } } ; . . . ; x _ { N } ^ { \\mathrm { c } } ; < \\mathrm { s q l } > ; x ^ { \\mathrm { s } } ; < \\mathrm { q u e s t i o n } > ; x ^ { \\mathrm { q } } ]\n$$",
216
+ "text_format": "latex",
217
+ "bbox": [
218
+ 299,
219
+ 904,
220
+ 697,
221
+ 921
222
+ ],
223
+ "page_idx": 1
224
+ },
225
+ {
226
+ "type": "text",
227
+ "text": "where $[ a ; b ]$ denotes the concatenation between the sequences $a$ and $b$ and we add sentinel tokens between neighbouring sequences to demarcate the boundaries. ",
228
+ "bbox": [
229
+ 171,
230
+ 103,
231
+ 823,
232
+ 132
233
+ ],
234
+ "page_idx": 2
235
+ },
236
+ {
237
+ "type": "text",
238
+ "text": "The network first encodes $x$ using a two-layer, bidirectional Long Short-Term Memory network (Hochreiter & Schmidhuber, 1997). The input to the encoder are the embeddings corresponding to words in the input sequence. We denote the output of the encoder by $h ^ { \\mathrm { e n c } }$ , where $h _ { t } ^ { \\mathrm { e n c } }$ is the state of the encoder corresponding to the $t ^ { \\mathrm { { t h } } }$ word in the input sequence. For brevity, we do not write out the LSTM equations, which are described by Hochreiter & Schmidhuber (1997). We then apply a pointer network similar to that proposed by Vinyals et al. (2015) to the input encodings $h ^ { \\mathrm { e n c } }$ . ",
239
+ "bbox": [
240
+ 173,
241
+ 138,
242
+ 825,
243
+ 223
244
+ ],
245
+ "page_idx": 2
246
+ },
247
+ {
248
+ "type": "text",
249
+ "text": "The decoder network uses a two layer, unidirectional LSTM. During each decoder step $s$ , the decoder LSTM takes as input $y _ { s - 1 }$ , the query token generated during the previous decoding step, and outputs the state $g _ { s }$ . Next, the decoder produces a scalar attention score $\\alpha _ { s , t } ^ { \\mathrm { p t r } }$ for each position $t$ of the input sequence: ",
250
+ "bbox": [
251
+ 173,
252
+ 229,
253
+ 825,
254
+ 287
255
+ ],
256
+ "page_idx": 2
257
+ },
258
+ {
259
+ "type": "equation",
260
+ "img_path": "images/95d0bc93dcbda8e7584bb0d3faf14298d8f837607b6e727b4d4135f0093569ac.jpg",
261
+ "text": "$$\n\\alpha _ { s , t } ^ { \\mathrm { p t r } } = W ^ { \\mathrm { p t r } } \\mathrm { t a n h } \\left( U ^ { \\mathrm { p t r } } g _ { s } + V ^ { \\mathrm { p t r } } h _ { t } \\right)\n$$",
262
+ "text_format": "latex",
263
+ "bbox": [
264
+ 372,
265
+ 291,
266
+ 625,
267
+ 310
268
+ ],
269
+ "page_idx": 2
270
+ },
271
+ {
272
+ "type": "text",
273
+ "text": "We choose the input token with the highest score as the next token of the generated SQL query, $y _ { s } = \\mathrm { a r g m a x } ( \\alpha _ { s } ^ { \\mathrm { p t r } } )$ . ",
274
+ "bbox": [
275
+ 171,
276
+ 313,
277
+ 825,
278
+ 342
279
+ ],
280
+ "page_idx": 2
281
+ },
282
+ {
283
+ "type": "text",
284
+ "text": "2.2 SEQ2SQL ",
285
+ "text_level": 1,
286
+ "bbox": [
287
+ 174,
288
+ 357,
289
+ 285,
290
+ 372
291
+ ],
292
+ "page_idx": 2
293
+ },
294
+ {
295
+ "type": "text",
296
+ "text": "While the augmented pointer network can solve the SQL generation problem, it does not leverage the structure inherent in SQL. Typically, a SQL query such as that shown in Figure 3 consists of three components. The first component is the aggregation operator, in this case COUNT, which produces a summary of the rows selected by the query. Alternatively the query may request no summary statistics, in which case an aggregation operator is not provided. The second component is the SELECT column(s), in this case Engine, which identifies the column(s) that are to be included in the returned results. The third ",
297
+ "bbox": [
298
+ 174,
299
+ 383,
300
+ 450,
301
+ 590
302
+ ],
303
+ "page_idx": 2
304
+ },
305
+ {
306
+ "type": "image",
307
+ "img_path": "images/27a29333845bc236fce3fc23e6b9beb4b328686d46fb7dfd5b082cd1c1a0765f.jpg",
308
+ "image_caption": [
309
+ "Figure 3: The $\\mathrm { S e q } 2 \\mathrm { S Q L }$ model has three components, corresponding to the three parts of a SQL query (right). The input to the model are the question (top left) and the table column names (bottom left). "
310
+ ],
311
+ "image_footnote": [],
312
+ "bbox": [
313
+ 473,
314
+ 395,
315
+ 815,
316
+ 508
317
+ ],
318
+ "page_idx": 2
319
+ },
320
+ {
321
+ "type": "text",
322
+ "text": "component is the WHERE clause of the query, in this case WHERE Driver $=$ Val Musetti, which contains conditions by which to filter the rows. Here, we keep rows in which the driver is “Val Musetti”. ",
323
+ "bbox": [
324
+ 174,
325
+ 592,
326
+ 823,
327
+ 632
328
+ ],
329
+ "page_idx": 2
330
+ },
331
+ {
332
+ "type": "text",
333
+ "text": "Seq2SQL, as shown in Figure 3, has three parts that correspond to the aggregation operator, the SELECT column, and the WHERE clause. First, the network classifies an aggregation operation for the query, with the addition of a null operation that corresponds to no aggregation. Next, the network points to a column in the input table corresponding to the SELECT column. Finally, the network generates the conditions for the query using a pointer network. The first two components are supervised using cross entropy loss, whereas the third generation component is trained using policy gradient to address the unordered nature of query conditions (we explain this in the subsequent WHERE Clause section). Utilizing the structure of SQL allows $\\mathrm { S e q } 2 \\mathrm { S Q L }$ to further prune the output space of queries, which leads to higher performance than Seq2Seq and the augmented pointer network. ",
334
+ "bbox": [
335
+ 173,
336
+ 640,
337
+ 825,
338
+ 779
339
+ ],
340
+ "page_idx": 2
341
+ },
342
+ {
343
+ "type": "text",
344
+ "text": "Aggregation Operation. The aggregation operation depends on the question. For the example shown in Figure 3, the correct operator is COUNT because the question asks for “How many”. To compute the aggregation operation, we first compute the scalar attention for each tth token in the input sequence. We normalize the vector of scores $\\alpha _ { t } ^ { \\mathrm { i n p } } = W ^ { \\mathrm { i n p } } h _ { t } ^ { \\mathrm { e n c } }$ , $\\alpha ^ { \\mathrm { i n p } } = [ \\alpha _ { 1 } ^ { \\mathrm { i n p } } , \\alpha _ { 2 } ^ { \\mathrm { i n p } } , \\ldots ]$ produce a distribution over the input encodings, $\\beta ^ { \\mathrm { i n p } } = \\mathrm { s o f t m a x } \\left( \\alpha ^ { \\mathrm { i n p } } \\right)$ . The input representation $\\kappa ^ { \\mathrm { a g g } }$ is the sum over the input encodings $h ^ { \\mathrm { e n c } }$ weighted by the normalized scores $\\beta ^ { \\mathrm { i n p } }$ : ",
345
+ "bbox": [
346
+ 173,
347
+ 792,
348
+ 825,
349
+ 886
350
+ ],
351
+ "page_idx": 2
352
+ },
353
+ {
354
+ "type": "equation",
355
+ "img_path": "images/667a22ad7e0046eb8e96fb824695f671a7b5c77139a32fcadf0c2a3eab2260e5.jpg",
356
+ "text": "$$\n\\kappa ^ { \\mathrm { a g g } } = \\sum _ { t } \\beta _ { t } ^ { \\mathrm { i n p } } h _ { t } ^ { \\mathrm { e n c } }\n$$",
357
+ "text_format": "latex",
358
+ "bbox": [
359
+ 429,
360
+ 890,
361
+ 568,
362
+ 921
363
+ ],
364
+ "page_idx": 2
365
+ },
366
+ {
367
+ "type": "text",
368
+ "text": "Let $\\alpha ^ { \\mathrm { a g g } }$ denote the scores over the aggregation operations such as COUNT, MIN, MAX, and the noaggregation operation NULL. We compute $\\alpha ^ { \\mathrm { a g g } }$ by applying a multi-layer perceptron to the input ",
369
+ "bbox": [
370
+ 171,
371
+ 103,
372
+ 823,
373
+ 136
374
+ ],
375
+ "page_idx": 3
376
+ },
377
+ {
378
+ "type": "equation",
379
+ "img_path": "images/a34b4e799d41ef778d7f6ed063599c15e0759d7f2e932cd6d25027d4dc312e88.jpg",
380
+ "text": "$$\n\\alpha ^ { \\mathrm { a g g } } = W ^ { \\mathrm { a g g } } \\operatorname { t a n h } \\left( V ^ { \\mathrm { a g g } } \\kappa ^ { \\mathrm { a g g } } + b ^ { \\mathrm { a g g } } \\right) + c ^ { \\mathrm { a g g } }\n$$",
381
+ "text_format": "latex",
382
+ "bbox": [
383
+ 346,
384
+ 138,
385
+ 650,
386
+ 156
387
+ ],
388
+ "page_idx": 3
389
+ },
390
+ {
391
+ "type": "text",
392
+ "text": "We apply the softmax function to obtain the distribution over the set of possible aggregation operations $\\beta ^ { \\mathrm { a g g } } = \\mathrm { s o f t m a x } \\left( \\alpha ^ { \\mathrm { a g g } } \\right)$ . We use cross entropy loss $L ^ { \\mathrm { a g g } }$ for the aggregation operation. ",
393
+ "bbox": [
394
+ 173,
395
+ 176,
396
+ 823,
397
+ 207
398
+ ],
399
+ "page_idx": 3
400
+ },
401
+ {
402
+ "type": "text",
403
+ "text": "SELECT Column. The selection column depends on the table columns as well as the question. Namely, for the example in Figure 3, “How many engine types” indicates that we need to retrieve the “Engine” column. SELECT column prediction is then a matching problem, solvable using a pointer: given the list of column representations and a question representation, we select the column that best matches the question. ",
404
+ "bbox": [
405
+ 173,
406
+ 220,
407
+ 825,
408
+ 291
409
+ ],
410
+ "page_idx": 3
411
+ },
412
+ {
413
+ "type": "text",
414
+ "text": "In order to produce the representations for the columns, we first encode each column name with a LSTM. The representation of a particular column $j , e _ { j } ^ { \\mathrm { c } }$ , is given by: ",
415
+ "bbox": [
416
+ 173,
417
+ 297,
418
+ 823,
419
+ 328
420
+ ],
421
+ "page_idx": 3
422
+ },
423
+ {
424
+ "type": "equation",
425
+ "img_path": "images/66d304caaad45dc14d944d7176cd16854f8f79c8a23c65557f0a13f1a539334a.jpg",
426
+ "text": "$$\nh _ { j , t } ^ { \\mathrm { c } } = \\mathrm { L S T M } \\left( \\operatorname { e m b } \\left( x _ { j , t } ^ { \\mathrm { c } } \\right) , h _ { j , t - 1 } ^ { \\mathrm { c } } \\right) \\qquad e _ { j } ^ { \\mathrm { c } } = h _ { j , T _ { j } } ^ { \\mathrm { c } }\n$$",
427
+ "text_format": "latex",
428
+ "bbox": [
429
+ 328,
430
+ 354,
431
+ 668,
432
+ 375
433
+ ],
434
+ "page_idx": 3
435
+ },
436
+ {
437
+ "type": "text",
438
+ "text": "Here, $h _ { j , t } ^ { \\mathrm { c } }$ denotes the tth encoder state of the $j$ th column. We take the last encoder state to be $e _ { j } ^ { \\mathrm { c } }$ column $j$ ’s representation. ",
439
+ "bbox": [
440
+ 171,
441
+ 381,
442
+ 821,
443
+ 410
444
+ ],
445
+ "page_idx": 3
446
+ },
447
+ {
448
+ "type": "text",
449
+ "text": "To construct a representation for the question, we compute another input representation $\\kappa ^ { \\mathrm { s e l } }$ using the same architecture as for $\\kappa ^ { \\mathrm { a g g } }$ (Equation 3) but with untied weights. Finally, we apply a multi-layer perceptron over the column representations, conditioned on the input representation, to compute the a score for each column $j$ : ",
450
+ "bbox": [
451
+ 174,
452
+ 416,
453
+ 825,
454
+ 473
455
+ ],
456
+ "page_idx": 3
457
+ },
458
+ {
459
+ "type": "equation",
460
+ "img_path": "images/a660e32dfbd20c4c237bc4c94b6fb2fb2862ba156fee8fb2bf12a685e89971ab.jpg",
461
+ "text": "$$\n\\alpha _ { j } ^ { \\mathrm { s e l } } = W ^ { \\mathrm { s e l } } \\operatorname { t a n h } \\left( V ^ { \\mathrm { s e l } } \\kappa ^ { \\mathrm { s e l } } + V ^ { \\mathrm { c } } e _ { j } ^ { \\mathrm { c } } \\right)\n$$",
462
+ "text_format": "latex",
463
+ "bbox": [
464
+ 375,
465
+ 491,
466
+ 620,
467
+ 512
468
+ ],
469
+ "page_idx": 3
470
+ },
471
+ {
472
+ "type": "text",
473
+ "text": "We normalize the scores with a softmax function to produce a distribution over the possible SELECT columns $\\beta ^ { \\mathrm { s e l } } =$ softmax $\\left( \\alpha ^ { \\mathrm { { s e l } } } \\right)$ . For the example shown in Figure 3, the distribution is over the columns “Entrant”, “Constructor”, “Chassis”, “Engine”, “No”, and the ground truth SELECT column “Driver”. We train the SELECT network using cross entropy loss $L ^ { \\mathrm { { \\bar { s e l } } } }$ . ",
474
+ "bbox": [
475
+ 174,
476
+ 521,
477
+ 825,
478
+ 578
479
+ ],
480
+ "page_idx": 3
481
+ },
482
+ {
483
+ "type": "text",
484
+ "text": "WHERE Clause. We can train the WHERE clause using a pointer decoder similar to that described in Section 2.1. However, there is a limitation in using the cross entropy loss to optimize the network: the WHERE conditions of a query can be swapped and the query yield the same result. Suppose we have the question “which men are older than $1 8 ^ { \\circ }$ and the queries SELECT name FROM insurance WHERE age $\\mathrm { ~ ~ { ~ \\geq ~ } ~ } { \\mathrm { ~ \\perp ~ 8 ~ } }$ AND gender $=$ \"male\" and SELECT name FROM insurance WHERE gender $=$ \"male\" AND age $\\mathrm { ~ ~ { ~ \\geq ~ } ~ } \\mathbb { 1 } \\mathrm { 8 }$ . Both queries obtain the correct execution result despite not having exact string match. If the former is provided as the ground truth, using cross entropy loss to supervise the generation would then wrongly penalize the latter. To address this problem, we apply reinforcement learning to learn a policy to directly optimize the expected correctness of the execution result (Equation 7). ",
485
+ "bbox": [
486
+ 173,
487
+ 593,
488
+ 825,
489
+ 733
490
+ ],
491
+ "page_idx": 3
492
+ },
493
+ {
494
+ "type": "text",
495
+ "text": "Instead of teacher forcing at each step of query generation, we sample from the output distribution to obtain the next token. At the end of the generation procedure, we execute the generated SQL query against the database to obtain a reward. Let $y = \\mathring [ y ^ { 1 } , y ^ { 2 } , . . . , y ^ { T } ]$ denote the sequence of generated tokens in the WHERE clause. Let $q \\left( y \\right)$ denote the query generated by the model and $q _ { g }$ denote the ground truth query corresponding to the question. We define the reward $R \\left( q \\left( y \\right) , q _ { g } \\right)$ as ",
496
+ "bbox": [
497
+ 174,
498
+ 738,
499
+ 825,
500
+ 810
501
+ ],
502
+ "page_idx": 3
503
+ },
504
+ {
505
+ "type": "equation",
506
+ "img_path": "images/82691a75ce29817c681ce98d4fd832d8ad072b7ae7d08d07478723b38fda5e2b.jpg",
507
+ "text": "$$\nR \\left( q \\left( y \\right) , q _ { g } \\right) = \\left\\{ \\begin{array} { l l } { - 2 , } & { \\mathrm { i f ~ } q \\left( y \\right) \\mathrm { ~ i s ~ n o t ~ a ~ v a l i d ~ S Q L ~ q u e r y } } \\\\ { - 1 , } & { \\mathrm { i f ~ } q \\left( y \\right) \\mathrm { ~ i s ~ a ~ v a l i d ~ S Q L ~ q u e r y ~ a n d ~ e x e c u t e s ~ t o ~ a n ~ i n c o r r e c t ~ r e s u l t } } \\\\ { + 1 , } & { \\mathrm { i f ~ } q \\left( y \\right) \\mathrm { ~ i s ~ a ~ v a l i d ~ S Q L ~ q u e r y ~ a n d ~ e x e c u t e s ~ t o ~ t h e ~ c o r r e c t ~ r e s u l t } } \\end{array} \\right.\n$$",
508
+ "text_format": "latex",
509
+ "bbox": [
510
+ 197,
511
+ 829,
512
+ 785,
513
+ 882
514
+ ],
515
+ "page_idx": 3
516
+ },
517
+ {
518
+ "type": "text",
519
+ "text": "The loss, $L ^ { \\mathrm { w h e } } = - \\mathbb { E } _ { y } [ R \\left( q \\left( y \\right) , q _ { g } \\right) ]$ , is the negative expected reward over possible WHERE clauses. \nWe derive the policy gradient for $L ^ { \\mathrm { w h e } }$ as shown by Sutton et al. (2000) and Schulman et al. (2015). ",
520
+ "bbox": [
521
+ 173,
522
+ 892,
523
+ 825,
524
+ 924
525
+ ],
526
+ "page_idx": 3
527
+ },
528
+ {
529
+ "type": "equation",
530
+ "img_path": "images/5a13dba91473051a072d661c2615d54c9aeba54583fdb004e628202bbb9e2cc4.jpg",
531
+ "text": "$$\n\\begin{array} { r c l } { \\nabla L _ { \\Theta } ^ { \\mathrm { w h e } } } & { = } & { - \\nabla _ { \\Theta } \\left( \\mathbb { E } _ { y \\sim p _ { y } } \\left[ R \\left( q \\left( \\boldsymbol { y } \\right) , q _ { g } \\right) \\right] \\right) } \\\\ & { = } & { - \\mathbb { E } _ { y \\sim p _ { y } } \\left[ R \\left( q \\left( \\boldsymbol { y } \\right) , q _ { g } \\right) \\nabla _ { \\Theta } \\sum _ { t } \\left( \\log p _ { y } \\left( y _ { t } ; \\Theta \\right) \\right) \\right] } \\\\ & { \\approx } & { - R \\left( q \\left( \\boldsymbol { y } \\right) , q _ { g } \\right) \\nabla _ { \\Theta } \\sum _ { t } \\left( \\log p _ { y } \\left( y _ { t } ; \\Theta \\right) \\right) } \\end{array}\n$$",
532
+ "text_format": "latex",
533
+ "bbox": [
534
+ 287,
535
+ 121,
536
+ 705,
537
+ 219
538
+ ],
539
+ "page_idx": 4
540
+ },
541
+ {
542
+ "type": "text",
543
+ "text": "Here, $p _ { y } ( y _ { t } )$ denotes the probability of choosing token $y _ { t }$ during time step $t$ . In equation 10, we approximate the expected gradient using a single Monte-Carlo sample $y$ ",
544
+ "bbox": [
545
+ 174,
546
+ 222,
547
+ 825,
548
+ 251
549
+ ],
550
+ "page_idx": 4
551
+ },
552
+ {
553
+ "type": "text",
554
+ "text": "Mixed Objective Function. We train the model using gradient descent to minimize the objective function $\\dot { L } = L ^ { \\mathrm { a g g } } + L ^ { \\mathrm { s e l } } + L ^ { \\mathrm { w h e } }$ . Consequently, the total gradient is the equally weighted sum of the gradients from the cross entropy loss in predicting the SELECT column, from the cross entropy loss in predicting the aggregation operation, and from policy learning. ",
555
+ "bbox": [
556
+ 173,
557
+ 265,
558
+ 825,
559
+ 321
560
+ ],
561
+ "page_idx": 4
562
+ },
563
+ {
564
+ "type": "text",
565
+ "text": "3 WIKISQL ",
566
+ "text_level": 1,
567
+ "bbox": [
568
+ 174,
569
+ 342,
570
+ 289,
571
+ 358
572
+ ],
573
+ "page_idx": 4
574
+ },
575
+ {
576
+ "type": "text",
577
+ "text": "WikiSQL is a collection of questions, corresponding SQL queries, and SQL tables. A single example in WikiSQL, shown in Figure 2, contains a table, a SQL query, and the natural language question corresponding to the SQL query. Table 1 shows how WikiSQL compares to related datasets. Namely, WikiSQL is the largest hand-annotated semantic parsing dataset to date - it is an order of magnitude larger than other datasets that have logical forms, either in terms of the number of examples or the number of tables. The queries in WikiSQL span over a large number of tables and hence presents an ",
578
+ "bbox": [
579
+ 174,
580
+ 373,
581
+ 485,
582
+ 553
583
+ ],
584
+ "page_idx": 4
585
+ },
586
+ {
587
+ "type": "image",
588
+ "img_path": "images/adbcb4d9e44352d24300f8a4b23f8bc6c9413df72e38d90548a15bfeeb2243d7.jpg",
589
+ "image_caption": [
590
+ "Figure 4: Distribution of questions in WikiSQL. "
591
+ ],
592
+ "image_footnote": [],
593
+ "bbox": [
594
+ 498,
595
+ 371,
596
+ 820,
597
+ 527
598
+ ],
599
+ "page_idx": 4
600
+ },
601
+ {
602
+ "type": "text",
603
+ "text": "unique challenge: the model must be able to not only generalize to new queries, but to new table schema. Finally, WikiSQL contains realistic data extracted from the web. This is evident in the distributions of the number of columns, the lengths of questions, and the length of queries, respectively shown in Figure 5. Another indicator of the variety of questions in the dataset is the distribution of question types, shown in Figure 4. ",
604
+ "bbox": [
605
+ 174,
606
+ 554,
607
+ 825,
608
+ 622
609
+ ],
610
+ "page_idx": 4
611
+ },
612
+ {
613
+ "type": "image",
614
+ "img_path": "images/7d88f8a70db87dd519843bb04c6b7ff79703cb5ff66e6c9a778cf054a8facf3b.jpg",
615
+ "image_caption": [
616
+ "Figure 5: Distribution of table, question, query sizes in WikiSQL. "
617
+ ],
618
+ "image_footnote": [],
619
+ "bbox": [
620
+ 205,
621
+ 628,
622
+ 790,
623
+ 789
624
+ ],
625
+ "page_idx": 4
626
+ },
627
+ {
628
+ "type": "text",
629
+ "text": "We collect WikiSQL by crowd-sourcing on Amazon Mechanical Turk in two phases. First, a worker paraphrases a generated question for a table. We form the generated question using a template, filled using a randomly generated SQL query. We ensure the validity and complexity of the tables by keeping only those that are legitimate database tables and sufficiently large in the number of rows and columns. Next, two other workers verify that the paraphrase has the same meaning as the generated question. We discard paraphrases that do not show enough variation, as measured by the character edit distance from the generated question, as well as those both workers deemed incorrect during verification. Section A of the Appendix contains more details on the collection of WikiSQL. We make available examples of the interface used during the paraphrase phase and during the verification phase in the supplementary materials. The dataset is available for download at [MASK]. ",
630
+ "bbox": [
631
+ 173,
632
+ 811,
633
+ 825,
634
+ 924
635
+ ],
636
+ "page_idx": 4
637
+ },
638
+ {
639
+ "type": "text",
640
+ "text": "",
641
+ "bbox": [
642
+ 174,
643
+ 103,
644
+ 825,
645
+ 145
646
+ ],
647
+ "page_idx": 5
648
+ },
649
+ {
650
+ "type": "text",
651
+ "text": "The tables, their paraphrases, and SQL queries are randomly slotted into train, dev, and test splits, such that each table is present in exactly one split. In addition to the raw tables, queries, results, and natural utterances, we also release a corresponding SQL database and query execution engine. ",
652
+ "bbox": [
653
+ 174,
654
+ 154,
655
+ 483,
656
+ 250
657
+ ],
658
+ "page_idx": 5
659
+ },
660
+ {
661
+ "type": "text",
662
+ "text": "3.1 EVALUATION ",
663
+ "text_level": 1,
664
+ "bbox": [
665
+ 174,
666
+ 266,
667
+ 305,
668
+ 280
669
+ ],
670
+ "page_idx": 5
671
+ },
672
+ {
673
+ "type": "text",
674
+ "text": "Let $N$ denote the total number of examples in the dataset, $N _ { \\mathrm { e x } }$ the number of queries that, when executed, result in the correct result, and $N _ { \\mathrm { l f } }$ the number of queries has exact string match with the ground truth query used to collect the paraphrase. We evaluate using the execution accuracy metric $\\begin{array} { r l r } { \\mathrm { A c c } _ { \\mathrm { e x } } } & { { } = } & { \\frac { N _ { \\mathrm { e x } } } { N } } \\end{array}$ . One downside of $\\operatorname { A c c } _ { \\mathrm { e x } }$ is that it is possible to construct a SQL query that does not correspond to the question but nevertheless obtains the same result. For example, the two queries SELECT COUNT(name) ",
675
+ "bbox": [
676
+ 174,
677
+ 292,
678
+ 483,
679
+ 473
680
+ ],
681
+ "page_idx": 5
682
+ },
683
+ {
684
+ "type": "table",
685
+ "img_path": "images/b38e61696d1324438dab165b6a1dcaa747916cca6508ffb54c036b643d647e01.jpg",
686
+ "table_caption": [],
687
+ "table_footnote": [],
688
+ "table_body": "<table><tr><td>Dataset</td><td>Size</td><td>LF</td><td>Schema</td></tr><tr><td>WikiSQL</td><td>80654</td><td>yes</td><td>24241</td></tr><tr><td>Geoquery</td><td>880</td><td>yes</td><td>8</td></tr><tr><td>ATIS</td><td>5871</td><td>yes</td><td>141</td></tr><tr><td>Freebase917</td><td>917</td><td>yes</td><td>81*</td></tr><tr><td>Overnight</td><td>26098</td><td>yes</td><td>8</td></tr><tr><td>WebQuestions</td><td>5810</td><td>no</td><td>2420</td></tr><tr><td>WikiTableQuestions</td><td>22033</td><td>no</td><td>2108</td></tr></table>",
689
+ "bbox": [
690
+ 496,
691
+ 159,
692
+ 831,
693
+ 287
694
+ ],
695
+ "page_idx": 5
696
+ },
697
+ {
698
+ "type": "text",
699
+ "text": "Table 1: Comparison between WikiSQL and existing datasets. The datasets are GeoQuery880 (Tang & Mooney, 2001), ATIS (Price, 1990), Free917 (Cai & Yates, 2013), Overnight (Wang et al., 2015), WebQuestions (Berant et al., 2013), and WikiTableQuestions (Pasupat & Liang, 2015). “Size” denotes the number of examples in the dataset. “LF” indicates whether it has annotated logical forms. “Schema” denotes the number of tables. ATIS is presented as a slot filling task. Each Freebase API page is counted as a separate domain. ",
700
+ "bbox": [
701
+ 498,
702
+ 297,
703
+ 823,
704
+ 465
705
+ ],
706
+ "page_idx": 5
707
+ },
708
+ {
709
+ "type": "text",
710
+ "text": "WHERE $\\mathrm { S S N } ~ = ~ 1 2 3$ and SELECT COUNT(SSN) WHERE $\\mathrm { S S N } ~ = ~ 1 2 3$ produce the same result if no two people with different names share the SSN 123. Hence, we also use the logical form accuracy $\\textstyle \\operatorname { A c c } _ { \\mathrm { l f } } = { \\frac { N _ { \\mathrm { l f } } } { N } }$ . However, as we showed in Section 2.2, $\\operatorname { A c c } _ { \\mathrm { l f } }$ incorrectly penalizes queries that achieve the correct result but do not have exact string match with the ground truth query. Due to these observations, we use both metrics to evaluate the models. ",
711
+ "bbox": [
712
+ 174,
713
+ 474,
714
+ 825,
715
+ 545
716
+ ],
717
+ "page_idx": 5
718
+ },
719
+ {
720
+ "type": "text",
721
+ "text": "4 EXPERIMENTS ",
722
+ "text_level": 1,
723
+ "bbox": [
724
+ 176,
725
+ 564,
726
+ 326,
727
+ 579
728
+ ],
729
+ "page_idx": 5
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "We tokenize the dataset using Stanford CoreNLP (Manning et al., 2014). We use the normalized tokens for training and revert into original gloss before outputting the query so that generated queries are executable on the database. We use fixed GloVe word embeddings (Pennington et al., 2014) and character n-gram embeddings (Hashimoto et al., 2016). Let $w _ { x } ^ { \\mathrm { g } }$ denote the GloVe embedding and $w _ { x } ^ { \\mathrm { c } }$ the character embedding for word $x$ . Here, $w _ { x } ^ { \\mathrm { c } }$ is the mean of the embeddings of all the character ngrams in $x$ . For words that have neither word nor character embeddings, we assign the zero vector. All networks are run for a maximum of 300 epochs with early stopping on dev split execution accuracy. We train using ADAM (Kingma & Ba, 2014) and regularize using dropout (Srivastava et al., 2014). All recurrent layers have a hidden size of 200 units and are followed by a dropout of 0.3. We implement all models using PyTorch 1. To train Seq2SQL, we first train a version in which the WHERE clause is supervised via teacher forcing (i.e. the policy is not learned from scratch) and then continue training using reinforcement learning. In order to obtain the rewards described in Section 2.2, we use the query execution engine described in Section 3. ",
734
+ "bbox": [
735
+ 173,
736
+ 594,
737
+ 825,
738
+ 775
739
+ ],
740
+ "page_idx": 5
741
+ },
742
+ {
743
+ "type": "text",
744
+ "text": "4.1 RESULT ",
745
+ "text_level": 1,
746
+ "bbox": [
747
+ 174,
748
+ 791,
749
+ 269,
750
+ 805
751
+ ],
752
+ "page_idx": 5
753
+ },
754
+ {
755
+ "type": "text",
756
+ "text": "We compare results against the attentional sequence to sequence neural semantic parser proposed by Dong & Lapata (2016). This model achieves state of the art results on a variety of semantic parsing datasets, outperforming a host of non-neural semantic parsers despite not using hand-engineered grammars. To make this baseline even more competitive on our new dataset, we augment their input with the table schema such that the model can generalize to new tables. We describe this baseline in detail in Section 2 of the Appendix. Table 2 compares the performance of the three models. ",
757
+ "bbox": [
758
+ 174,
759
+ 818,
760
+ 825,
761
+ 901
762
+ ],
763
+ "page_idx": 5
764
+ },
765
+ {
766
+ "type": "table",
767
+ "img_path": "images/6839bc1d9383fc2a2ffc16e110898f19e0b67bed781b7d9f6b21bc9f0c027dc9.jpg",
768
+ "table_caption": [
769
+ "Table 2: Performance on WikiSQL. Both metrics are defined in Section 3.1. For $\\mathrm { S e q } 2 \\mathrm { S Q L }$ (no RL), the WHERE clause is supervised via teacher forcing as opposed to reinforcement learning. "
770
+ ],
771
+ "table_footnote": [],
772
+ "table_body": "<table><tr><td>Model</td><td>Dev AcClf</td><td>Dev AcCex</td><td>Test Accf</td><td>Test AcCex</td></tr><tr><td>Baseline (Dong &amp; Lapata, 2016)</td><td>23.3%</td><td>37.0%</td><td>23.4%</td><td>35.9%</td></tr><tr><td>Aug Ptr Network</td><td>44.1%</td><td>53.8%</td><td>43.3%</td><td>53.3%</td></tr><tr><td>Seq2SQL (no RL)</td><td>48.2%</td><td>58.1%</td><td>47.4%</td><td>57.1%</td></tr><tr><td>Seq2SQL</td><td>49.5%</td><td>60.8%</td><td>48.3%</td><td> 59.4%</td></tr></table>",
773
+ "bbox": [
774
+ 200,
775
+ 90,
776
+ 792,
777
+ 183
778
+ ],
779
+ "page_idx": 6
780
+ },
781
+ {
782
+ "type": "text",
783
+ "text": "Reducing the output space by utilizing the augmented pointer network improves upon the baseline by $1 7 . 4 \\%$ . Leveraging the structure of SQL queries leads to another improvement of $3 . 8 \\%$ , as is shown by the performance of Seq2SQL without RL compared to the augmented pointer network. Finally, training using reinforcement learning based on rewards from in-the-loop query executions on a database leads to another performance increase of $2 . 3 \\%$ , as is shown by the performance of the full Seq2SQL model. ",
784
+ "bbox": [
785
+ 173,
786
+ 226,
787
+ 825,
788
+ 309
789
+ ],
790
+ "page_idx": 6
791
+ },
792
+ {
793
+ "type": "text",
794
+ "text": "4.2 ANALYSIS ",
795
+ "text_level": 1,
796
+ "bbox": [
797
+ 174,
798
+ 327,
799
+ 287,
800
+ 340
801
+ ],
802
+ "page_idx": 6
803
+ },
804
+ {
805
+ "type": "text",
806
+ "text": "Limiting the output space via pointer network leads to more accurate conditions. Compared to the baseline, the augmented pointer network generates higher quality WHERE clause. For example, for “in how many districts was a successor seated on march 4, 1850?”, the baseline generates the condition successor seated $=$ seated march 4 whereas Seq2SQL generates successor seated $=$ seated march 4 1850. Similarly, for “what’s doug battaglia’s pick number?”, the baseline generates Player $=$ doug whereas Seq2SQL generates Player $=$ doug battaglia. The conditions tend to contain rare words (e.g. “ $\\cdot 1 8 5 0 ^ { \\cdot 9 } )$ , but the baseline is inclined to produce common words in the training corpus, such as “march” and “4” for date, or “doug” for name. The pointer is less affected since it selects exclusively from the input. ",
807
+ "bbox": [
808
+ 173,
809
+ 353,
810
+ 825,
811
+ 478
812
+ ],
813
+ "page_idx": 6
814
+ },
815
+ {
816
+ "type": "text",
817
+ "text": "Incorporating structure reduces invalid queries. Seq2SQL without RL directly predicts selection and aggregation and reduces invalid SQL queries generated from $7 . 9 \\%$ t o $4 . 8 \\%$ . A large quantity of invalid queries result from column names – the generated ",
818
+ "bbox": [
819
+ 173,
820
+ 494,
821
+ 470,
822
+ 577
823
+ ],
824
+ "page_idx": 6
825
+ },
826
+ {
827
+ "type": "table",
828
+ "img_path": "images/ea7ee8062c47343d46a3818055a4261f7ac71fc7dbb45d0139656a10bdcc32d4.jpg",
829
+ "table_caption": [
830
+ "Table 3: Performance on the COUNT operator. "
831
+ ],
832
+ "table_footnote": [],
833
+ "table_body": "<table><tr><td>Model</td><td>Precision</td><td>Recall</td><td>F1</td></tr><tr><td>Aug Ptr Network</td><td>66.3%</td><td>64.4%</td><td>65.4%</td></tr><tr><td>Seq2SQL</td><td>72.6%</td><td>66.2%</td><td>69.2%</td></tr></table>",
834
+ "bbox": [
835
+ 483,
836
+ 492,
837
+ 823,
838
+ 551
839
+ ],
840
+ "page_idx": 6
841
+ },
842
+ {
843
+ "type": "text",
844
+ "text": "query refers to selection columns that are not present in the table. This is particularly helpful when the column name contain many tokens, such as “Miles $\\left( \\mathrm { k m } \\right) ^ { \\ast }$ , which has 4 tokens. Introducing a classifier for the aggregation also reduces the error rate. Table 3 shows that adding the aggregation classifier improves the precision, recall, and F1 for predicting the COUNT operator. For more queries produced by the different models, please see Section 3 of the Appendix. ",
845
+ "bbox": [
846
+ 174,
847
+ 577,
848
+ 825,
849
+ 647
850
+ ],
851
+ "page_idx": 6
852
+ },
853
+ {
854
+ "type": "text",
855
+ "text": "RL generates higher quality WHERE clause that are ordered differently than ground truth. Training with policy-based RL obtains correct results in which the order of conditions is differs from the ground truth query. For example, for “in what district was the democratic candidate first elected in 1992?”, the ground truth conditions are First elected $= \\ 1 9 9 2$ AND Party $=$ Democratic whereas Seq2SQL generates Party $=$ Democratic AND First elected $= \\ 1 9 9 2$ . When Seq2SQL is correct and Seq2SQL without RL is not, the latter tends to produce an incorrect WHERE clause. For example, for the rather complex question “what is the race name of the 12th round trenton, new jersey race where a.j. foyt had the pole position?”, Seq2SQL trained without RL generates WHERE rnd $\\qquad = \\quad \\pm 2$ and track $\\ u = \\ a \\cdot \\dot { \\ u } $ . foyt AND pole position $=$ a.j. foyt whereas Seq2SQL trained with RL correctly generates WHERE rnd $\\qquad = \\quad \\pm 2$ AND pole position $\\ u = \\hat { \\ u } \\hat { \\mathrm { ~ \\bf ~ d ~ } } \\cdot \\dot { \\mathrm { ~ \\bf ~ J ~ } }$ . foyt. ",
856
+ "bbox": [
857
+ 173,
858
+ 662,
859
+ 825,
860
+ 815
861
+ ],
862
+ "page_idx": 6
863
+ },
864
+ {
865
+ "type": "text",
866
+ "text": "5 RELATED WORK ",
867
+ "text_level": 1,
868
+ "bbox": [
869
+ 176,
870
+ 835,
871
+ 344,
872
+ 852
873
+ ],
874
+ "page_idx": 6
875
+ },
876
+ {
877
+ "type": "text",
878
+ "text": "Semantic Parsing. In semantic parsing for question answering (QA), natural language questions are parsed into logical forms that are then executed on a knowledge graph (Zelle & Mooney, 1996; Wong & Mooney, 2007; Zettlemoyer & Collins, 2005; 2007). Other works in semantic parsing focus on learning parsers without relying on annotated logical forms by leveraging conversational logs (Artzi & Zettlemoyer, 2011), demonstrations (Artzi & Zettlemoyer, 2013), distant supervision (Cai & Yates, 2013; Reddy et al., 2014), and question-answer pairs (Liang et al., 2011). Semantic parsing systems are typically constrained to a single schema and require hand-curated grammars to perform well2. Pasupat & Liang (2015) addresses the single-schema limitation by proposing the floating parser, which generalizes to unseen web tables on the WikiTableQuestions task. Our approach is similar in that it generalizes to new table schema. However, we do not require access to table content, conversion of table to an additional graph, hand-engineered features, nor handengineered grammar. ",
879
+ "bbox": [
880
+ 174,
881
+ 867,
882
+ 823,
883
+ 924
884
+ ],
885
+ "page_idx": 6
886
+ },
887
+ {
888
+ "type": "text",
889
+ "text": "",
890
+ "bbox": [
891
+ 174,
892
+ 103,
893
+ 825,
894
+ 215
895
+ ],
896
+ "page_idx": 7
897
+ },
898
+ {
899
+ "type": "text",
900
+ "text": "Semantic parsing datasets. Previous semantic parsing systems were designed to answer complex and compositional questions over closed-domain, fixed-schema datasets such as GeoQuery (Tang & Mooney, 2001) and ATIS (Price, 1990). Researchers also investigated QA over subsets of largescale knowledge graphs such as DBPedia (Starc & Mladenic, 2017) and Freebase (Cai & Yates, 2013; Berant et al., 2013). The dataset “Overnight” (Wang et al., 2015) uses a similar crowdsourcing process to build a dataset of natural language question, logical form pairs, but has only 8 domains. WikiTableQuestions (Pasupat & Liang, 2015) is a collection of question and answers, also over a large quantity of tables extracted from Wikipedia. However, it does not provide logical forms whereas WikiSQL does. WikiTableQuestions focuses on the task of QA over noisy web tables, whereas WikiSQL focuses on generating SQL queries for questions over relational database tables. We intend to build a natural language interface for databases, and do not use table content apart from evaluation. ",
901
+ "bbox": [
902
+ 174,
903
+ 231,
904
+ 825,
905
+ 397
906
+ ],
907
+ "page_idx": 7
908
+ },
909
+ {
910
+ "type": "text",
911
+ "text": "Representation learning for sequence generation. Dong & Lapata (2016)’s attentional sequence to sequence neural semantic parser, which we use as the baseline, achieves state-of-the-art results on a variety of semantic parsing datasets despite not utilizing hand-engineered grammar. Unlike their model, Seq2SQL uses pointer based generation akin to Vinyals et al. (2015) to achieve higher performance, especially in generating queries with rare words and column names. Pointer models have also been successfully applied to tasks such as language modeling (Merity et al., 2017), summarization (Gu et al., 2016), combinatorial optimization (Bello et al., 2017), and question answering (Seo et al., 2017; Xiong et al., 2017). Another interesting neural semantic parsing model is the Neural Programmar by Neelakantan et al. (2017). Our approach is different than their work in that we do not require access to the table content during inference, which may be unavailable due to privacy concerns. We also do not hand-engineer model architecture for query execution and instead leverage existing database engines to perform efficient query execution. In contrast to both Dong & Lapata (2016) and Neelakantan et al. (2017), we train our model using policy-based RL, which helps Seq2SQL achieve state-of-the-art performance. ",
912
+ "bbox": [
913
+ 174,
914
+ 414,
915
+ 825,
916
+ 608
917
+ ],
918
+ "page_idx": 7
919
+ },
920
+ {
921
+ "type": "text",
922
+ "text": "Natural language interface for databases. One of the prominent works in natural language interfaces is PRECISE (Popescu et al., 2003), which translates questions to SQL queries and identifies questions that it is not confident about. Giordani & Moschitti (2012) translate questions to SQL by first generating candidate queries from a grammar then ranking them using tree kernels. Both of these approaches rely on high quality grammar and are not suitable for tasks that require generalization to new schema. Iyer et al. (2017) also translate to SQL, but with a Seq2Seq model that is further improved with human feedback. Seq2SQL outperforms Seq2Seq and uses reinforcement learning instead of human feedback during training. ",
923
+ "bbox": [
924
+ 174,
925
+ 625,
926
+ 825,
927
+ 736
928
+ ],
929
+ "page_idx": 7
930
+ },
931
+ {
932
+ "type": "text",
933
+ "text": "6 CONCLUSION ",
934
+ "text_level": 1,
935
+ "bbox": [
936
+ 176,
937
+ 757,
938
+ 318,
939
+ 773
940
+ ],
941
+ "page_idx": 7
942
+ },
943
+ {
944
+ "type": "text",
945
+ "text": "We proposed Seq2SQL, a deep neural network for translating questions to SQL queries. Our model leverages the structure of SQL queries to reduce the output space of the model. To train Seq2SQL, we applied in-the-loop query execution to learn a policy for generating the conditions of the SQL query, which is unordered and unsuitable for optimization via cross entropy loss. We also introduced WikiSQL, a dataset of questions and SQL queries that is an order of magnitude larger than comparable datasets. Finally, we showed that $\\mathrm { S e q } 2 \\mathrm { S Q L }$ outperforms a state-of-the-art semantic parser on WikiSQL, improving execution accuracy from $3 5 . 9 \\%$ to $5 9 . 4 \\%$ and logical form accuracy from $2 3 . 4 \\%$ to $4 8 . 3 \\%$ . ",
946
+ "bbox": [
947
+ 174,
948
+ 789,
949
+ 825,
950
+ 900
951
+ ],
952
+ "page_idx": 7
953
+ },
954
+ {
955
+ "type": "text",
956
+ "text": "REFERENCES \nI. Androutsopoulos, G.D. Ritchie, and P. Thanisch. Natural language interfaces to databases - an introduction. 1995. \nYoav Artzi and Luke S. Zettlemoyer. Bootstrapping semantic parsers from conversations. In EMNLP, 2011. \nYoav Artzi and Luke S. Zettlemoyer. Weakly supervised learning of semantic parsers for mapping instructions to actions. TACL, 1:49–62, 2013. \nThorsten Beck, Asli Demirguc¸-Kunt, and Ross Levine. A new database on the structure and devel- ¨ opment of the financial sector. The World Bank Economic Review, 14(3):597–605, 2000. \nIrwan Bello, Hieu Pham, Quoc V. Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. ICLR, 2017. \nJonathan Berant, Andrew Chou, Roy Frostig, and Percy Liang. Semantic parsing on freebase from question-answer pairs. In EMNLP, 2013. \nChandra Bhagavatula, Thanapon Noraset, and Doug Downey. Methods for exploring and mining tables on wikipedia. In IDEA@KDD, 2013. \nQingqing Cai and Alexander Yates. Large-scale semantic parsing via schema matching and lexicon extension. In ACL, 2013. \nLi Dong and Mirella Lapata. Language to logical form with neural attention. ACL, 2016. \nAlessandra Giordani and Alessandro Moschitti. Translating questions to SQL queries with generative parsers discriminatively reranked. In COLING, 2012. \nJiatao Gu, Zhengdong Lu, Hang Li, and Victor O. K. Li. Incorporating copying mechanism in sequence-to-sequence learning. ACL, 2016. \nKazuma Hashimoto, Caiming Xiong, Yoshimasa Tsuruoka, and Richard Socher. A Joint Many-Task Model: Growing a Neural Network for Multiple NLP Tasks. arXiv, cs.CL 1611.01587, 2016. \nRichard Hillestad, James Bigelow, Anthony Bower, Federico Girosi, Robin Meili, Richard Scoville, and Roger Taylor. Can electronic medical record systems transform health care? potential health benefits, savings, and costs. Health affairs, 24(5):1103–1117, 2005. \nSepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. Neural computation, 1997. \nSrinivasan Iyer, Ioannis Konstas, Alvin Cheung, Jayant Krishnamurthy, and Luke Zettlemoyer. Learning a neural semantic parser from user feedback. In ACL, 2017. \nDiederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv, abs/1412.6980, 2014. \nPercy Liang, Michael I. Jordan, and Dan Klein. Learning dependency-based compositional semantics. Computational Linguistics, 39:389–446, 2011. \nChristopher D. Manning, Mihai Surdeanu, John Bauer, Jenny Finkel, Steven J. Bethard, and David McClosky. The Stanford CoreNLP natural language processing toolkit. In Association for Computational Linguistics (ACL) System Demonstrations, pp. 55–60, 2014. \nStephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. ICLR, 2017. \nArvind Neelakantan, Quoc V. Le, Mart´ın Abadi, Andrew McCallum, and Dario Amodei. Learning a natural language interface with neural programmer. In ICLR, 2017. \nEric WT Ngai, Li Xiu, and Dorothy CK Chau. Application of data mining techniques in customer relationship management: A literature review and classification. Expert systems with applications, 36(2):2592–2602, 2009. ",
957
+ "bbox": [
958
+ 169,
959
+ 83,
960
+ 828,
961
+ 933
962
+ ],
963
+ "page_idx": 8
964
+ },
965
+ {
966
+ "type": "text",
967
+ "text": "Panupong Pasupat and Percy Liang. Compositional semantic parsing on semi-structured tables. In ACL, 2015. ",
968
+ "bbox": [
969
+ 171,
970
+ 103,
971
+ 825,
972
+ 133
973
+ ],
974
+ "page_idx": 9
975
+ },
976
+ {
977
+ "type": "text",
978
+ "text": "Jeffrey Pennington, Richard Socher, and Christopher D. Manning. Glove: Global vectors for word representation. In EMNLP, 2014. ",
979
+ "bbox": [
980
+ 169,
981
+ 140,
982
+ 823,
983
+ 170
984
+ ],
985
+ "page_idx": 9
986
+ },
987
+ {
988
+ "type": "text",
989
+ "text": "Ana-Maria Popescu, Oren Etzioni, and Henry Kautz. Towards a theory of natural language interfaces to databases. In Proceedings of the 8th International Conference on Intelligent User Interfaces, pp. 149–157. ACM, 2003. ",
990
+ "bbox": [
991
+ 174,
992
+ 178,
993
+ 823,
994
+ 222
995
+ ],
996
+ "page_idx": 9
997
+ },
998
+ {
999
+ "type": "text",
1000
+ "text": "Patti J. Price. Evaluation of spoken language systems: The ATIS domain. 1990. ",
1001
+ "bbox": [
1002
+ 173,
1003
+ 229,
1004
+ 699,
1005
+ 246
1006
+ ],
1007
+ "page_idx": 9
1008
+ },
1009
+ {
1010
+ "type": "text",
1011
+ "text": "Siva Reddy, Mirella Lapata, and Mark Steedman. Large-scale semantic parsing without questionanswer pairs. TACL, 2:377–392, 2014. ",
1012
+ "bbox": [
1013
+ 173,
1014
+ 253,
1015
+ 821,
1016
+ 284
1017
+ ],
1018
+ "page_idx": 9
1019
+ },
1020
+ {
1021
+ "type": "text",
1022
+ "text": "John Schulman, Nicolas Heess, Theophane Weber, and Pieter Abbeel. Gradient estimation using stochastic computation graphs. In NIPS, 2015. ",
1023
+ "bbox": [
1024
+ 169,
1025
+ 291,
1026
+ 823,
1027
+ 321
1028
+ ],
1029
+ "page_idx": 9
1030
+ },
1031
+ {
1032
+ "type": "text",
1033
+ "text": "Min Joon Seo, Aniruddha Kembhavi, Ali Farhadi, and Hannaneh Hajishirzi. Bidirectional attention flow for machine comprehension. ICLR, 2017. ",
1034
+ "bbox": [
1035
+ 169,
1036
+ 329,
1037
+ 823,
1038
+ 359
1039
+ ],
1040
+ "page_idx": 9
1041
+ },
1042
+ {
1043
+ "type": "text",
1044
+ "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:1929–1958, 2014. ",
1045
+ "bbox": [
1046
+ 174,
1047
+ 367,
1048
+ 823,
1049
+ 410
1050
+ ],
1051
+ "page_idx": 9
1052
+ },
1053
+ {
1054
+ "type": "text",
1055
+ "text": "Janez Starc and Dunja Mladenic. Joint learning of ontology and semantic parser from text. Intelligent Data Analysis, 21:19–38, 2017. ",
1056
+ "bbox": [
1057
+ 173,
1058
+ 419,
1059
+ 821,
1060
+ 448
1061
+ ],
1062
+ "page_idx": 9
1063
+ },
1064
+ {
1065
+ "type": "text",
1066
+ "text": "Richard S Sutton, David A McAllester, Satinder P Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. In Advances in neural information processing systems, pp. 1057–1063, 2000. ",
1067
+ "bbox": [
1068
+ 173,
1069
+ 457,
1070
+ 825,
1071
+ 501
1072
+ ],
1073
+ "page_idx": 9
1074
+ },
1075
+ {
1076
+ "type": "text",
1077
+ "text": "Lappoon R. Tang and Raymond J. Mooney. Using multiple clause constructors in inductive logic programming for semantic parsing. In ECML, 2001. ",
1078
+ "bbox": [
1079
+ 173,
1080
+ 508,
1081
+ 823,
1082
+ 537
1083
+ ],
1084
+ "page_idx": 9
1085
+ },
1086
+ {
1087
+ "type": "text",
1088
+ "text": "Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In NIPS, 2015. ",
1089
+ "bbox": [
1090
+ 173,
1091
+ 545,
1092
+ 738,
1093
+ 561
1094
+ ],
1095
+ "page_idx": 9
1096
+ },
1097
+ {
1098
+ "type": "text",
1099
+ "text": "Yushi Wang, Jonathan Berant, and Percy Liang. Building a semantic parser overnight. In ACL, 2015. ",
1100
+ "bbox": [
1101
+ 173,
1102
+ 569,
1103
+ 820,
1104
+ 599
1105
+ ],
1106
+ "page_idx": 9
1107
+ },
1108
+ {
1109
+ "type": "text",
1110
+ "text": "Yuk Wah Wong and Raymond J. Mooney. Learning synchronous grammars for semantic parsing with lambda calculus. In ACL, 2007. ",
1111
+ "bbox": [
1112
+ 173,
1113
+ 608,
1114
+ 823,
1115
+ 637
1116
+ ],
1117
+ "page_idx": 9
1118
+ },
1119
+ {
1120
+ "type": "text",
1121
+ "text": "Caiming Xiong, Victor Zhong, and Richard Socher. Dynamic coattention networks for question answering. ICLR, 2017. ",
1122
+ "bbox": [
1123
+ 173,
1124
+ 645,
1125
+ 821,
1126
+ 675
1127
+ ],
1128
+ "page_idx": 9
1129
+ },
1130
+ {
1131
+ "type": "text",
1132
+ "text": "John M. Zelle and Raymond J. Mooney. Learning to parse database queries using inductive logic programming. In AAAI/IAAI, Vol. 2, 1996. ",
1133
+ "bbox": [
1134
+ 171,
1135
+ 683,
1136
+ 821,
1137
+ 713
1138
+ ],
1139
+ "page_idx": 9
1140
+ },
1141
+ {
1142
+ "type": "text",
1143
+ "text": "Luke S. Zettlemoyer and Michael Collins. Learning to map sentences to logical form: Structured classification with probabilistic categorial grammars. In Uncertainty in Artificial Intelligence, 2005. ",
1144
+ "bbox": [
1145
+ 173,
1146
+ 720,
1147
+ 825,
1148
+ 763
1149
+ ],
1150
+ "page_idx": 9
1151
+ },
1152
+ {
1153
+ "type": "text",
1154
+ "text": "Luke S. Zettlemoyer and Michael Collins. Online learning of relaxed ccg grammars for parsing to logical form. In EMNLP-CoNLL, 2007. ",
1155
+ "bbox": [
1156
+ 173,
1157
+ 772,
1158
+ 823,
1159
+ 803
1160
+ ],
1161
+ "page_idx": 9
1162
+ },
1163
+ {
1164
+ "type": "text",
1165
+ "text": "A COLLECTION OF WIKISQL ",
1166
+ "text_level": 1,
1167
+ "bbox": [
1168
+ 176,
1169
+ 102,
1170
+ 436,
1171
+ 118
1172
+ ],
1173
+ "page_idx": 10
1174
+ },
1175
+ {
1176
+ "type": "text",
1177
+ "text": "WikiSQL is collected in a paraphrase phases as well as a verification phase. In the paraphrase phase, we use tables extracted from Wikipedia by Bhagavatula et al. (2013) and remove small tables according to the following criteria: ",
1178
+ "bbox": [
1179
+ 174,
1180
+ 135,
1181
+ 823,
1182
+ 178
1183
+ ],
1184
+ "page_idx": 10
1185
+ },
1186
+ {
1187
+ "type": "text",
1188
+ "text": "• the number of cells in each row is not the same • the content in a cell exceed 50 characters • a header cell is empty • the table has less than 5 rows or 5 columns • over $40 \\%$ of the cells of a row contain identical content ",
1189
+ "bbox": [
1190
+ 215,
1191
+ 193,
1192
+ 596,
1193
+ 296
1194
+ ],
1195
+ "page_idx": 10
1196
+ },
1197
+ {
1198
+ "type": "text",
1199
+ "text": "We also remove the last row of a table because a large quantity of HTML tables tend to have summary statistics in the last row, and hence the last row does not adhere to the table schema defined by the header row. ",
1200
+ "bbox": [
1201
+ 174,
1202
+ 310,
1203
+ 823,
1204
+ 352
1205
+ ],
1206
+ "page_idx": 10
1207
+ },
1208
+ {
1209
+ "type": "text",
1210
+ "text": "For each of the table that passes the above criteria, we randomly generate 6 SQL queries according to the following rules: ",
1211
+ "bbox": [
1212
+ 174,
1213
+ 359,
1214
+ 823,
1215
+ 388
1216
+ ],
1217
+ "page_idx": 10
1218
+ },
1219
+ {
1220
+ "type": "text",
1221
+ "text": "• the query follows the format SELECT agg op agg col from table where cond1 col cond1 op cond1 AND cond2 col cond2 op cond2 ... • the aggregation operator agg op can be empty or COUNT. In the event that the aggregation column agg col is numeric, agg op can additionally be one of MAX and MIN • the condition operator cond op is $=$ . In the event that the corresponding condition column cond col is numeric, cond op can additionally be one of $>$ and $<$ • the condition cond can be any possible value present in the table under the corresponding cond col. In the event that cond col is numerical, cond can be any numerical value sampled from the range from the minimum value in the column to the maximum value in the column. ",
1222
+ "bbox": [
1223
+ 215,
1224
+ 405,
1225
+ 825,
1226
+ 566
1227
+ ],
1228
+ "page_idx": 10
1229
+ },
1230
+ {
1231
+ "type": "text",
1232
+ "text": "We only generate queries that produce a non-empty result set. To enforce succinct queries, we remove conditions from the generated queries if doing so does not change the execution result. ",
1233
+ "bbox": [
1234
+ 176,
1235
+ 583,
1236
+ 823,
1237
+ 611
1238
+ ],
1239
+ "page_idx": 10
1240
+ },
1241
+ {
1242
+ "type": "text",
1243
+ "text": "For each query, we generate a crude question using a template and obtain a human paraphrase via crowdsourcing on Amazon Mechanical Turk. In each Amazon Mechanical Turk HIT, a worker is shown the first 4 rows of the table as well as its generated questions and asked to paraphrase each question. ",
1244
+ "bbox": [
1245
+ 174,
1246
+ 618,
1247
+ 825,
1248
+ 674
1249
+ ],
1250
+ "page_idx": 10
1251
+ },
1252
+ {
1253
+ "type": "text",
1254
+ "text": "After obtaining natural language utterances from the paraphrase phase, we give each questionparaphrase pair to two other workers in the verification phase to verify that the paraphrase and the original question contain the same meaning. ",
1255
+ "bbox": [
1256
+ 176,
1257
+ 681,
1258
+ 825,
1259
+ 723
1260
+ ],
1261
+ "page_idx": 10
1262
+ },
1263
+ {
1264
+ "type": "text",
1265
+ "text": "We then filter the initial collection of paraphrases using the following criteria: ",
1266
+ "bbox": [
1267
+ 174,
1268
+ 729,
1269
+ 683,
1270
+ 744
1271
+ ],
1272
+ "page_idx": 10
1273
+ },
1274
+ {
1275
+ "type": "text",
1276
+ "text": "• the paraphrase must be deemed correct by at least one worker during the verification phrase • the paraphrase must be sufficiently different from the generated question, with a characterlevel edit distance greater than 10 ",
1277
+ "bbox": [
1278
+ 215,
1279
+ 760,
1280
+ 825,
1281
+ 810
1282
+ ],
1283
+ "page_idx": 10
1284
+ },
1285
+ {
1286
+ "type": "text",
1287
+ "text": "B ATTENTIONAL SEQ2SEQ NEURAL SEMANTIC PARSER BASELINE",
1288
+ "text_level": 1,
1289
+ "bbox": [
1290
+ 174,
1291
+ 833,
1292
+ 745,
1293
+ 851
1294
+ ],
1295
+ "page_idx": 10
1296
+ },
1297
+ {
1298
+ "type": "text",
1299
+ "text": "We employ the attentional sequence to sequence model for the baseline. This model by Dong & Lapata (2016) achieves state of the art results on a variety of semantic parsing datasets despite not using hand-engineered grammar. We implement a variant using OpenNMT and a global attention encoder-decoder architecture (with input feeding) described by Luong et al. ",
1300
+ "bbox": [
1301
+ 174,
1302
+ 867,
1303
+ 825,
1304
+ 924
1305
+ ],
1306
+ "page_idx": 10
1307
+ },
1308
+ {
1309
+ "type": "text",
1310
+ "text": "We use the same two-layer, bidirectional, stacked LSTM encoder as described previously. The decoder is almost identical to that described by Equation 2 of the paper, with the sole difference coming from input feeding. ",
1311
+ "bbox": [
1312
+ 174,
1313
+ 103,
1314
+ 825,
1315
+ 147
1316
+ ],
1317
+ "page_idx": 11
1318
+ },
1319
+ {
1320
+ "type": "equation",
1321
+ "img_path": "images/7e4e8de749c18fb549700cfd18481cb6477353976ac4025304e02d90e3891b82.jpg",
1322
+ "text": "$$\ng _ { s } = \\mathrm { L S T M } \\left( \\left[ \\operatorname { e m b } \\left( y _ { s - 1 } \\right) ; \\kappa _ { s - 1 } ^ { \\mathrm { d e c } } \\right] , g _ { s - 1 } \\right)\n$$",
1323
+ "text_format": "latex",
1324
+ "bbox": [
1325
+ 359,
1326
+ 164,
1327
+ 637,
1328
+ 184
1329
+ ],
1330
+ "page_idx": 11
1331
+ },
1332
+ {
1333
+ "type": "text",
1334
+ "text": "where $\\kappa _ { s } ^ { \\mathrm { d e c } }$ is the attentional context over the input sequence during the sth decoding step, computed as ",
1335
+ "bbox": [
1336
+ 173,
1337
+ 195,
1338
+ 825,
1339
+ 224
1340
+ ],
1341
+ "page_idx": 11
1342
+ },
1343
+ {
1344
+ "type": "equation",
1345
+ "img_path": "images/0232738c1a8d293ceaf8339643f87a5b7a2fda1f9f32e1eb72c335383db17cf7.jpg",
1346
+ "text": "$$\n\\alpha _ { s , t } ^ { \\mathrm { d e c } } = h _ { s } ^ { \\mathrm { d e c } } \\left( W ^ { \\mathrm { d e c } } h _ { t } ^ { \\mathrm { e n c } } \\right) ^ { \\intercal } \\qquad \\beta _ { s } ^ { \\mathrm { d e c } } = \\mathrm { s o f t m a x } \\left( \\alpha _ { s } ^ { \\mathrm { d e c } } \\right)\n$$",
1347
+ "text_format": "latex",
1348
+ "bbox": [
1349
+ 315,
1350
+ 241,
1351
+ 681,
1352
+ 262
1353
+ ],
1354
+ "page_idx": 11
1355
+ },
1356
+ {
1357
+ "type": "equation",
1358
+ "img_path": "images/dc225221d884a29fccb084e6fdc5fc7f5605f992f1d2ebeb857902bd92ccb94b.jpg",
1359
+ "text": "$$\n\\kappa _ { s } = \\sum _ { t } \\beta _ { s , t } h _ { t } ^ { \\mathrm { e n c } }\n$$",
1360
+ "text_format": "latex",
1361
+ "bbox": [
1362
+ 437,
1363
+ 279,
1364
+ 558,
1365
+ 313
1366
+ ],
1367
+ "page_idx": 11
1368
+ },
1369
+ {
1370
+ "type": "text",
1371
+ "text": "To produce the output token during the sth decoder step, the concatenation of the decoder state and the attention context is given to a final linear layer to produce a distribution $\\alpha ^ { \\mathrm { d e c } }$ over words in the target vocabulary ",
1372
+ "bbox": [
1373
+ 174,
1374
+ 323,
1375
+ 825,
1376
+ 366
1377
+ ],
1378
+ "page_idx": 11
1379
+ },
1380
+ {
1381
+ "type": "equation",
1382
+ "img_path": "images/e5b5bf146dda2fa139fca15ab1d851f9463c94def5ff0b19eed3da4a01211a9f.jpg",
1383
+ "text": "$$\n\\alpha ^ { \\mathrm { d e c } } = \\mathrm { s o f t m a x } \\left( U ^ { \\mathrm { d e c } } [ h _ { s } ^ { \\mathrm { d e c } } ; \\kappa _ { s } ^ { \\mathrm { d e c } } ] \\right)\n$$",
1384
+ "text_format": "latex",
1385
+ "bbox": [
1386
+ 380,
1387
+ 382,
1388
+ 617,
1389
+ 402
1390
+ ],
1391
+ "page_idx": 11
1392
+ },
1393
+ {
1394
+ "type": "text",
1395
+ "text": "During training, teacher forcing is used. During inference, a beam size of 5 is used and generated unknown words are replaced by the input words with the highest attention weight. ",
1396
+ "bbox": [
1397
+ 173,
1398
+ 411,
1399
+ 826,
1400
+ 440
1401
+ ],
1402
+ "page_idx": 11
1403
+ },
1404
+ {
1405
+ "type": "text",
1406
+ "text": "C PREDICTIONS BY SEQ2SQL ",
1407
+ "text_level": 1,
1408
+ "bbox": [
1409
+ 176,
1410
+ 460,
1411
+ 441,
1412
+ 478
1413
+ ],
1414
+ "page_idx": 11
1415
+ },
1416
+ {
1417
+ "type": "table",
1418
+ "img_path": "images/ea003ea4d88a49efeaaf1b8d5ae41b730de5be5993605737b4990eb09c355e8d.jpg",
1419
+ "table_caption": [
1420
+ "Table 4: Examples predictions by the models on the dev split. Q denotes the natural language question and G denotes the corresponding ground truth query. P, ${ \\bf \\vec { S } } ^ { \\prime }$ , and S denote, respectively, the queries produced by the Augmented Pointer Network, Seq2SQL without reinforcement learning, Seq2SQL. We omit the FROM table part of the query for succinctness. "
1421
+ ],
1422
+ "table_footnote": [],
1423
+ "table_body": "<table><tr><td>Q</td><td colspan=\"16\">when connecticut &amp; villanova are the regular season winner how many tournament venues (city)are there?</td></tr><tr><td></td><td colspan=\"11\">SELECT COUNT tournament player (city) WHERE regular season winner city )= connecticut &amp; villanova</td></tr><tr><td>P S</td><td></td><td colspan=\"3\">COUNT tournament venue</td><td></td><td>(city)</td><td></td><td></td><td colspan=\"3\"></td></tr><tr><td></td><td>SELECT COUNT</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>WHERE tournament winner = connecticut &amp; villanova</td></tr><tr><td>S G</td><td>SELECT SELECT COUNT</td><td>tournament venue</td><td>tournament venue</td><td></td><td></td><td>(city) (city)</td><td></td><td>WHERE regular season winner</td><td></td><td>WHERE regular season winner = connecticut &amp; villanova connecticut &amp; villanova</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Q P</td><td colspan=\"8\">what are the aggregate scores of those races where the first leg results are O-1?</td><td colspan=\"2\"></td></tr><tr><td>S</td><td>SELECT aggregate WHERE 1st</td><td></td><td></td><td></td><td></td><td>=0-1</td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT</td><td>COUNT agg.</td><td></td><td></td><td></td><td></td><td>score WHERE 1st leg = 0-1</td><td></td><td></td><td></td></tr><tr><td>G</td><td>SELECT agg. SELECT agg.</td><td>score WHERE</td><td>score WHERE 1st leg = 0-1</td><td>1st leg = 0-1</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td colspan=\"8\"></td><td colspan=\"2\"></td></tr><tr><td>Q P</td><td colspan=\"8\">what is the race name of the l2th round trenton, new jersey race where a.j.foyt had the pole position?</td><td colspan=\"2\"></td></tr><tr><td>S</td><td colspan=\"8\">SELECT race name WHERE location = 12th AND round position = a.j.</td><td colspan=\"2\">foyt,new jersey AND foyt AND pole position = a.j. foyt</td></tr><tr><td>S</td><td colspan=\"7\">SELECT race name WHERE rnd = 12 AND track = a.j. f SELECT = 12 AND pole position = a.j.</td><td colspan=\"2\">foyt</td></tr><tr><td>G</td><td colspan=\"7\">race name rnd SELECT race name WHERE rnd = 12 :AND pole position = a.j.</td><td colspan=\"2\">foyt</td></tr><tr><td>Q</td><td colspan=\"7\"></td><td colspan=\"2\"></td></tr><tr><td>P</td><td>what city is on 89.9?</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT city WHERE frequency = 89.9 SELECT city of license WHERE frequency = 89.9</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT city of license WHERE frequency</td><td></td><td></td><td></td><td></td><td></td><td>= 89.9</td><td></td><td></td><td></td></tr><tr><td>G</td><td>SELECT city of license WHERE frequency</td><td></td><td></td><td></td><td></td><td></td><td>=89.9</td><td></td><td></td><td></td></tr><tr><td>Q</td><td>how many voters from the bronx voted for the socialist party?</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>P</td><td>SELECT MIN % party = socialist</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S&#x27; S</td><td>SELECT COUNT the bronx where the bronx = socialist</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>G</td><td>SELECT COUNT the bronx WHERE the bronx = socialist SELECT the bronx WHERE party = socialist</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td colspan=\"8\">in what year did a plymouth vehicle win on february 9 ?</td><td colspan=\"2\"></td></tr><tr><td>Q P</td><td colspan=\"8\">SELECT MIN year (km) WHERE date = february 9 AND race time = plymouth 9</td><td colspan=\"2\"></td></tr><tr><td>S</td><td>SELECT</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>S</td><td>SELECT</td><td>year (km)</td><td></td><td></td><td></td><td></td><td></td><td></td><td>year(km) WHERE date = plymouth 9 AND race time = february 9</td><td></td><td></td></tr><tr><td>G</td><td>SELECT year (km)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>WHERE date = plymouth 9 AND race time= february 9 WHERE manufacturer = plymouth AND date = february 9</td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>",
1424
+ "bbox": [
1425
+ 173,
1426
+ 500,
1427
+ 897,
1428
+ 840
1429
+ ],
1430
+ "page_idx": 11
1431
+ }
1432
+ ]
parse/train/Syx6bz-Ab/Syx6bz-Ab_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/Syx6bz-Ab/Syx6bz-Ab_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rkgt0REKwS/rkgt0REKwS.md ADDED
@@ -0,0 +1,564 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CURRICULUM LOSS: ROBUST LEARNING AND GEN-ERALIZATION AGAINST LABEL CORRUPTION
2
+
3
+ Yueming Lyu & Ivor W. Tsang Centre for Artificial Intelligence, University of Technology Sydney yueminglyu@gmail.com, Ivor.Tsang@uts.edu.au
4
+
5
+ # ABSTRACT
6
+
7
+ Deep neural networks (DNNs) have great expressive power, which can even memorize samples with wrong labels. It is vitally important to reiterate robustness and generalization in DNNs against label corruption. To this end, this paper studies the 0-1 loss, which has a monotonic relationship with empirical adversary (reweighted) risk (Hu et al., 2018). Although the 0-1 loss has some robust properties, it is difficult to optimize. To efficiently optimize the 0-1 loss while keeping its robust properties, we propose a very simple and efficient loss, i.e. curriculum loss (CL). Our CL is a tighter upper bound of the 0-1 loss compared with conventional summation based surrogate losses. Moreover, CL can adaptively select samples for model training. As a result, our loss can be deemed as a novel perspective of curriculum sample selection strategy, which bridges a connection between curriculum learning and robust learning. Experimental results on benchmark datasets validate the robustness of the proposed loss.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Noise corruption is a common phenomenon in our daily life. For instance, noisy corrupted (wrong) labels may be resulted from annotating for similar objects (Su et al., 2012; Yuan et al., 2019), crawling images and labels from websites (Hu et al., 2017; Tanaka et al., 2018) and creating training sets by program (Ratner et al., 2016; Khetan et al., 2018). Learning with noisy labels is thus an promising area.
12
+
13
+ Deep neural networks (DNNs) have great expressive power (model complexity) to learn challenging tasks. However, DNNs also undertake a higher risk of overfitting to the data. Although many regularization techniques, such as adding regularization terms, data augmentation, weight decay, dropout and batch normalization, have been proposed, generalization is still vitally important for deep learning to fully exploit the super-expressive power. Zhang et al. (2017) show that DNNs can even fully memorize samples with incorrectly corrupted labels. Such label corruption significantly degenerates the generalization performance of deep models. This calls a lot of attention on robustness in deep learning with noisy labels.
14
+
15
+ Robustness of 0-1 loss: The problem resulted from data corruption or label corruption is that test distribution is different from training distribution. Hu et al. (2018) analyzed the adversarial risk that the test distribution density is adversarially changed within a limited $f$ -divergence (e.g. KLdivergence) from the training distribution density. They show that there is a monotonic relationship between the (empirical) risk and the (empirical) adversarial risk when the 0-1 loss function is used. This suggests that minimizing the empirical risk with the 0-1 loss function is equivalent to minimize the empirical adversarial risk (worst-case risk). When we train a model based on the corrupted training distribution, we want our model to perform well on the clean distribution. Since we do not know the clean distribution, we want our model to perform well for the worst case estimate of the clean distribution in some constrained set. It is thus natural to employ the worst-case classification risk of the estimated clean distribution as the objective. Note that the worst-case classification risk is an upper bound of the classification risk of the true clean distribution, minimizing the worst-case risk can usually decrease the true risk. When we employ the 0-1 loss, because of the equivalence between the classification risk and the worst-case classification risk, we can directly minimize the classification risk under the corrupted training distribution instead of minimizing the worst-case classification risk.
16
+
17
+ From the learning perspective, the 0-1 loss is more robust to outliers compared with an unbounded (convex) loss (e.g. hinge loss) (Masnadi-Shirazi & Vasconcelos, 2009). This is due to unbounded convex losses putting much weight on the outliers (with a large loss value) when minimizing the losses (Masnadi-Shirazi & Vasconcelos, 2009). If the unbounded (convex) loss is employed in deep network models, this becomes more prominent. Since training loss of deep networks can often be minimized to zero, outlier with a large loss has a large impact on the model. On the other hand, the 0-1 loss treats each training sample equally. Thus, each sample does not have too much influence on the model. Therefore, the model is tolerant of a small number of outliers.
18
+
19
+ Although the 0-1 loss has many robust properties, its non-differentiability and zero gradients make it difficult to optimize. One possible way to alleviate this problem is to seek an upper bound of the 0-1 loss that is still efficient to optimize but tighter than conventional (convex) losses. Such a tighter upper bound of the 0-1 loss can reduce the influence of the noisy outliers compared with conventional (convex) losses. At the same time, it is easier to optimize compared with the 0-1 loss. When minimizing the upper bound surrogate, we expect that the 0-1 loss objective is also minimized.
20
+
21
+ Learnability under large noise rate: The 0-1 loss cannot deal with large noise rate. When the noise rate becomes large, the systematic error (due to label corruption) grows up and becomes not negligible. As a result, the model’s generalization performance will degenerate due to this systematic error. To reduce the systematic error produced by training with noisy labels, several methods have been proposed. They can be categorized into three kinds: transition matrix based method (Sukhbaatar et al., 2014; Patrini et al., 2017; Goldberger & Ben-Reuven, 2017), regularization based method (Miyato et al., 2016) and sample selection based method (Jiang et al., 2018; Han et al., 2018b). Among them, sample selection based method is one promising direction that selects samples to reduce noisy ratio for training. These methods are based on the idea of curriculum learning (Bengio et al., 2009) which is one successful method that trains the model gradually with samples ordered in a meaningful sequence. Although they achieve success to some extents, most of these methods are heuristic based.
22
+
23
+ To efficiently minimize the 0-1 loss while keeping the robust properties, we propose a novel loss that is a tighter upper bound of the 0-1 loss compared with conventional surrogate losses. Specifically, giving any base loss function $l ( u ) ~ \geq ~ \mathbf { 1 } \big ( u < 0 \big ) , u ~ \in ~ \mathbb { R }$ , our loss $Q ( \mathbf { u } )$ satisfies $\begin{array} { r } { \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \le Q ( \mathbf { u } ) \le \sum _ { i = 1 } ^ { n } l \big ( u _ { i } \big ) } \end{array}$ , where $\mathbf { u } = [ u _ { 1 } , \cdots , u _ { n } ]$ with $u _ { i }$ being the classification margin of $i ^ { t h }$ sample, and $\mathbf { 1 } ( \cdot )$ is an indicator function. We name it as Curriculum Loss (CL) because our loss automatically and adaptively selects samples for training, which can be deemed as a curriculum learning paradigm.
24
+
25
+ Our contributions are listed as follows:
26
+
27
+ • We propose a novel loss (i.e. curriculum loss) for robust learning against label corruption. We prove that our CL is a tighter upper bound of 0-1 loss compared with conventional summation based surrogate loss. Moreover, CL can adaptively select samples for stagewise training, which bridges a connection between curriculum learning and robust learning.
28
+ • We prove that CL can be performed by a simple and fast selection algorithm with $\mathcal { O } ( n \bar { \log { n } } )$ time complexity. Moreover, our CL supports mini-batch update, which is convenient to be used as a plug-in in many deep models.
29
+ • We further propose a Noise Pruned Curriculum Loss (NPCL) to address label corruption problem by extending CL to a more general form. Our NPCL automatically prune the estimated noisy samples during training. Moreover, NPCL is also very simple and efficient, which can be used as a plug-in in deep models as well.
30
+
31
+ # 2 CURRICULUM LOSS
32
+
33
+ In this section, we present the framework of our proposed Curriculum Loss (CL). We begin with discussion about robustness of the 0-1 loss in Section 2.1. We then show that our CL is a tighter upper bound of the 0-1 loss compared with conventional summation based surrogate losses in Section 2.2. A tighter bound of the 0-1 loss means that it is less sensitive to the noisy outliers, and it better preserves the robustness of the 0-1 loss with a small rate of label corruption. For a large rate of label corruption, we extend our CL to a Noise Pruned Curriculum Loss (NPCL) to address this issue in Section 2.3. A simple multi-class extension and a novel soft multi-hinge loss are included in the Appendix. All the detailed proofs can be found in the Appendix as well.
34
+
35
+ # 2.1 ROBUSTNESS OF 0-1 LOSS AGAINST LABEL CORRUPTION
36
+
37
+ We rephrase Theorem 1 in (Hu et al., 2018) from a different perspective, which motivates us to employ the 0-1 loss for training against label corruption.
38
+
39
+ Theorem 1. (Monotonic Relationship) $H u$ et al. (Hu et al., 2018)) Let $p ( x , y )$ and $q ( x , y )$ be the training and test density,respectively. Define $r ( x , y ) = q ( x , y ) / p ( x , y )$ and $r _ { i } = r ( x _ { i } , y _ { i } )$ . Let $l ( \widehat { y } , y ) = \mathbf { 1 } { \big ( } s i g n ( \widehat { y } ) \neq y { \big ) }$ and $l ( \widehat { y } , y ) = \mathbf { 1 } \big ( a r g m a x _ { k } ( \widehat { y } _ { k } ) \neq y \big )$ be 0-1 loss for binary classification and multi-class classification, respectively. Let $f ( \cdot )$ be convex with $f ( 1 ) = 0$ . Define risk ${ \mathcal { R } } ( \theta )$ , empirical risk $\widehat { \mathcal { R } } ( \theta )$ , adversarial risk $\mathcal { R } _ { a d v } ( \theta )$ and empirical adversarial risk $\widehat { \mathcal { R } } _ { a d v } ( \theta )$ as
40
+
41
+ $$
42
+ \begin{array} { r l } & { \mathcal { R } ( \theta ) = \mathbb { E } _ { p ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right] } \\ & { \mathcal { \widehat { R } } ( \theta ) = \displaystyle \frac { 1 } { n } \sum _ { i = 1 } ^ { n } l ( g _ { \theta } ( x _ { i } ) , y _ { i } ) } \\ & { \mathcal { R } _ { a d v } ( \theta ) = \displaystyle \operatorname* { s u p } _ { r \in \mathcal { U } _ { f } } \mathbb { E } _ { p ( x , y ) } \left[ r ( x , y ) l ( g _ { \theta } ( x ) , y ) \right] } \\ & { \mathcal { \widehat { R } } _ { a d v } ( \theta ) = \displaystyle \operatorname* { s u p } _ { { \mathbf { r } \in \widehat { \mathcal { U } } _ { f } } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } r _ { i } l ( g _ { \theta } ( x _ { i } ) , y _ { i } ) , } \end{array}
43
+ $$
44
+
45
+ wher $\begin{array} { r } { \mathcal { U } _ { f } = \{ r ( x , y ) | \mathbb { E } _ { p ( x , y ) } [ f ( r ( x , y ) ) ] \leq \delta , \mathbb { E } _ { p ( x , y ) } [ r ( x , y ) ] = 1 , r ( x , y ) \geq 0 , \forall ( x , y ) \in \mathcal { X } \times \mathcal { Y } \} } \end{array}$ and $\begin{array} { r } { \widehat { \mathcal { U } } _ { f } = \big \{ { \bf r } \big | \frac { 1 } { n } \sum _ { i = 1 } ^ { n } f ( r _ { i } ) \leq \delta , \frac { 1 } { n } \sum _ { i = 1 } ^ { n } r _ { i } = 1 , { \bf r } \geq 0 \big \} . } \end{array}$ Then we have that
46
+
47
+ The same monotonic relationship holds between their empirical approximation: $\widehat { \mathcal { R } } ( \theta )$ and $\widehat { \mathcal { R } } _ { a d v }$
48
+
49
+ Theorem 1 (Hu et al., 2018) shows that the monotonic relationship between the (empirical) risk and the (empirical) adversarial risk (worst-case risk) when 0-1 loss function is used. It means that minimizing (empirical) risk is equivalent to minimize the (empirical) adversarial risk (worst-case risk) for 0-1 loss. When we train a model based on the corrupted training distribution $p ( x , y )$ , we want our model to perform well on the clean distribution $q ( x , y )$ . Since we do not know the clean distribution $q$ , we want our model to perform well for the worst-case estimate of the clean distribution, with the assumption that the $f$ -divergence between the corrupted distribution $p$ and the clean distribution $q$ is bounded by $\delta$ . Note that the underlying clean distribution is fixed but unknown, given the corrupted training distribution, the smallest $\delta$ that bounds the divergence between the corrupted distribution and clean distribution measures the intrinsic difficulty of the corruption, and it is also fixed and unknown. The corresponding worst-case distribution w.r.t the smallest $\delta$ is an estimate of the true clean distribution, and this worst-case risk upper bounds the risk of the true clean distribution. In addition, this bound is tighter than the other worst-case risks w.r.t larger $\delta$ . It is natural to use this upper bound as the objective for robust learning. When we use 0-1 loss (that is commonly employed for evaluation), because of the equivalence of the risk and the worst-case risk, we can directly minimize risk under training distribution $p$ instead of directly minimizing the worst-case risk (i.e., the upper bound). Moreover, this enables us to minimize the upper bound without knowing the true $\delta$ beforehand. When the true $\delta$ is small, i.e., the corruption of the training data is not heavy, the upper bound is not too pessimistic. Usually, minimizing the upper bound can decrease the true risk under clean distribution. Particularly, when the clean distribution coincides with the worst-case estimate w.r.t the smallest $\delta$ , minimizing the risk under the corrupted training distribution leads to the same minimizer as minimizing the risk under the clean distribution.
50
+
51
+ # 2.2 TIGHTER UPPER BOUNDS OF THE 0-1 LOSS
52
+
53
+ Unlike commonly used loss functions in machine learning, the non-differentiability and zero gradients of the 0-1 loss make it difficult to optimize. We thus propose a tighter upper bound surrogate loss. We use the classification margin to define the 0-1 loss. For binary classification, classification margin is $u = { \widehat { y } } y$ , where $\widehat { y }$ and $y \in \{ + 1 , - 1 \}$ denotes the prediction and ground truth, respectively. b b(A simple multi-class extension is discussed in the Appendix.) Let $u _ { i } \in \mathbb { R }$ be the classification margin of the $i ^ { t h }$ sample for $i \in \{ 1 , . . . , n \}$ . Denote $\mathbf { u } = [ u _ { 1 } , . . . , u _ { n } ]$ . The 0-1 loss objective can be defined as follows:
54
+
55
+ $$
56
+ \begin{array} { r } { J ( \mathbf { u } ) = \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) . } \end{array}
57
+ $$
58
+
59
+ Given a base upper bound function $l ( u ) \geq \mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ , the conventional surrogate of the 0-1 loss can be defined as
60
+
61
+ $$
62
+ \begin{array} { r } { \widehat { J } ( \mathbf { u } ) = \sum _ { i = 1 } ^ { n } l ( u _ { i } ) . } \end{array}
63
+ $$
64
+
65
+ Our curriculum loss $Q ( \mathbf { u } )$ can be defined as Eq.(9). $Q ( \mathbf { u } )$ is a tighter upper bound of 0-1 loss $J ( \mathbf { u } )$ compared with the conventional surrogate loss $\widehat { J } ( { \mathbf { u } } )$ , which is summarized in Theorem 2:
66
+
67
+ Theorem 2. (Tighter Bound) Suppose that base loss function $l ( u ) \ \geq \ \mathbf { 1 } ( u < 0 ) , u \ \in \ \mathbb { R }$ is an upper bound of the 0-1 loss function. Let $u _ { i } \in \mathbb { R }$ be the classification margin of the $i ^ { t h }$ sample for $i \in \{ 1 , . . . , n \}$ . Denote $\operatorname* { m a x } ( \cdot , \cdot )$ as the maximum between two inputs. Let $\mathbf { u } = [ u _ { 1 } , . . . , u _ { n } ]$ . Define $Q \left( \mathbf { u } \right)$ as follows:
68
+
69
+ $$
70
+ Q \left( \mathbf { u } \right) = \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \operatorname* { m i n } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , n - \sum _ { i = 1 } ^ { n } v _ { i } + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \big ) .
71
+ $$
72
+
73
+ Then $J ( \mathbf { u } ) \leq Q \left( \mathbf { u } \right) \leq \widehat { \mathbf { J } } \left( \mathbf { u } \right)$ holds true.
74
+
75
+ Remark: For any fixed $\mathbf { u }$ , we can obtain an optimum solution $\mathbf { v } ^ { * }$ of the partial optimization. The index indicator $\mathbf { v } ^ { * }$ can naturally select samples as a curriculum paradigm for training models. The partial optimization w.r.t index indicator $\mathbf { v }$ can be solved by a very simple and efficient algorithm (Algorithm 1) in ${ \mathcal { O } } ( n \log n )$ . Thus, the loss is very efficient to compute. Moreover, since $\bar { Q } \left( \mathbf { u } \right)$ is tighter than conventional surrogate loss $\widehat { J } ( { \mathbf { u } } )$ , it is less sensitive to outliers compared with $\widehat { J } ( { \mathbf { u } } )$ . Furthermore, it better preserves the robust property of the 0-1 loss against label corruption.
76
+
77
+ The difficulty of optimizing the 0-1 loss is that the 0-1 loss has zero gradients in almost everywhere (except at the breaking point). This issue prevents us from using first-order methods to optimize the 0-1 loss. Eq.(9) provides a surrogate of the 0-1 loss with non-zero subgradient for optimization, while preserving robust properties of the 0-1 loss. Note that our goal is to construct a tight upper bound of the 0-1 loss while maintaining informative (sub)gradients. Eq.(9) balances the 0-1 loss and conventional surrogate by selecting (the trust) samples (index) for training progressively.
78
+
79
+ Updating with all the samples at once is not efficient for deep models, while training with mini-batch is more efficient and well supported for many deep learning tools. We thus propose a batch based curriculum loss $\widehat { Q } ( { \mathbf { u } } )$ given as Eq.(10). We show that $\widehat { Q } ( { \mathbf { u } } )$ is also a tighter upper bound of 0-1 loss objective $J ( \mathbf { u } )$ compared with conventional loss $\widehat { J } ( { \bf u } )$ . This property is summarized in Corollary 1.
80
+
81
+ Corollary 1. (Mini-batch Update) Suppose that base loss function $l ( u ) \geq \mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ is an upper bound of the 0-1 loss function. Let $b$ , m be the number of batches and batch size, respectively. Let $u _ { i j } \in \mathbb { R }$ be the classification margin of the $i ^ { t h }$ sample in batch $j$ for $i \in \{ 1 , . . . , m \}$ and $j \in$ $\{ 1 , . . . , b \}$ . Denote $\mathbf { u } = [ u _ { 1 1 } , . . . , u _ { m b } ]$ . Let $n = m b$ . Define $\widehat { Q } \left( \mathbf { u } \right)$ as follows:
82
+
83
+ $$
84
+ \widehat { Q } \left( \mathbf { u } \right) = \sum _ { j = 1 } ^ { b } \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } \operatorname* { m a x } \Big ( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } + \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \Big ) .
85
+ $$
86
+
87
+ Then $J ( \mathbf { u } ) \leq Q \left( \mathbf { u } \right) \leq \widehat { Q } \left( \mathbf { u } \right) \leq \widehat { \mathrm { J } } \left( \mathbf { u } \right)$ holds true.
88
+
89
+ Remark: Corollary 1 shows that a batch-based curriculum loss is also a tighter upper bound of 0-1 loss $J ( \mathbf { u } )$ compared with the conventional surrogate loss $\widehat { J } ( { \bf u } )$ . This enables us to train deep models with mini-batch update. Note that random shuffle in different epoch results in a different batch-based curriculum loss. Nevertheless, we at least know that all the induced losses are upper bounds of 0-1 loss objective and are tighter than $\widehat { J } ( { \mathbf { u } } )$ . Moreover, all these losses are induced by the same base loss function $l ( \cdot )$ . Note that, our goal is to minimize the 0-1 loss. Random shuffle leads to a multiple surrogate training scheme. In addition, training deep models without shuffle does not have this issue.
90
+
91
+ We now present another curriculum loss $E \left( \mathbf { u } \right)$ which is tighter than $Q ( \mathbf { u } )$ . $E \left( \mathbf { u } \right)$ is an (scaled) upper bound of 0-1 loss. This property is summarized as Theorem 3.
92
+
93
+ # Algorithm 1 Partial Optimization
94
+
95
+ <table><tr><td>Input: ui for i ∈ {1,..,n}, the selection threshold C; Output: Index set v = (U1, U2,..., Un); Compute the losses li = l(ui) for i= i,., n;</td><td colspan="3"></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>Sort samples (index) w.r.t. the losses {i}=1 in a non-decreasing order;</td><td></td><td></td><td>;//Get𝑙≤··≤ln</td></tr><tr><td>Initialize Lo = O; fori=1 to n do</td><td></td><td></td><td></td></tr><tr><td>Li=Li-1+l;</td><td></td><td></td><td></td></tr><tr><td>ifLi≤(C+1-i) then</td><td></td><td></td><td></td></tr><tr><td>Set Ui = 1;</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>else</td><td></td><td></td><td></td></tr><tr><td>Set Ui = O;</td><td></td><td></td><td></td></tr><tr><td>end if</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td></tr><tr><td>end for</td><td></td><td></td><td></td></tr></table>
96
+
97
+ Theorem 3. (Scaled Bound) Suppose that base loss function $l ( u ) \geq \mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ is an upper bound of the 0-1 loss function. Let $u _ { i } ~ \in ~ \mathbb { R }$ be the classification margin of the $i ^ { t h }$ sample for $i \in \{ 1 , . . . , n \}$ . Denote $\mathbf { u } = [ u _ { 1 } , . . . , u _ { n } ]$ . Define $E \left( \mathbf { u } \right)$ as follows:
98
+
99
+ $$
100
+ E \left( \mathbf { u } \right) = \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , n - \sum _ { i = 1 } ^ { n } v _ { i } \big ) .
101
+ $$
102
+
103
+ Then $J ( \mathbf { u } ) \leq 2 E \left( \mathbf { u } \right) \leq 2 \widehat { \mathbf { J } } \left( \mathbf { u } \right)$ holds true.
104
+
105
+ Remark: $E ( \mathbf { u } )$ has similar properties to $Q ( \mathbf { u } )$ discussed above. Moreover, it is tighter than $Q ( \mathbf { u } )$ , i.e. $E ( \mathbf { u } ) \leq Q ( \mathbf { u } )$ . Thus, it is less sensitive to outliers compared with $Q ( \mathbf { u } )$ . However, $Q ( \mathbf { u } )$ can construct more adaptive curriculum by taking 0-1 loss into consideration during the training process.
106
+
107
+ Directly optimizing $E ( \mathbf { u } )$ is not as efficient as that optimizing $Q ( \mathbf { u } )$ . We now present a batch loss objective $\widehat { E } ( { \bf u } )$ given as Eq.(12). $\widehat { E } ( { \bf u } )$ is also a tighter upper bound of 0-1 loss objective $J ( \mathbf { u } )$ compared with conventional surrogate loss $\widehat { J } ( { \bf u } )$ .
108
+
109
+ Corollary 2. (Mini-batch Update for Scaled Bound) Suppose that base loss function $l ( u ) \geq$ $\mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ is an upper bound of the 0-1 loss function. Let $b$ , m be the number of batches and batch size, respectively. Let $u _ { i j } \in \mathbb { R }$ be the classification margin of the $i ^ { t h }$ sample in batch $j$ for $i \in \{ 1 , . . . , m \}$ and $j \in \{ 1 , . . . , b \}$ . Denote $\mathbf { u } = [ u _ { 1 1 } , . . . , u _ { m b } ]$ . Let $n = m b$ . Define $\widehat { E } ( { \bf u } )$ as follows:
110
+
111
+ $$
112
+ \widehat { E } \left( \mathbf { u } \right) = \sum _ { j = 1 } ^ { b } \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } \big ) .
113
+ $$
114
+
115
+ Then $J ( \mathbf { u } ) \leq 2 E \left( \mathbf { u } \right) \leq 2 \widehat { E } \left( \mathbf { u } \right) \leq 2 \widehat { \mathbf { J } } \left( \mathbf { u } \right)$ holds true.
116
+
117
+ All the curriculum losses defined above rely on minimizing a partial optimization problem (Eq.(13)) to find the selection index set $\mathbf { v } ^ { * }$ . We now show that the optimization of $\mathbf { v }$ with given classification margin $u _ { i } \in \mathbb { R } , i \in \{ 1 , . . . , n \}$ can be done in ${ \mathcal { O } } ( n \log n )$ .
118
+
119
+ Theorem 4. (Partial Optimization) Suppose that base loss function $l ( u ) \geq \mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ is an upper bound of the 0-1 loss function. For fixed $u _ { i } \in \mathbb { R } ,$ , $i \in \{ 1 , . . . , n \}$ , an minimum solution $\mathbf { v } ^ { * }$ of the minimization problem in Eq. (13) can be achieved by Algorithm $^ { l }$ :
120
+
121
+ $$
122
+ \begin{array} { r } { \underset { { \mathbf { v } } \in \{ 0 , 1 \} ^ { n } } { \operatorname* { m i n } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , C - \sum _ { i = 1 } ^ { n } v _ { i } \big ) , } \end{array}
123
+ $$
124
+
125
+ where $C$ is the threshold parameter such that $0 \leq C \leq 2 n$ .
126
+
127
+ Remark: The time complexity of Algorithm 1 is ${ \mathcal { O } } ( n \log n )$ . Moreover, it does not involve complex operations, and is very simple and efficient to compute.
128
+
129
+ Algorithm 1 can adaptively select samples for training. It has some useful properties to help us better understand the objective after partial minimization, we present them in Proposition 1.
130
+
131
+ Proposition 1. (Optimum of Partial Optimization) Suppose that base loss function $l ( u ) \ \geq$ $\mathbf { 1 } ( u < 0 ) , u \in \mathbb { R }$ is an upper bound of the 0-1 loss function. Let $u _ { i } \in \mathbb { R }$ for $i \in \{ 1 , . . . , n \}$ be fixed values. Without loss of generality, assume $l ( u _ { 1 } ) \le l ( u _ { 2 } ) \cdot \cdot \cdot \le l ( u _ { n } )$ . Let $\mathbf { v } ^ { * }$ be an optimum solution of the partial optimization problem in Eq.(13). Let $\begin{array} { r } { T ^ { * } = \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } } \end{array}$ and $\begin{array} { r } { L _ { T ^ { * } } = \sum _ { i = 1 } ^ { T ^ { * } } l ( u _ { i } ) } \end{array}$ . Then we have
132
+
133
+ $$
134
+ \begin{array} { r l } & { L _ { T ^ { * } } \leq C + 1 - T ^ { * } } \\ & { L _ { T ^ { * } + 1 } > C - T ^ { * } } \\ & { L _ { T ^ { * } + 1 } > \operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } ) } \\ & { \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \operatorname* { m i n } } \underset { 0 } { \operatorname* { m a x } } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , C - \sum _ { i = 1 } ^ { n } v _ { i } \big ) = \operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } ) . } \end{array}
135
+ $$
136
+
137
+ Remark: When $\begin{array} { r } { C \leq n + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$ , Eq.(17) is tighter than the conventional loss $\widehat { J } ( { \mathbf { u } } )$ . When $C \geq n$ , Eq. (17) is a scaled upper bound of 0-1 loss $J ( \mathbf { u } )$ . From Eq.(17) , we know the optimum of the partial optimization problem (13) (i.e. our objective) is $\operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } )$ . When $L _ { T ^ { * } } \geq C - T ^ { * }$ , we can directly optimize $L _ { T ^ { * } }$ with the selected samples for training. When $L _ { T ^ { * } } <$ $C - T ^ { * }$ , note that $L _ { T ^ { * } + 1 } > \operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } )$ from Eq.(16), we can optimize $L _ { T ^ { * } + 1 }$ for training. Note that when $T ^ { * } < n$ , we have that $\begin{array} { r } { L _ { T ^ { * } + 1 } \leq L _ { n } = \bar { \sum _ { i = 1 } ^ { n } l ( u _ { i } ) } } \end{array}$ , which is still tighter than the conventional loss $\widehat { J } ( { \bf u } )$ . When $T ^ { * } = n$ , for the parameter $\begin{array} { r } { C \le n + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$ , we have that $L _ { T ^ { * } } = { \widehat { J } } ( \mathbf { u } ) \geq J ( \mathbf { u } ) \geq C - n = C - T ^ { * }$ . Thus we can optimize $\operatorname* { m a x } ( L _ { T ^ { * } } , C - \dot { T } ^ { * } ) = \widehat { J } ( \mathbf { u } )$ . In practice, when training with random mini-batch, we find that optimizing $L _ { T ^ { * } }$ in both cases instead of $L _ { T ^ { * } + 1 }$ does not make much influence.
138
+
139
+ # 2.3 NOISE PRUNED CURRICULUM LOSS
140
+
141
+ The curriculum loss in Eq.(9) and Eq.(11) expect to minimize the upper bound of the 0-1 loss for all the training samples. When model capability (complexity) is high, (deep network) model will still attain small (zero) training loss and overfit to the noisy samples.
142
+
143
+ The ideal model is that it correctly classifies the clean training samples and misclassifies the noisy samples with wrong labels. Suppose that the rate of noisy samples (by label corruption) is $\epsilon \in [ 0 , 1 ]$ . The ideal model is to correctly classify the $( 1 - \epsilon ) n$ clean training samples, and misclassify the $\epsilon n$ noisy training samples. This is because the label is corrupted. Correctly classify the training samples with corrupted (wrong) label means that the model has already overfitted to noisy samples. This will harm the generalization to the unseen data.
144
+
145
+ Considering all the above reasons, we thus propose the Noise Pruned Curriculum Loss (NPCL) as
146
+
147
+ $$
148
+ \mathcal { L } \left( \mathbf { u } \right) = \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , C - \sum _ { i = 1 } ^ { n } v _ { i } \big ) ,
149
+ $$
150
+
151
+ where $C = ( 1 - \epsilon ) n$ or $\begin{array} { r } { C = ( 1 - \epsilon ) ^ { 2 } n + ( 1 - \epsilon ) \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$
152
+
153
+ When we know there are $\epsilon n$ noisy samples in the training set, we can leverage this as our prior. (The impact of misspecification of the prior is included in the supplement.) When $C = ( 1 - \epsilon ) n$ (assume $C , \epsilon n$ are integers for simplicity), from the selection procedure in Algorithm 1, we know $\boldsymbol { \epsilon } n ^ { 1 }$ $\textstyle \sum _ { i = 1 } ^ { n } v _ { i } \geq ( 1 - \epsilon ) n + 1$ samples with largest losses . Without loss of generality, assume $l ( u )$ will be pruned. This is because $l ( u _ { 1 } ) \le l ( u _ { 2 } ) \cdot \cdot \cdot \le l ( u _ { n } )$ $\begin{array} { r } { C - \sum _ { i = 1 } ^ { n ^ { - } } v _ { i } + 1 \le 0 } \end{array}$ . After when pruning, we have $v _ { ( 1 - \epsilon ) n + 1 } = \cdot \cdot \cdot = v _ { n } = 0$ , the pruned loss becomes
154
+
155
+ $$
156
+ \widetilde { \mathcal { L } } \left( \mathbf { u } \right) = \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { ( 1 - \epsilon ) n } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { ( 1 - \epsilon ) n } v _ { i } l ( u _ { i } ) , ( 1 - \epsilon ) n - \sum _ { i = 1 } ^ { ( 1 - \epsilon ) n } v _ { i } \big ) .
157
+ $$
158
+
159
+ It is the basic CL for $( 1 - \epsilon ) n$ samples and it is the upper bound of $\begin{array} { r } { \sum _ { i = 1 } ^ { ( 1 - \epsilon ) n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$ . If we prune more noisy samples than clean samples, it will reduce the noise ratio. Then the basic CL can handle. Fortunately, this assumption is supported by the "memorization" effect in deep networks (Arpit et al., 2017), i.e. deep networks tend to learn clean and easy pattern first. Thus, the loss of noisy or hard data tend to remain high for a period (before being overfitted). Therefore, the pruned samples with largest loss are more likely to be the noisy samples. After the rough pruning, the problem becomes optimizing basic CL for the remaining samples as in Eq.(19). Note that our CL is a tight upper bound approximation to the 0-1 loss, it preserves the robust property to some extent. Thus, it can handle case with small noise rate. Specifically, our CL(Eq.19) further select samples from the remaining samples for training adaptively according to the state of training process. This generally will further reduce the noise ratio. Thus, we may expect our NPCL to be robust to noisy samples. Note that, all the above can be done by the simple and efficient Algorithm 1 without explicit pruning samples in a separated step. Namely, our loss can do all these automatically under a unified objective form in Eq.(18).
160
+
161
+ Algorithm 2 Training with Batch Noise Pruned Curriculum Loss
162
+
163
+ <table><tr><td>Input:Number of epochs N,batch size m, noise ratio ∈; Output: The model parameter w; Initialize model parameter w. fork=1 toN do Shuffle training set D;</td></tr><tr><td>while Not fetch all the data from D do</td></tr><tr><td>Fetch a mini-batch D from D;</td></tr><tr><td>Compute losses {i}m1 for data in D; Compute the selection threshold C according to Eq.(21).</td></tr><tr><td>Compute selection index v* by Algorithm 1;</td></tr><tr><td>Update w = w - aVl (Dv-) w.r.t the subset Dv* ofD selected by v*;</td></tr><tr><td>end while end for</td></tr></table>
164
+
165
+ When $C = ( 1 - \epsilon ) n$ , the NPCL in Eq.(18) reduces to basic CL $E ( \mathbf { u } )$ in Eq.(11) with $\epsilon = 0$ . When $\begin{array} { r } { C = ( 1 - \epsilon ) ^ { 2 } n + ( 1 - \epsilon ) \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$ , for an ideal target model (that misclassifies noisy samples only), we know that $\begin{array} { r } { \mathbb { E } [ C ] = ( 1 - \epsilon ) ^ { 2 } n + ( 1 - \epsilon ) \mathbb { E } [ \sum _ { i = 1 } ^ { n } { \bf 1 } \big ( u _ { i } < 0 \big ) ] = ( 1 - \epsilon ) ^ { 2 } n + ( 1 - \epsilon ) \epsilon n = } \end{array}$ $( 1 - \epsilon ) n$ . It has similar properties as choosing $C = ( 1 - \epsilon ) n$ . Moreover, it is more adaptive by considering 0-1 loss during training at different stages. In this case, the NPCL in Eq.(18) reduces to the CL $Q ( \mathbf { u } )$ in Eq.(9) when $\epsilon = 0$ . Note that $C$ is a prior, users can defined it based on their domain knowledge.
166
+
167
+ To leverage the benefit of deep learning, we present the batched NPCL as
168
+
169
+ $$
170
+ \widehat { \mathcal { L } } \left( \mathbf { u } \right) = \sum _ { j = 1 } ^ { b } \operatorname* { m i n } _ { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , \widehat { C } _ { j } - \sum _ { i = 1 } ^ { m } v _ { i j } \big ) ,
171
+ $$
172
+
173
+ where $\widehat { C } _ { j } = ( 1 - \epsilon ) m$ or as in Eq.(21):
174
+
175
+ $$
176
+ \widehat C _ { j } = ( 1 - \epsilon ) ^ { 2 } m + ( 1 - \epsilon ) \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) .
177
+ $$
178
+
179
+ Similar to Corollary 1, we know that $\mathcal { L } \left( \mathbf { u } \right) \leq \widehat { \mathcal { L } } \left( \mathbf { u } \right)$ . Thus, optimizing the batched NPCL is indeed minimizing the upper bound of NPCL. This enables us to train the model with mini-batch update, which is very efficient for modern deep learning tools. The training procedure is summarized in Algorithm 2. It uses Algorithm 1 to select a subset of samples from every mini-batch. Then, it uses the selected samples to perform gradient update.
180
+
181
+ # 3 EMPIRICAL STUDY
182
+
183
+ # 3.1 EVALUATION OF ROBUSTNESS AGAINST LABEL CORRUPTION
184
+
185
+ We evaluate our NPCL by comparing Generalized Cross-Entropy (GCE) loss (Zhang & Sabuncu, 2018), Co-teaching (Han et al., 2018b), Co-teaching+ (Yu et al., 2019), MentorNet (Jiang et al., 2018) and standard network training on MNIST, CIFAR10 and CIFAR100 dataset as in (Han et al., 2018b; Patrini et al., 2017; Goldberger & Ben-Reuven, 2017). Two types of random label corruption, i.e. Symmetry flipping (Van Rooyen et al., 2015) and Pair flipping (Han et al., 2018a), are considered in this work. Symmetry flipping is that the corrupted label is uniformly assign to one of $K - 1$ incorrect classes. Pair flipping is that the corrupted label is assign to one specific class similar to the ground truth. The noise rate $\epsilon$ of label flipping is chosen from $\{ 2 0 \% , 5 0 \% , 3 5 \% \}$ as a representative. As a robust loss function, we further compare NPCL with GCE loss in detail with noise rate in $\{ 0 \% , 1 0 \%$ , $2 0 \%$ , $3 0 \%$ , $4 0 \%$ , $5 0 \% \}$ . We employ same network architecture and network hyperparameters as in Co-teaching (Han et al., 2018b) for all the methods in comparison. Specifically, the batch size and the number of epochs is set to $m = 1 2 8$ and $N = 2 0 0$ , respectively. The Adam optimizer with the same parameter as (Han et al., 2018b) is employed. The architecture of neural network is presented in Appendix L. For NPCL, we employ hinge loss as the base upper bound function of 0-1 loss. In the first few epochs, we train model using full batch with soft hinge loss (in the supplement) as a burn-in period suggested in (Jiang et al., 2018). Specifically, we start NPCL at $5 ^ { t h }$ epoch on MNIST and $1 \dot { 0 } ^ { t h }$ epoch on CIFAR10 and CIFAR100, respectively. For Coteaching (Han et al., 2018b) and MentorNet in (Jiang et al., 2018), we employ the open sourced code of $\mathrm { C o }$ -teaching (Han et al., 2018b). For Co-teaching $^ +$ (Yu et al., 2019), we employ the code provided by the authors. We implement NPCL by Pytorch. For NPCL, Co-teaching and Co-teaching+, we employ the true noise rate as parameter. Experiments are performed five independent runs. The error bar for STD is shaded.
186
+
187
+ ![](images/d7707926362d18623b1724cbcb8d44064ad4e28f21f77d6af92e23cafc95ee58.jpg)
188
+ Figure 1: Test accuracy and label precision vs. number of epochs on MNIST dataset.
189
+
190
+ For performance measurements, we employ both test accuracy and label precision as in (Han et al., 2018b). Label precision is defined as $:$ number of clean samples / number of selected samples, which measures the selection accuracy for sample selection based methods. A higher label precision in the mini-batch after sample selection can lead to a update with less noisy samples, which means that model suffers less influence of noisy samples and thus preforms more robustly to label corruption.
191
+
192
+ The pictures of test accuracy and label precision vs. number of epochs on MNIST are presented in Figure 1. The results on CIFAR10 and CIFAR100 are shown in Figure 5 and Figure 6 in Appendix, respectively. It shows that NCPL achieves superior performance compared with GCE loss in terms of test accuracy. Particularly, NPCL obtains significant better performance compared with GCE loss in hard cases: Symmetry- $50 \%$ and Pair-flip- $35 \%$ , which shows that NPCL is more robust to label corruption compared with GCE loss. Moreover, NPCL obtains better performance on MNIST, and competitive performance on CIFAR10 and CIFAR100 compared with Co-teaching. Furthermore, NPCL achieves better performance than Co-teaching+ on CIFAR10 and two cases on MNIST. In addition, we find that Co-teaching $^ +$ is not stable on CIFAR100 with $50 \%$ symmetric noise. Note that NPCL is a simple plug-in for a single network, while Co-teaching/Co-teaching+ employs two networks to train the model concurrently. Thus, both the space complexity and time complexity of Co-teaching/Co-teaching+ is doubled compared with our NPCL.
193
+
194
+ Both our NPCL and Generalized Cross Entropy (GCE) loss are robust loss functions as plug-in for single network. Thus, we provide a more detailed comparison between our NPCL and GCE loss with noise rate in $\{ 0 \%$ , $1 0 \%$ , $2 0 \%$ , $3 0 \%$ , $4 0 \%$ , $5 0 \% \}$ . The experimental results on CIFAR10 are presented in Figure 3. The experimental results on CIFAR100 and MNIST are provided in Figure 8 and Figure 7 in Appendix.From Figure 3, Figure 8 and Figure 7, we can observe that NPCL obtains similar and higher test accuracy in all the cases. Moreover, from Figure 3 and Figure 7, we can see that NPCL achieves similar test accuracy compared with the GCE loss when the noise rate is small. The improvement increases with the increase of the noise rate. Particularly, NPCL obtains remarkable improvement compared with the GCE loss on CIFAR10 with noise rate $50 \%$ . It shows that NPCL is more robust compared with GCE loss against label corruption. GCE loss employs all samples for training, while NPCL prunes the noisy samples adaptively. As a result, GCE loss still employs samples with wrong labels for training, which misleads the model. Thus, NPCL obtains better performance when the noise rate becomes large.
195
+
196
+ # 3.2 MORE EXPERIMENTS WITH DIFFERENT NETWORK ARCHITECTURES
197
+
198
+ We follow the experiments setup in (Lee et al., 2019). We use the online code of (Lee et al., 2019) , and only change the loss for comparison. We cite the numbers of Softmax, RoG and D2L (Ma et al., 2018) in (Lee et al., 2019) for comparison.
199
+
200
+ The test accuracy results on uniform noise, semantic noise and open-set noise are shown in Table 1, Table 2 and Table 3, respectively. From Table 1, we can observe that both NPCL and CL outperforms Softmax (cross-entropy) and RoG (cross-entropy) on five cases for uniform noise. Note that RoG is an ensemble method, while CL/NPCL is a single loss for network training, one can combine them to boost the performance. From Table 2, we can see that CL obtains consistently better performance than cross-entropy and D2L (Ma et al., 2018) for the semantic noise. Table 3 shows that NPCL achieves competitive performance compared with RoG for open-set noise.
201
+
202
+ Table 1: Test accuracy $\% )$ of DenseNet on CIFAR10 and CIFAR100.
203
+
204
+ <table><tr><td rowspan=2 colspan=1>Noise type</td><td rowspan=1 colspan=4>CIFAR10</td><td rowspan=1 colspan=4>CIFAR100</td></tr><tr><td rowspan=1 colspan=1>NPCL</td><td rowspan=1 colspan=1>CL</td><td rowspan=1 colspan=1>Softmax</td><td rowspan=1 colspan=1>RoG</td><td rowspan=1 colspan=1>NPCL</td><td rowspan=1 colspan=1>CL</td><td rowspan=1 colspan=1>Softmax</td><td rowspan=1 colspan=1>RoG</td></tr><tr><td rowspan=1 colspan=1>uniform (20%)</td><td rowspan=1 colspan=1>89.49</td><td rowspan=1 colspan=1>89.32</td><td rowspan=1 colspan=1>81.01</td><td rowspan=1 colspan=1>87.41</td><td rowspan=1 colspan=1>64.88</td><td rowspan=1 colspan=1>67.92</td><td rowspan=1 colspan=1>61.72</td><td rowspan=1 colspan=1>64.29</td></tr><tr><td rowspan=1 colspan=1>uniform (40%)</td><td rowspan=1 colspan=1>83.24</td><td rowspan=1 colspan=1>85.57</td><td rowspan=1 colspan=1>72.34</td><td rowspan=1 colspan=1>81.83</td><td rowspan=1 colspan=1>56.34</td><td rowspan=1 colspan=1>58.63</td><td rowspan=1 colspan=1>50.89</td><td rowspan=1 colspan=1>55.68</td></tr><tr><td rowspan=1 colspan=1>uniform (60%)</td><td rowspan=1 colspan=1>66.2</td><td rowspan=1 colspan=1>68.52</td><td rowspan=1 colspan=1>55.42</td><td rowspan=1 colspan=1>75.45</td><td rowspan=1 colspan=1>44.49</td><td rowspan=1 colspan=1>46.65</td><td rowspan=1 colspan=1>38.33</td><td rowspan=1 colspan=1>44.12</td></tr></table>
205
+
206
+ Table 2: Test accuracy $\left( \% \right)$ of DenseNet on CIFAR10 and CIFAR100 with semantic noise.
207
+
208
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Label generator (noise rate)</td><td rowspan=1 colspan=1>NPCL</td><td rowspan=1 colspan=1>CL</td><td rowspan=1 colspan=1>Cross-entropy</td><td rowspan=1 colspan=1>D2L</td></tr><tr><td rowspan=3 colspan=1>CIFAR10</td><td rowspan=1 colspan=1>DenseNet(32%)</td><td rowspan=1 colspan=1>66.5</td><td rowspan=1 colspan=1>67.45</td><td rowspan=1 colspan=1>67.24</td><td rowspan=1 colspan=1>66.91</td></tr><tr><td rowspan=1 colspan=1>ResNet(38%)</td><td rowspan=1 colspan=1>61.88</td><td rowspan=1 colspan=1>62.88</td><td rowspan=1 colspan=1>62.26</td><td rowspan=1 colspan=1>59.10</td></tr><tr><td rowspan=1 colspan=1>VGG(34%)</td><td rowspan=1 colspan=1>68.37</td><td rowspan=1 colspan=1>69.61</td><td rowspan=1 colspan=1>68.77</td><td rowspan=1 colspan=1>57.97</td></tr><tr><td rowspan=3 colspan=1>CIFAR100</td><td rowspan=1 colspan=1>DenseNet(34%)</td><td rowspan=1 colspan=1>57.59</td><td rowspan=1 colspan=1>55.14</td><td rowspan=1 colspan=1>50.72</td><td rowspan=1 colspan=1>5.00</td></tr><tr><td rowspan=1 colspan=1>ResNet(37%)</td><td rowspan=1 colspan=1>54.49</td><td rowspan=1 colspan=1>53.20</td><td rowspan=1 colspan=1>50.68</td><td rowspan=1 colspan=1>23.71</td></tr><tr><td rowspan=1 colspan=1>VGG(37%)</td><td rowspan=1 colspan=1>55.41</td><td rowspan=1 colspan=1>52.71</td><td rowspan=1 colspan=1>51.08</td><td rowspan=1 colspan=1>40.97</td></tr></table>
209
+
210
+ Table 3: Test accuracy $( \% )$ of DenseNet on CIFAR10 with open-set noise.
211
+
212
+ <table><tr><td rowspan=1 colspan=1>Open-set Data</td><td rowspan=1 colspan=1>NPCL</td><td rowspan=1 colspan=1>Softmax</td><td rowspan=1 colspan=1>RoG</td></tr><tr><td rowspan=1 colspan=1>CIFAR100</td><td rowspan=1 colspan=1>82.85</td><td rowspan=1 colspan=1>79.01</td><td rowspan=1 colspan=1>83.37</td></tr><tr><td rowspan=1 colspan=1>ImageNet</td><td rowspan=1 colspan=1>87.95</td><td rowspan=1 colspan=1>86.88</td><td rowspan=1 colspan=1>87.05</td></tr><tr><td rowspan=1 colspan=1>CIFAR100-ImageNet</td><td rowspan=1 colspan=1>84.28</td><td rowspan=1 colspan=1>81.58</td><td rowspan=1 colspan=1>84.35</td></tr></table>
213
+
214
+ We further evaluate the performance of CL/NPCL on the Tiny-ImageNet dataset. We use the ResNet18 network as the test-bed. For GCE loss, we employ the default hyper-parameter $q = 0 . 7$ in all cases. All the methods are performed five runs with seeds $\{ 1 , 2 , 3 , 4 , 5 \}$ . The curve of mean test accuracy (shaded in std) are provided in Figure 2. We can see that NPCL and CL obtain higher test accuracy than generalized cross-entropy loss and stand cross-entropy loss on both cases. Note that CL does not have parameters, it is much convenient to use.
215
+
216
+ ![](images/b448702943960546e83b7d26aca3d5b58a9b31aee3de30b4d60e734169188e52.jpg)
217
+ Figure 2: Test accuracy $( \% )$ on Tiny-ImageNet dataset with symmetric noise
218
+
219
+ ![](images/f63c157cd728b4bd2beba221a506ad80b21eb73fa9a9f90619adad0eac89b860.jpg)
220
+ Figure 3: Test accuracy vs. number of epochs on CIFAR10 dataset.
221
+
222
+ # 4 CONCLUSION AND FURTHER WORK
223
+
224
+ In this work, we proposed a curriculum loss (CL) for robust learning. Theoretically, we analyzed the properties of CL and proved that it is tighter upper bound of the 0-1 loss compared with conventional summation based surrogate losses. We extended our CL to a more general form (NPCL) to handle large rate of label corruption. Empirically, experimental results on benchmark datasets show the robustness of the proposed loss. As a further work, we may improve our CL to handle imbalanced distribution by considering diversity for each class. Moreover, it is interesting to investigate the influence of different base loss functions in CL and NPCL.
225
+
226
+ # ACKNOWLEDGEMENT
227
+
228
+ We sincerely thank the reviewers for their insightful comments and suggestions. This paper was supported by Australian Research Council grants DP180100106 and DP200101328.
229
+
230
+ # REFERENCES
231
+
232
+ Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. In ICML, pp. 233–242, 2017.
233
+
234
+ Peter L Bartlett, Michael I Jordan, and Jon D McAuliffe. Convexity, classification, and risk bounds. Journal of the American Statistical Association, 101(473):138–156, 2006.
235
+
236
+ Yoshua Bengio, Jérôme Louradour, Ronan Collobert, and Jason Weston. Curriculum learning. In ICML, pp. 41–48. ACM, 2009.
237
+
238
+ Jacob Goldberger and Ehud Ben-Reuven. Training deep neural-networks using a noise adaptation layer. In ICLR, 2017.
239
+
240
+ Bo Han, Jiangchao Yao, Gang Niu, Mingyuan Zhou, Ivor Tsang, Ya Zhang, and Masashi Sugiyama. Masking: A new perspective of noisy supervision. In Advances in Neural Information Processing Systems, pp. 5836–5846, 2018a.
241
+
242
+ Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Advances in Neural Information Processing Systems, pp. 8527–8537, 2018b.
243
+
244
+ Mengqiu Hu, Yang Yang, Fumin Shen, Luming Zhang, Heng Tao Shen, and Xuelong Li. Robust web image annotation via exploring multi-facet and structural knowledge. IEEE Transactions on Image Processing, 26(10):4871–4884, 2017.
245
+
246
+ Weihua Hu, Gang Niu, Issei Sato, and Masashi Sugiyama. Does distributionally robust supervised learning give robust classifiers? 2018.
247
+
248
+ Lu Jiang, Deyu Meng, Shoou-I Yu, Zhenzhong Lan, Shiguang Shan, and Alexander Hauptmann. Self-paced learning with diversity. In Advances in Neural Information Processing Systems, pp. 2078–2086, 2014.
249
+
250
+ Lu Jiang, Deyu Meng, Qian Zhao, Shiguang Shan, and Alexander G Hauptmann. Self-paced curriculum learning. In Twenty-Ninth AAAI Conference on Artificial Intelligence, 2015.
251
+
252
+ Lu Jiang, Zhengyuan Zhou, Thomas Leung, Li-Jia Li, and Li Fei-Fei. Mentornet: Learning datadriven curriculum for very deep neural networks on corrupted labels. 2018.
253
+
254
+ Ashish Khetan, Zachary C Lipton, and Anima Anandkumar. Learning from noisy singly-labeled data. ICLR, 2018.
255
+
256
+ M Pawan Kumar, Benjamin Packer, and Daphne Koller. Self-paced learning for latent variable models. In Advances in Neural Information Processing Systems, pp. 1189–1197, 2010.
257
+
258
+ Kimin Lee, Sukmin Yun, Kibok Lee, Honglak Lee, Bo Li, and Jinwoo Shin. Robust inference via generative classifiers for handling noisy labels. In International Conference on Machine Learning, 2019.
259
+
260
+ Xingjun Ma, Yisen Wang, Michael E Houle, Shuo Zhou, Sarah M Erfani, Shu-Tao Xia, Sudanthi Wijewickrema, and James Bailey. Dimensionality-driven learning with noisy labels. In International Conference on Machine Learning, 2018.
261
+
262
+ Hamed Masnadi-Shirazi and Nuno Vasconcelos. On the design of loss functions for classification: theory, robustness to outliers, and savageboost. In Advances in neural information processing systems, pp. 1049–1056, 2009.
263
+
264
+ Takeru Miyato, Andrew M Dai, and Ian Goodfellow. Virtual adversarial training for semi-supervised text classification. In ICLR, 2016.
265
+
266
+ Robert Moore and John DeNero. L1 and l2 regularization for multiclass hinge loss models. In Symposium on Machine Learning in Speech and Language Processing, 2011.
267
+
268
+ Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1944–1952, 2017.
269
+
270
+ Alexander J Ratner, Christopher M De Sa, Sen Wu, Daniel Selsam, and Christopher Ré. Data programming: Creating large training sets, quickly. In Advances in neural information processing systems, pp. 3567–3575, 2016.
271
+
272
+ Hao Su, Jia Deng, and Li Fei-Fei. Crowdsourcing annotations for visual object detection. In Workshops at the Twenty-Sixth AAAI Conference on Artificial Intelligence, 2012.
273
+
274
+ Sainbayar Sukhbaatar, Joan Bruna, Manohar Paluri, Lubomir Bourdev, and Rob Fergus. Training convolutional networks with noisy labels. arXiv preprint arXiv:1406.2080, 2014.
275
+
276
+ Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5552–5560, 2018.
277
+
278
+ Brendan Van Rooyen, Aditya Menon, and Robert C Williamson. Learning with symmetric label noise: The importance of being unhinged. In Advances in Neural Information Processing Systems, pp. 10–18, 2015.
279
+
280
+ Yichao Wu and Yufeng Liu. Robust truncated hinge loss support vector machines. Journal of the American Statistical Association, 102(479):974–983, 2007.
281
+
282
+ Xingrui Yu, Bo Han, Jiangchao Yao, Gang Niu, Ivor Tsang, and Masashi Sugiyama. How does disagreement help generalization against label corruption? In International Conference on Machine Learning, pp. 7164–7173, 2019.
283
+
284
+ Yuan Yuan, Yueming Lyu, Xi Shen, Ivor W. Tsang, and Dit-Yan Yeung. Marginalized average attentional network for weakly-supervised learning. In ICLR, 2019.
285
+
286
+ Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. ICLR, 2017.
287
+
288
+ Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Advances in neural information processing systems, pp. 8778–8788, 2018.
289
+
290
+ # A EXPLANATION OF THEOREM 1 FOR ROBUST LEARNING
291
+
292
+ Theorem. (Monotonic Relationship) ( $_ { H u }$ et al., 2018) Let $p ( x , y )$ and $q ( x , y )$ be the training and test density,respectively. Define $r ( x , y ) ~ = ~ q ( x , y ) / p ( x , y )$ and $r _ { i } ~ = ~ r ( x _ { i } , y _ { i } )$ . Let $l ( \widehat { y } , y ) = 1 \big ( s i g n ( \widehat { y } ) \ne y \big )$ and $l ( \widehat { y } , y ) \ = \ \mathbf { 1 } \big ( a r g m a x _ { k } ( \widehat { y } _ { k } ) \neq y \big )$  be 0-1 loss for binary classifib b bcation and multi-class classification, respectively. Let $f ( \cdot )$ be convex with $f ( 1 ) = 0$ . Define risk ${ \mathcal { R } } ( \theta )$ , empirical risk $\widehat { \mathcal { R } } ( \theta )$ , adversarial risk $\mathcal { R } _ { a d v } ( \theta )$ and empirical adversarial risk $\widehat { \mathcal { R } } _ { a d v } ( \theta )$ as
293
+
294
+ $$
295
+ \begin{array} { r l } & { \mathcal { R } ( \theta ) = \mathbb { E } _ { p ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right] } \\ & { \mathcal { \widehat { R } } ( \theta ) = \displaystyle \frac { 1 } { n } \sum _ { i = 1 } ^ { n } l ( g _ { \theta } ( x _ { i } ) , y _ { i } ) } \\ & { \mathcal { R } _ { a d v } ( \theta ) = \displaystyle \operatorname* { s u p } _ { r \in \mathcal { U } _ { f } } \mathbb { E } _ { p ( x , y ) } \left[ r ( x , y ) l ( g _ { \theta } ( x ) , y ) \right] } \\ & { \mathcal { \widehat { R } } _ { a d v } ( \theta ) = \displaystyle \operatorname* { s u p } _ { { \mathbf { r } \in \widehat { \mathcal { U } } _ { f } } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } r _ { i } l ( g _ { \theta } ( x _ { i } ) , y _ { i } ) , } \end{array}
296
+ $$
297
+
298
+ wher $\begin{array} { r } { \mathcal { U } _ { f } = \{ r ( x , y ) | \mathbb { E } _ { p ( x , y ) } [ f ( r ( x , y ) ) ] \leq \delta , \mathbb { E } _ { p ( x , y ) } [ r ( x , y ) ] = 1 , r ( x , y ) \geq 0 , \forall ( x , y ) \in \mathcal { X } \times \mathcal { Y } \} } \end{array}$ and $\begin{array} { r } { \widehat { \mathcal { U } } _ { f } = \big \{ { \bf r } \big | \frac { 1 } { n } \sum _ { i = 1 } ^ { n } f ( r _ { i } ) \leq \delta , \frac { 1 } { n } \sum _ { i = 1 } ^ { n } r _ { i } = 1 , { \bf r } \geq 0 \big \} . } \end{array}$ Then we have that
299
+
300
+ The same monotonic relationship holds between their empirical approximation: $\widehat { \mathcal { R } } ( \theta )$ and $\widehat { \mathcal { R } } _ { a d v }$
301
+
302
+ Hu et al. (2018) show that minimizing (empirical) risk is equivalent to minimize the (empirical) adversarial risk (worst-case risk) for 0-1 loss. Thus, we can directly optimize the risk instead of the worst-case risk. Specifically, suppose we have an observable training distribution $p ( x , y )$ . The observable distribution $p ( x , y )$ may be corrupted from an underlying clean distribution $q ( x , y )$ . We train a model based on the training distribution $p ( x , y )$ , and we want our model to perform well on the clean distribution $q ( x , y )$ . Since we do not know the clean distribution $q ( x , y )$ , we want our model to perform well for the worst-case estimate of the clean distribution, with the assumption that the $f$ -divergence between the corrupted distribution $p$ and the clean distribution $q$ is bounded by $\delta$ . Note that the underlying clean distribution is fixed but unknown, given the corrupted training distribution, the smallest $\delta$ that bounds the divergence between the corrupted distribution and clean distribution measures the intrinsic difficulty of the corruption, and it is also fixed and unknown. The corresponding worst-case distribution w.r.t the smallest $\delta$ is an estimate of the true clean distribution, and this worst-case risk upper bounds the risk of the true clean distribution. In addition, this bound is tighter than the other worst-case risks w.r.t larger $\delta$ . Formally, the upper bound w.r.t the smallest $\delta$ is given as
303
+
304
+ $$
305
+ G ( \theta ) : = \operatorname* { s u p } _ { q \in \widetilde { \mathcal { U } } _ { f } } \mathbb { E } _ { q ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right]
306
+ $$
307
+
308
+ where $\widetilde { \mathcal { U } } _ { f }$ is an equivalent constrainted set w.r.t $\mathcal { U } _ { f }$ for $q ( x , y )$ . Then, we have
309
+
310
+ $$
311
+ G ( \theta ) : = \operatorname* { s u p } _ { q \in \tilde { \mathcal { M } } _ { f } } \mathbb { E } _ { q ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right] = \operatorname* { s u p } _ { r \in \mathcal { U } _ { f } } \mathbb { E } _ { p ( x , y ) } \left[ r ( x , y ) l ( g _ { \theta } ( x ) , y ) \right]
312
+ $$
313
+
314
+ When $l ( \cdot )$ is 0-1 loss, from Theorem 1, we know that minimize $G ( \theta )$ is equivalent to minimize $\widetilde G ( \theta )$ .
315
+ Thus, we can minimize $\widetilde G ( \boldsymbol { \theta } )$ instead of $G ( \theta )$ .
316
+
317
+ $$
318
+ \widetilde G ( \theta ) : = \mathbb { E } _ { p ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right]
319
+ $$
320
+
321
+ Minimize the Eq.(30) enables us to minimize the Eq.(28) without knowing the true divergence parameter $\delta$ beforehand. Usually, minimizing the upper bound can decrease the true risk under clean distribution. Particularly, when the clean distribution coincides with the worst-case estimate w.r.t the smallest $\delta$ , minimizing the risk under the corrupted training distribution leads to the same minimizer as minimizing the risk under the clean distribution.
322
+
323
+ # Relationship between label corruption and general corruption
324
+
325
+ Label corruption is a special case of general corruption. Label corruption restricts the corruption in the space $\mathcal { V }$ instead of the space $\mathcal { X } \times \mathcal { V }$ . That is to say, the training distribution $p ( x )$ is same as the clean distribution $q ( x )$ over $\mathcal { X }$ . Then, we have the robust risk for label corruption as
326
+
327
+ $$
328
+ G _ { y } ( \theta ) : = \operatorname* { s u p } _ { q \in \widetilde { \mathcal { U } } _ { f } \cap H } \mathbb { E } _ { q ( x , y ) } \left[ l ( g _ { \theta } ( x ) , y ) \right]
329
+ $$
330
+
331
+ where $H : = \{ q ( x , y ) | q ( x ) = p ( x ) , \forall ( x , y ) \in \mathcal { X } \times \mathcal { Y } \}$ . The supremum in $G _ { y } ( \theta )$ is taken over $\widetilde { \mathcal { U } } _ { f } \cap H$ , while the supremum in $G ( \theta )$ is taken over $\widetilde { \mathcal { U } } _ { f }$ . Due to the additional constrain $q ( x ) =$ $p \bar { ( \boldsymbol { x } ) } , \forall ( \boldsymbol { x } , \boldsymbol { y } ) \in \mathcal { X } \times \mathcal { Y }$ , we thus know that the robust risk $G _ { y } ( \theta )$ is bounded by $G ( \theta )$ , i.e., $G _ { y } ( \theta ) \leq$ $G ( \theta )$ . Moreover, it is more piratical and important to be robust for both label corruption and feature corruption.
332
+
333
+ # B PROOF OF THEOREM 2
334
+
335
+ Proof. Because $\mathbf { 1 } ( u < 0 ) \leq l ( u )$ , we have $\textstyle \sum _ { i = 1 } ^ { n } l ( u _ { i } ) \geq \sum _ { i = 1 } ^ { n } \mathbf { 1 } { \big ( } u _ { i } < 0 { \big ) }$ . Then
336
+
337
+ $$
338
+ \begin{array} { r l } & { Q \left( \mathbf { u } \right) = \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \operatorname* { m i n } } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { n } { v _ { i } l ( u _ { i } ) } , n - \sum _ { i = 1 } ^ { n } { v _ { i } } + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \right) } \\ & { \quad \le \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { n } l ( u _ { i } ) , n - \sum _ { i = 1 } ^ { n } 1 + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \right) } \\ & { \quad = \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { n } l ( u _ { i } ) , \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \right) } \\ & { \quad = \sum _ { i = 1 } ^ { n } l ( u _ { i } ) } \end{array}
339
+ $$
340
+
341
+ Since loss $\begin{array} { r } { \widehat { J } ( \mathbf { u } ) = \sum _ { i = 1 } ^ { n } l ( u _ { i } ) } \end{array}$ , we obtain $Q \left( \mathbf { u } \right) \leq \widehat { J } \left( \mathbf { u } \right)$ .
342
+
343
+ On the other hand, we have that
344
+
345
+ $$
346
+ \begin{array} { r l } & { Q \left( \mathbf { u } \right) = \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { n } { v _ { i } l ( u _ { i } ) } , n - \sum _ { i = 1 } ^ { n } { v _ { i } } + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) \right) } \\ & { \qquad \quad \geq _ { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } n - \sum _ { i = 1 } ^ { n } v _ { i } + \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \\ & { \qquad = \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}
347
+ $$
348
+
349
+ Since $\begin{array} { r } { J ( \mathbf { u } ) = \sum _ { i = 1 } ^ { n } \mathbf { 1 } \big ( u _ { i } < 0 \big ) } \end{array}$ , we obtain $Q \left( \mathbf { u } \right) \geq J \left( \mathbf { u } \right)$
350
+
351
+ # C PROOF OF COROLLARY 1
352
+
353
+ Proof. Since $n = m b$ , similar to the proof of $Q \left( \mathbf { u } \right) \leq \widehat { J } \left( \mathbf { u } \right)$ , we have
354
+
355
+ $$
356
+ \begin{array} { r l } & { \widehat { Q } \left( \mathbf { u } \right) = \mathop { \sum } _ { j = 1 } ^ { b } \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } { \operatorname* { m i n } } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } + \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ & { \qquad \leq \mathop { \sum } _ { j = 1 } ^ { b } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } 1 + \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ & { = \mathop { \sum } _ { j = 1 } ^ { b } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) , \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ & { = \mathop { \sum } _ { j = 1 } ^ { b } \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) = \widehat { J } \left( \mathbf { u } \right) } \end{array}
357
+ $$
358
+
359
+ On the other hand, since the group (batch) separable sum structure, we have that
360
+
361
+ $$
362
+ \begin{array} { l } { \displaystyle \widehat { Q } \left( \mathbf { u } \right) = \sum _ { j = 1 } ^ { b } \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } { \mathrm { m i n } } \underset { \mathbf { \omega } } { \mathrm { m a x } } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } + \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ { \displaystyle = \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \sum _ { j = 1 } ^ { b } \underset { \mathbf { \omega } } { \mathrm { m a x } } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } + \sum _ { i = 1 } ^ { m } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ { \displaystyle \geq \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \underset { \mathbf { \omega } } { \mathrm { m a x } } \left( \underset { j = 1 } { \overset { b } { \sum } } \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , n - \underset { j = 1 } { \overset { b } { \sum } } \underset { i = 1 } { \overset { m } { \sum } } v _ { i j } + \sum _ { j = 1 } ^ { b } \underset { i = 1 } { \overset { m } { \sum } } \mathbf { 1 } \big ( u _ { i j } < 0 \big ) \right) } \\ { \displaystyle = Q \left( \mathbf { u } \right) \geq J \left( \mathbf { u } \right) } \end{array}
363
+ $$
364
+
365
+ # D PROOF OF PARTIAL OPTIMIZATION THEOREM (THEOREM 4)
366
+
367
+ Proof. For simplicity, let $l _ { i } = l ( u _ { i } ) , i \in \{ 1 , . . . , n \}$ . Without loss of generality, assume $l _ { 1 } \leq l _ { 2 } \dotsm \leq$ $l _ { n }$ . Let $\mathbf { v } ^ { * }$ be the solution obtained by Algorithm 1. Assume there exits a $\mathbf { v }$ such that
368
+
369
+ $$
370
+ \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l _ { i } , C - \sum _ { i = 1 } ^ { n } v _ { i } \big ) < \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } , C - \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } \big ) .
371
+ $$
372
+
373
+ Let $T = \sum _ { i = 1 } ^ { n } v _ { i }$ and $T ^ { * } = \sum _ { i = 1 } ^ { n } v _ { i } ^ { * }$
374
+
375
+ Case 1: If $T = T ^ { * }$ , then there exists an $v _ { k } = 1$ and $v _ { k } ^ { * } = 0$ . From Algorithm 1, we know $k > T ^ { * }$ $( v _ { k } ^ { * } = 0 \Rightarrow k > T ^ { * } )$ and $l _ { k } \ge l _ { j } , j \in \{ 1 , . . . , T ^ { * } \}$ . Then we know $\sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } \leq \sum _ { i = 1 } ^ { n } v _ { i } l _ { i }$ . Thus, we can achieve that
376
+
377
+ $$
378
+ \begin{array} { r } { \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } \big ) = \operatorname* { m a x } \bigl ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } \big ) } \\ { \leq \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } \big ) . } \end{array}
379
+ $$
380
+
381
+ This contradicts the assumption in Eq.(44)
382
+
383
+ Case 2: If $T > T ^ { * }$ , then there exists an $v _ { k } = 1$ and $v _ { k } ^ { * } = 0$ . Let $\mathrm { L } _ { T ^ { * } } = \sum _ { i = 1 } ^ { T ^ { * } } l _ { i }$ . Since $l _ { k } \geq 0$ , we have $\mathrm { L } _ { T ^ { * } } + l _ { k } \geq \mathrm { L } _ { T ^ { * } }$ . From Algorithm 1, we know that $\mathrm { L } _ { \mathrm { T } ^ { * } } + l _ { k } > C - T ^ { * }$ . Thus we obtain that
384
+
385
+ $$
386
+ \begin{array} { r l } { \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } \big ) \geq \mathrm { L } _ { T ^ { * } } + l _ { k } } & { } \\ { \geq \operatorname* { m a x } \big ( \mathrm { L } _ { T ^ { * } } , C - T ^ { * } \big ) } & { } \\ { = \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } \big ) } \end{array}
387
+ $$
388
+
389
+ This contradicts the assumption in Eq.(44)
390
+
391
+ Case 3: If $T < T ^ { * }$ , we obtain $C - T \geq C - T ^ { * } + 1$ . Then we can achieve that
392
+
393
+ $$
394
+ \begin{array} { l } { \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } \big ) = \operatorname* { m a x } \big ( \mathrm { L } _ { T ^ { * } } , C - T ^ { * } \big ) } \\ { \leq C + 1 - T ^ { * } } \\ { \leq C - T } \\ { = C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } } \\ { \leq \operatorname* { m a x } \big ( \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } l _ { i } , C - \displaystyle \sum _ { i = 1 } ^ { n } v _ { i } \big ) . } \end{array}
395
+ $$
396
+
397
+ This contradicts the assumption in Eq.(44).
398
+
399
+ Finally, we conclude that $\mathbf { v } ^ { * }$ obtained by Algorithm 1 is the minimum of the optimization problem given in (13). □
400
+
401
+ # E PROOF OF PROPOSITION 1
402
+
403
+ Proof. Note that $T ^ { * } = \sum _ { i = 1 } ^ { n } v _ { i } ^ { * }$ , from the condition of $v _ { i } ^ { * } = 1$ in Algorithm 1, we know that $L _ { T ^ { * } } \leq$ $C + 1 - T ^ { * }$ . From the condition of $v _ { k } ^ { * } = 0$ in Algorithm 1, we know that $L _ { T ^ { * } + 1 } > C - T ^ { * }$ . Because $l ( u _ { i } ) \geq \mathbf { 1 } ( u _ { i } < 0 ) \geq 0$ for $i \in \{ 1 , . . . , n \}$ , we have $L _ { T ^ { * } + 1 } = L _ { T ^ { * } } + l ( u _ { T ^ { * } + 1 } ) \ge L _ { T ^ { * } }$ . Thus, we obtain $L _ { T ^ { * } + 1 } > \operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } )$ . By substitute the optimum $\mathbf { v } ^ { * }$ into the optimization function, we obtain that
404
+
405
+ $$
406
+ \begin{array} { r l } & { \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { n } } { \operatorname* { m i n } } \underset { i = 1 } { \operatorname* { m a x } } \big ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , C - \sum _ { i = 1 } ^ { n } v _ { i } \big ) } \\ & { = \operatorname* { m a x } \big ( \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } l ( u _ { i } ) , C - \sum _ { i = 1 } ^ { n } v _ { i } ^ { * } \big ) } \\ & { = \operatorname* { m a x } ( L _ { T ^ { * } } , C - T ^ { * } ) } \end{array}
407
+ $$
408
+
409
+ # F PROOF OF THEOREM 3
410
+
411
+ Proof. We first prove that objective (11) is tighter than the loss objective $\widehat { J } ( { \mathbf { u } } )$ in Eq.(8). After this, we prove that objective (11) is an upper bound of the $_ { 0 / 1 }$ loss defined in equation (7).
412
+
413
+ For simplicity, let $l _ { i } = l ( u _ { i } )$ , we obtain that
414
+
415
+ $$
416
+ \begin{array} { l } { { \displaystyle E \left( { \bf u } \right) = \operatorname* { m i n } _ { { \bf v } \in \{ 0 , 1 \} ^ { n } } \operatorname* { m a x } ( \sum _ { i = 1 } ^ { n } v _ { i } l ( u _ { i } ) , n - \sum _ { i = 1 } ^ { n } v _ { i } ) } \ ~ } \\ { { \displaystyle \quad \leq \operatorname* { m a x } ( \sum _ { i = 1 } ^ { n } l ( u _ { i } ) , ( n - \sum _ { i = 1 } ^ { n } 1 ) ) } \ ~ } \\ { { \displaystyle \quad = \sum _ { i = 1 } ^ { n } l ( u _ { i } ) . } } \end{array}
417
+ $$
418
+
419
+ Note that ${ \widehat { J } } \left( { \bf u } \right) = \sum _ { i = 1 } ^ { n } l ( u _ { i } )$ , thus, we have $E \left( \mathbf { u } \right) \leq \widehat { J } \left( \mathbf { u } \right)$ .
420
+
421
+ Without loss of generality, assume $l _ { 1 } ~ \le ~ l _ { 2 } \dots ~ \le ~ l _ { n }$ . Let $\mathrm { L } _ { i } ~ = ~ \sum _ { j = 1 } ^ { i } l _ { j }$ , $\mathrm { ~ T ~ } = \sum _ { i = 1 } ^ { n } v _ { i } ^ { * }$ , where $\mathbf { v } ^ { * } { = } [ v _ { 1 } ^ { * } , v _ { 2 } ^ { * } \cdot \cdot \cdot v _ { n } ^ { * } ] ^ { T }$ is the optimum of $v$ for fixed $\mathbf { u }$ . Let $k = \sum _ { i = 1 } ^ { n } \mathbf { 1 } ( u _ { i } \geq 0 )$ . Then we achieve that the $_ { 0 / 1 }$ loss $J ( \mathbf { u } )$ is as follows:
422
+
423
+ $$
424
+ J ( \mathbf { u } ) = \sum _ { i = 1 } ^ { n } \mathbf { 1 } ( u _ { i } < 0 ) { = } n - k .
425
+ $$
426
+
427
+ From Algorithm 1 with $C = n$ , we achieve that $\mathrm { L } _ { \mathrm { T } } \leq n - T + 1$ and $\operatorname { L } _ { \mathrm { T } + 1 } > n - T$ .
428
+
429
+ Case 1: If $k \geq T$ , we can achieve that
430
+
431
+ $$
432
+ \begin{array} { r l } & { 2 E \left( \mathbf { u } \right) - J ( \mathbf { u } ) = 2 \operatorname* { m a x } ( \mathrm { L } _ { T } , n - T ) - \left( n - k \right) } \\ & { \qquad \geq 2 ( n - T ) - ( n - k ) } \\ & { \qquad = n + k - 2 T \geq 0 . } \end{array}
433
+ $$
434
+
435
+ Case 2: If $k < T , n - T \geq \mathrm { L } _ { T }$ , we can obtain that
436
+
437
+ $$
438
+ 2 E \left( \mathbf { u } \right) - J ( \mathbf { u } ) = 2 ( n - T ) - ( n - k ) = n + k - 2 T .
439
+ $$
440
+
441
+ Since $k < T$ , if follows that
442
+
443
+ $$
444
+ \begin{array} { l } { { \displaystyle \mathrm { L } _ { \mathrm { T } } = \mathrm { L } _ { k } + \sum _ { j = k + 1 } ^ { T } l _ { j } \geq \mathrm { L } _ { k } + \sum _ { j = k + 1 } ^ { T } 1 } } \\ { ~ = \mathrm { L } _ { k } + T - k } \\ { ~ \geq T - k . } \end{array}
445
+ $$
446
+
447
+ Together with $n - T \geq \mathrm { L } _ { T }$ , we can obtain that
448
+
449
+ $$
450
+ n - T \geq \mathrm { L } _ { T } \geq T - k \Rightarrow n + k - 2 T \geq 0 .
451
+ $$
452
+
453
+ Thus, we can achieve that
454
+
455
+ $$
456
+ 2 E \left( \mathbf { u } \right) - J ( \mathbf { u } ) = n + k - 2 T \geq 0 .
457
+ $$
458
+
459
+ Case 3: If $k < T , n - T < \mathrm { L } _ { T }$ , we can obtain that
460
+
461
+ $$
462
+ \begin{array} { r l } & { 2 E \left( \mathbf { u } \right) - J ( \mathbf { u } ) = 2 \operatorname* { m a x } ( \mathrm { L } _ { T } , n - T ) - \left( n - k \right) } \\ & { \qquad = 2 \mathrm { L } _ { T } - \left( n - k \right) } \\ & { \qquad > \left( n - T \right) + \mathrm { L } _ { T } - n + k . } \end{array}
463
+ $$
464
+
465
+ From (67), we have $\mathrm { L } _ { \mathrm { T } } \geq T - k$ . Together with (72), it follows that
466
+
467
+ $$
468
+ 2 E \left( \mathbf { u } \right) - J ( \mathbf { u } ) > \left( n - T \right) + \left( T - k \right) - n + k \geq 0 .
469
+ $$
470
+
471
+ Finally, we can achieve that $J ( \mathbf { u } ) \leq 2 E \left( \mathbf { u } \right) \leq 2 \widehat { J } \left( \mathbf { u } \right)$ .
472
+
473
+ # G PROOF OF COROLLARY 2
474
+
475
+ Proof. Since $n = m b$ , similar to the proof of $\widehat { Q } \left( \mathbf { u } \right) \leq \widehat { J } \left( \mathbf { u } \right)$ , we have
476
+
477
+ $$
478
+ \begin{array} { r l } & { \widehat { E } \left( \mathbf { u } \right) = \sum _ { j = 1 } ^ { b } \underset { \mathbf { v } \in \{ 0 , 1 \} ^ { m } } { \operatorname* { m i n } } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } \right) } \\ & { \qquad \leq \sum _ { j = 1 } ^ { b } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } 1 \right) } \\ & { \qquad = \sum _ { j = 1 } ^ { b } \operatorname* { m a x } \left( \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) , 0 \right) } \\ & { \qquad = \sum _ { j = 1 } ^ { b } \sum _ { i = 1 } ^ { m } l ( u _ { i j } ) = \widehat { J } \left( \mathbf { u } \right) } \end{array}
479
+ $$
480
+
481
+ On the other hand, since the group (batch) separable sum structure, we have that
482
+
483
+ $$
484
+ \begin{array} { l } { { \displaystyle { \widehat E } \left( { \bf u } \right) = \sum _ { j = 1 } ^ { b } \underset { { \bf v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \mathrm { m a x } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } \right) } } \\ { { \displaystyle \qquad = \underset { { \bf v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \sum _ { j = 1 } ^ { b } \mathrm { m a x } \left( \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , m - \sum _ { i = 1 } ^ { m } v _ { i j } \right) } } \\ { { \displaystyle \qquad \geq \underset { { \bf v } \in \{ 0 , 1 \} ^ { n } } { \mathrm { m i n } } \mathrm { m a x } \left( \sum _ { j = 1 } ^ { b } \sum _ { i = 1 } ^ { m } v _ { i j } l ( u _ { i j } ) , n - \sum _ { j = 1 } ^ { b } \sum _ { i = 1 } ^ { m } v _ { i j } \right) } } \\ { { \displaystyle \qquad = E \left( { \bf u } \right) } } \end{array}
485
+ $$
486
+
487
+ Together with Theorem 3, we obtain that $J ( \mathbf { u } ) \leq 2 E \left( \mathbf { u } \right) \leq 2 \widehat { E } \left( \mathbf { u } \right) \leq 2 \widehat { \mathbf { J } } \left( \mathbf { u } \right)$
488
+
489
+ ![](images/eb13c2cedb245727c2705c592a2a36415ac72b20de2d2f41efb7ca3177337e84.jpg)
490
+ Figure 4: Training/Test accuracy for soft and hard hinge loss with different optimizer on CIFAR100
491
+
492
+ # H MULTI-CLASS EXTENSION
493
+
494
+ For multi-class classification, denote the groudtruth label as $y \in \{ 1 , . . . , K \}$ . Denote the classification prediction (the last layer output of networks before loss function) as $i _ { i } , i \in \{ 1 , . . . , K \}$ . Then, the classification margin for multi-class classification can be defined as follows
495
+
496
+ $$
497
+ u = t _ { y } - \operatorname* { m a x } _ { i \neq y } t _ { i } .
498
+ $$
499
+
500
+ We can see that $\mathbf { 1 } { \left( u < 0 \right) } = \mathbf { 1 } { \left( t _ { y } - \operatorname* { m a x } _ { i \neq y } { t _ { i } } < 0 \right) }$ is indeed the 0-1 loss for multi-class classification.
501
+
502
+ With the classification margin $u$ , we can compute the base loss $l ( u ) \ge \mathbf { 1 } ( u < 0 )$ . In this work, we employ the hinge loss. As we need the upper bound of 0-1 loss, the multi-class hard hinge loss function Moore & DeNero (2011) can be defined as
503
+
504
+ $$
505
+ H ( \mathbf { t } , y ) = \operatorname* { m a x } ( 1 - u , 0 ) = \operatorname* { m a x } ( 1 - t _ { y } + \operatorname* { m a x } _ { i \neq y } { t _ { i } , 0 } ) .
506
+ $$
507
+
508
+ The multi-class hard hinge loss in Eq.(81) is not easy to optimize for deep networks. We propose a novel soft multi-class hinge loss function as follows:
509
+
510
+ $$
511
+ S ( \mathbf { t } , y ) = \left\{ \begin{array} { l l } { \operatorname* { m a x } ( 1 - t _ { y } + \operatorname* { m a x } _ { i \neq y } t _ { i } , 0 ) } & { , \ t _ { y } - \operatorname* { m a x } _ { i \neq y } t _ { i } \geq 0 } \\ { \operatorname* { m a x } ( 1 - t _ { y } + \mathrm { L o g } \mathrm { S u m E x p } ( \mathbf { t } ) , 0 ) } & { , \ t _ { y } - \operatorname* { m a x } _ { i \neq y } t _ { i } < 0 . } \end{array} \right.
512
+ $$
513
+
514
+ The soft hinge loss employs the LogSumExp function to approximate the max function when the classification margin is less than zero, i.e., misclassification case. Intuitively, when the sample is misclassified, it is far away from being correctly separate by a positive margin (e.g. margin $u \geq 1 \mathrm { ~ , ~ }$ ). In this situation, a smooth loss function can help speed up gradient update. Because $\mathrm { L o g S u m E x p ( t ) } > \mathrm { m a x } _ { i \in \{ 1 , \cdots K \} } t _ { i }$ we know that the soft hinge loss is an upper bound of the hard hinge loss, i.e., $S ( \mathbf { t } , y ) \ge H ( \mathbf { t } , y )$ . Moreover, we can obtain a new weighted loss $F ( \mathbf { t } , y ; \beta ) =$ $\beta S ( \mathbf { t } , y ) + ( 1 - \beta ) H ( \mathbf { t } , y ) , \beta \in [ 0 , 1 ]$ that is also an upper bound of 0-1 loss.
515
+
516
+ # I EVALUATION OF EFFICIENCY OF THE PROPOSED SOFT-HINGE LOSS
517
+
518
+ We compare our soft multi-class hinge loss with hard multi-class hinge loss Moore & DeNero (2011) on CIFAR100 dataset training with Adam and SGD optimizer, respectively. We keep both the network architecture and hyperparameters same. We employ the default learning rate and momentums of Adam optimizer in PyTorch toolbox, i.e. $l r = 1 0 ^ { - 3 } , \bar { \beta } _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 9 \bar { 9 }$ . For SGD optimizer, the learning rate $( l r )$ and momentum $( \rho )$ are set to $l r = 1 0 ^ { - 2 }$ and $\rho = 0 . 9$ respectively.
519
+
520
+ The pictures of training/test accuracy v.s number of epochs are presented in Figure 4. We can observe that both the training accuracy and the test accuracy of our soft hinge loss increase greatly fast as the number of epochs increase. In contrast, the training and test accuracy of hard hinge loss grow very slowly. The training accuracy of soft hinge loss can arrive $1 0 0 \%$ trained with both optimizers. Both training and test accuracy of soft hinge loss are consistently better than hard hinge loss. In addition, training accuracy of hard hinge loss can also reach $1 0 0 \%$ when SGD optimizer is used. However, its test accuracy is lowever than that of soft hinge loss.
521
+
522
+ # J IMPACT OF MISSPECIFIED ESTIMATION OF NOISE RATE $\epsilon$
523
+
524
+ We empirically analyze the impact of misspecified prior for the noise rate $\epsilon$ . The average test accuracy over last ten epochs on MNIST for different priors are reported in Table 4. We can observe that NPCL is robust to misspecified prior for small noise cases (Symmetry- $20 \%$ ). Moreover, it becomes a bit more sensitive on large noise case (Symmetry- $50 \%$ ) and on the pair flipping case (Pair- $3 5 \%$ ).
525
+
526
+ Table 4: Average test accuracy of NPCL with different $\epsilon$ on MNIST over last ten epochs
527
+
528
+ <table><tr><td rowspan=1 colspan=1>FlippingRate</td><td rowspan=1 colspan=1>0.5€</td><td rowspan=1 colspan=1>0.75€</td><td rowspan=1 colspan=1>E</td><td rowspan=1 colspan=1>1.25€</td><td rowspan=1 colspan=1>1.5€</td></tr><tr><td rowspan=1 colspan=1>Symmetry-20%</td><td rowspan=1 colspan=1>96.31% ± 0.17%</td><td rowspan=1 colspan=1>97.72%± 0.09%</td><td rowspan=1 colspan=1>99.41% ± 0.01%</td><td rowspan=1 colspan=1>99.55% ± 0.02%</td><td rowspan=1 colspan=1>99.10% ± 0.04%</td></tr><tr><td rowspan=1 colspan=1>Symmetry-50%</td><td rowspan=1 colspan=1>78.67% ± 0.36%</td><td rowspan=1 colspan=1>87.36%±0.29%</td><td rowspan=1 colspan=1>98.53% ±0.02%</td><td rowspan=1 colspan=1>97.92% ±0.06%</td><td rowspan=1 colspan=1>67.61% ± 0.06%</td></tr><tr><td rowspan=1 colspan=1>Pair-35%</td><td rowspan=1 colspan=1>80.59%± 0.40%</td><td rowspan=1 colspan=1>87.86%± 0.48%</td><td rowspan=1 colspan=1>97.90% ± 0.04%</td><td rowspan=1 colspan=1>99.33% ± 0.02%</td><td rowspan=1 colspan=1>86.66% ± 0.08%</td></tr></table>
529
+
530
+ Table 5: Average test accuracy on MNIST over the last ten epochs.
531
+
532
+ <table><tr><td rowspan=1 colspan=1>Flipping-Rate</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>MentorNet</td><td rowspan=1 colspan=1>Co-teaching</td><td rowspan=1 colspan=1>Co-teaching+</td><td rowspan=1 colspan=1>GCE</td><td rowspan=1 colspan=1>NPCL</td></tr><tr><td rowspan=1 colspan=1>Symmetry-20%</td><td rowspan=1 colspan=1>93.78% ±0.04%</td><td rowspan=1 colspan=1>96.68% ±0.05%</td><td rowspan=1 colspan=1>97.14% ±0.03%</td><td rowspan=1 colspan=1>99.41% ± 0.01%</td><td rowspan=1 colspan=1>99.40±0.01%</td><td rowspan=1 colspan=1>99.41% ±0.01%</td></tr><tr><td rowspan=1 colspan=1>Symmetry-50%</td><td rowspan=1 colspan=1>65.81% ± 0.14%</td><td rowspan=1 colspan=1>90.53% ±0.07%</td><td rowspan=1 colspan=1>91.35% ±0.09%</td><td rowspan=1 colspan=1>97.79% ± 0.03%</td><td rowspan=1 colspan=1>92.48±0.13%</td><td rowspan=1 colspan=1>98.53%±0.02%</td></tr><tr><td rowspan=1 colspan=1>Pair-35%</td><td rowspan=1 colspan=1>70.50% ±0.16%</td><td rowspan=1 colspan=1>89.62% ±0.15%</td><td rowspan=1 colspan=1>90.96%±0.18%</td><td rowspan=1 colspan=1>93.81% ± 0.20%</td><td rowspan=1 colspan=1>72.26 ± 0.06%</td><td rowspan=1 colspan=1>97.90% ± 0.04%</td></tr></table>
533
+
534
+ Table 6: Average test accuracy on CIFAR10 over the last ten epochs.
535
+
536
+ <table><tr><td rowspan=1 colspan=1>Flipping-Rate</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>MentorNet</td><td rowspan=1 colspan=1>Co-teaching</td><td rowspan=1 colspan=1>Co-teaching+</td><td rowspan=1 colspan=1>GCE</td><td rowspan=1 colspan=1>NPCL</td></tr><tr><td rowspan=1 colspan=1>Symmetry-20%</td><td rowspan=1 colspan=1>76.62% ± 0.07%</td><td rowspan=1 colspan=1>81.20% ±0.09%</td><td rowspan=1 colspan=1>82.13% ±0.08%</td><td rowspan=1 colspan=1>80.64% ±0.15%</td><td rowspan=1 colspan=1>84.68% ±0.05%</td><td rowspan=1 colspan=1>84.30% ±0.07%</td></tr><tr><td rowspan=1 colspan=1>Symmetry-50%</td><td rowspan=1 colspan=1>49.92% ±0.09%</td><td rowspan=1 colspan=1>72.09% ±0.06%</td><td rowspan=1 colspan=1>74.28% ±0.11%</td><td rowspan=1 colspan=1>58.43% ±0.30 %</td><td rowspan=1 colspan=1>61.80% ±0.11%</td><td rowspan=1 colspan=1>77.66% ± 0.09%</td></tr><tr><td rowspan=1 colspan=1>Pair-35%</td><td rowspan=1 colspan=1>62.26%± 0.09%</td><td rowspan=1 colspan=1>71.52% ±0.06%</td><td rowspan=1 colspan=1>77.77%±0.14%</td><td rowspan=1 colspan=1>62.72%± 0.23%</td><td rowspan=1 colspan=1>60.86% ±0.05%</td><td rowspan=1 colspan=1>76.52% ± 0.11%</td></tr></table>
537
+
538
+ # K RELATED LITERATURE
539
+
540
+ Curriculum Learning: Curriculum learning is a general learning methodology that achieves success in many area. The very beginning work of curriculum learning (Bengio et al., 2009) trains a model gradually with samples ordered in a meaningful sequence, which has improved performance on many problems. Since the curriculum in (Bengio et al., 2009) is predetermined by prior knowledge and remained fixed later, which ignores the feedback of learners, Kumar et al. (Kumar et al., 2010) further propose Self-paced learning that selects samples by alternative minimization of an augmented objective. Jiang et al. (Jiang et al., 2014) propose a self-paced learning method to select samples with diversity. After that, Jiang et al. (Jiang et al., 2015) propose a self-paced curriculum strategy that takes different priors into consideration. Although these methods achieve success, the relation between the augmented objective of self-paced learning and the original objective (e.g. cross entropy loss for classification) is not clear. In addition, as stated in (Jiang et al., 2018), the alternative update in self-paced learning is not efficient for training deep networks.
541
+
542
+ Learning with Noisy Labels: The most related works are the sample selection based methods for robust learning. This kind of works are inspired by curriculum learning (Bengio et al., 2009). Among them, Jiang et al. (Jiang et al., 2018) propose to learn the curriculum from data by a mentor net. They use the mentor net to select samples for training with noisy labels. Co-teaching (Han et al., 2018b) employs two networks to select samples to train each other and achieve good generalization performance against large rate of label corruption. Co-teaching $^ +$ (Yu et al., 2019) extends Coteaching by selecting samples with disagreement of prediction of two networks. Compared with Co-teaching/Co-teaching+, our CL is a simple plugin for a single network. Thus both space and time complexity of CL are half of Co-teaching’s. Recently, Zhang & Sabuncu (2018) propose a generalized Cross-entropy loss for robust learning.
543
+
544
+ Construction of tighter bounds of 0-1 loss: Along the line of construction of tighter bounds of the 0-1 loss, many methods have been proposed. To name a few, Masnadi-Shirazi et al. (MasnadiShirazi & Vasconcelos, 2009) propose Savage loss, which is a non-convex upper bound of the 0-1 loss function. Bartlett et al. (Bartlett et al., 2006) analyze the properties of the truncated loss for conventional convex loss. Wu et al. (Wu & Liu, 2007) study the truncated hinge loss for SVM. Although the results are fruitful, these works are mainly focus on loss function at individual data point, they do not have sample selection property. In contrast, our curriculum loss can automatically select samples for training. Moreover, it can be constructed in a tighter way than these individual losses by employing them as the base loss function.
545
+
546
+ Table 7: Average test accuracy on CIFAR100 over the last ten epochs.
547
+
548
+ <table><tr><td rowspan=1 colspan=1>Flipping-Rate</td><td rowspan=1 colspan=1>Standard</td><td rowspan=1 colspan=1>MentorNet</td><td rowspan=1 colspan=1>Co-teaching</td><td rowspan=1 colspan=1>Co-teaching+</td><td rowspan=1 colspan=1>GCE</td><td rowspan=1 colspan=1>NPCL</td></tr><tr><td rowspan=1 colspan=1>Symmetry-20%</td><td rowspan=1 colspan=1>47.05% ±0.11%</td><td rowspan=1 colspan=1>51.58%±0.15%</td><td rowspan=1 colspan=1>53.89%± 0.09%</td><td rowspan=1 colspan=1>56.15% ± 0.09%</td><td rowspan=1 colspan=1>51.86% ± 0.09%</td><td rowspan=1 colspan=1>55.30%± 0.09%</td></tr><tr><td rowspan=1 colspan=1>Symmetry-50%</td><td rowspan=1 colspan=1>25.47% ± 0.07%</td><td rowspan=1 colspan=1>39.65%± 0.10%</td><td rowspan=1 colspan=1>41.08% ± 0.07%</td><td rowspan=1 colspan=1>37.88% ±0.06%</td><td rowspan=1 colspan=1>37.60%±0.08%</td><td rowspan=1 colspan=1>42.56% ± 0.06%</td></tr><tr><td rowspan=1 colspan=1>Pair-35%</td><td rowspan=1 colspan=1>39.91% ± 0.11%</td><td rowspan=1 colspan=1>40.42%±0.07%</td><td rowspan=1 colspan=1>43.36%±0.08%</td><td rowspan=1 colspan=1>40.88%±0.16%</td><td rowspan=1 colspan=1>36.64% ±0.07%</td><td rowspan=1 colspan=1>44.43% ±0.15%</td></tr></table>
549
+
550
+ ![](images/04e73ed022ca2bace512276fd4f5a1055c360281b99a6b8ceac955c074bf65a0.jpg)
551
+ Figure 5: Test accuracy and label precision vs. number of epochs on CIFAR10 dataset.
552
+
553
+ # L ARCHITECTURE OF NEURAL NETWORKS
554
+
555
+ <table><tr><td rowspan=1 colspan=1>CNN on MNIST</td><td rowspan=1 colspan=1>CNN on CIFAR-10</td><td rowspan=1 colspan=1>CNN on CIFAR-100</td></tr><tr><td rowspan=1 colspan=1>28×28 Gray Image</td><td rowspan=1 colspan=1>32×32 RGB Image</td><td rowspan=1 colspan=1>32×32 RGB Image</td></tr><tr><td rowspan=1 colspan=3>3×3 conv, 128 LReLU3 ×3 conv, 128 LReLU3×3 conv, 128 LReLU</td></tr><tr><td rowspan=1 colspan=3>2×2 max-pool, stride 2dropout, p = 0.25</td></tr><tr><td rowspan=1 colspan=3>3 ×3 conv, 256 LReLU3 ×3 conv, 256 LReLU3 ×3 conv, 256 LReLU</td></tr><tr><td rowspan=1 colspan=3>2×2 max-pool, stride 2dropout, p = 0.25</td></tr><tr><td rowspan=1 colspan=3>3×3 conv, 512LReLU3 ×3 conv, 256 LReLU3 ×3 conv, 128 LReLU</td></tr><tr><td rowspan=1 colspan=3>avg-pool</td></tr><tr><td rowspan=1 colspan=1>dense 128-→10</td><td rowspan=1 colspan=1>dense 128-→10</td><td rowspan=1 colspan=1>dense 128-→100</td></tr></table>
556
+
557
+ ![](images/6a3d8ac426366bfc09346e6ef7ebb53e582885f40f8d62d0b45eea045705fc3d.jpg)
558
+ Figure 6: Test accuracy and label precision vs. number of epochs on CIFAR100 dataset.
559
+
560
+ ![](images/104cc7d0f744900cd1976959b118598ff3ded73a6e9a19470c092fe08304f08d.jpg)
561
+ Figure 7: Test accuracy vs. number of epochs on MNIST dataset.
562
+
563
+ ![](images/d0f70ae5c1a93be88ed5cfed56a929b76f576a54110dcb9e5b3167b70dfdbb68.jpg)
564
+ Figure 8: Test accuracy vs. number of epochs on CIFAR100 dataset.
parse/train/rkgt0REKwS/rkgt0REKwS_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rkgt0REKwS/rkgt0REKwS_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rkgt0REKwS/rkgt0REKwS_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rkllGyBFPH/rkllGyBFPH.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rkllGyBFPH/rkllGyBFPH_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rkllGyBFPH/rkllGyBFPH_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/rkllGyBFPH/rkllGyBFPH_model.json ADDED
The diff for this file is too large to render. See raw diff