ZHANGYUXUAN-zR commited on
Commit
7d884a2
·
verified ·
1 Parent(s): 4a71609

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. parse/train/B1eWbxStPH/B1eWbxStPH.md +301 -0
  2. parse/train/B1eWbxStPH/B1eWbxStPH_middle.json +0 -0
  3. parse/train/BklfR3EYDH/BklfR3EYDH_content_list.json +0 -0
  4. parse/train/BklfR3EYDH/BklfR3EYDH_middle.json +0 -0
  5. parse/train/ByxBFsRqYm/ByxBFsRqYm.md +615 -0
  6. parse/train/ByxBFsRqYm/ByxBFsRqYm_content_list.json +0 -0
  7. parse/train/ByxBFsRqYm/ByxBFsRqYm_middle.json +0 -0
  8. parse/train/ByxBFsRqYm/ByxBFsRqYm_model.json +0 -0
  9. parse/train/ByxY8CNtvr/ByxY8CNtvr.md +370 -0
  10. parse/train/ByxY8CNtvr/ByxY8CNtvr_content_list.json +1875 -0
  11. parse/train/ByxY8CNtvr/ByxY8CNtvr_middle.json +0 -0
  12. parse/train/ByxY8CNtvr/ByxY8CNtvr_model.json +0 -0
  13. parse/train/H1ekF2EYDH/H1ekF2EYDH.md +0 -0
  14. parse/train/H1ekF2EYDH/H1ekF2EYDH_content_list.json +0 -0
  15. parse/train/H1ekF2EYDH/H1ekF2EYDH_middle.json +0 -0
  16. parse/train/H1ekF2EYDH/H1ekF2EYDH_model.json +0 -0
  17. parse/train/HJYoqzbC-/HJYoqzbC-.md +233 -0
  18. parse/train/HJYoqzbC-/HJYoqzbC-_model.json +0 -0
  19. parse/train/HJgC60EtwB/HJgC60EtwB.md +589 -0
  20. parse/train/HJgC60EtwB/HJgC60EtwB_content_list.json +0 -0
  21. parse/train/HJgC60EtwB/HJgC60EtwB_middle.json +0 -0
  22. parse/train/HJgC60EtwB/HJgC60EtwB_model.json +0 -0
  23. parse/train/HklY120cYm/HklY120cYm.md +346 -0
  24. parse/train/HklY120cYm/HklY120cYm_content_list.json +1513 -0
  25. parse/train/HklY120cYm/HklY120cYm_middle.json +0 -0
  26. parse/train/HklY120cYm/HklY120cYm_model.json +0 -0
  27. parse/train/OeWooOxFwDa/OeWooOxFwDa.md +256 -0
  28. parse/train/OeWooOxFwDa/OeWooOxFwDa_content_list.json +1088 -0
  29. parse/train/OeWooOxFwDa/OeWooOxFwDa_middle.json +0 -0
  30. parse/train/OeWooOxFwDa/OeWooOxFwDa_model.json +0 -0
  31. parse/train/S1fUpoR5FQ/S1fUpoR5FQ.md +0 -0
  32. parse/train/S1fUpoR5FQ/S1fUpoR5FQ_content_list.json +0 -0
  33. parse/train/S1fUpoR5FQ/S1fUpoR5FQ_middle.json +0 -0
  34. parse/train/S1fUpoR5FQ/S1fUpoR5FQ_model.json +0 -0
  35. parse/train/SkxxtgHKPS/SkxxtgHKPS.md +0 -0
  36. parse/train/SkxxtgHKPS/SkxxtgHKPS_content_list.json +0 -0
  37. parse/train/SkxxtgHKPS/SkxxtgHKPS_middle.json +0 -0
  38. parse/train/SkxxtgHKPS/SkxxtgHKPS_model.json +0 -0
  39. parse/train/ZsZM-4iMQkH/ZsZM-4iMQkH.md +0 -0
  40. parse/train/ZsZM-4iMQkH/ZsZM-4iMQkH_content_list.json +0 -0
  41. parse/train/ZsZM-4iMQkH/ZsZM-4iMQkH_middle.json +0 -0
  42. parse/train/ZsZM-4iMQkH/ZsZM-4iMQkH_model.json +0 -0
  43. parse/train/gDcaUj4Myhn/gDcaUj4Myhn.md +296 -0
  44. parse/train/gDcaUj4Myhn/gDcaUj4Myhn_model.json +0 -0
  45. parse/train/o81ZyBCojoA/o81ZyBCojoA.md +380 -0
  46. parse/train/o81ZyBCojoA/o81ZyBCojoA_content_list.json +0 -0
  47. parse/train/o81ZyBCojoA/o81ZyBCojoA_middle.json +0 -0
  48. parse/train/o81ZyBCojoA/o81ZyBCojoA_model.json +0 -0
  49. parse/train/r1xQNlBYPS/r1xQNlBYPS.md +250 -0
  50. parse/train/r1xQNlBYPS/r1xQNlBYPS_content_list.json +1316 -0
parse/train/B1eWbxStPH/B1eWbxStPH.md ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DIRECTIONAL MESSAGE PASSING FOR MOLECULAR GRAPHS
2
+
3
+ Johannes Gasteiger, Janek Groß & Stephan Günnemann
4
+
5
+ Technical University of Munich, Germany {j.gasteiger,grossja,guennemann}@in.tum.de
6
+
7
+ # ABSTRACT
8
+
9
+ Graph neural networks have recently achieved great successes in predicting quantum mechanical properties of molecules. These models represent a molecule as a graph using only the distance between atoms (nodes). They do not, however, consider the spatial direction from one atom to another, despite directional information playing a central role in empirical potentials for molecules, e.g. in angular potentials. To alleviate this limitation we propose directional message passing, in which we embed the messages passed between atoms instead of the atoms themselves. Each message is associated with a direction in coordinate space. These directional message embeddings are rotationally equivariant since the associated directions rotate with the molecule. We propose a message passing scheme analogous to belief propagation, which uses the directional information by transforming messages based on the angle between them. Additionally, we use spherical Bessel functions and spherical harmonics to construct theoretically well-founded, orthogonal representations that achieve better performance than the currently prevalent Gaussian radial basis representations while using fewer than $1 / 4$ of the parameters. We leverage these innovations to construct the directional message passing neural network (DimeNet). DimeNet outperforms previous GNNs on average by $7 6 \%$ on MD17 and by $3 1 \%$ on QM9. Our implementation is available online.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ In recent years scientists have started leveraging machine learning to reduce the computation time required for predicting molecular properties from a matter of hours and days to mere milliseconds. With the advent of graph neural networks (GNNs) this approach has recently experienced a small revolution, since they do not require any form of manual feature engineering and significantly outperform previous models (Gilmer et al., 2017; Schütt et al., 2017). GNNs model the complex interactions between atoms by embedding each atom in a high-dimensional space and updating these embeddings by passing messages between atoms. By predicting the potential energy these models effectively learn an empirical potential function. Classically, these functions have been modeled as the sum of four parts: (Leach, 2001)
14
+
15
+ $$
16
+ E = E _ { \mathrm { { b o n d s } } } + E _ { \mathrm { { a n g l e } } } + E _ { \mathrm { { t o r s i o n } } } + E _ { \mathrm { { n o n - b o n d e d } } } ,
17
+ $$
18
+
19
+ where $E _ { \mathrm { b o n d s } }$ models the dependency on bond lengths, $E _ { \mathrm { a n g l e } }$ on the angles between bonds, $E _ { \mathrm { t o r s i o n } }$ on bond rotations, i.e. the dihedral angle between two planes defined by pairs of bonds, and $E _ { \mathrm { n o n } }$ -bonded models interactions between unconnected atoms, e.g. via electrostatic or van der Waals interactions. The update messages in GNNs, however, only depend on the previous atom embeddings and the pairwise distances between atoms – not on directional information such as bond angles and rotations. Thus, GNNs lack the second and third terms of this equation and can only model them via complex higher-order interactions of messages. Extending GNNs to model them directly is not straightforward since GNNs solely rely on pairwise distances, which ensures their invariance to translation, rotation, and inversion of the molecule, which are important physical requirements.
20
+
21
+ In this paper, we propose to resolve this restriction by using embeddings associated with the directions to neighboring atoms, i.e. by embedding atoms as a set of messages. These directional message embeddings are equivariant with respect to the above transformations since the directions move with the molecule. Hence, they preserve the relative directional information between neighboring atoms. We propose to let message embeddings interact based on the distance between atoms and the angle between directions. Both distances and angles are invariant to translation, rotation, and inversion of the molecule, as required. Additionally, we show that the distance and angle can be jointly represented in a principled and effective manner by using spherical Bessel functions and spherical harmonics. We leverage these innovations to construct the directional message passing neural network (DimeNet). DimeNet can learn both molecular properties and atomic forces. It is twice continuously differentiable and solely based on the atom types and coordinates, which are essential properties for performing molecular dynamics simulations. DimeNet outperforms previous GNNs on average by $7 \hat { 6 } \%$ on MD17 and by $3 1 \%$ on QM9. Our paper’s main contributions are:
22
+
23
+ 1. Directional message passing, which allows GNNs to incorporate directional information by connecting recent advances in the fields of equivariance and graph neural networks as well as ideas from belief propagation and empirical potential functions such as Eq. 1. 2. Theoretically principled orthogonal basis representations based on spherical Bessel functions and spherical harmonics. Bessel functions achieve better performance than Gaussian radial basis functions while reducing the radial basis dimensionality by $4 \mathbf { x }$ or more. 3. The Directional Message Passing Neural Network (DimeNet): A novel GNN that leverages these innovations to set the new state of the art for molecular predictions and is suitable both for predicting molecular properties and for molecular dynamics simulations.
24
+
25
+ # 2 RELATED WORK
26
+
27
+ ML for molecules. The classical way of using machine learning for predicting molecular properties is combining an expressive, hand-crafted representation of the atomic neighborhood (Bartók et al., 2013) with Gaussian processes (Bartók et al., 2010; 2017; Chmiela et al., 2017) or neural networks (Behler & Parrinello, 2007). Recently, these methods have largely been superseded by graph neural networks, which do not require any hand-crafted features but learn representations solely based on the atom types and coordinates molecules (Duvenaud et al., 2015; Gilmer et al., 2017; Schütt et al., 2017; Hy et al., 2018; Unke & Meuwly, 2019). Our proposed message embeddings can also be interpreted as directed edge embeddings or embeddings on the line graph (Chen et al., 2019b). (Undirected) edge embeddings have already been used in previous GNNs for molecules (Jørgensen et al., 2018; Chen et al., 2019a). However, these GNNs use both node and edge embeddings and do not leverage any directional information.
28
+
29
+ Graph neural networks. GNNs were first proposed in the 90s (Baskin et al., 1997; Sperduti & Starita, 1997) and 00s (Gori et al., 2005; Scarselli et al., 2009). General GNNs have been largely inspired by their application to molecular graphs and have started to achieve breakthrough performance in various tasks at around the same time the molecular variants did (Kipf & Welling, 2017; Gasteiger et al., 2019; Zambaldi et al., 2019). Some recent progress has been focused on GNNs that are more powerful than the 1-Weisfeiler-Lehman test of isomorphism (Morris et al., 2019; Maron et al., 2019). However, for molecular predictions these models are significantly outperformed by GNNs focused on molecules (see Sec. 7). Some recent GNNs have incorporated directional information by considering the change in local coordinate systems per atom (Ingraham et al., 2019). However, this approach breaks permutation invariance and is therefore only applicable to chain-like molecules (e.g. proteins).
30
+
31
+ Equivariant neural networks. Group equivariance as a principle of modern machine learning was first proposed by Cohen & Welling (2016). Following work has generalized this principle to spheres (Cohen et al., 2018), molecules (Thomas et al., 2018), volumetric data (Weiler et al., 2018), and general manifolds (Cohen et al., 2019). Equivariance with respect to continuous rotations has been achieved so far by switching back and forth between Fourier and coordinate space in each layer (Cohen et al., 2018) or by using a fully Fourier space model (Kondor et al., 2018; Anderson et al., 2019). The former introduces major computational overhead and the latter imposes significant constraints on model construction, such as the inability of using non-linearities. Our proposed solution does not suffer from either of those limitations.
32
+
33
+ # 3 REQUIREMENTS FOR MOLECULAR PREDICTIONS
34
+
35
+ In recent years machine learning has been used to predict a wide variety of molecular properties, both low-level quantum mechanical properties such as potential energy, energy of the highest occupied molecular orbital (HOMO), and the dipole moment and high-level properties such as toxicity, permeability, and adverse drug reactions $\mathrm { W u }$ et al., 2018). In this work we will focus on scalar regression targets, i.e. targets $t \in \mathbb { R }$ . A molecule is uniquely defined by the atomic numbers $z = \{ z _ { 1 } , \ldots , z _ { N } \}$ and positions $\pmb { X } = \{ \pmb { x } _ { 1 } , \ldots , \pmb { x } _ { N } \}$ . Some models additionally use auxiliary information $\Theta$ such as bond types or electronegativity of the atoms. We do not include auxiliary features in this work since they are hand-engineered and non-essential. In summary, we define an ML model for molecular prediction with parameters $\theta$ via $f _ { \theta } : \{ X , z \} \to \mathbb { R }$ .
36
+
37
+ Symmetries and invariances. All molecular predictions must obey some basic laws of physics, either explicitly or implicitly. One important example of such are the fundamental symmetries of physics and their associated invariances. In principle, these invariances can be learned by any neural network via corresponding weight matrix symmetries (Ravanbakhsh et al., 2017). However, not explicitly incorporating them into the model introduces duplicate weights and increases training time and complexity. The most essential symmetries are translational and rotational invariance (follows from homogeneity and isotropy), permutation invariance (follows from the indistinguishability of particles), and symmetry under parity, i.e. under sign flips of single spatial coordinates.
38
+
39
+ Molecular dynamics. Additional requirements arise when the model should be suitable for molecular dynamics (MD) simulations and predict the forces ${ \bf \nabla } _ { F _ { i } }$ acting on each atom. The force field is a conservative vector field since it must satisfy conservation of energy (the necessity of which follows from homogeneity of time (Noether, 1918)). The easiest way of defining a conservative vector field is via the gradient of a potential function. We can leverage this fact by predicting a potential instead of the forces and then obtaining the forces via backpropagation to the atom coordinates, i.e. $\begin{array} { r } { F _ { i } ( \boldsymbol { X } , z ) = - \frac { \partial } { \partial x _ { i } } f _ { \theta } ( \boldsymbol { X } , z ) } \end{array}$ . We can even directly incorporate the forces in the training loss and directly train a model for MD simulations (Pukrittayakamee et al., 2009):
40
+
41
+ $$
42
+ \mathcal { L } _ { \mathrm { M D } } ( \mathbf { \boldsymbol { X } } , z ) = \left| f _ { \theta } ( \mathbf { \boldsymbol { X } } , z ) - \hat { t } ( \mathbf { \boldsymbol { X } } , z ) \right| + \frac { \rho } { 3 N } \sum _ { i = 1 } ^ { N } \sum _ { \alpha = 1 } ^ { 3 } \left| - \frac { \partial f _ { \theta } ( \mathbf { \boldsymbol { X } } , z ) } { \partial x _ { i \alpha } } - \hat { F } _ { i \alpha } ( \mathbf { \boldsymbol { X } } , z ) \right| ,
43
+ $$
44
+
45
+ where the target $\hat { t } = \hat { E }$ is the ground-truth energy (usually available as well), $\hat { F }$ are the ground-truth forces, and the hyperparameter $\rho$ sets the forces’ loss weight. For stable simulations ${ \bf \nabla } _ { F _ { i } }$ must be continuously differentiable and the model $f _ { \theta }$ itself therefore twice continuously differentiable. We hence cannot use discontinuous transformations such as ReLU non-linearities. Furthermore, since the atom positions $\boldsymbol { X }$ can change arbitrarily we cannot use pre-computed auxiliary information $\Theta$ such as bond types.
46
+
47
+ # 4 DIRECTIONAL MESSAGE PASSING
48
+
49
+ Graph neural networks. Graph neural networks treat the molecule as a graph, in which the nodes are atoms and edges are defined either via a predefined molecular graph or simply by connecting atoms that lie within a cutoff distance $c$ . Each edge is associated with a pairwise distance between atoms $d _ { i j } = \lVert \pmb { x } _ { i } - \pmb { x } _ { j } \rVert _ { 2 }$ . GNNs implement all of the above physical invariances by construction since they only use pairwise distances and not the full atom coordinates. However, note that a predefined molecular graph or a step function-like cutoff cannot be used for MD simulations since this would introduce discontinuities in the energy landscape. GNNs represent each atom $i$ via an atom embedding $\pmb { h } _ { i } \in \mathbb { R } ^ { H }$ . The atom embeddings are updated in each layer by passing messages along the molecular edges. Messages are usually transformed based on an edge embedding $\mathbf { \boldsymbol { e } } _ { ( i j ) } \in \mathbb { R } ^ { H _ { \mathrm { e } } }$ and summed over the atom’s neighbors ${ \mathcal { N } } _ { i }$ , i.e. the embeddings are updated in layer $l$ via
50
+
51
+ $$
52
+ \pmb { h } _ { i } ^ { ( l + 1 ) } = f _ { \mathrm { u p d a t e } } ( \pmb { h } _ { i } ^ { ( l ) } , \sum _ { j \in \mathcal { N } _ { i } } f _ { \mathrm { i n t } } ( \pmb { h } _ { j } ^ { ( l ) } , \pmb { e } _ { ( i j ) } ^ { ( l ) } ) ) ,
53
+ $$
54
+
55
+ with the update function $f _ { \mathrm { u p d a t e } }$ and the interaction function $f _ { \mathrm { i n t } }$ , which are both commonly implemented using neural networks. The edge embeddings e(l)(ij) usually only depend on the interatomic distances, but can also incorporate additional bond information (Gilmer et al., 2017) or be recursively updated in each layer using the neighboring atom embeddings (Jørgensen et al., 2018).
56
+
57
+ Directionality. In principle, the pairwise distance matrix contains the full geometrical information of the molecule. However, GNNs do not use the full distance matrix since this would mean passing messages globally between all pairs of atoms, which increases computational complexity and can lead to overfitting. Instead, they usually use a cutoff distance $c$ , which means they cannot distinguish between certain molecules (Xu et al., 2019). E.g. at a cutoff of roughly $2 \mathring \mathrm { A }$ a regular GNN would not be able to distinguish between a hexagonal (e.g. Cyclohexane) and two triangular molecules (e.g. Cyclopropane) with the same bond lengths since the neighborhoods of each atom are exactly the same for both (see Appendix, Fig. 6). This problem can be solved by modeling the directions to neighboring atoms instead of just their distances. A principled way of doing so while staying invariant to a transformation group $G$ (such as described in Sec. 3) is via group-equivariance (Cohen & Welling, 2016). A function $f : X \to Y$ is defined as being equivariant if $f \bar { ( } \varphi _ { g } ^ { X } ( x ) ) = \varphi _ { g } ^ { Y } ( f ( x ) )$ , with the group action in the input and output space $\varphi _ { g } ^ { X }$ and $\varphi _ { g } ^ { Y }$ . However, equivariant CNNs only achieve equivariance with respect to a discrete set of rotations (Cohen & Welling, 2016). For a precise prediction of molecular properties we need continuous equivariance with respect to rotations, i.e. to the SO(3) group.
58
+
59
+ Directional embeddings. We solve this problem by noting that an atom by itself is rotationally invariant. This invariance is only broken by neighboring atoms that interact with it, i.e. those inside the cutoff $c$ . Since each neighbor breaks up to one rotational invariance they also introduce additional degrees of freedom, which we need to represent in our model. We can do so by generating a separate embedding $\boldsymbol { m } _ { j i }$ for each atom $i$ and neighbor $j$ by applying the same learned filter in the direction of each neighboring atom (in contrast to equivariant CNNs, which apply filters in fixed, global directions). These directional embeddings are equivariant with respect to global rotations since the associated directions rotate with the molecule and hence conserve the relative directional information between neighbors.
60
+
61
+ Representation via joint 2D basis. We use the directional information associated with each embedding by leveraging the angle $\alpha _ { ( k j , j i ) } = \angle { \pmb x } _ { k } { \pmb x } _ { j } { \pmb x } _ { i }$ when aggregating the neighboring embeddings $m _ { k j }$ of $\mathbf { \nabla } m _ { j i }$ . We combine the angle with the interatomic distance $d _ { k j }$ associated with the incoming message $m _ { k j }$ and jointly represent both in $\pmb { a } _ { \mathrm { S B F } } ^ { ( k j , j i ) } \in \mathbb { R } ^ { N _ { \mathrm { S H B F } } \cdot N _ { \mathrm { S R B F } } }$ using a 2D representation based on spherical Bessel functions and spherical harmonics, as explained in Sec. 5. We empirically found that this basis representation provides a better inductive bias than the raw angle alone. Note that by only using interatomic distances and angles our model becomes invariant to rotations.
62
+
63
+ Message embeddings. The directional embedding $m _ { j i }$ associated with the atom pair $j i$ can be thought of as a message being sent from atom $j$ to atom $i$ . Hence, in analogy to belief propagation, we embed each atom $i$ using a set of incoming messages $\boldsymbol { m } _ { j i }$ , i.e. $\begin{array} { r } { \mathbf { \dot { \Sigma } } \mathbf { h } _ { i } = \sum _ { j \in \mathcal { N } _ { i } } \mathbf { m } _ { j i } } \end{array}$ , and update the message $\mathbf { \nabla } m _ { j i }$ based on the incoming messages $m _ { k j }$ (Yedidia et al., 2003). Hence, as illustrated in Fig. 1, we define the update function and aggregation scheme for message embeddings as
64
+
65
+ $$
66
+ m _ { j i } ^ { ( l + 1 ) } = f _ { \mathrm { u p d a t e } } ( m _ { j i } ^ { ( l ) } , \sum _ { k \in \mathcal { N } _ { j } \backslash \{ i \} } f _ { \mathrm { i n t } } ( m _ { k j } ^ { ( l ) } , e _ { \mathrm { R B F } } ^ { ( j i ) } , a _ { \mathrm { S B F } } ^ { ( k j , j i ) } ) ) ,
67
+ $$
68
+
69
+ ![](images/5cbc1f1807eb8c06323123863c1231cdf2d0f3c65522536869028bf16cc5f1cc.jpg)
70
+ Figure 1: Aggregation scheme for message embeddings.
71
+
72
+ where e(ji)RBF denotes the radial basis function representation of the interatomic distance $d _ { j i }$ , which will be discussed in Sec. 5. We found this aggregation scheme to not only have a nice analogy to belief propagation, but also to empirically perform better than alternatives. Note that since $f _ { \mathrm { i n t } }$ now incorporates the angle between atom pairs, or bonds, we have enabled our model to directly learn the angular potential $E _ { \mathrm { a n g l e } }$ , the second term in Eq. 1. Moreover, the message embeddings are essentially embeddings of atom pairs, as used by the provably more powerful GNNs based on higher-order Weisfeiler-Lehman tests of isomorphism. Our model can therefore provably distinguish molecules that a regular GNN cannot (e.g. the previous example of a hexagonal and two triangular molecules) (Morris et al., 2019).
73
+
74
+ # 5 PHYSICALLY BASED REPRESENTATIONS
75
+
76
+ Representing distances and angles. For the interaction function $f _ { \mathrm { i n t } }$ in Eq. 4 we use a joint representation ${ \pmb a } _ { \mathrm { S B F } } ^ { ( k j , j i ) }$ of the angles $\alpha _ { ( k j , j i ) }$ between message embeddings and the interatomic distances $d _ { k j } = \| \pmb { x } _ { k } - \pmb { x } _ { j } \| _ { 2 }$ , as well as a representation $e _ { \mathrm { R B F } } ^ { ( j i ) }$ of the distances $d _ { j i }$ . Earlier works have used a set of Gaussian radial basis functions to represent interatomic distances, with tightly spaced means that are distributed e.g. uniformly (Schütt et al., 2017) or exponentially (Unke & Meuwly, 2019). Similar in spirit to the functional bases used by steerable CNNs (Cohen & Welling, 2017; Cheng et al., 2019) we propose to use an orthogonal basis instead, which reduces redundancy and thus improves parameter efficiency. Furthermore, a basis chosen according to the properties of the modeled system can even provide a helpful inductive bias. We therefore derive a proper basis representation for quantum systems next.
77
+
78
+ From Schrödinger to Fourier-Bessel. To construct a basis representation in a principled manner we first consider the space of possible solutions. Our model aims at approximating results of density functional theory (DFT) calculations, i.e. results given by an electron density $\bar { \langle \Psi ( d ) | \Psi ( d ) \rangle }$ , with the electron wave function $\Psi ( d )$ and $\pmb { d } = \pmb { x } _ { k } - \pmb { x } _ { j }$ . The solution space of $\Psi ( d )$ is defined by the time-independent Schrödinger equation − \~22m ∇2 + V (d) Ψ(d) = EΨ(d), with constant mass $m$ and energy $E$ . We do not know the potential $V ( d )$ and so choose it in an uninformative way by simply setting it to 0 inside the cutoff distance $c$ (up to which we pass messages between atoms) and to $\infty$ outside. Hence, we arrive at the Helmholtz equation $( \nabla ^ { 2 } \dot { + } k ^ { 2 } ) \Psi ( \mathbfit { d } ) \dot { = } 0$ , with the wave number $\begin{array} { r } { k = \frac { \sqrt { 2 m E } } { \hbar } } \end{array}$ and the boundary condition $\Psi ( c ) = 0$ at the cutoff $c$ . Separation of variables in polar coordinates $( d , \alpha , \varphi )$ yields the solution (Griffiths & Schroeter, 2018)
79
+
80
+ $$
81
+ \Psi ( d , \alpha , \varphi ) = \sum _ { l = 0 } ^ { \infty } \sum _ { m = - l } ^ { l } ( a _ { l m } j _ { l } ( k d ) + b _ { l m } y _ { l } ( k d ) ) Y _ { l } ^ { m } ( \alpha , \varphi ) ,
82
+ $$
83
+
84
+ with the spherical Bessel functions of the first and second kind $j _ { l }$ and $y _ { l }$ and the spherical harmonics $Y _ { l } ^ { m }$ . As common in physics we only use the regular solutions, i.e. those that do not approach $- \infty$ at the origin, and hence set $b _ { l m } = 0$ . Recall that our first goal is to construct a joint 2D basis for $d _ { k j }$ and $\alpha _ { ( k j , j i ) }$ , i.e. a function that depends on $d$ and a single angle $\alpha$ . To achieve this we set $m = 0$ and obtain $\begin{array} { r } { \Psi _ { \mathrm { S B F } } ( d , \alpha ) = \bar { \sum _ { l } } a _ { l } j _ { l } \bar { ( k d ) } Y _ { l } ^ { 0 } ( \alpha ) } \end{array}$ . The boundary conditions are satisfied by setting Bessel function, w $k = \begin{array} { l } { { z _ { l n } } } \\ { { c } } \end{array}$ , where precom $z _ { l n }$ is the ed nu $n$ -th root of the rically. Norm $l$ -orderlizing $\Psi _ { \mathrm { S B F } }$ inside the cutoff distance $c$ yields the 2D spherical Fourier-Bessel basi s a˜(kj,ji)SBF ∈ RNSHBF·NSRBF , which is illustrated in Fig. 2 and defined by
85
+
86
+ $$
87
+ \tilde { a } _ { \mathrm { S B F } , l n } ( d , \alpha ) = \sqrt { \frac { 2 } { c ^ { 3 } j _ { l + 1 } ^ { 2 } ( z _ { l n } ) } } j _ { l } ( \frac { z _ { l n } } { c } d ) Y _ { l } ^ { 0 } ( \alpha ) ,
88
+ $$
89
+
90
+ ![](images/9bfd692768e72e48fefe61b96319789e624f4cae228cbcdf4602b85b9890770c.jpg)
91
+ Figure 2: 2D spherical Fourier-Bessel basis $\tilde { a } _ { \mathrm { S B F } , l n } ( d , \alpha )$ .
92
+
93
+ with $l \in [ 0 . . N _ { \mathrm { S H B F } } - 1 ]$ and $n \in [ 1 . . N _ { \mathrm { S R B F } } ]$ . Our second goal is constructing a radial basis for $d _ { j i }$ , i.e. a function that solely depends on $d$ and not on the angles $\alpha$ and $\varphi$ . We achieve this by setting $l =$ $m = 0$ and obtain $\begin{array} { r } { \Psi _ { \mathrm { R B F } } ( d ) = a j _ { 0 } ( \frac { z _ { 0 , n } } { c } d ) } \end{array}$ , with roots at $z _ { 0 , n } = n \pi$ Normalizing this function on $[ 0 , c ]$ and using $j _ { 0 } ( d ) = \sin ( d ) / d$ gives the radial basis $\tilde { e } _ { \mathrm { R B F } } \in \mathbb { R } ^ { N _ { \mathrm { R B F } } }$ , as shown in Fig. 3 and defined by
94
+
95
+ $$
96
+ \tilde { e } _ { \mathrm { R B F } , n } ( d ) = \sqrt { \frac { 2 } { c } } \frac { \sin ( \frac { n \pi } { c } d ) } { d } ,
97
+ $$
98
+
99
+ ![](images/3af00214c450e203cf18c3b37377201b4283ec4fea4c7edfdad1e045f3947daa.jpg)
100
+ Figure 3: Radial Bessel basis for $N _ { \mathrm { R B F } } = 5$ .
101
+
102
+ with $n \in [ 1 \ldots N _ { \mathrm { R B F } } ]$ . Both of these bases are purely real-valued and orthogonal in the domain of interest. They furthermore enable us to bound the highest-frequency components by $\begin{array} { r } { \omega _ { \alpha } \leq \frac { N _ { \mathrm { S H B F } } } { 2 \pi } } \end{array}$ , $\begin{array} { r } { \omega _ { d _ { k j } } \ \leq \ \frac { N _ { \mathrm { S R B F } } } { c } } \end{array}$ , and $\begin{array} { r } { \omega _ { d _ { j i } } \leq \frac { N _ { \mathrm { R B F } } } { c } } \end{array}$ . This restriction is an effective way of regularizing the model and ensures that predictions are stable to small perturbations. We found $N _ { \mathrm { S R B F } } = 6$ and $N _ { \mathrm { R B F } } = 1 6$ radial basis functions to be more than sufficient. Note that $N _ { \mathrm { R B F } }$ is $_ { 4 \mathrm { X } }$ lower than PhysNet’s 64 (Unke & Meuwly, 2019) and $2 0 \mathrm { x }$ lower than SchNet’s 300 radial basis functions (Schütt et al., 2017).
103
+
104
+ Continuous cutoff. $\tilde { \mathbf { \pmb { a } } } _ { \mathrm { S B F } } ^ { ( k j , j i ) }$ and $\tilde { e } _ { \mathrm { R B F } } ( d )$ are not twice continuously differentiable due to the step function cutoff at $c$ . To alleviate this problem we introduce an envelope function $u ( d )$ that has a root of multiplicity 3 at $d = c$ , causing the final functions $\begin{array} { r } { { \pmb a } _ { \mathrm { R B F } } ( d ) = \bar { u ( d ) } \tilde { \pmb a } _ { \mathrm { R B F } } ( d ) } \end{array}$ and $e _ { \mathrm { R B F } } ( d ) =$ $u ( d ) \tilde { e } _ { \mathrm { R B F } } ( d )$ and their first and second derivatives to go to 0 at the cutoff. We achieve this with the polynomial
105
+
106
+ ![](images/2d3f962458bbdcdec53d95c5a2b9d8bd02b3e0874d7a3dbcf8a3d016258dcbfc.jpg)
107
+ Figure 4: The DimeNet architecture. $\boxed { \begin{array} { r l } \end{array} }$ denotes the layer’s input and $\parallel$ denotes concatenation. The distances $d _ { j i }$ are represented using spherical Bessel functions and the distances $d _ { k j }$ and angles $\alpha _ { ( k j , j i ) }$ are jointly represented using a 2D spherical Fourier-Bessel basis. An embedding block generates the inital message embeddings $\mathbf { \nabla } m _ { j i }$ . These embeddings are updated in multiple interaction blocks via directional message passing, which uses the neighboring messages $m _ { k j } ^ { - } , k \in \mathcal { N } _ { j } \setminus \{ i \}$ , the 2D representations a(kj,jSBF , and the distance representations $e _ { \mathrm { R B F } } ^ { ( j i ) }$ . Each block passes the resulting embeddings to an output block, which transforms them using the radial basis $e _ { \mathrm { R B F } } ^ { ( j i ) }$ and sums them up per atom. Finally, the outputs of all layers are summed up to generate the prediction.
108
+
109
+ $$
110
+ u ( d ) = 1 - { \frac { ( p + 1 ) ( p + 2 ) } { 2 } } d ^ { p } + p ( p + 2 ) d ^ { p + 1 } - { \frac { p ( p + 1 ) } { 2 } } d ^ { p + 2 } ,
111
+ $$
112
+
113
+ where $p \in { \mathbb { N } } _ { 0 }$ . We did not find the model to be sensitive to different choices of envelope functions and choose $p = 6$ . Note that using an envelope function causes the bases to lose their orthonormality, which we did not find to be a problem in practice. We furthermore fine-tune the Bessel wave numbers $\begin{array} { r } { k _ { n } = \frac { n \pi } { c } } \end{array}$ used in give a s $\tilde { e } _ { \mathrm { R B F } } \in \mathbb { R } ^ { N _ { \mathrm { R B F } } ^ { \bullet } }$ via backpropagation after initializing them to these values, which werediction accuracy.
114
+
115
+ # 6 DIRECTIONAL MESSAGE PASSING NEURAL NETWORK (DIMENET)
116
+
117
+ The Directional Message Passing Neural Network’s (DimeNet) design is based on a streamlined version of the PhysNet architecture (Unke & Meuwly, 2019), in which we have integrated directional message passing and spherical Fourier-Bessel representations. DimeNet generates predictions that are invariant to atom permutations and translation, rotation and inversion of the molecule. DimeNet is suitable both for the prediction of various molecular properties and for molecular dynamics (MD) simulations. It is twice continuously differentiable and able to learn and predict atomic forces via backpropagation, as described in Sec. 3. The predicted forces fulfill energy conservation by construction and are equivariant with respect to permutation and rotation. Model differentiability in combination with basis representations that have bounded maximum frequencies furthermore guarantees smooth predictions that are stable to small deformations. Fig. 4 gives an overview of the architecture.
118
+
119
+ Embedding block. Atomic numbers are represented by learnable, randomly initialized atom type embeddings ${ \bf \Delta } _ { h _ { i } ^ { ( 0 ) } } \in \mathbb { R } ^ { F }$ that are shared across molecules. The first layer generates message embeddings from these and the distance between atoms via
120
+
121
+ $$
122
+ \begin{array} { r } { { \pmb m } _ { j i } ^ { ( 1 ) } = \sigma ( [ { \pmb h } _ { j } ^ { ( 0 ) } { \| { \pmb h } _ { i } ^ { ( 0 ) } \| } e _ { \mathrm { R B F } } ^ { ( j i ) } ] { \pmb W } + b ) , } \end{array}
123
+ $$
124
+
125
+ where $\parallel$ denotes concatenation and the weight matrix $W$ and bias $^ { b }$ are learnable.
126
+
127
+ Table 1: MAE on QM9. DimeNet sets the state of the art on 11 targets, outperforming the second-best model on average by $3 1 \%$ (mean std. MAE).
128
+
129
+ <table><tr><td>Target</td><td>Unit</td><td>PPGN</td><td>SchNet</td><td>PhysNet</td><td>MEGNet-s</td><td>Cormorant</td><td>DimeNet</td></tr><tr><td>μ</td><td>D</td><td>0.047</td><td>0.033</td><td>0.0529</td><td>0.05</td><td>0.13</td><td>0.0286</td></tr><tr><td>α</td><td>a03</td><td>0.131</td><td>0.235</td><td>0.0615</td><td>0.081</td><td>0.092</td><td>0.0469</td></tr><tr><td>EHOMO</td><td>meV</td><td>40.3</td><td>41</td><td>32.9</td><td>43</td><td>36</td><td>27.8</td></tr><tr><td>ELUMO</td><td>meV</td><td>32.7</td><td>34</td><td>24.7</td><td>44</td><td>36</td><td>19.7</td></tr><tr><td>△E</td><td>meV</td><td>60.0</td><td>63</td><td>42.5</td><td>66</td><td>60</td><td>34.8</td></tr><tr><td>(R²)</td><td>a02</td><td>0.592</td><td>0.073</td><td>0.765</td><td>0.302</td><td>0.673</td><td>0.331</td></tr><tr><td>ZPVE</td><td>meV</td><td>3.12</td><td>1.7</td><td>1.39</td><td>1.43</td><td>1.98</td><td>1.29</td></tr><tr><td>Uo</td><td>meV</td><td>36.8</td><td>14</td><td>8.15</td><td>12</td><td>28</td><td>8.02</td></tr><tr><td>U</td><td>meV</td><td>36.8</td><td>19</td><td>8.34</td><td>13</td><td>-</td><td>7.89</td></tr><tr><td>H</td><td>meV</td><td>36.3</td><td>14</td><td>8.42</td><td>12</td><td>-</td><td>8.11</td></tr><tr><td>G</td><td>meV cal</td><td>36.4</td><td>14</td><td>9.40</td><td>12</td><td>-</td><td>8.98</td></tr><tr><td>Cv</td><td>molK</td><td>0.055</td><td>0.033</td><td>0.0280</td><td>0.029</td><td>0.031</td><td>0.0249</td></tr><tr><td>std. MAE logMAE</td><td>%</td><td>1.84 -4.64</td><td>1.76 -5.17</td><td>1.37 -5.35</td><td>1.80 -5.17</td><td>2.14 -4.75</td><td>1.05 -5.57</td></tr></table>
130
+
131
+ Interaction block. The embedding block is followed by multiple stacked interaction blocks. This block implements $f _ { \mathrm { i n t } }$ and $f _ { \mathrm { u p d a t e } }$ of Eq. 4 as shown in Fig. 4. Note that the 2D representation ${ \pmb a } _ { \mathrm { S B F } } ^ { ( k j , j i ) }$ is first transformed into an $N _ { \mathrm { b i l i n e a r } }$ -dimensional representation via a linear layer. The main purpose of this is to make the dimensionality of a(kj,jSBF independent of the subsequent bilinear layer, which uses a comparatively large $N _ { \mathrm { b i l i n e a r } } \times F \times \ddot { F } .$ -dimensional weight tensor. We have also experimented with using a bilinear layer for the radial basis representation, but found that the element-wise multiplication e(ji)RBFW mkj performs better, which suggests that the 2D representations require more complex transformations than radial information alone. The interaction block transforms each message embedding $\mathbf { \nabla } m _ { j i }$ using multiple residual blocks, which are inspired by ResNet (He et al., 2016) and consist of two stacked dense layers and a skip connection.
132
+
133
+ Output block. The message embeddings after each block (including the embedding block) are passed to an output block. The output block transforms each message embedding $\boldsymbol { m } _ { j i }$ using the radial basis $e _ { \mathrm { R B F } } ^ { ( j i ) }$ , which ensures continuous differentiability and slightly improves performance. Afterwards the incoming messages are summed up per atom $i$ to obtain $\begin{array} { r } { \pmb { h } _ { i } = \sum _ { j } \pmb { m } _ { j i } } \end{array}$ , which is then transformed using multiple dense layers to generate the atom-wise output $t _ { i } ^ { ( l ) }$ . These outputs are then summed up to obtain the final prediction $t = \Sigma _ { i } \Sigma _ { l } t _ { i } ^ { ( l ) }$ .
134
+
135
+ Continuous differentiability. Multiple model choices were necessary to achieve twice continuous model differentiability. First, DimeNet uses the self-gated Swish activation function $\sigma ( x ) = x$ · sigmoid $( x )$ (Ramachandran et al., 2018) instead of a regular ReLU activation function. Second, we multiply the radial basis functions $\tilde { e } _ { \mathrm { R B F } } ( d )$ with an envelope function $u ( d )$ that has a root of multiplicity 3 at the cutoff $c$ . Finally, DimeNet does not use any auxiliary data but relies on atom types and positions alone.
136
+
137
+ # 7 EXPERIMENTS
138
+
139
+ Models. For hyperparameter choices and training setup see Appendix B. We use 6 state-of-theart models for comparison: SchNet (Schütt et al., 2017), PhysNet (results based on the reference implementation) (Unke & Meuwly, 2019), provably powerful graph networks (PPGN, results provided by the original authors) (Maron et al., 2019), MEGNet-simple (without auxiliary information) (Chen et al., 2019a), Cormorant (Anderson et al., 2019), and symmetrized gradient-domain machine learning (sGDML) (Chmiela et al., 2018). Note that sGDML cannot be used for QM9 since it can only be trained on a single molecule.
140
+
141
+ QM9. We test DimeNet’s performance for predicting molecular properties using the common QM9 benchmark (Ramakrishnan et al., 2014). It consists of roughly 130 000 molecules in equilibrium with up to 9 heavy C, O, N, and F atoms. We use 110 000 molecules in the training, 10 000 in the validation and $1 0 8 3 1$ in the test set. We only use the atomization energy for $U _ { 0 }$ , $U , H$ , and $G$ , i.e. subtract the atomic reference energies, which are constant per atom type, and perform the training using eV. In Table 1 we report the mean absolute error (MAE) of each target and the overall mean standardized MAE (std. MAE) and mean standardized logMAE (for details see Appendix C). We predict $\Delta \epsilon$ simply by taking $\epsilon _ { \mathrm { L U M O } } - \epsilon _ { \mathrm { H O M O } }$ , since it is calculated in exactly this way by DFT calculations. We train a separate model for each target, which significantly improves results compared to training a single shared model for all targets (see App. E). DimeNet sets the new state of the art on 11 out of 12 targets and decreases mean std. MAE by $3 1 \%$ and mean logMAE by 0.22 compared to the second-best model.
142
+
143
+ Table 2: MAE on MD17 using 1000 training samples (energies in $\frac { \mathrm { k c a l } } { \mathrm { m o l } }$ , forces in $\frac { \mathrm { k c a l } } { \mathrm { m o l } \mathrm { \AA } } .$ ). DimeNet outperforms SchNet by a large margin and performs roughly on par with sGDML.
144
+
145
+ <table><tr><td colspan="2"></td><td>sGDML</td><td>SchNet</td><td>DimeNet</td></tr><tr><td rowspan="2">Aspirin</td><td>Energy</td><td>0.19</td><td>0.37</td><td>0.204</td></tr><tr><td>Forces</td><td>0.68</td><td>1.35</td><td>0.499</td></tr><tr><td rowspan="2">Benzene</td><td>Energy</td><td>0.10</td><td>0.08</td><td>0.078</td></tr><tr><td>Forces</td><td>0.06</td><td>0.31</td><td>0.187</td></tr><tr><td rowspan="2">Ethanol</td><td>Energy</td><td>0.07</td><td>0.08</td><td>0.064</td></tr><tr><td>Forces</td><td>0.33</td><td>0.39</td><td>0.230</td></tr><tr><td rowspan="2">Malonaldehyde</td><td>Energy</td><td>0.10</td><td>0.13</td><td>0.104</td></tr><tr><td>Forces</td><td>0.41</td><td>0.66</td><td>0.383</td></tr><tr><td rowspan="2">Naphthalene</td><td>Energy</td><td>0.12</td><td>0.16</td><td>0.122</td></tr><tr><td>Forces</td><td>0.11</td><td>0.58</td><td>0.215</td></tr><tr><td rowspan="2">Salicylic acid</td><td>Energy</td><td>0.12</td><td>0.20</td><td>0.134</td></tr><tr><td>Forces</td><td>0.28</td><td>0.85</td><td>0.374</td></tr><tr><td rowspan="2">Toluene</td><td>Energy</td><td>0.10</td><td>0.12</td><td>0.102</td></tr><tr><td>Forces</td><td>0.14</td><td>0.57</td><td>0.216</td></tr><tr><td rowspan="2">Uracil</td><td>Energy</td><td>0.11</td><td>0.14</td><td>0.115</td></tr><tr><td>Forces</td><td>0.24</td><td>0.56</td><td>0.301</td></tr><tr><td rowspan="2">std. MAE (%)</td><td>Energy</td><td>2.53</td><td>3.32</td><td>2.49</td></tr><tr><td>Forces</td><td>1.01</td><td>2.38</td><td>1.10</td></tr></table>
146
+
147
+ ![](images/b1759bc30827d4f0f05c5947d535b91cab9125f993b7ca465a440c43c8fb641c.jpg)
148
+ Figure 5: Examples of DimeNet filters. They exhibit a clear 2D structure. For details see Appendix D.
149
+
150
+ Table 3: Ablation studies using multi-task learning on QM9. All of our contributions have a significant impact on performance.
151
+
152
+ <table><tr><td>Variation</td><td>MAE MAEDimeNet</td><td>△logMAE</td></tr><tr><td>GaussianRBF</td><td>110%</td><td>0.10</td></tr><tr><td>NSHBF =1</td><td>126%</td><td>0.11</td></tr><tr><td>Node embeddings</td><td>168%</td><td>0.45</td></tr></table>
153
+
154
+ MD17. We use MD17 (Chmiela et al., 2017) to test model performance in molecular dynamics simulations. The goal of this benchmark is predicting both the energy and atomic forces of eight small organic molecules, given the atom coordinates of the thermalized (i.e. non-equilibrium, slightly moving) system. The ground truth data is computed via molecular dynamics simulations using DFT. A separate model is trained for each molecule, with the goal of providing highly accurate individual predictions. This dataset is commonly used with $5 0 0 0 0$ training and $1 0 0 0 0$ validation and test samples. We found that DimeNet can match state-of-the-art performance in this setup. E.g. for Benzene, depending on the force weight $\rho$ , DimeNet achieves $0 . 0 { \dot { 3 } } 5 \mathrm { k c a l m o l ^ { - 1 } }$ MAE for the energy or $0 . 0 7 \mathrm { k c a l m o l ^ { - 1 } }$ and $0 . 1 7 \mathrm { k c a l m o l ^ { - 1 } \mathring { A } ^ { - 1 } }$ for energy and forces, matching the results reported by Anderson et al. (2019) and Unke & Meuwly (2019). However, this accuracy is two orders of magnitude below the DFT calculation’s accuracy (approx. $2 . 3 \mathrm { k c a l m o l ^ { - 1 } }$ for energy (Faber et al., 2017)), so any remaining difference to real-world data is almost exclusively due to errors in the DFT simulation. Truly reaching better accuracy can therefore only be achieved with more precise ground-truth data, which requires far more expensive methods (e.g. CCSD(T)) and thus ML models that are more sample-efficient (Chmiela et al., 2018). We therefore instead test our model on the harder task of using only 1000 training samples. As shown in Table 2 DimeNet outperforms SchNet by a large margin and performs roughly on par with sGDML. However, sGDML uses hand-engineered descriptors that provide a strong advantage for small datasets, can only be trained on a single molecule (a fixed set of atoms), and does not scale well with the number of atoms or training samples.
155
+
156
+ Ablation studies. To test whether directional message passing and the Fourier-Bessel basis are the actual reason for DimeNet’s improved performance, we ablate them individually and compare the mean standardized MAE and logMAE for multi-task learning on QM9. Table 3 shows that both of our contributions have a significant impact on the model��s performance. Using 64 Gaussian RBFs instead of 16 and 6 Bessel basis functions to represent $d _ { j i }$ and $d _ { k j }$ increases the error by $1 0 \%$ , which shows that this basis does not only reduce the number of parameters but additionally provides a helpful inductive bias. DimeNet’s error increases by around $2 6 \%$ when we ignore the angles between messages by setting $N _ { \mathrm { S H B F } } = 1$ , showing that directly incorporating directional information does indeed improve performance. Using node embeddings instead of message embeddings (and hence also ignoring directional information) has the largest impact and increases MAE by $6 8 \%$ , at which point DimeNet performs worse than SchNet. Furthermore, Fig. 5 shows that the filters exhibit a structurally meaningful dependence on both the distance and angle. For example, some of these filters are clearly being activated by benzene rings ( $1 2 0 ^ { \circ }$ angle, $1 . 3 9 \bar { \mathrm { A } }$ distance). This further demonstrates that the model learns to leverage directional information.
157
+
158
+ # 8 CONCLUSION
159
+
160
+ In this work we have introduced directional message passing, a more powerful and expressive interaction scheme for molecular predictions. Directional message passing enables graph neural networks to leverage directional information in addition to the interatomic distances that are used by normal GNNs. We have shown that interatomic distances can be represented in a principled and effective manner using spherical Bessel functions. We have furthermore shown that this representation can be extended to directional information by leveraging 2D spherical Fourier-Bessel basis functions. We have leveraged these innovations to construct DimeNet, a GNN suitable both for predicting molecular properties and for use in molecular dynamics simulations. We have demonstrated DimeNet’s performance on QM9 and MD17 and shown that our contributions are the essential ingredients that enable DimeNet’s state-of-the-art performance. DimeNet directly models the first two terms in Eq. 1, which are known as the important “hard” degrees of freedom in molecules (Leach, 2001). Future work should aim at also incorporating the third and fourth terms of this equation. This could improve predictions even further and enable the application to molecules much larger than those used in common benchmarks like QM9.
161
+
162
+ # ACKNOWLEDGMENTS
163
+
164
+ This research was supported by the German Federal Ministry of Education and Research (BMBF), grant no. 01IS18036B, and by the Deutsche Forschungsgemeinschaft (DFG) through the Emmy Noether grant GU 1409/2-1 and the TUM International Graduate School of Science and Engineering (IGSSE), GSC 81. The authors of this work take full responsibilities for its content.
165
+
166
+ # REFERENCES
167
+
168
+ Brandon M. Anderson, Truong-Son Hy, and Risi Kondor. Cormorant: Covariant Molecular Neural Networks. In NeurIPS, 2019.
169
+ Albert P. Bartók, Mike C. Payne, Risi Kondor, and Gábor Csányi. Gaussian Approximation Potentials: The Accuracy of Quantum Mechanics, without the Electrons. Physical Review Letters, 104(13): 136403, April 2010.
170
+ Albert P. Bartók, Risi Kondor, and Gábor Csányi. On representing chemical environments. Physical Review B, 87(18):184115, May 2013.
171
+ Albert P. Bartók, Sandip De, Carl Poelking, Noam Bernstein, James R. Kermode, Gábor Csányi, and Michele Ceriotti. Machine learning unifies the modeling of materials and molecules. Science Advances, 3(12):e1701816, December 2017.
172
+ Igor I. Baskin, Vladimir A. Palyulin, and Nikolai S. Zefirov. A Neural Device for Searching Direct Correlations between Structures and Properties of Chemical Compounds. Journal of Chemical Information and Computer Sciences, 37(4):715–721, July 1997.
173
+ Jörg Behler and Michele Parrinello. Generalized Neural-Network Representation of HighDimensional Potential-Energy Surfaces. Physical Review Letters, 98(14):146401, April 2007.
174
+ Chi Chen, Weike Ye, Yunxing Zuo, Chen Zheng, and Shyue Ping Ong. Graph Networks as a Universal Machine Learning Framework for Molecules and Crystals. Chemistry of Materials, 31 (9):3564–3572, May 2019a.
175
+
176
+ Zhengdao Chen, Lisha Li, and Joan Bruna. Supervised Community Detection with Line Graph Neural Networks. In ICLR, 2019b.
177
+
178
+ Xiuyuan Cheng, Qiang Qiu, A. Robert Calderbank, and Guillermo Sapiro. RotDCF: Decomposition of Convolutional Filters for Rotation-Equivariant Deep Networks. In ICLR, 2019.
179
+
180
+ Stefan Chmiela, Alexandre Tkatchenko, Huziel E. Sauceda, Igor Poltavsky, Kristof T. Schütt, and Klaus-Robert Müller. Machine learning of accurate energy-conserving molecular force fields. Science Advances, 3(5):e1603015, May 2017.
181
+
182
+ Stefan Chmiela, Huziel E. Sauceda, Klaus-Robert Müller, and Alexandre Tkatchenko. Towards exact molecular dynamics simulations with machine-learned force fields. Nature Communications, 9(1): 1–10, September 2018.
183
+
184
+ Taco Cohen and Max Welling. Group Equivariant Convolutional Networks. In ICML, 2016.
185
+
186
+ Taco Cohen, Maurice Weiler, Berkay Kicanaoglu, and Max Welling. Gauge Equivariant Convolutional Networks and the Icosahedral CNN. In ICML, 2019.
187
+
188
+ Taco S. Cohen and Max Welling. Steerable CNNs. In ICLR, 2017.
189
+
190
+ Taco S. Cohen, Mario Geiger, Jonas Köhler, and Max Welling. Spherical CNNs. In ICLR, 2018.
191
+
192
+ David K. Duvenaud, Dougal Maclaurin, Jorge Aguilera-Iparraguirre, Rafael Gómez-Bombarelli, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P. Adams. Convolutional Networks on Graphs for Learning Molecular Fingerprints. In NIPS, 2015.
193
+
194
+ Felix A. Faber, Luke Hutchison, Bing Huang, Justin Gilmer, Samuel S. Schoenholz, George E. Dahl, Oriol Vinyals, Steven Kearnes, Patrick F. Riley, and O. Anatole von Lilienfeld. Machine learning prediction errors better than DFT accuracy. CoRR, 1702.05532, February 2017.
195
+
196
+ Johannes Gasteiger, Aleksandar Bojchevski, and Stephan Günnemann. Predict then Propagate: Graph Neural Networks Meet Personalized PageRank. In ICLR, 2019.
197
+
198
+ Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural Message Passing for Quantum Chemistry. In ICML, 2017.
199
+
200
+ M. Gori, G. Monfardini, and F. Scarselli. A new model for learning in graph domains. In IEEE International Joint Conference on Neural Networks, July 2005.
201
+
202
+ David J. Griffiths and Darrell F. Schroeter. Introduction to Quantum Mechanics. 3 edition, August 2018.
203
+
204
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In CVPR, 2016.
205
+
206
+ Truong Son Hy, Shubhendu Trivedi, Horace Pan, Brandon M. Anderson, and Risi Kondor. Predicting molecular properties with covariant compositional networks. The Journal of Chemical Physics, 148(24):241745, June 2018.
207
+
208
+ John Ingraham, Vikas K. Garg, Regina Barzilay, and Tommi S. Jaakkola. Generative Models for Graph-Based Protein Design. In ICLR workshop, 2019.
209
+
210
+ Peter Bjørn Jørgensen, Karsten Wedel Jacobsen, and Mikkel N. Schmidt. Neural Message Passing with Edge Updates for Predicting Properties of Molecules and Materials. CoRR, 1806.03146, 2018.
211
+
212
+ Thomas N. Kipf and Max Welling. Semi-Supervised Classification with Graph Convolutional Networks. In ICLR, 2017.
213
+
214
+ Risi Kondor, Zhen Lin, and Shubhendu Trivedi. Clebsch-Gordan Nets: a Fully Fourier Space Spherical Convolutional Neural Network. In NeurIPS, 2018.
215
+
216
+ Andrew R. Leach. Molecular Modelling: Principles and Applications. 2001.
217
+
218
+ Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably Powerful Graph Networks. In NeurIPS, 2019.
219
+
220
+ Christopher Morris, Martin Ritzert, Matthias Fey, William L. Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and Leman Go Neural: Higher-Order Graph Neural Networks. In AAAI, 2019.
221
+
222
+ Emmy Noether. Invariante Variationsprobleme. Nachrichten von der Gesellschaft der Wissenschaften zu Göttingen, Mathematisch-Physikalische Klasse, 1918:235–257, 1918.
223
+
224
+ A. Pukrittayakamee, M. Malshe, M. Hagan, L. M. Raff, R. Narulkar, S. Bukkapatnum, and R. Komanduri. Simultaneous fitting of a potential-energy surface and its corresponding force fields using feedforward neural networks. The Journal of Chemical Physics, 130(13):134101, April 2009.
225
+
226
+ Prajit Ramachandran, Barret Zoph, and Quoc V. Le. Searching for Activation Functions. In ICLR workshop, 2018.
227
+
228
+ Raghunathan Ramakrishnan, Pavlo O. Dral, Matthias Rupp, and O. Anatole von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific Data, 1(1):1–7, August 2014.
229
+
230
+ Siamak Ravanbakhsh, Jeff G. Schneider, and Barnabás Póczos. Equivariance Through ParameterSharing. In ICML, 2017.
231
+
232
+ Sashank J. Reddi, Satyen Kale, and Sanjiv Kumar. On the Convergence of Adam and Beyond. In ICLR, 2018.
233
+
234
+ F. Scarselli, M. Gori, Ah Chung Tsoi, M. Hagenbuchner, and G. Monfardini. The Graph Neural Network Model. IEEE Transactions on Neural Networks, 20(1):61–80, January 2009.
235
+
236
+ Kristof Schütt, Pieter-Jan Kindermans, Huziel Enoc Sauceda Felix, Stefan Chmiela, Alexandre Tkatchenko, and Klaus-Robert Müller. SchNet: A continuous-filter convolutional neural network for modeling quantum interactions. In NIPS, 2017.
237
+
238
+ A. Sperduti and A. Starita. Supervised neural networks for the classification of structures. IEEE Transactions on Neural Networks, 8(3):714–735, May 1997.
239
+
240
+ Nathaniel Thomas, Tess Smidt, Steven M. Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor Field Networks: Rotation- and Translation-Equivariant Neural Networks for 3D Point Clouds. CoRR, 1802.08219, 2018.
241
+
242
+ Oliver T. Unke and Markus Meuwly. PhysNet: A Neural Network for Predicting Energies, Forces, Dipole Moments, and Partial Charges. Journal of Chemical Theory and Computation, 15(6): 3678–3693, June 2019.
243
+
244
+ Maurice Weiler, Mario Geiger, Max Welling, Wouter Boomsma, and Taco Cohen. 3D Steerable CNNs: Learning Rotationally Equivariant Features in Volumetric Data. In NeurIPS, 2018.
245
+
246
+ Zhenqin Wu, Bharath Ramsundar, Evan N. Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S. Pappu, Karl Leswing, and Vijay Pande. MoleculeNet: a benchmark for molecular machine learning. Chemical Science, 9(2):513–530, 2018.
247
+
248
+ Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How Powerful are Graph Neural Networks? In ICLR, 2019.
249
+
250
+ Jonathan S Yedidia, William T Freeman, and Yair Weiss. Understanding belief propagation and its generalizations. In Exploring artificial intelligence in the new millennium, volume 8, pp. 236–239. 2003.
251
+
252
+ Vinícius Flores Zambaldi, David Raposo, Adam Santoro, Victor Bapst, Yujia Li, Igor Babuschkin, Karl Tuyls, David P. Reichert, Timothy P. Lillicrap, Edward Lockhart, Murray Shanahan, Victoria Langston, Razvan Pascanu, Matthew Botvinick, Oriol Vinyals, and Peter W. Battaglia. Deep reinforcement learning with relational inductive biases. In ICLR, 2019.
253
+
254
+ # A INDISTINGUISHABLE MOLECULES
255
+
256
+ ![](images/c9af661ecdeade93896638ceecf76ebfbdcd6671ba8476766339782f90e9c712.jpg)
257
+ Figure 6: A standard non-directional GNN cannot distinguish between a hexagonal (left) and two triangular molecules (right) with the same bond lengths, since the neighborhood of each atom is exactly the same. An example of this would be Cyclohexane and two Cyclopropane molecules with slightly stretched bonds, when the GNN either uses the molecular graph or a cutoff distance of $c \leq 2 . 5 \mathring \mathrm { A }$ . Directional message passing solves this problem by considering the direction of each bond.
258
+
259
+ # B EXPERIMENTAL SETUP
260
+
261
+ The model architecture and hyperparameters were optimized using the QM9 validation set. We use 6 stacked interaction blocks and embeddings of size $F = 1 2 8$ throughout the model. For the basis functions we choose $N _ { \mathrm { S H B F } } = 7$ and $N _ { \mathrm { S R B F } } = N _ { \mathrm { R B F } } = 6$ . For the weight tensor in the interaction block we use $N _ { \mathrm { b i l i n e a r } } = 8$ . We did not find the model to be very sensitive to these values as long as they were large enough (i.e. at least 4).
262
+
263
+ We found the cutoff $c = 5 \mathring \mathrm { A }$ and the learning rate $1 \times 1 0 ^ { - 3 }$ to be rather important hyperparameters. We optimized the model using AMSGrad (Reddi et al., 2018) with 32 molecules per mini-batch. We use a linear learning rate warm-up over 3000 steps and an exponential decay with ratio 0.1 every $2 0 0 0 0 0 0$ steps. The model weights for validation and test were obtained using an exponential moving average (EMA) with decay rate 0.999. For MD17 we use the loss function from Eq. 2 with force weight $\rho = 1 0 0$ , like previous models Schütt et al. (2017). Note that $\rho$ presents a trade-off between energy and force accuracy. It should be chosen rather high since the forces determine the dynamics of the chemical system (Unke & Meuwly, 2019). We use early stopping on the validation loss. On QM9 we train for at most 3 000 000 and on MD17 for at most 100 000 steps.
264
+
265
+ # C SUMMARY STATISTICS
266
+
267
+ We summarize the results across different targets using the mean standardized MAE
268
+
269
+ $$
270
+ \mathrm { s t d . } \mathrm { M A E } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \left( \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { | f _ { \theta } ^ { ( m ) } ( \mathbf { X } _ { i } , z _ { i } ) - \hat { t } _ { i } ^ { ( m ) } | } { \sigma _ { m } } \right) ,
271
+ $$
272
+
273
+ and the mean standardized logMAE
274
+
275
+ $$
276
+ \log \mathrm { M A E } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \log \left( \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { | f _ { \theta } ^ { ( m ) } ( X _ { i } , z _ { i } ) - \hat { t } _ { i } ^ { ( m ) } | } { \sigma _ { m } } \right) ,
277
+ $$
278
+
279
+ with target index $m$ , number of targets $M = 1 2$ , dataset size $N$ , ground truth values $\hat { \pmb { t } } ^ { ( m ) }$ , model $f _ { \theta } ^ { ( m ) }$ , inputs $X _ { i }$ and $z _ { i }$ , and standard deviation $\sigma _ { m }$ of $\hat { \pmb { t } } ^ { ( m ) }$ . Std. MAE reflects the average error compared to the standard deviation of each target. Since this error is dominated by a few difficult targets (e.g. HOMO) we also report logMAE, which reflects every relative improvement equally but is sensitive to outliers, such as SchNet’s result on $\left. R ^ { 2 } \right.$ .
280
+
281
+ # D DIMENET FILTERS
282
+
283
+ To illustrate the filters learned by DimeNet we separate the spatial dependency in the interaction function $f _ { \mathrm { i n t } }$ via
284
+
285
+ $$
286
+ f _ { \mathrm { i n t } } ( \boldsymbol { m } , d _ { j i } , d _ { k j } , \alpha _ { ( k j , j i ) } ) = \sum _ { n } \left[ \sigma ( \boldsymbol { W } \boldsymbol { m } + b ) \right] _ { n } f _ { \mathrm { f l l t e r } 1 , n } ( d _ { j i } ) f _ { \mathrm { f l l t e r } 2 , n } ( d _ { k j } , \alpha _ { ( k j , j i ) } ) .
287
+ $$
288
+
289
+ The filters $f _ { \mathrm { f l l t e r } 1 , n } : \mathbb { R } ^ { + } \mathbb { R }$ and $f _ { \mathrm { f l l t e r } 2 , n } : \mathbb { R } ^ { + } \times [ 0 , 2 \pi ] \to \mathbb { R } ^ { F }$ are given by
290
+
291
+ $$
292
+ \begin{array} { r } { f _ { \mathrm { f l l t e r } 1 , n } ( d ) = ( W _ { \mathrm { R B F } } e _ { \mathrm { R B F } } ( d ) ) _ { n } , } \\ { f _ { \mathrm { f l l t e r } 2 , n } ( d , \alpha ) = ( W _ { \mathrm { S B F } } \pmb { a } _ { \mathrm { S B F } } ( d , \alpha ) ) ^ { T } \pmb { \mathbb { W } } _ { n } , } \end{array}
293
+ $$
294
+
295
+ where $W _ { \mathrm { R B F } }$ , $W _ { \mathrm { S B F } }$ , and $\boldsymbol { \mathsf { W } }$ are learned weight matrices/tensors, $e _ { \mathrm { R B F } } ( d )$ is the radial basis representation, and $\pmb { a } _ { \mathrm { S B F } } ( d , \alpha )$ is the 2D spherical Fourier-Bessel representation. Fig. 5 shows how the first 15 elements of $f _ { \mathrm { f i l t e r } 2 , n } ( d , \alpha )$ vary with $d$ and $\alpha$ when choosing the tensor slice $n = 1$ (with $\alpha = 0$ at the top of the figure).
296
+
297
+ # E MULTI-TARGET RESULTS
298
+
299
+ Table 4: MAE on QM9 with multi-target learning. Single-target learning significantly improves performance on all targets. Using a separate output block per target slightly reduces this difference with little impact on training time.
300
+
301
+ <table><tr><td>Target</td><td>Unit</td><td>Multi-target</td><td>Sep. output blocks</td><td>Single-target</td></tr><tr><td>μ</td><td>D</td><td>0.0775</td><td>0.0815</td><td>0.0286</td></tr><tr><td>α</td><td></td><td>0.0649</td><td>0.0616</td><td>0.0469</td></tr><tr><td>EHOMO</td><td>meV</td><td>45.1</td><td>45.5</td><td>27.8</td></tr><tr><td>ELUMO</td><td>meV</td><td>41.1</td><td>33.9</td><td>19.7</td></tr><tr><td>△ε</td><td>meV</td><td>59.2</td><td>63.6</td><td>34.8</td></tr><tr><td>(R²)</td><td>a0²</td><td>0.345</td><td>0.348</td><td>0.331</td></tr><tr><td>ZPVE</td><td>meV</td><td>2.87</td><td>1.44</td><td>1.29</td></tr><tr><td>Uo</td><td>meV</td><td>12.9</td><td>10.6</td><td>8.02</td></tr><tr><td>U</td><td>meV</td><td>13.0</td><td>10.5</td><td>7.89</td></tr><tr><td>H</td><td>meV</td><td>13.0</td><td>10.4</td><td>8.11</td></tr><tr><td>G</td><td>meV</td><td>13.8</td><td>10.8</td><td>8.98</td></tr><tr><td>Cv</td><td>cal molK</td><td>0.0309</td><td>0.0283</td><td>0.0249</td></tr><tr><td>std. MAE logMAE</td><td>%</td><td>1.92 -5.07</td><td>1.90 -5.21</td><td>1.05</td></tr></table>
parse/train/B1eWbxStPH/B1eWbxStPH_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BklfR3EYDH/BklfR3EYDH_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/BklfR3EYDH/BklfR3EYDH_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ByxBFsRqYm/ByxBFsRqYm.md ADDED
@@ -0,0 +1,615 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ATTENTION, LEARN TO SOLVE ROUTING PROBLEMS!
2
+
3
+ Herke van Hoof University of Amsterdam h.c.vanhoof@uva.nl
4
+
5
+ Wouter Kool
6
+ University of Amsterdam ORTEC
7
+ w.w.m.kool@uva.nl Max Welling
8
+ University of Amsterdam CIFAR
9
+ m.welling@uva.nl
10
+
11
+ # ABSTRACT
12
+
13
+ The recently presented idea to learn heuristics for combinatorial optimization problems is promising as it can save costly development. However, to push this idea towards practical implementation, we need better models and better ways of training. We contribute in both directions: we propose a model based on attention layers with benefits over the Pointer Network and we show how to train this model using REINFORCE with a simple baseline based on a deterministic greedy rollout, which we find is more efficient than using a value function. We significantly improve over recent learned heuristics for the Travelling Salesman Problem (TSP), getting close to optimal results for problems up to 100 nodes. With the same hyperparameters, we learn strong heuristics for two variants of the Vehicle Routing Problem (VRP), the Orienteering Problem (OP) and (a stochastic variant of) the Prize Collecting TSP (PCTSP), outperforming a wide range of baselines and getting results close to highly optimized and specialized algorithms.
14
+
15
+ # 1 INTRODUCTION
16
+
17
+ Imagine yourself travelling to a scientific conference. The field is popular, and surely you do not want to miss out on anything. You have selected several posters you want to visit, and naturally you must return to the place where you are now: the coffee corner. In which order should you visit the posters, to minimize your time walking around? This is the Travelling Scientist Problem (TSP).
18
+
19
+ You realize that your problem is equivalent to the Travelling Salesman Problem (conveniently also TSP). This seems discouraging as you know the problem is (NP-)hard (Garey & Johnson, 1979). Fortunately, complexity theory analyzes the worst case, and your Bayesian view considers this unlikely. In particular, you have a strong prior: the posters will probably be laid out regularly. You want a special algorithm that solves not any, but this type of problem instance. You have some months left to prepare. As a machine learner, you wonder whether your algorithm can be learned?
20
+
21
+ Motivation Machine learning algorithms have replaced humans as the engineers of algorithms to solve various tasks. A decade ago, computer vision algorithms used hand-crafted features but today they are learned end-to-end by Deep Neural Networks (DNNs). DNNs have outperformed classic approaches in speech recognition, machine translation, image captioning and other problems, by learning from data (LeCun et al., 2015). While DNNs are mainly used to make predictions, Reinforcement Learning (RL) has enabled algorithms to learn to make decisions, either by interacting with an environment, e.g. to learn to play Atari games (Mnih et al., 2015), or by inducing knowledge through look-ahead search: this was used to master the game of Go (Silver et al., 2017).
22
+
23
+ The world is not a game, and we desire to train models that make decisions to solve real problems. These models must learn to select good solutions for a problem from a combinatorially large set of potential solutions. Classically, approaches to this problem of combinatorial optimization can be divided into exact methods, that guarantee finding optimal solutions, and heuristics, that trade off optimality for computational cost, although exact methods can use heuristics internally and vice versa. Heuristics are typically expressed in the form of rules, which can be interpreted as policies to make decisions. We believe that these policies can be parameterized using DNNs, and be trained to obtain new and stronger algorithms for many different combinatorial optimization problems, similar to the way DNNs have boosted performance in the applications mentioned before. In this paper, we focus on routing problems: an important class of practical combinatorial optimization problems.
24
+
25
+ The promising idea to learn heuristics has been tested on TSP (Bello et al., 2016). In order to push this idea, we need better models and better ways of training. Therefore, we propose to use a powerful model based on attention and we propose to train this model using REINFORCE with a simple but effective greedy rollout baseline. The goal of our method is not to outperform a nonlearned, specialized TSP algorithm such as Concorde (Applegate et al., 2006). Rather, we show the flexibility of our approach on multiple (routing) problems of reasonable size, with a single set of hyperparameters. This is important progress towards the situation where we can learn strong heuristics to solve a wide range of different practical problems for which no good heuristics exist.
26
+
27
+ # 2 RELATED WORK
28
+
29
+ The application of Neural Networks (NNs) for optimizing decisions in combinatorial optimization problems dates back to Hopfield & Tank (1985), who applied a Hopfield-network for solving small TSP instances. NNs have been applied to many related problems (Smith, 1999), although in most cases in an online manner, starting ‘from scratch’ and ‘learning’ a solution for every instance. More recently, (D)NNs have also been used offline to learn about an entire class of problem instances.
30
+
31
+ Vinyals et al. (2015) introduce the Pointer Network (PN) as a model that uses attention to output a permutation of the input, and train this model offline to solve the (Euclidean) TSP, supervised by example solutions. Upon test time, their beam search procedure filters invalid tours. Bello et al. (2016) introduce an Actor-Critic algorithm to train the PN without supervised solutions. They consider each instance as a training sample and use the cost (tour length) of a sampled solution for an unbiased Monte-Carlo estimate of the policy gradient. They introduce extra model depth in the decoder by an additional glimpse (Vinyals et al., 2016) at the embeddings, masking nodes already visited. For small instances $\mathbf { \bar { \Phi } } n = 2 0 \mathbf { \Phi }$ ), they get close to the results by Vinyals et al. (2015), they improve for $n = 5 0$ and additionally include results for $n = 1 0 0$ . Nazari et al. (2018) replace the LSTM encoder of the PN by element-wise projections, such that the updated embeddings after state-changes can be effectively computed. They apply this model on the Vehicle Routing Problem (VRP) with split deliveries and a stochastic variant.
32
+
33
+ Dai et al. (2017) do not use a separate encoder and decoder, but a single model based on graph embeddings. They train the model to output the order in which nodes are inserted into a partial tour, using a helper function to insert at the best possible location. Their 1-step DQN (Mnih et al., 2015) training method trains the algorithm per step and incremental rewards provided to the agent at every step effectively encourage greedy behavior. As mentioned in their appendix, they use the negative of the reward, which combined with discounting encourages the agent to insert the farthest nodes first, which is known to be an effective heuristic (Rosenkrantz et al., 2009).
34
+
35
+ Nowak et al. (2017) train a Graph Neural Network in a supervised manner to directly output a tour as an adjacency matrix, which is converted into a feasible solution by a beam search. The model is non-autoregressive, so cannot condition its output on the partial tour and the authors report an optimality gap of $2 . 7 \%$ for $n = 2 0$ , worse than autoregressive approaches mentioned in this section. Kaempfer & Wolf (2018) train a model based on the Transformer architecture (Vaswani et al., 2017) that outputs a fractional solution to the multiple TSP (mTSP). The result can be seen as a solution to the linear relaxation of the problem and they use a beam search to obtain a feasible integer solution.
36
+
37
+ Independently of our work, Deudon et al. (2018) presented a model for TSP using attention in the OR community. They show performance can improve using 2OPT local search, but do not show benefit of their model in direct comparison to the PN. We use a different decoder and improved training algorithm, both contributing to significantly improved results, without 2OPT and additionally show application to different problems. For a full discussion of the differences, we refer to Appendix B.4.
38
+
39
+ # 3 ATTENTION MODEL
40
+
41
+ We define the Attention Model in terms of the TSP. For other problems, the model is the same but the input, mask and decoder context need to be defined accordingly, which is discussed in the Appendix. We define a problem instance $s$ as a graph with $n$ nodes, where node $i \in \{ 1 , \ldots , n \}$ is represented by features $\mathbf { x } _ { i }$ . For TSP, $\mathbf { x } _ { i }$ is the coordinate of node $i$ and the graph is fully connected (with selfconnections) but in general, the model can be considered a Graph Attention Network (Velickovic et al., 2018) and take graph structure into account by a masking procedure (see Appendix A). We define a solution (tour) ${ \pmb \pi } = ( \pi _ { 1 } , \ldots , \pi _ { n } )$ as a permutation of the nodes, so $\pi _ { t } \in \{ 1 , \ldots n \}$ and $\pi _ { t } \neq \pi _ { t ^ { \prime } } \forall t \neq t ^ { \prime }$ . Our attention based encoder-decoder model defines a stochastic policy $p ( \pi | s )$ for selecting a solution $\pi$ given a problem instance $s$ . It is factorized and parameterized by $\pmb { \theta }$ as
42
+
43
+ $$
44
+ p _ { \theta } ( \pi | s ) = \prod _ { t = 1 } ^ { n } p _ { \theta } ( \pi _ { t } | s , \pi _ { 1 : t - 1 } ) .
45
+ $$
46
+
47
+ The encoder produces embeddings of all input nodes. The decoder produces the sequence $\pi$ of input nodes, one node at a time. It takes as input the encoder embeddings and a problem specific mask and context. For TSP, when a partial tour has been constructed, it cannot be changed and the remaining problem is to find a path from the last node, through all unvisited nodes, to the first node. The order and coordinates of other nodes already visited are irrelevant. To know the first and last node, the decoder context consists (next to the graph embedding) of embeddings of the first and last node. Similar to Bello et al. (2016), the decoder observes a mask to know which nodes have been visited.
48
+
49
+ # 3.1 ENCODER
50
+
51
+ The encoder that we use (Figure 1) is similar to the encoder used in the Transformer architecture by Vaswani et al. (2017), but we do not use positional encoding such that the resulting node embeddings are invariant to the input order. From the $d _ { \mathrm { x } }$ -dimensional input features $\mathbf { x } _ { i }$ (for TSP $d _ { \mathrm { x } } = 2$ ), the encoder computes initial $d _ { \mathrm { h } }$ -dimensional node embeddings $\bar { \mathbf { h } } _ { i } ^ { ( 0 ) }$ (we use $d _ { \mathrm { h } } ~ = ~ 1 2 8 )$ ) through a learned linear projection with parameters $W ^ { \mathrm { x } }$ and $\mathbf { b } ^ { \mathrm { x } }$ : $\mathbf { h } _ { i } ^ { ( 0 ) } = W ^ { \mathrm { x } } \mathbf { x } _ { i } + \mathbf { b } ^ { \mathrm { x } }$ . The embeddings are updated using $N$ attention layers, each consisting of two sublayers. We denote with $\mathbf { h } _ { i } ^ { ( \ell ) }$ the node
52
+
53
+ ![](images/4262e785fe471fbd720745bed088f1ea7575816f86de1a22bcf439b3c9707c7c.jpg)
54
+ Figure 1: Attention based encoder. Input nodes are embedded and processed by $N$ sequential layers, each consisting of a multi-head attention (MHA) and node-wise feed-forward (FF) sublayer. The graph embedding is computed as the mean of node embeddings. Best viewed in color.
55
+
56
+ embeddings produced by layer $\ell \in \{ 1 , . . , N \}$ . The encoder computes an aggregated embedding $\bar { \mathbf { h } } ^ { ( N ) }$ of the input graph as the node embeddings mean of the final node emand the graph embedding ings are $\mathbf { h } _ { i } ^ { ( N ) }$ : a $\begin{array} { r } { \bar { \mathbf { h } } ^ { ( N ) } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathbf { h } _ { i } ^ { ( N ) } } \end{array}$ $\mathbf { h } _ { i } ^ { ( N ) }$ $\bar { \mathbf { h } } ^ { ( N ) }$
57
+
58
+ Attention layer Following the Transformer architecture (Vaswani et al., 2017), each attention layer consist of two sublayers: a multi-head attention (MHA) layer that executes message passing between the nodes and a node-wise fully connected feed-forward (FF) layer. Each sublayer adds a skip-connection (He et al., 2016) and batch normalization (BN) (Ioffe & Szegedy, 2015) (which we found to work better than layer normalization (Ba et al., 2016)):
59
+
60
+ $$
61
+ \begin{array} { r l } & { \hat { { \bf h } } _ { i } = { \bf B } { \bf N } ^ { \ell } \left( { \bf h } _ { i } ^ { ( \ell - 1 ) } + { \bf M } { \bf H } { \bf A } _ { i } ^ { \ell } \left( { \bf h } _ { 1 } ^ { ( \ell - 1 ) } , \ldots , { \bf h } _ { n } ^ { ( \ell - 1 ) } \right) \right) } \\ & { { \bf h } _ { i } ^ { ( \ell ) } = { \bf B } { \bf N } ^ { \ell } \left( \hat { { \bf h } } _ { i } + { \bf F } { \bf F } ^ { \ell } ( \hat { { \bf h } } _ { i } ) \right) . } \end{array}
62
+ $$
63
+
64
+ The layer index $\ell$ indicates that the layers do not share parameters. The MHA sublayer uses $M =$ 8 heads with dimensionality $\begin{array} { l } { { \frac { { { d } _ { h } } } { M _ { . } } } ~ = ~ \mathrm { { { i 6 } } } } \end{array}$ , and the FF sublayer has one hidden (sub)sublayer with dimension 512 and ReLu activation. See Appendix A for details.
65
+
66
+ # 3.2 DECODER
67
+
68
+ Decoding happens sequentially, and at timestep $t \in \{ 1 , \ldots n \}$ , the decoder outputs the node $\pi _ { t }$ based on the embeddings from the encoder and the outputs $\pi _ { t ^ { \prime } }$ generated at time $t ^ { \prime } < t$ . During decoding, we augment the graph with a special context node $( c )$ to represent the decoding context. The decoder computes an attention (sub)layer on top of the encoder, but with messages only to the context node for efficiency.1 The final probabilities are computed using a single-head attention mechanism. See Figure 2 for an illustration of the decoding process.
69
+
70
+ ![](images/d29b3c1d9243ba44c83b38df391102f7525fe72856931b0f9666c6933b72c7df.jpg)
71
+ Figure 2: Attention based decoder for the TSP problem. The decoder takes as input the graph embedding and node embeddings. At each time step $t$ , the context consist of the graph embedding and the embeddings of the first and last (previously output) node of the partial tour, where learned placeholders are used if $t = 1$ . Nodes that cannot be visited (since they are already visited) are masked. The example shows how a tour $\pi = ( 3 , 1 , 2 , 4 )$ is constructed. Best viewed in color.
72
+
73
+ Context embedding The context of the decoder at time $t$ comes from the encoder and the output up to time $t$ . As mentioned, for the TSP it consists of the embedding of the graph, the previous (last) node $\pi _ { t - 1 }$ and the first node $\pi _ { 1 }$ . For $t = 1$ we use learned $d _ { \mathrm { h } }$ -dimensional parameters $\mathbf { v } ^ { \mathrm { l } }$ and $\mathbf { v } ^ { \mathrm { f } }$ as input placeholders:
74
+
75
+ $$
76
+ \mathbf { h } _ { ( c ) } ^ { ( N ) } = \left\{ \begin{array} { l l } { \left[ \bar { \mathbf { h } } ^ { ( N ) } , \mathbf { h } _ { \pi _ { t - 1 } } ^ { ( N ) } , \mathbf { h } _ { \pi _ { 1 } } ^ { ( N ) } \right] } & { t > 1 } \\ { \left[ \bar { \mathbf { h } } ^ { ( N ) } , \mathbf { v } ^ { \mathrm { l } } , \mathbf { v } ^ { \mathrm { f } } \right] } & { t = 1 . } \end{array} \right.
77
+ $$
78
+
79
+ Here $[ \cdot , \cdot , \cdot ]$ is the horizontal concatenation operator and we write the $( 3 \cdot d _ { \mathrm { h } } )$ -dimensional result vector as $\mathbf { h } _ { ( c ) } ^ { ( N ) }$ to indicate we interpret it as the embedding of the special context node $( c )$ and use the superscript $( N )$ to align with the node embeddings $\mathbf { h } _ { i } ^ { ( N ) }$ . We could project the embedding back to $d _ { \mathrm { h } }$ dimensions, but we absorb this transformation in the parameter $W ^ { Q }$ in equation 5.
80
+
81
+ Now we compute a new context node embedding $\mathbf { h } _ { ( c ) } ^ { ( N + 1 ) }$ using the ( $M$ -head) attention mechanism described in Appendix A. The keys and values come from the node embeddings $\mathbf { h } _ { i } ^ { ( N ) }$ , but we only compute a single query $\mathbf { q } _ { \left( c \right) }$ (per head) from the context node (we omit the $( N )$ for readability):
82
+
83
+ $$
84
+ \mathbf { q } _ { ( c ) } = W ^ { Q } \mathbf { h } _ { ( c ) } \quad \mathbf { k } _ { i } = W ^ { K } \mathbf { h } _ { i } , \quad \mathbf { v } _ { i } = W ^ { V } \mathbf { h } _ { i } .
85
+ $$
86
+
87
+ We compute the compatibility of the query with all nodes, and mask (set $u _ { ( c ) j } = - \infty )$ ) nodes which cannot be visited at time $t$ . For TSP, this simply means we mask the nodes already visited:
88
+
89
+ $$
90
+ u _ { ( c ) j } = \left\{ \begin{array} { l l } { \frac { \mathbf { q } _ { ( c ) } ^ { T } \mathbf { k } _ { j } } { \sqrt { d _ { \mathrm { k } } } } } & { \mathrm { i f } \ j \neq \pi _ { t ^ { \prime } } \quad \forall t ^ { \prime } < t } \\ { - \infty } & { \mathrm { o t h e r w i s e . } } \end{array} \right.
91
+ $$
92
+
93
+ Here $\begin{array} { r } { d _ { \mathrm { k } } \ = \ \frac { d _ { \mathrm { h } } } { M } } \end{array}$ is the query/key dimensionality (see Appendix A). Again, we compute $u _ { ( c ) j }$ and $\mathbf { v } _ { i }$ for $M = \bar { 8 }$ heads and compute the final multi-head attention value for the context node using equations 12–14 from Appendix A, but with $( c )$ instead of $i$ . This mechanism is similar to our encoder, but does not use skip-connections, batch normalization or the feed-forward sublayer for maximal efficiency. The result $\mathbf { h } _ { ( c ) } ^ { ( N + 1 ) }$ is similar to the glimpse described by Bello et al. (2016).
94
+
95
+ Calculation of log-probabilities To compute output probabilities $p _ { \pmb { \theta } } ( \pi _ { t } | s , \pi _ { 1 : t - 1 } )$ in equation 1, we add one final decoder layer with a single attention head ( $M = 1$ so $d _ { \mathrm { k } } = d _ { \mathrm { h } }$ ). For this layer, we only compute the compatibilities $\boldsymbol { u } _ { ( c ) j }$ using equation 6, but following Bello et al. (2016) we clip the result (before masking!) within $[ - C , C ]$ $C = 1 0$ ) using tanh:
96
+
97
+ $$
98
+ u _ { ( c ) j } = \left\{ \begin{array} { l l } { C \cdot \operatorname { t a n h } \left( \frac { \mathbf { q } _ { ( c ) } ^ { T } \mathbf { k } _ { j } } { \sqrt { d _ { \mathrm { k } } } } \right) } & { \mathrm { i f ~ } j \neq \pi _ { t ^ { \prime } } \quad \forall t ^ { \prime } < t } \\ { - \infty } & { \mathrm { o t h e r w i s e } . } \end{array} \right.
99
+ $$
100
+
101
+ We interpret these compatibilities as unnormalized log-probabilities (logits) and compute the final output probability vector $\mathbf { p }$ using a softmax (similar to equation 12 in Appendix A):
102
+
103
+ $$
104
+ p _ { i } = p _ { \theta } \bigl ( \pi _ { t } = i | s , \pi _ { 1 : t - 1 } \bigr ) = \frac { e ^ { u _ { ( c ) i } } } { \sum _ { j } e ^ { u _ { ( c ) j } } } .
105
+ $$
106
+
107
+ # 4 REINFORCE WITH GREEDY ROLLOUT BASELINE
108
+
109
+ Section 3 defined our model that given an instance $s$ defines a probability distribution $p _ { \pmb { \theta } } ( \pmb { \pi } | s )$ , from which we can sample to obtain a solution (tour) ${ \boldsymbol { \pi } } | { \boldsymbol { s } } $ . In order to train our model, we define the loss $\begin{array} { r } { \mathcal { L } ( \pmb { \theta } | s ) = \mathbb { E } _ { p _ { \pmb { \theta } } ( \pmb { \pi } | s ) } \bar { [ \cal L ( \pmb { \pi } ) ] } } \end{array}$ : the expectation of the cost $L ( \pi )$ (tour length for TSP). We optimize $\mathcal { L }$ by gradient descent, using the REINFORCE (Williams, 1992) gradient estimator with baseline $b ( s )$ :
110
+
111
+ $$
112
+ \nabla \mathcal { L } ( \pmb \theta | s ) = \mathbb { E } _ { p _ { \pmb \theta } ( \pmb \pi | s ) } \left[ \left( L ( \pmb \pi ) - b ( s ) \right) \nabla \log p _ { \pmb \theta } ( \pmb \pi | s ) \right] .
113
+ $$
114
+
115
+ A good baseline $b ( s )$ reduces gradient variance and therefore increases speed of learning. A simple example is an exponential moving average $b ( s ) = M$ with decay $\beta$ . Here $M = L ( \pi )$ in the first iteration and gets updated as $M \gets \beta M { + } ( 1 { - } \beta ) L ( \pi )$ in subsequent iterations. A popular alternative is the use of a learned value function (critic) ${ \hat { v } } ( s , \pmb { w } )$ , where the parameters $\pmb { w }$ are learned from the observations $( s , L ( \pi ) )$ . However, getting such actor-critic algorithms to work is non-trivial.
116
+
117
+ We propose to use a rollout baseline in a way that is similar to self-critical training by Rennie et al. (2017), but with periodic updates of the baseline policy. It is defined as follows: $b ( s )$ is the cost of a solution from a deterministic greedy rollout of the policy defined by the best model so far.
118
+
119
+ Motivation The goal of a baseline is to estimate the difficulty of the instance $s$ , such that it can relate to the cost $L ( \pi )$ to estimate the advantage of the solution $\pi$ selected by the model. We make the following key observation: The difficulty of an instance can (on average) be estimated by the performance of an algorithm applied to it. This follows from the assumption that (on average) an algorithm will have a higher cost on instances that are more difficult. Therefore we form a baseline by applying (rolling out) the algorithm defined by our model during training. To eliminate variance we force the result to be deterministic by selecting greedily the action with maximum probability.
120
+
121
+ Determining the baseline policy As the model changes during training, we stabilize the baseline by freezing the greedy rollout policy $p _ { \pmb { \theta } ^ { \mathrm { B L } } }$ for a fixed number of steps (every epoch), similar to freezing of the target Q-network in DQN (Mnih et al., 2015). A stronger algorithm defines a stronger baseline, so we compare (with greedy decoding) the current training policy with the baseline policy at the end of every epoch, and replace the parameters $\pmb { \theta } ^ { \mathrm { B L } }$ of the baseline policy only if the improvement is significant according to a paired t-test $( \alpha = 5 \%$ ), on 10000 separate (evaluation) instances. If the baseline policy is updated, we sample new evaluation instances to prevent overfitting.
122
+
123
+ Analysis With the greedy rollout as baseline $b ( s )$ , the function ${ \cal L } ( { \pmb \pi } ) - b ( { \pmb s } )$ is negative if the sampled solution $\pi$ is better than the greedy rollout, causing actions to be reinforced, and vice versa. This way the model is trained to improve over its (greedy) self. We see similarities with selfplay improvement (Silver et al., 2017): sampling replaces tree search for exploration and the model is rewarded if it yields improvement (‘wins’) compared to the best model. Similar to AlphaGo, the evaluation at the end of each epoch ensures that we are always challenged by the best model.
124
+
125
+ Algorithm We use Adam (Kingma & Ba, 2015) as optimizer resulting in Algorithm 1.
126
+
127
+ Efficiency Each rollout constitutes an additional forward pass, increasing computation by $5 0 \%$ . However, as the baseline policy is fixed for an epoch, we can sample the data and compute baselines per epoch using larger batch sizes, allowed by the reduced memory requirement as the computations can run in pure inference mode. Empirically we find that it adds only $2 5 \%$ (see Appendix B.5), taking up $2 0 \%$ of total time. If desired, the baseline rollout can be computed in parallel such that there is no increase in time per iteration, as an easy way to benefit from an additional GPU.
128
+
129
+ # Algorithm 1 REINFORCE with Rollout Baseline
130
+
131
+ signifi2: Init θ,3: for ep4: fo5: 6: 7: 1: Input: number of epochs $E$ , steps per epoch $_ T$ , batch size $B$
132
+ cance $_ \alpha$ $\theta ^ { \mathrm { B L } } \theta$ $= 1 , \ldots , E$
133
+ r step $= 1$ , . . . , $_ T$ do
134
+ $s _ { i } \gets$ RandomInstance() $\forall i \in \left\{ 1 , \ldots , B \right\}$
135
+ $\pi _ { i } \operatorname { S a m p l e R o l l o u t } ( s _ { i } , p _ { \pmb \theta } ) \forall i \in \{ 1 , . . . , B \}$ $\forall i \in \left\{ 1 , \ldots , B \right\}$
136
+ $\begin{array} { r } { \nabla \mathcal { L } \gets \sum _ { i = 1 } ^ { B } \left( L ( \pi _ { i } ) - L ( \pi _ { i } ^ { \mathrm { B L } } ) \right) \nabla _ { \theta } \log p _ { \theta } ( \pi _ { i } ) } \end{array}$
137
+ 9: θ ← Adam(θ, ∇L)
138
+ 10: end for
139
+ 11: if OneSidedPairedTTest $\left( p _ { \pmb { \theta } } , p _ { \pmb { \theta } ^ { \mathrm { B L } } } \right) < \alpha$ then
140
+ 12: ${ \boldsymbol { \theta } } ^ { \mathrm { B L } } { \boldsymbol { \theta } }$
141
+ 13: end if
142
+ 14: end for
143
+
144
+ # 5 EXPERIMENTS
145
+
146
+ We focus on routing problems: we consider the TSP, two variants of the VRP, the Orienteering Problem and the (Stochastic) Prize Collecting TSP. These provide a range of different challenges, constraints and objectives and are traditionally solved by different algorithms. For the Attention Model (AM), we adjust the input, mask, decoder context and objective function for each problem (see Appendix for details and data generation) and train on problem instances of $n = 2 0$ , 50 and 100 nodes. For all problems, we use the same hyperparameters: those we found to work well on TSP.
147
+
148
+ Hyperparameters We initialize parameters Uniform $( - 1 / \sqrt { d } , 1 / \sqrt { d } )$ , with $d$ the input dimension. Every epoch we process 2500 batches of 512 instances (except for VRP with $n = 1 0 0$ , where we use $2 5 0 0 \times 2 5 6$ for memory constraints). For TSP, an epoch takes 5:30 minutes for $n = 2 0$ , 16:20 for $n = 5 0$ (single GPU 1080Ti) and 27:30 for $n = 1 0 0$ (on 2 1080Ti’s). We train for 100 epochs using training data generated on the fly. We found training to be stable and results to be robust against different seeds, where only in one case (PCTSP with $n = 2 0$ ) we had to restart training with a different seed because the run diverged. We use $N = 3$ layers in the encoder, which we found is a good trade-off between quality of the results and computational complexity. We use a constant learning rate $\eta = 1 0 ^ { - 4 }$ . Training with a higher learning rate $\eta = 1 0 ^ { - 3 }$ is possible and speeds up initial learning, but requires decay (0.96 per epoch) to converge and may be a bit more unstable. See Appendix B.5. With the rollout baseline, we use an exponential baseline $\beta = 0 . 8 )$ during the first epoch, to stabilize initial learning, although in many cases learning also succeeds without this ‘warmup’. Our code in PyTorch (Paszke et al., 2017) is publicly available.2
149
+
150
+ Decoding strategy and baselines For each problem, we report performance on 10000 test instances. At test time we use greedy decoding, where we select the best action (according to the model) at each step, or sampling, where we sample 1280 solutions (in $< 1 \mathrm { s }$ on a single GPU) and report the best. More sampling improves solution quality at increased computation. In Table 1 we compare greedy decoding against baselines that also construct a single solution, and compare sampling against baselines that also consider multiple solutions, either via sampling or (local) search. For each problem, we also report the ‘best possible solution’: either optimal via Gurobi (2018) (intractable for $n > 2 0$ except for TSP) or a problem specific state-of-the-art algorithm.
151
+
152
+ Run times Run times are important but hard to compare: they can vary by two orders of magnitude as a result of implementation (Python vs $\mathrm { C } { + + }$ ) and hardware (GPU vs CPU). We take a practical view and report the time it takes to solve the test set of 10000 instances, either on a single GPU (1080Ti) or 32 instances in parallel on a 32 virtual CPU system $( 2 \times \mathrm { X e o n E } 5 – 2 6 3 0 )$ . This is conservative: our model is parallelizable while most of the baselines are single thread CPU implementations which cannot parallelize when running individually. Also we note that after training our run time can likely be reduced by model compression (Hinton et al., 2015). In Table 1 we do not report running times for the results which were reported by others as they are not directly comparable but we note that in general our model and implementation is fast: for instance Bello et al. (2016) report 10.3s for sampling 1280 TSP solutions (K80 GPU) which we do in less than one second (on a 1080Ti). For most algorithms it is possible to trade off runtime for performance. As reporting full trade-off curves is impractical we tried to pick reasonable spots, reporting the fastest if results were similar or reporting results with different time limits (for example we use Gurobi with time limits as heuristic).
153
+
154
+ # 5.1 PROBLEMS
155
+
156
+ Travelling Salesman Problem (TSP) For the TSP, we report optimal results by Gurobi, as well as by Concorde (Applegate et al., 2006) (faster than Gurobi as it is specialized for TSP) and LKH3 (Helsgaun, 2017), a state-of-the-art heuristic solver that empirically also finds optimal solutions in time comparable to Gurobi. We compare against Nearest, Random and Farthest Insertion, as well as Nearest Neighbor, which is the only non-learned baseline algorithm that also constructs a tour directly in order (i.e. is structurally similar to our model). For details, see Appendix B.3. Additionally we compare against the learned heuristics in Section 2, most importantly Bello et al. (2016), as well as OR Tools reported by Bello et al. (2016) and Christofides $^ +$ 2OPT local search reported by Vinyals et al. (2015). Results for Dai et al. (2017) are (optimistically) computed from the optimality gaps they report on 15-20, 40-50 and 50-100 node graphs, respectively. Using a single greedy construction we outperform traditional baselines and we are able to achieve significantly closer to optimal results than previous learned heuristics (from around $1 . 5 \%$ to $0 . 3 \%$ above optimal for $n = 2 0$ ). Naturally, the difference with Bello et al. (2016) gets diluted when sampling many solutions (as with many samples even a random policy performs well), but we still obtain significantly better results, without tuning the softmax temperature. For completeness, we also report results from running the Encode-Attend-Navigate (EAN) code3 which is concurrent work by Deudon et al. (2018) (for details see Appendix B.4). Our model outperforms EAN, even if EAN is improved with 2OPT local search. Appendix B.5 presents the results visually, including generalization results for different $n$ .
157
+
158
+ Table 1: Attention Model (AM) vs baselines. The gap $\%$ is w.r.t. the best value across all methods.
159
+
160
+ <table><tr><td colspan="2">Method</td><td colspan="2">n = 20 Obj. Gap</td><td colspan="2">Time Obj.</td><td colspan="2">n= 50 Gap Time</td><td colspan="3">n = 100 Obj.</td></tr><tr><td>Concorde LKH3 Gurobi Gurobi (1s) Nearest Insertion Random Insertion Farthest Insertion</td><td></td><td>3.84 0.00% 3.84 0.00% 3.84 0.00% 3.84 0.00% 4.33 12.91%</td><td>(1m) (18s) (7s) (8s) (1s)</td><td>5.70 5.70 5.70 5.70 6.78</td><td>0.00% 0.00% 0.00% 0.00% 19.03% 7.65%</td><td></td><td>(2m) (5m) (2m) (2m) (2s)</td><td>Gap 7.76 7.76 7.76 -</td><td>Time 0.00% (3m) 0.00% (21m) 0.00% (17m) (6s)</td><td></td></tr><tr><td>P Dai et al. Nowak et al. EAN (greedy) AM (greedy) OR Tools Chr.f. + 2OPT</td><td>Nearest Neighbor Vinyals et al. (gr.) Bello et al. (gr.)</td><td>4.00 3.93 4.50 3.88 3.89 3.89 3.93 3.86 3.85 3.85</td><td>4.36% 2.36% 17.23% 1.15% 1.42% 1.42% 2.46% 0.66% 0.34% 0.37%</td><td>(0s) 6.13 (1s) 6.01 (0s) 7.00 7.66 5.95 5.99 (2m) 5.92 (0s) 5.80</td><td></td><td>5.53% 22.94% 34.48% 4.46% 5.16% 3.98% 1.76%</td><td>(1s) (2s) (0s) (5m) (2s)</td><td>9.46 8.52 8.35 9.68 8.30 8.31 8.42 8.12</td><td>21.82% 9.69% 7.59% 24.73% 6.90% 7.03% 8.41% 4.53%</td><td>(3s) (7s) (0s) (8m) (6s)</td></tr><tr><td rowspan="2">Gurobi LKH3 JYRP AM (greedy)</td><td>Bello et al. (s.) EAN (gr. + 2OPT) EAN (sampling) EAN (S. +20PT)</td><td>3.85 3.85 3.84 3.84</td><td>0.37% 0.42% 0.11% 0.09%</td><td>5.80 5.79 5.75 (4m) 5.85 (5m) 5.77 (6m) 5.75</td><td></td><td>1.83% 1.65% 0.95% 2.77% 1.28% 1.00%</td><td>(26m) (17m)</td><td>7.99 8.00 8.17 8.75</td><td>2.90% 3.03% 5.21% 12.70%</td><td>(3h) (56m)</td></tr><tr><td>AM(sampling) RL (greedy) 6.40</td><td>3.84 6.10 6.14 6.59</td><td>0.08% 0.00% 0.58% 8.03%</td><td>(5m) 5.73 (2h) 10.38 11.39</td><td>0.52% 0.00% 10.98</td><td>9.78% 5.86%</td><td>(32m) (24m) (7h) (3s)</td><td>8.12 7.94 15.65 17.23</td><td>4.64% 2.26% 0.00% 10.12%</td><td>(5h) (1h) (13h)</td></tr><tr><td>JRRIP</td><td>RL (beam 10) Random CW Random Sweep OR Tools AM (sampling)</td><td>6.40 6.81 7.08 6.43 6.25</td><td>4.92% 11.64% 16.07% 5.41% 2.49%</td><td>(6m) 10.62</td><td>11.15 12.25 12.96 11.31</td><td>7.46% 18.07% 24.91% 9.01% 2.40%</td><td>(28m)</td><td>16.80 16.96 18.96 20.33 17.16 16.23</td><td>7.34% 8.39% 21.18% 29.93% 9.67% 3.72%</td><td>(8s) (2h)</td></tr><tr><td></td><td>RL (greedy) AM (greedy) RL (beam 10)</td><td>6.51 6.39 6.34</td><td>4.19% 2.34% 1.47%</td><td>(1s) 10.92 11.08</td><td>11.32</td><td>6.88% 3.08% 4.61%</td><td>(4s)</td><td>17.12 16.83 16.86</td><td>5.23% 3.42% 3.63%</td><td>(11s)</td></tr><tr><td></td><td>AM (sampling) Gurobi Gurobi (1s)</td><td>6.25 5.39 4.62</td><td>0.00% 0.00% (16m) 14.22%</td><td>(9m) 10.59 (4m) 1.29</td><td></td><td>0.00% 92.03%</td><td>(42m) (6m)</td><td>16.27 0.58</td><td>0.00% 98.25%</td><td>(3h) (7m)</td></tr><tr><td>(gruttsip) dg</td><td>Gurobi (10s) Gurobi (30s) Compass Tsili (greedy)</td><td>5.37 5.38 5.37</td><td>0.33% 0.05% 0.36%</td><td>(12m) (14m) 13.57 (2m) 16.17 12.46</td><td>10.96</td><td>32.20% 16.09% 0.00% 22.94%</td><td>(51m) (2h) (5m) (4s)</td><td>1.34 3.23 33.19 25.69</td><td>95.97% 90.28% 0.00% 22.59%</td><td>(53m) (3h) (15m) (5s)</td></tr><tr><td></td><td>AM (greedy) GA (Python) OR Tools (10s)</td><td>4.08 5.19 5.12 4.09</td><td>24.25% 3.64% 4.88% 24.05%</td><td>(4s) (0s) 15.64 (10m) 10.90 (52m)</td><td></td><td>3.23% 32.59%</td><td>(1s) (1h)</td><td>31.62 14.91</td><td>4.75% 55.08%</td><td>(5s) (5h)</td></tr><tr><td>PSTP</td><td>Tsili (sampling) AM(sampling) Gurobi Gurobi (1s) Gurobi (10s)</td><td>5.30 5.30 3.13 3.14</td><td>1.62% 1.56% 0.00% 0.07%</td><td>(28s) (4m) 16.07 (2m) (1m)</td><td>15.50</td><td>4.14% 0.60% -</td><td>(2m) (16m)</td><td>30.52 32.68</td><td>8.05% 1.55% -</td><td>(6m) (53m)</td></tr><tr><td rowspan="2">JSSTTS REOPT (first) AM(greedy)</td><td>Gurobi (30s) AM(greedy) ILS (C++)</td><td>3.13 3.13 |3.18 3.16</td><td>0.00% 0.00% 1.62% 0.77%</td><td>(2m) (2m) (0s)| (16m)</td><td>4.54 4.48 4.60 4.50</td><td>1.36% 0.03% 2.66% 0.36%</td><td>(32m) (54m) (2s) (2h)</td><td>6.25 5.98</td><td>- 4.46% 0.00%</td><td>(5s) (12h)</td></tr><tr><td>OR Tools (10s) OR Tools (60s) ILS (Python 10x) AM (sampling) REOPT (all) REOPT (half) 3.31</td><td>3.14 3.13 5.21 3.15 3.34 3.31</td><td>0.05% 0.01% 66.19% 0.45% 2.38% 1.38% (25m)</td><td>(52m) (5h) (4m) (5m) (17m)</td><td>4.51 4.48 12.51 4.52 4.68</td><td>0.70% 0.00% 179.05% 0.74% 1.04% 0.00%</td><td>(52m) (5h) (3m) (19m) (2h) 3h</td><td>6.35 6.07 23.98 6.08 6.22 6.16</td><td>6.21% 1.56% 300.95% 1.67% 1.10% 0.00%</td><td>(52m) (5h) (3m) (1h) (12h)</td></tr></table>
161
+
162
+ Vehicle Routing Problem (VRP) In the Capacitated VRP (CVRP) (Toth & Vigo, 2014), each node has a demand and multiple routes should be constructed (starting and ending at the depot), such that the total demand of the nodes in each route does not exceed the vehicle capacity. We also consider the Split Delivery VRP (SDVRP), which allows to split customer demands over multiple routes. We implement the datasets described by Nazari et al. (2018) and compare against their Reinforcement Learning (RL) framework and the strongest baselines they report. Comparing greedy decoding, we obtain significantly better results. We cannot directly compare our sampling (1280 samples) to their beam search with size 10 (they do not report sampling or larger beam sizes), but note that our greedy method also outperforms their beam search in most (larger) cases, getting (in $< 1$ second/instance) much closer to LKH3 (Helsgaun, 2017), a state-of-the-art algorithm which found best known solutions to CVRP benchmarks. See Appendix C.4 for greedy example solution plots.
163
+
164
+ Orienteering Problem (OP) The OP (Golden et al., 1987) is an important problem used to model many real world problems. Each node has an associated prize, and the goal is to construct a single tour (starting and ending at the depot) that maximizes the sum of prizes of nodes visited while being shorter than a maximum (given) length. We consider the prize distributions proposed in Fischetti et al. (1998): constant, uniform (in Appendix D.4), and increasing with the distance to the depot, which we report here as this is the hardest problem. As ‘best possible solution’ we report Gurobi (intractable for $n > 2 0 .$ ) and Compass, the recent state-of-the-art Genetic Algorithm (GA) by Kobeaga et al. (2018), which is only $2 \%$ better than sampling 1280 solutions with our method (objective is maximization). We outperform a Python $\mathrm { G A } ^ { 4 }$ (which seems not to scale), as well the construction phase of the heuristic by Tsiligirides (1984) (comparing greedy or 1280 samples) which is structurally similar to the one learned by our model. OR Tools fails to find feasible solutions in a few percent of the cases for $n > 2 0$ .
165
+
166
+ Prize Collecting TSP (PCTSP) In the PCTSP (Balas, 1989), each node has not only an associated prize, but also an associated penalty. The goal is to collect at least a minimum total prize, while minimizing the total tour length plus the sum of penalties of unvisited nodes. This problem is difficult as an algorithm has to trade off the penalty for not visiting a node with the marginal cost/tour length of visiting (which depends on the other nodes visited), while also satisfying the minimum total prize constraint. We compare against OR Tools with 10 or 60 seconds of local search, as well as open source $C { + + } ^ { 5 }$ and Python6 implementations of Iterated Local Search (ILS). Although the Attention Model does not find better solutions than OR Tools with 60s of local search, it finds almost equally good results in significantly less time. The results are also within $2 \%$ of the $\mathrm { C } { + } { + }$ ILS algorithm (but obtained much faster), which was the best open-source algorithm for PCTSP we could find.
167
+
168
+ Stochastic PCTSP (SPCTSP) The Stochastic variant of the PCTSP (SPCTSP) we consider shows how our model can deal with uncertainty naturally. In the SPCTSP, the expected node prize is known upfront, but the real collected prize only becomes known upon visitation. With penalties, this problem is a generalization of the stochastic $\mathbf { k }$ -TSP (Ene et al., 2018). Since our model constructs a tour one node at the time, we only need to use the real prizes to compute the remaining prize constraint. By contrast, any algorithm that selects a fixed tour may fail to satisfy the prize constraint so an algorithm must be adaptive. As a baseline, we implement an algorithm that plans a tour, executes part of it and then re-optimizes using the $\mathrm { C } { + } { + }$ ILS algorithm. We either execute all node visits (so planning additional nodes if the result does not satisfy the prize constraint), half of the planned node visits (for $O ( \log n )$ replanning iterations) or only the first node visit, for maximum adaptivity. We observe that our model outperforms all baselines for $n = 2 0$ . We think that failure to account for uncertainty (by the baselines) in the prize might result in the need to visit one or two additional nodes, which is relatively costly for small instances but relatively cheap for larger $n$ . Still, our method is beneficial as it provides competitive solutions at a fraction of the computational cost, which is important in online settings.
169
+
170
+ # 5.2 ATTENTION MODEL VS. POINTER NETWORK AND DIFFERENT BASELINES
171
+
172
+ Figure 3 compares the performance of the TSP20 Attention Model (AM) and our implementation of the Pointer Network (PN) during training. We use a validation set of size 10000 with greedy decoding, and compare to using an exponential $\beta = 0 . 8 )$ and a critic (see Appendix B.1) baseline. We used two random seeds and a decaying learning rate of $\eta = 1 0 ^ { - 3 } \times 0 . 9 6 ^ { \mathrm { e p o c h } }$ . This performs best for the PN, while for the AM results are similar to using $\eta = 1 0 ^ { - 4 }$ (see Appendix B.5). This clearly illustrates how the improvement we obtain is the result of both the AM and the rollout baseline: the AM outperforms the PN using any baseline and the rollout baseline improves the quality and convergence speed for both AM and PN. For the PN with critic baseline, we are unable to reproduce the $1 . 5 \%$ reported by Bello et al. (2016) (also when using an LSTM based critic), but our reproduction is closer than others have reported (Dai et al., 2017; Nazari et al., 2018). In Table 1 we compare against the original results. Compared to the rollout baseline, the exponential baseline is around $20 \%$ faster per epoch, whereas the critic baseline is around $13 \%$ slower (see Appendix B.5), so the picture does not change significantly if time is used as $\mathbf { X }$ -axis.
173
+
174
+ ![](images/fdbd917bf00f1aa0ddfe04a85911c89d083efb6235dae66ae1ae323524a7c678.jpg)
175
+ Figure 3: Held-out validation set optimality gap as a function of the number of epochs for the Attention Model (AM) and Pointer Network (PN) with different baselines (two different seeds).
176
+
177
+ # 6 DISCUSSION
178
+
179
+ In this work we have introduced a model and training method which both contribute to significantly improved results on learned heuristics for TSP and additionally learned strong (single construction) heuristics for multiple routing problems, which are traditionally solved by problem-specific approaches. We believe that our method is a powerful starting point for learning heuristics for other combinatorial optimization problems defined on graphs, if their solutions can be described as sequential decisions. In practice, operational constraints often lead to many variants of problems for which no good (human-designed) heuristics are available such that the ability to learn heuristics could be of great practical value.
180
+
181
+ Compared to previous works, by using attention instead of recurrence (LSTMs) we introduce invariance to the input order of the nodes, increasing learning efficiency. Also this enables parallelization, for increased computational efficiency. The multi-head attention mechanism can be seen as a message passing algorithm that allows nodes to communicate relevant information over different channels, such that the node embeddings from the encoder can learn to include valuable information about the node in the context of the graph. This information is important in our setting where decisions relate directly to the nodes in a graph. Being a graph based method, our model has increased scaling potential (compared to LSTMs) as it can be applied on a sparse graph and operate locally.
182
+
183
+ Scaling to larger problem instances is an important direction for future research, where we think we have made an important first step by using a graph based method, which can be sparsified for improved computational efficiency. Another challenge is that many problems of practical importance have feasibility constraints that cannot be satisfied by a simple masking procedure, and we think it is promising to investigate if these problems can be addressed by a combination of heuristic learning and backtracking. This would unleash the potential of our method, already highly competitive to the popular Google OR Tools project, to an even larger class of difficult practical problems.
184
+
185
+ # ACKNOWLEDGEMENTS
186
+
187
+ This research was funded by ORTEC Optimization Technology. We thank Thomas Kipf for helpful discussions and anonymous reviewers for comments that helped improve the paper. We thank DAS5 (Bal et al., 2016) for computational resources and we thank SURFsara (www.surfsara.nl) for the support in using the Lisa Compute Cluster.
188
+
189
+ # REFERENCES
190
+
191
+ David Applegate, Robert Bixby, Vasek Chvatal, and William Cook. Concorde TSP solver, 2006. URL http://www.math.uwaterloo.ca/tsp/concorde/m.
192
+
193
+ Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
194
+
195
+ Henri Bal, Dick Epema, Cees de Laat, Rob van Nieuwpoort, John Romein, Frank Seinstra, Cees Snoek, and Harry Wijshoff. A medium-scale distributed system for computer science research: Infrastructure for the long term. Computer, (5):54–63, 2016.
196
+
197
+ Egon Balas. The prize collecting traveling salesman problem. Networks, 19(6):621–636, 1989.
198
+
199
+ Irwan Bello, Hieu Pham, Quoc V Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. arXiv preprint arXiv:1611.09940, 2016.
200
+
201
+ Hanjun Dai, Elias B Khalil, Yuyu Zhang, Bistra Dilkina, and Le Song. Learning combinatorial optimization algorithms over graphs. In Advances in Neural Information Processing Systems 30, pp. 6348–6358, 2017.
202
+
203
+ Michel Deudon, Pierre Cournut, Alexandre Lacoste, Yossiri Adulyasak, and Louis-Martin Rousseau. Learning heuristics for the TSP by policy gradient. In International Conference on the Integration of Constraint Programming, Artificial Intelligence, and Operations Research, pp. 170–181. Springer, 2018.
204
+
205
+ Alina Ene, Viswanath Nagarajan, and Rishi Saket. Approximation algorithms for stochastic kTSP. In 37th IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, 2018.
206
+
207
+ Matteo Fischetti, Juan Jose Salazar Gonzalez, and Paolo Toth. Solving the orienteering problem through branch-and-cut. INFORMS Journal on Computing, 10(2):133–148, 1998.
208
+
209
+ Michael R Garey and David S Johnson. Computers and intractability: A guide to the theory of npcompleteness (series of books in the mathematical sciences), ed. Computers and Intractability, pp. 340, 1979.
210
+
211
+ Paul Glasserman and David D Yao. Some guidelines and guarantees for common random numbers. Management Science, 38(6):884–908, 1992.
212
+
213
+ Bruce L Golden, Larry Levy, and Rakesh Vohra. The orienteering problem. Naval Research Logistics (NRL), 34(3):307–318, 1987.
214
+
215
+ Gurobi Optimization, LLC. Gurobi optimizer reference manual, 2018. URL http://www. gurobi.com.
216
+
217
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
218
+
219
+ Keld Helsgaun. An extension of the Lin-Kernighan-Helsgaun TSP solver for constrained traveling salesman and vehicle routing problems: Technical report. 2017.
220
+
221
+ Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning and Representation Learning Workshop, 2015. URL http://arxiv. org/abs/1503.02531.
222
+
223
+ John J Hopfield and David W Tank. “Neural” computation of decisions in optimization problems. Biological cybernetics, 52(3):141–152, 1985.
224
+
225
+ Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015.
226
+
227
+ Yoav Kaempfer and Lior Wolf. Learning the multiple traveling salesmen problem with permutation invariant pooling networks. arXiv preprint arXiv:1803.09621, 2018.
228
+
229
+ Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.
230
+
231
+ Gorka Kobeaga, Mar´ıa Merino, and Jose A Lozano. An efficient evolutionary algorithm for the orienteering problem. Computers & Operations Research, 90:42–59, 2018.
232
+
233
+ Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. Nature, 521(7553):436, 2015.
234
+
235
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
236
+
237
+ MohammadReza Nazari, Afshin Oroojlooy, Lawrence Snyder, and Martin Takac. Reinforcement learning for solving the vehicle routing problem. In Advances in Neural Information Processing Systems, pp. 9860–9870, 2018.
238
+
239
+ Alex Nowak, Soledad Villar, Afonso S Bandeira, and Joan Bruna. A note on learning algorithms for quadratic assignment with graph neural networks. arXiv preprint arXiv:1706.07450, 2017.
240
+
241
+ Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. 2017.
242
+
243
+ Steven J Rennie, Etienne Marcheret, Youssef Mroueh, Jerret Ross, and Vaibhava Goel. Self-critical sequence training for image captioning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7008–7024, 2017.
244
+
245
+ Daniel J Rosenkrantz, Richard E Stearns, and Philip M Lewis. An analysis of several heuristics for the traveling salesman problem. In Fundamental Problems in Computing, pp. 45–69. Springer, 2009.
246
+
247
+ David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. Nature, 550(7676):354, 2017.
248
+
249
+ Kate A Smith. Neural networks for combinatorial optimization: a review of more than a decade of research. INFORMS Journal on Computing, 11(1):15–34, 1999.
250
+
251
+ Paolo Toth and Daniele Vigo. Vehicle routing: problems, methods, and applications. SIAM, 2014.
252
+
253
+ Theodore Tsiligirides. Heuristic methods applied to orienteering. Journal of the Operational Research Society, 35(9):797–809, 1984.
254
+
255
+ Pieter Vansteenwegen, Wouter Souffriau, and Dirk Van Oudheusden. The orienteering problem: A survey. European Journal of Operational Research, 209(1):1–10, 2011.
256
+
257
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pp. 5998–6008, 2017.
258
+
259
+ Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li, and Yoshua Bengio. Graph attention networks. In International Conference on Learning Representations, 2018.
260
+
261
+ Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Advances in Neural Information Processing Systems, pp. 2692–2700, 2015.
262
+
263
+ Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. In International Conference on Learning Representations, 2016.
264
+
265
+ Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
266
+
267
+ David H Wolpert and William G Macready. No free lunch theorems for optimization. IEEE transactions on evolutionary computation, 1(1):67–82, 1997.
268
+
269
+ ![](images/df3d4f4d85482ac690fae297009e6f26d5e99963cd05831044cbab696630191e.jpg)
270
+ Figure 4: Illustration of weighted message passing using a dot-attention mechanism. Only computation of messages received by node 1 are shown for clarity. Best viewed in color.
271
+
272
+ Attention mechanism We interpret the attention mechanism by Vaswani et al. (2017) as a weighted message passing algorithm between nodes in a graph. The weight of the message value that a node receives from a neighbor depends on the compatibility of its query with the key of the neighbor, as illustrated in Figure 4. Formally, we define dimensions $d _ { \mathrm { k } }$ and $d _ { \mathrm { v } }$ and compute the key $\mathbf { k } _ { i } \in \mathbb { R } ^ { d _ { \mathrm { k } } }$ , value $\mathbf { v } _ { i } \in \mathbb { R } ^ { d _ { \mathrm { v } } }$ and query $\mathbf { q } _ { i } \in \mathbb { R } ^ { \mathbf { \bar { d } _ { k } } }$ for each node by projecting the embedding $\mathbf { h } _ { i }$ :
273
+
274
+ $$
275
+ \mathbf { q } _ { i } = W ^ { Q } \mathbf { h } _ { i } , \quad \mathbf { k } _ { i } = W ^ { K } \mathbf { h } _ { i } , \quad \mathbf { v } _ { i } = W ^ { V } \mathbf { h } _ { i } .
276
+ $$
277
+
278
+ Here parameters $W ^ { Q }$ and $W ^ { K }$ are $( d _ { \mathrm { k } } \times d _ { \mathrm { h } } )$ matrices and $W ^ { V }$ has size $( d _ { \mathrm { v } } \times d _ { \mathrm { h } } )$ . From the queries and keys, we compute the compatibility $u _ { i j } \in \mathbb { R }$ of the query $\mathbf { q } _ { i }$ of node $i$ with the key $\mathbf { k } _ { j }$ of node $j$ as the (scaled, see Vaswani et al. (2017)) dot-product:
279
+
280
+ $$
281
+ u _ { i j } = { \left\{ \begin{array} { l l } { { \frac { \mathbf { q } _ { i } ^ { T } \mathbf { k } _ { j } } { \sqrt { d _ { \mathrm { k } } } } } } & { { \mathrm { i f } } i { \mathrm { a d j a c e n t t o } } j } \\ { - \infty } & { { \mathrm { o t h e r w i s e } } . } \end{array} \right. }
282
+ $$
283
+
284
+ In a general graph, defining the compatibility of non-adjacent nodes as $- \infty$ prevents message passing between these nodes. From the compatibilities $u _ { i j }$ , we compute the attention weights $a _ { i j } \in [ 0 , 1 ]$ using a softmax:
285
+
286
+ $$
287
+ a _ { i j } = \frac { e ^ { u _ { i j } } } { \sum _ { j ^ { \prime } } e ^ { u _ { i j ^ { \prime } } } } .
288
+ $$
289
+
290
+ Finally, the vector $\mathbf { h } _ { i } ^ { \prime }$ that is received by node $i$ is the convex combination of messages $\mathbf { v } _ { j }$ :
291
+
292
+ $$
293
+ \mathbf { h } _ { i } ^ { \prime } = \sum _ { j } a _ { i j } \mathbf { v } _ { j } .
294
+ $$
295
+
296
+ Multi-head attention As was noted by Vaswani et al. (2017) and Velickovic et al. (2018), it is beneficial to have multiple attention heads. This allows nodes to receive different types of messages from different neighbors. Especially, we compute the value in equation $1 3 \ M \ = \ 8$ times with different parameters, using $\begin{array} { r } { d _ { \mathrm { k } } = d _ { \mathrm { v } } = \frac { d _ { \mathrm { h } } } { M } = 1 6 } \end{array}$ . We denote the result vectors by $\mathbf { h } _ { i m } ^ { \prime }$ for $m \in$ $1 , \ldots , M$ . These are projected back to a single $d _ { \mathrm { h } }$ -dimensional vector using $( d _ { \mathrm { h } } \times d _ { \mathrm { v } } )$ parameter matrices $W _ { m } ^ { O }$ . The final multi-head attention value for node $i$ is a function of $\mathbf { h } _ { 1 } , \ldots , \mathbf { h } _ { n }$ through h 0im :
297
+
298
+ $$
299
+ { \mathbf { M H A } } _ { i } ( { \mathbf { h } } _ { 1 } , \dots , { \mathbf { h } } _ { n } ) = \sum _ { m = 1 } ^ { M } W _ { m } ^ { O } { \mathbf { h } } _ { i m } ^ { \prime } .
300
+ $$
301
+
302
+ Feed-forward sublayer The feed-forward sublayer computes node-wise projections using a hidden (sub)sublayer with dimension $d _ { \mathrm { f f } } = 5 1 2$ and a ReLu activation:
303
+
304
+ $$
305
+ \mathrm { F F } ( \hat { \mathbf { h } } _ { i } ) = W ^ { \mathrm { f f , 1 } } \cdot \mathrm { R e L u } ( W ^ { \mathrm { f f , 0 } } \hat { \mathbf { h } } _ { i } + { \pmb { b } } ^ { \mathrm { f f , 0 } } ) + { \pmb { b } } ^ { \mathrm { f f , 1 } } .
306
+ $$
307
+
308
+ Batch normalization We use batch normalization with learnable $d _ { \mathrm { h } }$ -dimensional affine parameters $\pmb { w } ^ { \mathrm { b n } }$ and $b ^ { \mathrm { b n } }$ :
309
+
310
+ $$
311
+ \mathbf { B N } ( \mathbf { h } _ { i } ) = \pmb { w } ^ { \mathrm { b n } } \odot \overline { { \mathbf { B N } } } ( \mathbf { h } _ { i } ) + \pmb { b } ^ { \mathrm { b n } } .
312
+ $$
313
+
314
+ Here $\odot$ denotes the element-wise product and $\overline { { \mathrm { B N } } }$ refers to batch normalization without affine transformation.
315
+
316
+ # B TRAVELLING SALESMAN PROBLEM
317
+
318
+ # B.1 CRITIC ARCHITECTURE
319
+
320
+ The critic network architecture uses 3 attention layers similar to our encoder, after which the node embeddings are averaged and processed by an MLP with one hidden layer with 128 neurons and ReLu activation and a single output. We used the same learning rate as for the AM/PN in all experiments.
321
+
322
+ # B.2 INSTANCE GENERATION
323
+
324
+ For all TSP instances, the $n$ node locations are sampled uniformly at random in the unit square. This distribution is chosen to be neither easy nor artificially hard and to be able to compare to other learned heuristics.
325
+
326
+ # B.3 DETAILS OF BASELINES
327
+
328
+ This section describes details of the heuristics implemented for the TSP. All of the heuristics construct a single tour in a single pass, by extending a partial solution one node at the time.
329
+
330
+ Nearest neighbor The nearest neighbor heuristic represents the partial solution as a path with a start and end node. The initial path is formed by a single node, selected randomly, which becomes the start node but also the end node of the initial path. In each iteration, the next node is selected as the node nearest to the end node of the partial path. This node is added to the path and becomes the new end node. Finally, after all nodes are added this way, the end node is connected with the start node to form a tour. In our implementation, for deterministic results we always start with the first node in the input, which can be considered random as the instances are generated randomly.
331
+
332
+ Farthest/nearest/random insertion The insertion heuristics represent a partial solution as a tour, and extends it by inserting nodes one node at the time. In our implementation, we always insert the node using the cheapest insertion cost. This means that when node $i$ is inserted, the place of insertion (between adjacent nodes $j$ and $k$ in the tour) is selected such that it minimizes the insertion costs $d _ { j i } + d _ { i k } - d _ { j k }$ , where $d _ { j i }$ , $d _ { i k }$ and $d _ { j k }$ represent the distances from node $j$ to $i , i$ to $k$ and $j$ to $k$ , respectively.
333
+
334
+ The different variants of the insertion heuristic vary in the way in which the node which is inserted is selected. Let $S$ be the set of nodes in the partial tour. Nearest insertion inserts the node $i$ that is nearest to (any node in) the tour:
335
+
336
+ $$
337
+ i ^ { * } = \arg \operatorname* { m i n } _ { i \notin S } \operatorname* { m i n } _ { j \in S } d _ { i j } .
338
+ $$
339
+
340
+ Farthest insertion inserts the node $i$ such that the distance to the tour (i.e. the distance from $i$ to the nearest node $j$ in the tour) is maximized:
341
+
342
+ $$
343
+ i ^ { * } = \arg \operatorname* { m a x } _ { i \notin S } \operatorname* { m i n } _ { j \in S } d _ { i j } .
344
+ $$
345
+
346
+ Random insertion inserts a random node. Similar to nearest neighbor, we consider the input order random so we simply insert the nodes in this order.
347
+
348
+ # B.4 COMPARISON TO CONCURRENT WORK
349
+
350
+ Independently of our work, Deudon et al. (2018) also developed a model for TSP based on the Transformer (Vaswani et al., 2017). There are important differences to this paper:
351
+
352
+ • As ‘context’ for the decoder, Deudon et al. (2018) use the embeddings of the last $K = 3$ visited nodes. We use only the last (e.g. $K = 1$ ) node but add the first visited node (as well as the graph embedding), since the first node is important (it is the destination) while the order of the other nodes is irrelevant as we explain in Section 3. Deudon et al. (2018) use a critic as baseline (which also uses the Transformer architecture). We also experiment with using a critic (based on the Transformer architecture), but found that using a rollout baseline is much more effective (see Section 5).
353
+
354
+ • Deudon et al. (2018) report results with sampling 128 solutions, with and without 2OPT local search. We report results without 2OPT, using either a single greedy solution or sampling 1280 solutions and additionally show how this directly improves performance compared to Bello et al. (2016). By adding 2OPT on top of the best sampled solution, Deudon et al. (2018) show that the model does not produce a local optimum and results can improve by using a ‘hybrid’ approach of a learned algorithm with local search. This is a nice example of combining learned and traditional heuristics, but it is not compared against using the Pointer Network (Bello et al., 2016) with 2OPT. The model of Deudon et al. (2018) uses a higher dimensionality internally in the decoder (for details see their paper). Training is done with 20000 steps with a batch size of 256. Deudon et al. (2018) apply Principal Component Analysis (PCA) on the input coordinates to eliminate rotation symmetry whereas we directly input node coordinates.
355
+ • Additionally to TSP, we also consider two variants of VRP, the OP with different prize distributions and the (stochastic) PCTSP.
356
+
357
+ We want to emphasize that this is independent work, but for completeness we include a full emperical comparison of performance. Since the results presented in the paper by Deudon et al. (2018) are not directly comparable, we ran their code7 and report results under the same circumstances: using greedy decoding and sampling 1280 solutions on our test dataset (which has exactly the same generative procedure, e.g. uniform in the unit square). Additionally, we include results of their model with 2OPT, showing that (even without 2OPT) final performance of our model is better. We use the hyperparameters in their code, but increase the batch size to 512 and number of training steps to $1 0 0 \times 2 5 0 0 = 2 5 0 0 0 0$ for a fair comparison (this increased the performance of their model). As training with $n = 1 0 0$ gave out-of-memory errors, we train only on $n = 2 0$ and $n = 5 0$ and (following Deudon et al. (2018)) report results for $n = 1 0 0$ using the model trained for $n = 5 0$ . The training time as well as test run times are comparable.
358
+
359
+ # B.5 EXTENDED RESULTS
360
+
361
+ Hyperparameters We found in general that using a larger learning rate of $1 0 ^ { - 3 }$ works better with decay but may be unstable in some cases. A smaller learning rate $1 \bar { 0 } ^ { - 4 }$ is more stable and does not require decay. This is illustrated in Figure 6, which shows validation results over time using both $1 0 ^ { - 3 }$ and $1 0 ^ { - 4 }$ with and without decay for TSP20 and TSP50 (2 seeds). As can be seen, without decay the method has not yet fully converged after 100 epochs and results may improve even further with longer training.
362
+
363
+ Table 2 shows the results in absolute terms as well as the relative optimality gap compared to Gurobi, for all runs using seeds 1234 and 1235 with the two different learning rate schedules. We did not run final experiments for $n = 1 0 0$ with the larger learning rate as we found training with the smaller learning rate to be more stable. It can be seen that in most cases the end results with different learning rate schedules are similar, except for the larger models ( $N = 5$ , $N = 8$ ) where some of the runs diverged using the larger learning rate. Experiments with different number of layers $N$ show that $N = 3$ and $N = 5$ achieve best performance, and we find $N = 3$ is a good trade-off between quality of the results and computational complexity (runtime) of the model.
364
+
365
+ Generalization We test generalization performance on different $n$ than trained for, which we plot in Figure 5 in terms of the relative optimality gap compared to Gurobi. The train sizes are indicated with vertical marker bars. The models generalize when tested on different sizes, although quality degrades as the difference becomes bigger, which can be expected as there is no free lunch (Wolpert & Macready, 1997). Since the architectures are the same, these differences mean the models learn to specialize on the problem sizes trained for. We can make a strong overall algorithm by selecting the trained model with highest validation performance for each instance size $n$ (marked in Figure 5 by the red bar). For reference, we also include the baselines, where for the methods that perform search or sampling we do not connect the dots to prevent cluttering and to make the distinction with methods that consider only a single solution clear.
366
+
367
+ Table 2: Epoch durations and results and with different seeds and learning rate schedules for TSP.
368
+
369
+ <table><tr><td rowspan="2"></td><td rowspan="2">|epoch| time</td><td colspan="2">n=10-4</td><td colspan="2">n=10-3 ×0.96epoch</td></tr><tr><td>seed = 1234</td><td>seed = 1235</td><td>seed = 1234</td><td>seed = 1235</td></tr><tr><td>TSP20</td><td>5:30</td><td>3.85 (0.34%)</td><td>3.85 (0.29%)</td><td>3.85 (0.33%)</td><td>3.85 (0.32%)</td></tr><tr><td>TSP50</td><td>16:20</td><td>5.80 (1.76%)</td><td>5.79 (1.66%)</td><td>5.81 (2.02%)</td><td>5.81 (2.00%)</td></tr><tr><td>TSP100 (2GPUs)</td><td>27:30</td><td>8.12 (4.53%)</td><td>8.10 (4.34%)</td><td></td><td></td></tr><tr><td>N=0</td><td>3:10</td><td>4.24 (10.50%)</td><td>4.26 (10.95%)</td><td>4.25 (10.79%)</td><td>4.24 (10.55%)</td></tr><tr><td>N=1</td><td>3:50</td><td>3.87 (0.97%)</td><td>3.87(1.01%)</td><td>3.87(0.90%)</td><td>3.87 (0.89%)</td></tr><tr><td>N=2</td><td>5:00</td><td>3.85 (0.40%)</td><td>3.85 (0.44%)</td><td>3.85 (0.38%)</td><td>3.85 (0.39%)</td></tr><tr><td>N=3</td><td>5:30</td><td>3.85 (0.34%)</td><td>3.85 (0.29%)</td><td>3.85 (0.33%)</td><td>3.85 (0.32%)</td></tr><tr><td>N=5</td><td>7:00</td><td>3.85 (0.25%)</td><td>3.85 (0.28%)</td><td>3.85 (0.30%)</td><td>10.43 (171.82%)</td></tr><tr><td>N=8</td><td>10:10</td><td>3.85(0.28%)</td><td>3.85 (0.33%)</td><td>10.43 (171.82%)</td><td>10.43 (171.82%)</td></tr><tr><td>AM/Exponential</td><td>4:20</td><td>3.87 (0.95%)</td><td>3.87 (0.93%)</td><td>3.87 (0.90%)</td><td>3.87 (0.87%)</td></tr><tr><td>AM/Critic</td><td>6:10</td><td>3.87(0.96%)</td><td>3.87 (0.97%)</td><td>3.87 (0.88%)</td><td>3.87 (0.88%)</td></tr><tr><td>AM/Rollout</td><td>5:30</td><td>3.85 (0.34%)</td><td>3.85 (0.29%)</td><td>3.85 (0.33%)</td><td>3.85 (0.32%)</td></tr><tr><td>PN /Exponential</td><td>5:10</td><td>3.95 (2.94%)</td><td>3.94 (2.80%)</td><td>3.92 (2.09%)</td><td>3.93 (2.37%)</td></tr><tr><td>PN /Critic</td><td>7:30</td><td>3.95 (3.00%)</td><td>3.95 (2.93%)</td><td>3.91 (2.01%)</td><td>3.94 (2.84%)</td></tr><tr><td>PN /Rollout</td><td>6:40</td><td>3.93 (2.46%)</td><td>3.93 (2.36%)</td><td>3.90 (1.63%)</td><td>3.90 (1.78%)</td></tr></table>
370
+
371
+ ![](images/277a8b08913356ba177c4d88288d2da5cf95e78261c0683de8d489036b56c67b.jpg)
372
+ Figure 5: Optimality gap of different methods as a function of problem size $n \_ { \mathrm { ~ \in ~ } }$ $\{ 5 , 1 0 , 1 5 , 2 0 , 2 5 , 3 0 , 4 0 , 5 0 , 6 0 , 7 5 , 1 0 0 , 1 2 5 \}$ . General baselines are drawn using dashed lines while learned algorithms are drawn with a solid line. Algorithms (general and learned) that perform search or sampling are plotted without connecting lines for clarity. The \*, \*\*, \*\*\* and \*\*\*\* indicate that values are reported from Bello et al. (2016), Vinyals et al. (2015), Dai et al. (2017) and Nowak et al. (2017) respectively. Best viewed in color.
373
+
374
+ ![](images/ebd773557ca0749991d2477725a184b40d69f3c03fcbce94f7e751944df68ab6.jpg)
375
+ Figure 6: Validation set optimality gap as a function of the number of epochs for different $\eta$
376
+
377
+ # C VEHICLE ROUTING PROBLEM
378
+
379
+ The Capacitated Vehicle Routing Problem (CVRP) is a generalization of the TSP in which case there is a depot and multiple routes should be created, each starting and ending at the depot. In our graph based formulation, we add a special depot node with index 0 and coordinates $\mathbf { x } _ { \mathrm { 0 } }$ . A vehicle (route) has capacity $D > 0$ and each (regular) node $i \in \{ 1 , \ldots n \}$ has a demand $0 < \delta _ { i } \le D$ . Each route starts and ends at the depot and the total demand in each route should not exceed the capacity, so $\textstyle \sum _ { i \in R _ { j } } \delta _ { i } \leq D$ , where $R _ { j }$ is the set of node indices assigned to route $j$ . Without loss of generality, we assume a normalized $\hat { D } = 1$ as we can use normalized demands $\begin{array} { r } { \hat { \delta } _ { i } = \frac { \delta _ { i } } { D } } \end{array}$ .
380
+
381
+ The Split Delivery VRP (SDVRP) is a generalization of CVRP in which every node can be visited multiple times, and only a subset of the demand has to be delivered at each visit. Instances for both CVRP and SDVRP are specified in the same way: an instance with size $n$ as a depot location $\mathbf { x } _ { \mathrm { 0 } }$ , $n$ node locations $\mathbf { x } _ { i } , i = 1 \ldots n$ and (normalized) demands $0 < \hat { \delta } _ { i } \leq 1 , i = 1 \ldots n$ .
382
+
383
+ # C.1 INSTANCE GENERATION
384
+
385
+ We follow Nazari et al. (2018) in the generation of instances for $n = 2 0 , 5 0 , 1 0 0$ , but normalize the demands by the capacities. The depot location as well as $n$ node locations are sampled uniformly at random in the unit square. The demands are defined as $\begin{array} { r } { \hat { \delta } _ { i } = \frac { \delta _ { i } } { D ^ { n } } } \end{array}$ where $\delta _ { i }$ is discrete and sampled uniformly from $\{ 1 , \ldots , 9 \}$ and $D ^ { 2 0 } = 3 0$ , $D ^ { 5 0 } = 4 0$ and $D ^ { 1 0 0 } = 5 0$ .
386
+
387
+ # C.2 ATTENTION MODEL FOR THE VRP
388
+
389
+ Encoder In order to allow our Attention Model to distinguish the depot node from the regular nodes, we use separate parameters $W _ { 0 } ^ { \mathrm { x } }$ and ${ \bf b } _ { 0 } ^ { \mathrm { x } }$ to compute the initial embedding $\mathbf { h } _ { 0 } ^ { ( 0 ) }$ of the depot node. Additionally, we provide the normalized demand $\delta _ { i }$ as input feature (and adjust the size of parameter $W ^ { \mathrm { x } }$ accordingly):
390
+
391
+ $$
392
+ \begin{array} { r } { \mathbf { h } _ { i } ^ { \left( 0 \right) } = \left\{ \begin{array} { l l } { W _ { 0 } ^ { \mathrm { x } } \mathbf { x } _ { i } + \mathbf { b } _ { 0 } ^ { \mathrm { x } } } & { i = 0 } \\ { W ^ { \mathrm { x } } \left[ \mathbf { x } _ { i } , \hat { \delta } _ { i } \right] + \mathbf { b } ^ { \mathrm { x } } } & { i = 1 , \ldots , n . } \end{array} \right. } \end{array}
393
+ $$
394
+
395
+ Capacity constraints To facilitate the capacity constraints, we keep track of the remaining demands $\hat { \delta } _ { i , t }$ for the nodes $i \in \{ 1 , \ldots n \}$ and remaining vehicle capacity $\hat { D } _ { t }$ at time $t$ . At $t = 1$ , these are initialized as $\hat { \delta } _ { i , t } = \hat { \delta } _ { i }$ and $\hat { D } _ { t } = 1$ , after which they are updated as follows (recall that $\pi _ { t }$ is the index of the node selected at decoding step $t$ ):
396
+
397
+ $$
398
+ \begin{array} { r l } { \widehat { \delta } _ { i , t + 1 } = \left\{ \begin{array} { l l } { \operatorname* { m a x } ( 0 , \widehat { \delta } _ { i , t } - \hat { D } _ { t } ) } & { \pi _ { t } = i } \\ { \widehat { \delta } _ { i , t } } & { \pi _ { t } \neq i } \end{array} \right. } \\ { \hat { D } _ { t + 1 } = \left\{ \begin{array} { l l } { \operatorname* { m a x } ( \hat { D } _ { t } - \widehat { \delta } _ { \pi _ { t } , t } , 0 ) } & { \pi _ { t } \neq 0 } \\ { 1 } & { \pi _ { t } = 0 . } \end{array} \right. } \end{array}
399
+ $$
400
+
401
+ If we do not allow split deliveries, $\hat { \delta } _ { i , t }$ will be either 0 or $\hat { \delta } _ { i }$ for all $t$ .
402
+
403
+ Decoder context The context for the decoder for the VRP at time $t$ is the current/last location $\pi _ { t - 1 }$ and the remaining capacity $\hat { D } _ { t }$ . Compared to TSP, we do not need placeholders if $t = 1$ as the route starts at the depot and we do not need to provide information about the first node as the route should end at the depot:
404
+
405
+ $$
406
+ \mathbf { h } _ { ( c ) } ^ { ( N ) } = \left\{ \begin{array} { l l } { \left[ \bar { \mathbf { h } } ^ { ( N ) } , \mathbf { h } _ { \pi _ { t - 1 } } ^ { ( N ) } , \hat { D } _ { t } \right] } & { t > 1 } \\ { \left[ \bar { \mathbf { h } } ^ { ( N ) } , \mathbf { h } _ { 0 } ^ { ( N ) } , \hat { D } _ { t } \right] } & { t = 1 . } \end{array} \right.
407
+ $$
408
+
409
+ Masking The depot can be visited multiple times, but we do not allow it to be visited at two subsequent timesteps. Therefore, in both layers of the decoder, we change the masking for the depot $j = 0$ and define $u _ { ( c ) 0 } = - \infty$ if (and only if) $t = 1$ or $\pi _ { t - 1 } = 0$ . The masking for the nodes depends on whether we allow split deliveries. Without split deliveries, we do not allow nodes to be visited if their remaining demand is 0 (if the node was already visited) or exceeds the remaining capacity, so for $j \neq 0$ we define $u _ { ( c ) j } = - \infty$ if (and only if) $\hat { \delta } _ { i , t } = 0$ or $\hat { \delta } _ { i , t } > \hat { D } _ { t }$ . With split deliveries, we only forbid delivery when the remaining demand is 0, so we define $u _ { ( c ) j } = - \infty$ if (and only if) $\hat { \delta } _ { i , t } = 0$ .
410
+
411
+ Split deliveries Without split deliveries, the remaining demand $\hat { \delta } _ { i , t }$ is either 0 or $\hat { \delta } _ { i }$ , corresponding to whether the node has been visited or not, and this information is conveyed to the model via the masking of the nodes already visited. However, when split deliveries are allowed, the remaining demand $\hat { \delta } _ { i , t }$ can take any value $0 \leq \hat { \delta } _ { i , t } \leq \hat { \delta } _ { i }$ . This information cannot be included in the context node as it corresponds to individual nodes. Therefore we include it in the computation of the keys and values in both the attention layer (glimpse) and the output layer of the decoder, such that we compute queries, keys and values using:
412
+
413
+ $$
414
+ \mathbf { q } _ { ( c ) } = W ^ { Q } \mathbf { h } _ { ( c ) } \quad \mathbf { k } _ { i } = W ^ { K } \mathbf { h } _ { i } + W _ { d } ^ { K } \hat { \delta } _ { i , t } , \quad \mathbf { v } _ { i } = W ^ { V } \mathbf { h } _ { i } + W _ { d } ^ { V } \hat { \delta } _ { i , t } .
415
+ $$
416
+
417
+ Here we $W _ { d } ^ { K }$ and $\it { W _ { d } ^ { V } }$ are $( d _ { k } \times 1 )$ parameter matrices and we define $\hat { \delta } _ { i , t } ~ = ~ 0$ for the depot $i = 0$ . Summing the projection of both $\mathbf { h } _ { i }$ and $\hat { \delta } _ { i , t }$ is equivalent to projecting the concatenation $[ \mathbf { h } _ { i } , \hat { \delta } _ { i , t } ]$ with a single $( ( d _ { h } + 1 ) \times d _ { k } )$ matrix $W ^ { K }$ . However, using this formulation we only need to compute the first term once (instead for every $t$ ) and by the weight initialization this puts more importance on $\hat { \delta } _ { i , t }$ initially (which is otherwise just 1 of $d _ { h } + 1 = 1 2 9$ input values).
418
+
419
+ Training For the VRP, the length of the output of the model depends on the number of times the depot is visited. In general, the depot is visited multiple times, and in the case of SDVRP also some regular nodes are visited twice. Therefore the length of the solution is larger than $n$ , which requires more memory such that we find it necessary to limit the batch size $B$ to 256 for $n = 1 0 0$ (on 2 GPUs). To keep training times tractable and the total number of parameter updates equal, we still process 2500 batches per epoch, for a total of $0 . 6 4 \mathbf { M }$ training instances per epoch.
420
+
421
+ # C.3 DETAILS OF BASELINES
422
+
423
+ For $\mathrm { L K H } 3 ^ { 8 }$ by Helsgaun (2017) we build and run their code with the SPECIAL parameter as specified in their CVRP runscript9. We perform 1 run with a maximum of 10000 trials, as we found performing 10 runs only marginally improves the quality of the results while taking much more time.
424
+
425
+ # C.4 EXAMPLE SOLUTIONS
426
+
427
+ Figure 7 shows example solutions for the CVRP with $n ~ = ~ 1 0 0$ that were obtained by a single construction using the model with greedy decoding. These visualizations give insight in the heuristic that the model has learned. In general we see that the model constructs the routes from the bottom to the top, starting below the depot. Most routes are densely packed, except for the last route that has to serve some remaining (close to each other) customers. In most cases, the node in the route that is farthest from the depot is somewhere in the middle of the route, such that customers are served on the way to and from the farthest nodes. In some cases, we see that the order of stops within some individual routes is suboptimal, which means that the method will likely benefit from simple further optimizations on top, such as a beam search, a post-processing procedure based on local search (e.g. 2OPT) or solving the individual routes using a TSP solver.
428
+
429
+ ![](images/8b14539074cffd959cf4c6edad69806e0f9aa42abfd65482e292164be0fe7709.jpg)
430
+ Figure 7: Example greedy solutions for the CVRP $n = 1 0 0$ ). Edges from and to depot omitted for clarity. Legend order/coloring and arcs indicate the order in which the solution was generated. Legends indicate the number of stops, the used and available capacity and the distance per route.
431
+
432
+ # D ORIENTEERING PROBLEM
433
+
434
+ In the Orienteering Problem (OP) each node has a prize $\rho _ { i }$ and the goal is to maximize the total prize of nodes visited, while keeping the total length of the route below a maximum length $T$ . This problem is different from the TSP and the VRP because visiting each node is optional. Similar to the VRP, we add a special depot node with index 0 and coordinates $\mathbf { x } _ { \mathrm { 0 } }$ . If the model selects the depot, we consider the route to be finished. In order to prevent infeasible solutions, we only allow to visit a node if after visiting that node a return to the depot is still possible within the maximum length constraint. Note that it is always suboptimal to visit the depot if additional nodes can be visited, but we do not enforce this knowledge.
435
+
436
+ # D.1 INSTANCE GENERATION
437
+
438
+ The depot location as well as $n$ node locations are sampled uniformly at random in the unit square.
439
+ For the distribution of the prizes, we consider three different variants described by Fischetti et al.
440
+ (1998), but we normalize the prizes $\rho _ { i }$ such that the normalized prizes $\hat { \rho } _ { i }$ are between 0 and 1.
441
+
442
+ Constant $\rho _ { i } = \hat { \rho } _ { i } = 1$ . Every node has the same prize so the goal becomes to visit as many nodes as possible within the length constraint.
443
+
444
+ Uniform $\begin{array} { r } { \rho _ { i } \sim \mathrm { D i s c r e t e U n i f o r m } ( 1 , 1 0 0 ) , \hat { \rho } _ { i } = \frac { \rho _ { i } } { 1 0 0 } } \end{array}$ . Every node has a prize that is (discretized) uniform.
445
+
446
+ Distance $\begin{array} { r } { \rho _ { i } = 1 + \left\lfloor 9 9 \cdot \frac { d _ { 0 i } } { \operatorname* { m a x } _ { j = 1 } ^ { n } d _ { 0 j } } \right\rfloor , \hat { \rho } _ { i } = \frac { \rho _ { i } } { 1 0 0 } } \end{array}$ , where $d _ { 0 i }$ is the distance from the depot to node $i$ . Every node has a (discretized) prize that is proportional to the distance to the depot. This is designed to be challenging as the largest prizes are furthest away from the depot (Fischetti et al., 1998).
447
+
448
+ The maximum length $T ^ { n }$ for instances with $n$ nodes (and a depot) is chosen to be (on average) approximately half of the length of the average TSP tour for uniform TSP instances with $n$ nodes10. This idea is that this way approximately (a little more than) half of the nodes can be visited, which results in the most difficult problem instances (Vansteenwegen et al., 2011). This is because the number of possible node selections $\textstyle { \binom { n } { k } }$ is maximized if $\begin{array} { r } { k = \frac { n } { 2 } } \end{array}$ and additionally determining the actual path is harder with more nodes selected. We set fixed maximum lengths $T ^ { 2 0 } = 2$ , $T ^ { 5 0 } = 3$ and $T ^ { \mathrm { 1 0 0 } } = 4$ instead of adjusting the constraint per instance, such that for some instances more or less nodes can be visited. Note that $T ^ { n }$ has the same unit as the node coordinates $\mathbf { x } _ { i }$ , so we do not normalize them.
449
+
450
+ # D.2 ATTENTION MODEL FOR THE OP
451
+
452
+ Encoder Similar to the VRP, we use separate parameters for the depot node embedding. Additionally, we provide the node prize $\hat { \rho } _ { i }$ as input feature:
453
+
454
+ $$
455
+ \mathbf { h } _ { i } ^ { ( 0 ) } = \left\{ \begin{array} { l l } { W _ { 0 } ^ { \mathrm { x } } \mathbf { x } _ { i } + \mathbf { b } _ { 0 } ^ { \mathrm { x } } } & { i = 0 } \\ { W ^ { \mathrm { x } } \left[ \mathbf { x } _ { i } , \hat { \rho } _ { i } \right] + \mathbf { b } ^ { \mathrm { x } } } & { i = 1 , \ldots , n . } \end{array} \right.
456
+ $$
457
+
458
+ Max length constraint In order to satisfy the max length constraint, we keep track of the remaining max length $T _ { t }$ at time $t$ . Starting at $t = 1$ , $T _ { 1 } = T$ . Then for $t > 0$ , $T$ is updated as
459
+
460
+ $$
461
+ T _ { t + 1 } = T _ { t } - d _ { \pi _ { t - 1 } , \pi _ { t } } .
462
+ $$
463
+
464
+ Here $d _ { \pi _ { t - 1 } , \pi _ { t } }$ is the distance from node $\pi _ { t - 1 }$ to $\pi _ { t }$ and we conveniently define $\pi _ { 0 } = 0$ as we start at the depot.
465
+
466
+ Decoder context The context for the decoder for the OP at time $t$ is the current/last location $\pi _ { t - 1 }$ and the remaining max length $T _ { t }$ . Similar to VRP, we do not need placeholders if $t = 1$ as the route starts at the depot and we do not need to provide information about the first node as the route should
467
+
468
+ end at the depot. We do not need to provide information on the prizes gathered as this is irrelevant for the remaining decisions. The context is defined as:
469
+
470
+ $$
471
+ \mathbf { h } _ { ( c ) } ^ { ( N ) } = \left\{ \begin{array} { l l } { \left[ \bar { \mathbf { h } } ^ { ( N ) } , \mathbf { h } _ { \pi _ { t - 1 } } ^ { ( N ) } , T _ { t } \right] } & { t > 1 } \\ { \left[ \bar { \mathbf { h } } ^ { ( N ) } , \mathbf { h } _ { 0 } ^ { ( N ) } , T _ { t } \right] } & { t = 1 . } \end{array} \right.
472
+ $$
473
+
474
+ Masking In the OP, the depot node can always be visited so is never masked. Regular nodes are masked (i.e. cannot be visited) if either they are already visited or if they cannot be visited within the remaining length constraint:
475
+
476
+ $$
477
+ u _ { ( c ) j } = - \infty \Leftrightarrow \exists t ^ { \prime } < t : \pi _ { t ^ { \prime } } = j \mathrm { o r } d _ { \pi _ { t - 1 } , j } + d _ { j 0 } > T _ { t }
478
+ $$
479
+
480
+ # D.3 DETAILS OF BASELINES
481
+
482
+ For Compass11 by Kobeaga et al. (2018), we compile their code and run it with default parameters, only adding $\begin{array} { c c c } { -- \infty } & { -- \infty } & { \mathsf { P } \mathrm { - } \mathsf { e a } 4 \infty \mathsf { p } } \end{array}$ to indicate that the Genetic Algorithm for the Orienteering Problem should be used. As Compass uses integer coordinates and prizes, we multiply all floats by $1 0 ^ { 7 }$ and round to integers. We run the Python Genetic Algorithm12 with default parameters.
483
+
484
+ Tsiligirides Tsiligirides (1984) describes a heuristic procedure for solving the OP. It consists of sampling 3000 tours through a randomized construction procedure and applies local search on top. The randomized construction part of the heuristic is structurally exactly the same as the heuristic learned by our model, but with a manually engineered function to define the node probabilities. We implement the construction part of the heuristic and compare it to our model (either greedy or sampling 1280 solutions), without the local search (as this can also be applied on top of our model). The final heuristic used by Tsiligirides (1984) uses a formula with multiple terms to define the probability that a node should be selected, but by tuning the weights the form with only one simple term works best, showing the difficulty of manually defining a good probability distribution. In our terms, the heuristic defines a score $s _ { i }$ for each node at time $t$ as the prize divided by the distance from the current node $\pi _ { t - 1 }$ , raised to the 4th power:
485
+
486
+ $$
487
+ s _ { i } = \left( \frac { \hat { \rho } _ { i } } { d _ { \pi _ { t - 1 } , i } } \right) ^ { 4 } .
488
+ $$
489
+
490
+ Let $S$ be the set with the $\operatorname* { m i n } ( 4 , n - ( t - 1 ) )$ unvisited nodes with maximum score $s _ { i }$ . Then the node probabilities $p _ { i }$ at time $t$ are defined as
491
+
492
+ $$
493
+ p _ { i } = p _ { \theta } ( \pi _ { t } = i | s , \pi _ { 1 : t - 1 } ) = { \left\{ \begin{array} { l l } { { \frac { s _ { i } } { \sum _ { j \in S } s _ { j } } } } & { { \mathrm { i f ~ } } i \in S } \\ { 0 } & { { \mathrm { o t h e r w i s e . } } } \end{array} \right. }
494
+ $$
495
+
496
+ OR Tools For the Google OR Tools implementation, we modify the formulation for the CVRP13:
497
+
498
+ • We replace the Manhattan distance by the Euclidian distance.
499
+ • We set the number of vehicles to 1.
500
+ • For each individual node $i$ , we add a Disjunction constraint with $\{ i \}$ as the set of nodes, and a penalty equal to the prize $\hat { \rho } _ { i }$ . This allows OR tools to skip node $i$ at a cost $\hat { \rho } _ { i }$ . • We replace the capacity constraint by a maximum distance. constraint
501
+ • We remove the objective to minimize the length.
502
+
503
+ We multiply all float inputs by $1 0 ^ { 7 }$ and round to integers. Note that OR Tools computes penalties for skipped nodes rather than gains for nodes that are visited. The problem is equivalent, but in order to compare the objective value against our method, we need to add the constant sum of all penalties $\textstyle \sum _ { i } { \hat { \rho } } _ { i }$ to the OR Tools objective.
504
+
505
+ # D.4 EXTENDED RESULTS
506
+
507
+ Table 3 displays the results for the OP with constant and uniform prize distributions. The results are similar to the results for the prize distribution based on the distance to the depot, although by the calculation time for Gurobi it is confirmed that indeed constant and uniform prize distributions are easier.
508
+
509
+ Table 3: Additional results for the OP
510
+
511
+ <table><tr><td>Method</td><td>20</td><td>100</td></tr><tr><td>Gurobi Compass</td><td>10.57 (4m) 10.56 (55s) 29.58</td><td>(3m) 59.35 (8m)</td></tr><tr><td>(tueseos) Tsili (greedy) AM (greedy)</td><td>8.82 (5s) 23.89 |10.27 (0s)28.31</td><td>(4s) 47.65 (5s) (2s) 55.81 (5s)</td></tr><tr><td>o GA (Python) OR Tools (10s) Tsili (sampling) AM (sampling)</td><td>9.72(10m) 18.52 8.54(52m) 10.48 (28s) 28.26 10.49 (4m) 29.36(17m) 58.33(56m)</td><td>(1h) 25.68 (5h) = (2m) 54.27 (6m)</td></tr><tr><td>Gurobi Compass</td><td>5.85 (7m) 5.84 (1m) 16.46</td><td>(5m) 33.30(14m)</td></tr><tr><td>(uojiun) Tsili (greedy) AM(greedy)</td><td>4.85 (4s) 12.80 5.60 (0s)15.62</td><td>(4s) 25.48 (5s) (2s)31.03 (5s)</td></tr><tr><td>GA (Python) OR Tools (10s) Tsili (sampling)</td><td>5.53(10m) 10.81 4.69 (52m) 5.70 (26s)15.28</td><td>(1h) 14.89 (5h) = 3(2m)29.54 (5m)</td></tr></table>
512
+
513
+ # E PRIZE COLLECTING TSP
514
+
515
+ In the Prize Collecting TSP (PCTSP) each node has a prize $\rho _ { i }$ and an associated penalty $\beta _ { i }$ . The goal is to minimize the total length of the tour plus the sum of penalties for nodes which are not visited, while collecting at least a given minimum total prize. W.l.o.g. we assume the minimum total prize is equal to 1 (as prizes can be normalized). This problem is related to the OP but inverts the goal (minimizing tour length given a minimum total prize to collect instead of maximizing total prize given a maximum tour length) and additionally adds penalties. Again, we add a special depot node with index 0 and coordinates $\mathbf { x } _ { \mathrm { 0 } }$ and if the model selects the depot, the route is finished. In the PCTSP, it can be beneficial to visit additional nodes, even if the minimum total prize constraint is already satisfied, in order to avoid penalties.
516
+
517
+ # E.1 INSTANCE GENERATION
518
+
519
+ The depot location as well as $n$ node locations are sampled uniformly at random in the unit square. Similar to the OP, we select the distribution for the prizes and penalties with the idea that for difficult instances approximately half of the nodes should be visited. Additionally, neither the prize nor the penalty should dominate the node selection process.
520
+
521
+ Prizes We consider uniformly distributed prizes. If we sample prizes $\rho _ { i } \sim \mathrm { U n i f o r m } ( 0 , 1 )$ , then $\begin{array} { r } { \mathbb { E } ( \rho _ { i } ) = \frac { 1 } { 2 } } \end{array}$ , and the expected total prize of any subset of $\frac { n } { 2 }$ nodes (i.e. half of the nodes) would be $\frac { n } { 4 }$ 2. Therefore, if $S$ 2is the set of nodes that is visited, we require that $\textstyle \sum _ { i \in S } \rho _ { i } \geq { \frac { n } { 4 } }$ , or equivalently $\textstyle \sum _ { i \in S _ { . } } { \hat { \rho } } _ { i } \geq 1$ where $\hat { \rho } _ { i } = \rho _ { i } \cdot \frac { 4 } { n }$ is the normalized prize. Note that it can be the case that $\textstyle \sum _ { i = 1 } ^ { n } { \hat { \rho } } _ { i } < 1$ in which case the prize constraint may be violated but it is only allowed to return to the depot after all nodes have been visited.
522
+
523
+ Penalties If penalties are too small, then node selection is determined almost entirely by the min
524
+ imum total prize constraint. If penalties are too large, we will always visit all nodes, making the
525
+ minimum total prize constraint obsolete. We argue that in order for the penalties to be meaning
526
+ ful, they should contribute a term in the objective approximately equal to the total length of the
527
+ tour. If $L ^ { n }$ is the expected TSP tour length with $n$ nodes, we try to achieve this by sampling
528
+ $\beta _ { i } \sim \mathrm { U n i f o r m } ( 0 , 2 \cdot { \frac { L ^ { n } } { n } } )$ such that he number $\begin{array} { r } { \mathbb { E } ( \beta _ { i } ) = \frac { L ^ { n } } { n } } \end{array}$ and the expected total pehe OP, we roughly define f f $\frac { n } { 2 }$ $\frac { L ^ { n } } { 2 }$ $\textstyle { \frac { L ^ { n } } { 2 } } \approx K ^ { n } = 2 , 3 , 4$
529
+ $n = 2 0 , 5 0 , 1 0 0 ^ { 1 4 }$ e should sample works better, wh $\beta _ { i } \sim \mathrm { U n i f o r m } ( 0 , 4 \cdot { \frac { K ^ { n } } { n } } )$ , but empiricallyand penalties are $\hat { \beta } _ { i } \sim \mathrm { U n i f o r m } ( 0 , 3 \cdot { \frac { K ^ { n } } { n } } )$
530
+
531
+ # E.2 ATTENTION MODEL FOR THE PCTSP
532
+
533
+ Encoder Again, we use separate parameters for the depot node embedding. Additionally, we provide the node prize $\hat { \rho } _ { i }$ and the penalty ${ \hat { \beta } } _ { i }$ as input features:
534
+
535
+ $$
536
+ \mathbf { h } _ { i } ^ { ( 0 ) } = \left\{ \begin{array} { l l } { W _ { 0 } ^ { \mathrm { x } } \mathbf { x } _ { i } + \mathbf { b } _ { 0 } ^ { \mathrm { x } } } & { i = 0 } \\ { W ^ { \mathrm { x } } \left[ \mathbf { x } _ { i } , \hat { \rho } _ { i } , \hat { \beta } _ { i } \right] + \mathbf { b } ^ { \mathrm { x } } } & { i = 1 , \ldots , n . } \end{array} \right.
537
+ $$
538
+
539
+ Minimum prize constraint In order to satisfy the minimum total prize constraint, we keep track of the remaining total prize $P _ { t }$ to collect at time $t$ . At $t = 1$ , $P _ { 1 } = 1$ (as we normalized prizes). Then for $t > 0$ , $P$ is updated as
540
+
541
+ $$
542
+ P _ { t + 1 } = \operatorname* { m a x } ( 0 , P _ { t } - \hat { \rho } _ { \pi _ { t } } ) .
543
+ $$
544
+
545
+ If the constraint is satisfied after visiting $\pi _ { t }$ is visited at time $t$ , then $P _ { t + 1 }$ will be 0.
546
+
547
+ Decoder context The context for the decoder for the PCTSP at time $t$ is the current/last location $\pi _ { t - 1 }$ and the remaining prize to collect $P _ { t }$ . Again, we do not need placeholders if $t = 1$ as the route starts at the depot and we do not need to provide information about the first node as the route should end at the depot. The information about the prizes collected is implicitly provided to the model in the form of $P _ { t }$ and we do not need to provide any information about the penalties as this is irrelevant for the remaining decisions:
548
+
549
+ $$
550
+ \mathbf { h } _ { ( c ) } ^ { ( N ) } = \left\{ \begin{array} { l l } { \left[ \bar { \mathbf { h } } ^ { ( N ) } , \mathbf { h } _ { \pi _ { t - 1 } } ^ { ( N ) } , P _ { t } \right] } & { t > 1 } \\ { \left[ \bar { \mathbf { h } } ^ { ( N ) } , \mathbf { h } _ { 0 } ^ { ( N ) } , P _ { t } \right] } & { t = 1 . } \end{array} \right.
551
+ $$
552
+
553
+ Masking In the PCTSP, the depot node cannot be visited if the remaining prize to collect $P _ { t }$ is larger than 0 and not yet all nodes have been visited (so $t \leq n$ ):
554
+
555
+ $$
556
+ u _ { ( c ) 0 } = - \infty \Leftrightarrow P _ { t } > 0 { \mathrm { ~ a n d ~ } } t \leq n .
557
+ $$
558
+
559
+ Regular nodes are masked (i.e. cannot be visited) only if they are already visited:
560
+
561
+ $$
562
+ u _ { ( c ) j } = - \infty \Leftrightarrow \exists t ^ { \prime } < t : \pi _ { t ^ { \prime } } = j .
563
+ $$
564
+
565
+ # E.3 DETAILS OF BASELINES
566
+
567
+ For the $\mathrm { C } { + } { + }$ Iterated Local Search (ILS) algorithm15, we perform 1 run as this takes already 2 minutes per instance (single thread) on average. For the Python ILS algorithm16 we perform 10 runs as this algorithm is fast. This improved results somewhat for $n = 2 0$ .
568
+
569
+ OR Tools For the Google OR Tools implementation, we modify the formulation for the CVRP17:
570
+
571
+ • We replace the Manhattan distance by the Euclidian distance.
572
+ • We set the number of vehicles to 1.
573
+ • For each individual node $i$ , we add a Disjunction constraint with $\{ i \}$ as the set of nodes, and a penalty equal to the penalty $\hat { \beta } _ { i }$ . This allows OR tools to skip node $i$ at a cost $\hat { \beta } _ { i }$ .
574
+ • We replace the capacity constraint by a minimum total prize constraint by adding the prizes as a Dimension.
575
+
576
+ We multiply all float inputs by $1 0 ^ { 7 }$ and round to integers. Note that we keep the total length objective from the CVRP and add the Disjunction constraint with penalties to obtain the right objective.
577
+
578
+ # F STOCHASTIC PCTSP (SPCTSP)
579
+
580
+ For the SPCTSP, we assume that the real prize collected $\hat { \rho } _ { i } ^ { * }$ at each node only becomes known when visiting the node, and $\hat { \rho } _ { i } = \mathbb { E } \left[ \hat { \rho } _ { i } ^ { * } \right]$ is the expected prize. We assume the real prizes follow a uniform distribution, so $\hat { \rho } _ { i } ^ { * } \sim \mathrm { U n i f o r m } ( 0 , 2 \hat { \rho } _ { i } )$ .
581
+
582
+ # F.1 ATTENTION MODEL FOR THE SPCTSP
583
+
584
+ In order to apply the Attention Model to the Stochastic PCTSP, the only change we need is that we use the real $\hat { \rho } _ { i } ^ { * }$ to update the remaining prize to collect $P _ { t }$ in equation 31:
585
+
586
+ $$
587
+ P _ { t + 1 } = \operatorname* { m a x } ( 0 , P _ { t } - \hat { \rho } _ { \pi _ { t } } ^ { * } ) .
588
+ $$
589
+
590
+ We could theoretically use the model trained for PCTSP without retraining, but we choose to retrain. This way the model could (for example) learn that $i f$ it needs to gather a remaining (normalized) prize of 0.1, it might prefer to visit a node with expected prize 0.2 over a node with expected prize 0.1 as the first real prize will be $\geq 0 . 1$ with probability $7 5 \%$ (uniform prizes) whereas the latter only with $5 0 \%$ and thus has a probability of $5 0 \%$ to not satisfy the constraint.
591
+
592
+ # F.2 ROLLOUT BASELINE IN THE STOCHASTIC SETTING
593
+
594
+ Instead of sampling the real prizes online, we already sample them when creating the dataset but keep them hidden to the algorithm. This way, when using a rollout baseline, both the greedy rollout baseline as well as the sample (rollout) from the model use the same real prizes, such that any difference between the two is not a result of stochasticity. This can be seen as a variant of using Common Random Numbers for variance reduction (Glasserman & Yao, 1992).
595
+
596
+ # F.3 DETAILS OF BASELINES
597
+
598
+ For the SPCTSP, it is not possible to formulate an exact model that constructs a tour offline (as any tour can be infeasible with nonzero probability) and an algorithm that computes the optimal decision online should take into account an infinite number of scenarios. As a baseline we implement a strategy that:
599
+
600
+ 1. Plans a tour using the expected prizes $\hat { \rho } _ { i }$
601
+ 2. Executes part of the tour (not returning to the depot), observing the real prizes $\hat { \rho } _ { i } ^ { * }$
602
+ 3. Computes the remaining total prize that needs to be collected
603
+ 4. Computes a new tour (again using expected prizes $\hat { \rho } _ { i }$ ), starting from the last node that was visited, through nodes that have not yet been visited and ending at the depot
604
+ 5. Repeats the steps (2) - (4) above until the minimum total prize has been collected or all nodes have been visited
605
+ 6. Returns to the depot
606
+
607
+ Planning of the tours using deterministic prizes means we need to solve a (deterministic) PCTSP, for which we use the ILS $\mathrm { C } { + } { + }$ algorithm as this was the strongest algorithm for PCTSP (for large $n$ ). Note that in (4), we have a variant of the PCTSP where we do not have a single depot, but rather separate start and end points, whereas the ILS $\mathrm { C } { + } { + }$ implementation assumes starting and ending at a single depot. However, as the ILS $\mathrm { C } { + } { + }$ implementation uses a distance matrix, we can effectively plan with a start and end node by defining the distance from the ‘depot’ to node $j$ as the distance from the start node (the last visited node) to node $j$ , whereas we leave the distance from node $j$ to the depot/end node unchanged (so the distance matrix becomes asymmetrical). Additionally, we remove all nodes (rows/columns in the distance matrix) that have already been visited from the problem.
608
+
609
+ We consider three variants that differ in the number of nodes that are visited before replanning the tour, for a tradeoff between adaptivity and run time:
610
+
611
+ 1. All nodes in the planned tour are visited (except the final return to the depot). We only need to replan and visit additional nodes if the constraint is not satisfied, otherwise we return to the depot.
612
+
613
+ 2. Half of the nodes in the planned tour are visited, where we visit $k$ nodes if there are $2 k + 1$ nodes (excluding the return to the depot), so we round down if an odd number of visits is planned. This way, we will have $O ( \log n )$ replanning iterations, while being more adaptive when we are closer to satisfying the total prize constraint. This is a trade-off of adaptivity vs computation time.
614
+
615
+ 3. Only the first node is visited, after which we directly replan. This allows the algorithm to take new online information about the real prizes into account directly, but is very expensive to compute as it requires $O ( n )$ iterations.
parse/train/ByxBFsRqYm/ByxBFsRqYm_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ByxBFsRqYm/ByxBFsRqYm_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ByxBFsRqYm/ByxBFsRqYm_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ByxY8CNtvr/ByxY8CNtvr.md ADDED
@@ -0,0 +1,370 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # IMPROVING NEURAL LANGUAGE GENERATION WITH SPECTRUM CONTROL
2
+
3
+ Lingxiao Wang1, Jing Huang2, Kevin Huang2, Ziniu $\mathbf { H } \mathbf { u } ^ { 1 }$ , Guangtao $\mathbf { W a n g } ^ { 2 }$ , Quanquan $\mathbf { G u } ^ { 1 }$
4
+
5
+ 1Department of Computer Science, University of California, Los Ange 2JD AI Research, Mountain View, CA 94034 {lingxw,bull,qgu}@cs.ucla.edu {jing.huang,kevin.huang3,guangtao.wang}@jd.com
6
+
7
+ # ABSTRACT
8
+
9
+ Recent Transformer-based models such as Transformer-XL and BERT have achieved huge success on various natural language processing tasks. However, contextualized embeddings at the output layer of these powerful models tend to degenerate and occupy an anisotropic cone in the vector space, which is called the representation degeneration problem. In this paper, we propose a novel spectrum control approach to address this degeneration problem. The core idea of our method is to directly guide the spectra training of the output embedding matrix with a slow-decaying singular value prior distribution through a reparameterization framework. We show that our proposed method encourages isotropy of the learned word representations while maintains the modeling power of these contextual neural models. We further provide a theoretical analysis and insight on the benefit of modeling singular value distribution. We demonstrate that our spectrum control method outperforms the state-of-the-art Transformer-XL modeling for language model, and various Transformer-based models for machine translation, on common benchmark datasets for these tasks.
10
+
11
+ # 1 INTRODUCTION
12
+
13
+ Neural language generation (NLG) is an important task with many practical applications, such as automatic speech recognition (Graves et al., 2013; Toshniwal et al., 2018), text generation (Bowman et al., 2016; Radford et al., 2019; Keskar et al., 2019), machine translation (Bahdanau et al., 2015; Vaswani et al., 2017) and dialog systems (Gao et al., $2 0 1 9 \mathrm { a }$ ; Tang et al., 2019). Most NLG models utilize a complex encoding model to map a given context into a hidden state vector, and then predict the next word distribution by multiplying the encoded vector with the output embedding layer, followed by a softmax layer. In the past few years, it has witnessed a significant progress in NLG by improving the encoding model, from the recurrent neural network (RNN) (Bahdanau et al., 2015; Jozefowicz et al., 2016; Merity et al., 2018a) based models to the current Transformer-based models (Vaswani et al., 2017; Devlin et al., 2019; Dai et al., 2019; Radford et al., 2019). However, embeddings in the softmax output layer have been shown not capable enough to model the conditional probability (Yang et al., 2018).
14
+
15
+ Recently, Gao et al. (2019b) pointed out another limitation of the output embeddings: the representation degeneration problem. They showed that the singular value distribution of the output embedding matrix tends to decay very fast, and the embedding space is squeezed into a narrow cone (as shown in Figure 1(a) and 1(c) in 2-D plots). Such anisotropic shape (Ethayarajh, 2019) is very different from what one would expect from an expressive word embedding space (Arora et al., 2016a; Mu & Viswanath, 2018). Therefore, several efforts (Gao et al., 2019b; Wang et al., 2019a) have been made to address the degeneration problem.
16
+
17
+ Unlike previous approaches that applied implicit regularization to singular values of the output embedding matrix, we propose a spectrum control (SC) approach, which was inspired by the spectral control technique used for Generative Adversarial Network (GAN) training (Jiang et al., 2019), to explicitly control the singular value distribution. We first reparameterize the output embedding matrix W by its singular value decomposition (SVD): $\mathbf { W } = \mathbf { U } \pmb { \Sigma } \mathbf { V } ^ { \top }$ , where $\mathbf { U } , \mathbf { V }$ are column orthonormal matrices, and $\pmb { \Sigma }$ is a diagonal matrix of singular values. Then we guide the training of $\pmb { \Sigma }$ by a predefined slow-decaying prior distribution, such as a polynomial decay distribution, or an exponential decay distribution. At the end of training, the distribution of singular values of the embedding matrix gets close to the prior distribution. Our spectrum control approach alleviates the representation degeneration problem by encouraging the diversity of word representations and improving isotropic property of these representations (see Figure 2), even on top of the powerful Transformer-based models.
18
+
19
+ ![](images/6aabc7dcf220659a7e78cd780ad4495be37f425567d5096648550374e4b349e4.jpg)
20
+ Figure 1: Projected word embeddings1and singular value distributions. (a) and (c): 2-D visualization of word embedding matrices of Transformer-XL for language modeling and Transformer for machine translation; (b) and (d): Normalized singular value distributions of embedding matrices.
21
+
22
+ ![](images/362900f46113b115804fab2e6286e00172299464a40406cbcdc0c01f6a72288d.jpg)
23
+ Figure 2: Projected word embeddings and singular value distributions using our spectrum control method. (a) and (c): 2-D visualization of word embedding matrices of Transformer-XL for language modeling and Transformer for machine translation; (b) and (d): Normalized singular value distributions of embedding matrices.
24
+
25
+ We further present a theoretical analysis to justify our method. The results suggest that it is beneficial to directly guide the singular value distribution of the embedding matrix throughout the training process and control the decay rate of these singular values. We demonstrate the effectiveness of our training framework with extensive experimental results on two tasks: language modeling and machine translation. Our spectrum control method outperforms the latest state-of-the-art TransformerXL model on WikiText-103 dataset for language modeling; and obtains close to 1.5 BLEU improvement on IWSLT 2014 German-English translation task compared to the Transformer baseline model.
26
+
27
+ # 2 RELATED WORK
28
+
29
+ In this paper, we mainly focus on the output embedding matrix that is used in the softmax output layer for language generation tasks. This embedding matrix is also used as input word embeddings, which is known as weight tying trick. The weight tying not only reduces the number of parameters but also enjoys theoretical benefits (Inan et al., 2017). Thus the weight tying has been successfully applied to many state-of-the-art models for language modeling and machine translation (Merity et al., 2018a; Vaswani et al., 2017; Yang et al., 2018).
30
+
31
+ However, there are certain issues with the softmax output layer. Yang et al. (2018) first identified a problem called “softmax bottleneck” that the softmax output layer does not have enough capacity to model natural language due to its connection with the rank bottleneck in matrix factorization. A simple and effective method called Mixture of Softmaxes (MoS) was proposed to deal with this issue. Follow-up work in Kanai et al. (2018); Ganea et al. (2019) tried to replace softmax with alternative activation functions. Kanai et al. (2018) proposed to use sigsoftmax, which is composed of a multiplication of an exponential function and sigmoid function. Ganea et al. (2019) proposed a Linear-Monotonic-Softmax (LMS) model that generalized the approach in Kanai et al. (2018) by learning parametric point-wise increasing functions to optimally distort the logits before feeding them into the softmax layer. Pappas & Henderson (2019) instead resorted to a powerful deep residual nonlinear output mapping while using a single softmax function without modifying its dimensionality or rank.
32
+
33
+ Another line of work focuses on increasing the expressive power of the output embedding matrix by adding a cosine similarity regularization term (Gao et al., 2019b), or adversarial noise (Wang et al., 2019a). Gao et al. (2019b) analyzed the representation degeneration problem that the output embeddings tend to degenerate and be distributed into a narrow cone. A regularization term based on the summation of pairwise cosine similarity among all words was proposed to increase the representation power of word embeddings. Wang et al. (2019a) pointed out the computation of regularization term in (Gao et al., 2019b) depends on the size of the vocabulary and hence is costly. Instead, they proposed a simple yet highly effective adversarial training method that adds adversarial noises to the output embedding layer when training the models. They proved in theory that this adversarial training increases the distances between two different words, and thus encourages the diversity of the embedding vectors. Our work follows this line of thought, but takes a different approach: motivated by the spectrum control method for GAN training (Jiang et al., 2019), we propose to directly guide the singular values by a slow-decaying prior distribution during the model training process. We show that the anisotropic behavior of the contextualized word representations from powerful Transformer-based models (Ethayarajh, 2019) are alleviated by our spectrum control approach.
34
+
35
+ # 3 PROBLEM SETUP
36
+
37
+ In this section, we briefly introduce the neural models for language generation, and illustrate the singular value decay phenomena of existing neural language models. We first introduce some notations used in the rest of the paper.
38
+
39
+ Notation: For a $d$ -dimensional vector $\mathbf { x } \in \mathbb { R } ^ { d }$ , we use $\begin{array} { r } { \| \mathbf { x } \| _ { q } = ( \sum _ { i = 1 } ^ { d } | x _ { i } | ^ { q } ) ^ { 1 / q } } \end{array}$ , where $0 < q < \infty$ to denote its $\ell _ { q }$ -norm, and $\left\| \mathbf { x } \right\| _ { \infty } = \operatorname* { m a x } _ { i } \left| x _ { i } \right|$ to be its infinity norm. For a matrix $\mathbf { A } \in \mathbb { R } ^ { d _ { 1 } \times d _ { 2 } }$ , let $\mathbf { A } _ { i * }$ be the $i$ -th row of $\mathbf { A }$ , and we use $\| \mathbf { A } \| _ { 2 } , \| \mathbf { A } \| _ { F } , \| \mathbf { A } \| _ { 1 }$ to denote its spectral norm, Frobenius norm, and matrix 1-norm. Given two sequences $\left\{ a _ { n } \right\}$ and $\left\{ b _ { n } \right\}$ , if there exists a constant $0 < C <$ $\infty$ such that $a _ { n } \leq C b _ { n }$ , we write $a _ { n } = O ( b _ { n } )$ , and we use ${ \widetilde { O } } ( \cdot )$ to hide the logarithmic factors.
40
+
41
+ # 3.1 NEURAL LANGUAGE GENERATION
42
+
43
+ We first briefly review the softmax output layer typically used in neural language generation models. We define the joint probability of a given length- $n$ sentence of words (tokens) $\mathbf { s } _ { n } = \left( \mathbf { y } _ { 1 } , \ldots , \mathbf { y } _ { n } \right)$ as the following product of conditional probabilities
44
+
45
+ $$
46
+ \mathbb { P } ( \mathbf { s } _ { n } ) = \prod _ { t = 1 } ^ { n } \mathbb { P } ( \mathbf { y } _ { t } | \mathbf { c } _ { t } ) ,
47
+ $$
48
+
49
+ where $\mathbf { y } _ { t } \in \mathcal { V }$ is the $t$ -th word in sentence ${ \bf s } _ { n }$ , and $\nu$ represents the word vocabulary, $\mathbf { c } _ { t } = \mathbf { y } _ { 1 : t - 1 } =$ $\left( \mathbf { y } _ { 1 } , \ldots , \mathbf { y } _ { t - 1 } \right)$ is referred to as the context of word $\mathbf { y } _ { t }$ . In addition, the context $\mathbf { c } _ { t }$ is usually modeled by a fixed size vector $\mathbf { h } _ { t } \in \mathbb { R } ^ { d }$ , which is referred to as the hidden state, using some neural networks such as LSTM (Hochreiter & Schmidhuber, 1997) and Transformer (Vaswani et al., 2017). Then, the probability distribution of the output word $\mathbf { y } _ { t }$ given the context $\mathbf { c } _ { t }$ , i.e., $\mathbb { P } ( \mathbf { y } _ { t } | \mathbf { c } _ { t } )$ in (3.1), is parameterized as the following softmax function:
50
+
51
+ $$
52
+ \mathbb { P } ( Y _ { t } = \mathbf { y } _ { t } | \mathbf { c } _ { t } ) = \mathbb { P } ( Y _ { t } = \mathbf { y } _ { t } | \mathbf { h } _ { t } ) = \frac { \exp ( \mathbf { h } _ { t } ^ { \top } \mathbf { W } _ { \mathcal { Z } ( \mathbf { y } _ { t } ) \ast } ) } { \sum _ { i = 1 } ^ { N } \exp ( \mathbf { h } _ { t } ^ { \top } \mathbf { W } _ { i \ast } ) } ,
53
+ $$
54
+
55
+ where $\mathbf { W } \in \mathbb { R } ^ { N \times d }$ is the weight matrix and is usually tied with the input word embedding matrix (Press & Wolf, 2017; Inan et al., 2017), $N = | \nu |$ is the vocabulary size, $d$ is the embedding dimension, $\mathcal { T } ( \mathbf { y } _ { t } )$ represents the index of word $\mathbf { y } _ { t }$ in vocabulary $\nu$ . In the following discussion, we call output weight matrix W as the word embedding matrix of the neural language model since it is tied with the input word embedding matrix.
56
+
57
+ In this paper we focus on the output layer of the neural model for language generation, i.e., the softmax layer in (3.2), as in (Yang et al., 2018; Kanai et al., 2018; Ganea et al., 2019; Gao et al., 2019b). We will examine the singular value distribution of $\mathbf { W }$ and propose a different approach to increase the expressive power of the word embedding.
58
+
59
+ # 3.2 FAST SINGULAR VALUE DECAY
60
+
61
+ As we mentioned before, the singular values of W tend to drop very fast and it may interact with the cone-shaped embedding space. More specifically, Figure 1(b) and 1(d) illustrate the distributions of the normalized singular values of the Transformer-XL based language model2 (Dai et al., 2019) and the Transformer-based machine translation model (Vaswani et al., 2017) trained on WikiText103 (Merity et al., 2018a) and IWSLT 2014 De-En (Cettolo et al., 2014) datasets, respectively. The plots show a fast singular value decay phenomenon, i.e., there is a huge drop between the first and remaining singular values. Such a phenomenon has also been observed in some previous work (Gao et al., 2019b; Wang et al., 2019a).
62
+
63
+ Figure 1(a) and 1(c) present the distributions of the projected word embeddings of the aforementioned two models. We can see from the plots that the projected word embeddings are distributed into some narrow cone shapes, which implies an anisotropic property of the learned word representations, i.e., the embedding vectors are not uniformly distributed in the space. The detailed analysis in Ethayarajh (2019) also confirms that contextualized word embeddings learnt from ELMo (Peters et al., 2018) (LSTM-based model), BERT and GPT-2 (Devlin et al., 2019; Radford et al., 2019) (Transformer-based models) indeed tend to be anisotropic.
64
+
65
+ These contextualized word embeddings have shown great success on many NLP tasks. However, static word embeddings, such as Word2Vec (Mikolov et al., 2013) and GloVe (Pennington et al., 2014) have been shown (Arora et al., 2016b; Mu & Viswanath, 2018) to be isotropic with great expressive power. Hence it may be also beneficial to increase the expressive power of the contextualized word embedding by increasing its isotropy. This motivates us to alleviate the fast singular value decay phenomenon to increase the isotropy of the learned word representations.
66
+
67
+ # 4 PROPOSED METHOD
68
+
69
+ To alleviate the fast singular value decay phenomenon, we propose to guide the singular value distribution of the contextualized word embedding throughout the training. As a result, we can achieve a trade-off between modeling contextual information, that tends to make word representations anisotropic, and the expressive power of word representations, that tends to be isotropic.
70
+
71
+ # 4.1 SVD REPARAMETERIZATION
72
+
73
+ Following the previous work (Jiang et al., 2019), we propose to apply singular value decomposition (SVD) based reparameterization to the embedding matrix W, i.e., $\mathbf { W } \mathbf { \bar { \Phi } } = \mathbf { U } \pmb { \Sigma } \mathbf { V } ^ { \top }$ , where ${ \textbf { U } } \in$ $\mathbb { R } ^ { N \times d } , \mathbf { V } \in \mathbb { R } ^ { { \hat { d } } \times d }$ are column orthonormal matrices, and $\pmb { \Sigma } \in \mathbb { R } ^ { d \times d }$ is a diagonal matrix with $\Sigma _ { k k } = \sigma _ { k }$ being the $k$ -th largest singular value of $\mathbf { W }$ . Note that SVD reparameterization is standard and has been widely used in the literature such as model compression (Chen et al., 2018), training DNNs (Zhang et al., 2018), and analyzing word embeddings (Arora et al., 2016c). Given the SVD reparameterization, we can control the singular values of the embedding matrix $\mathbf { W }$ by constraining the matrix $\mathbf { E }$ , and the conditional distribution in (3.2) can be rewritten as follows:
74
+
75
+ where $\mathcal { P }$ is a feasible set to represent the singular value distribution of the embedding matrix $\mathbf { W }$ .
76
+
77
+ To ensure the orthogonal constraints in (4.1), we propose to use the orthogonal regularization for $\mathbf { U } , \mathbf { V }$ during the training process, which has been previously used in (Jiang et al., 2019). In particular, we use the following regularization, which is a linear combination of Frobenius norm and spectral norm errors: $\lambda _ { 1 } \| \mathbf { U } ^ { \mathsf { T } } \mathbf { U } ^ { - } - \mathbf { I } \| _ { F } ^ { 2 } + \lambda _ { 2 } \| \mathbf { V } ^ { \mathsf { T } } \mathbf { V } - \mathbf { I } \| _ { F } ^ { 2 } + \lambda _ { 3 } \| \mathbf { U } ^ { \mathsf { T } } \mathbf { U } - \mathbf { I } \| _ { 2 } ^ { 2 } + \lambda _ { 4 } \| \mathbf { V } ^ { \mathsf { T } } \mathbf { V } - \mathbf { I } \| _ { 2 } ^ { 2 }$ , where $\{ \lambda _ { i } \} _ { i = 1 } ^ { 4 }$ are positive regularization parameters.
78
+
79
+ # 4.2 SPECTRUM CONTROL
80
+
81
+ Recall the SVD of $\mathbf { W } = \mathbf { U } \pmb { \Sigma } \mathbf { V } ^ { \top }$ , and we consider the following two types of the singular value distribution for $\pmb { \Sigma }$ , which is inspired by the eigenvalue distribution of kernel methods (Wei et al., 2017; Pacchiano et al., 2019):
82
+
83
+ • Exponential decay: we say the singular values $\{ \sigma _ { k } \} _ { k = 1 } ^ { d }$ of $\mathbf { W }$ satisfy the exponential decay if $\mathbf { W } \in \mathcal { P } _ { e } ( \gamma ) = \{ \mathbf { W } \in \mathbb { R } ^ { N \times d } \mid \sigma _ { k } \leq c _ { 1 } \exp ( - c _ { 2 } \bar { k } ^ { \gamma } ) , k = 1 , \ldots , d , \gamma > 0 , c _ { 1 } , c _ { 2 } > 0 \} \mid \mathbf { W } \in \mathbb { R } ^ { N \times d } .$ 0 are universal constants}.
84
+
85
+ • Polynomial decay: we say the singular values $\{ \sigma _ { k } \} _ { k = 1 } ^ { d }$ of $\mathbf { W }$ satisfy the polynomial decay if $\mathbf { W } \in \mathcal { P } _ { p } ( \gamma ) = \left\{ \mathbf { W } \in \mathbb { R } ^ { N \times d } \mid \sigma _ { k } \leq c _ { 1 } k ^ { - \gamma } , k = 1 , \ldots , d , \gamma > 0 , c _ { 1 } > 0 \right\}$ is a universal constant $\}$ .
86
+
87
+ For $\mathcal { P } _ { e } ( \gamma )$ and $\mathcal { P } _ { p } ( \gamma )$ , the parameter $\gamma$ controls the rate of singular value decay: the larger $\gamma$ is, the faster singular value decay will be. To ensure the learned word embedding matrix W have the desired singular value distributions, we propose to add the following regularizations to our training objective: $\begin{array} { r } { \mathcal { R } _ { e } ( \Sigma ) = \lambda _ { e } \sum _ { k = 1 } ^ { d } \left( \sigma _ { k } - c _ { 1 } \exp ( - c _ { 2 } k ^ { \gamma } ) \right) ^ { 2 } } \end{array}$ for exponential decay and $\begin{array} { r } { \mathcal { R } _ { p } ( \Sigma ) = \lambda _ { p } \sum _ { k = 1 } ^ { d } \left( \sigma _ { k } - c _ { 1 } k ^ { - \gamma } \right) ^ { 2 } } \end{array}$ for polynomial decay, where $\lambda _ { e } , \lambda _ { p }$ are positive regularization parameters. Although the concept of “spectrum control” was previously used in Jiang et al. (2019) to improve the training of GANs, our spectrum control method is trying to solve a totally different problem, i.e., neural language generation, and its motivation is coming from a very different perspective, i.e., the representation degeneration of the word representations. In addition, our method of controlling the singular value with prior distributions is significantly different from the penalty function used in their method. Finally, our method is essential to improve the performance of the neural language generation, while the penalty function proposed in Jiang et al. (2019) can deteriorate the training of neural language models, as we illustrated in Appendix B.
88
+
89
+ # 4.3 THEORETICAL ANALYSIS
90
+
91
+ In this subsection, we show some theoretical insights on why our proposed method can improve the performance of the NLG model. In particular, we follow the similar setup as considered in (Gao et al., 2019b), i.e., focusing on the optimization of the embedding matrix $\mathbf { W } \in \mathbb { R } ^ { N \times d }$ and assume all the other parameters are fixed and well-optimized. In practice, we use our method to train the models from scratch. Therefore, according to the output layer in (3.2), we consider the following empirical risk minimization problem: given a training dataset $S = \{ ( \mathbf { h } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ with each example drawn i.i.d. from some unknown but fixed distribution $\mathcal { D }$ , and $\mathbf { h } _ { i } \in \mathbb { R } ^ { d }$ as a hidden state, $y _ { i } \in \{ 1 , \ldots , N \}$ as its associated label, our goal is to minimize the training loss as follows:
92
+
93
+ $$
94
+ \operatorname* { m i n } _ { \mathbf { W } \in \mathbb { R } ^ { N \times d } } L _ { S } ( \mathbf { W } ) = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \ell \bigl ( \mathbf { h } _ { i } ^ { \top } \mathbf { W } , y _ { i } \bigr ) ,
95
+ $$
96
+
97
+ where $\ell \big ( \mathbf { h } _ { i } ^ { \top } \mathbf { W } , y _ { i } \big )$ is the cross-entropy loss with respect to $\mathbf { h } _ { i } ^ { \top } \mathbf { W }$ and $y _ { i }$ . The cross-entropy loss defined above is widely used to train NLG models, and is also used to compute the perplexity of the trained model, which is the benchmark criterion to evaluate the performance of language models.
98
+
99
+ In addition, we define the expected loss as follows $L _ { \mathcal { D } } ( \mathbf { W } ) = \mathbb { E } [ \ell \left( \mathbf { h } ^ { \top } \mathbf { W } , y \right) ]$ , where the expectation is taken over the distribution $\mathcal { D }$ of the training data.
100
+
101
+ Let $\begin{array} { r } { \widehat { \mathbf { W } } = \arg \operatorname* { m i n } _ { \mathbf { W } \in \mathcal { P } ( \gamma ) } L _ { S } ( \mathbf { W } ) , } \end{array}$ , where $\mathcal { P } ( \gamma ) = \mathcal { P } _ { e } ( \gamma )$ for exponential decay and $\mathcal { P } ( \gamma ) = \mathcal { P } _ { p } ( \gamma )$ for polynomial decay. We assume the right singular vector matrix satisfies $\| \mathbf { V } \| _ { 1 } ~ \leq ~ V$ for all $\mathbf { W } \in \mathcal { P } ( \gamma )$ . Now, we are ready to provide the main theory of our method (The proof can be found in Appendix A).
102
+
103
+ Theorem 4.1. Under previously stated conditions, suppose that $| \ell ( \cdot ) | \leq B$ , $\ell$ is $G$ -Lipschitz continuous, and $\| \mathbf { h } _ { i } \| _ { \infty } \leq H$ for all $i = 1 , \ldots , n$ . If we choose $\gamma > 1 / 2$ , then with probability at least $1 - \delta$ , we have
104
+
105
+ $$
106
+ L _ { \mathcal { D } } ( \widehat { \mathbf { W } } ) \leq \operatorname* { m i n } _ { \mathbf { W } \in \mathcal { P } ( \gamma ) } L _ { S } ( \mathbf { W } ) + \frac { C _ { 1 } A N \Big ( \sqrt { \sum _ { j = 1 } ^ { m - 1 } \sigma _ { j } ^ { 2 } } + \sqrt { m ^ { 1 - 2 \gamma } / ( 2 \gamma - 1 ) } \Big ) + C _ { 2 } B \sqrt { \log ( 1 / \delta ) } } { \sqrt { n } } ,
107
+ $$
108
+
109
+ where $C _ { 1 } , C _ { 2 }$ are absolute constants, $m \in [ 2 , d ]$ , $A = G V H { \sqrt { \log d } }$ .
110
+
111
+ Remark 4.2. According to Theorem 4.1, the expected loss of the learned embedding matrix $\widehat { \bf W }$ consists of two terms. The first term represents the training loss, the second term is the generalization error gap. Specifically, the smaller the $\gamma$ , the larger the feasible set $\mathcal { P } ( \gamma )$ , thus the smaller the training loss $\mathrm { m i n } _ { \mathbf { W } \in \mathcal { P ( \gamma ) } } L _ { S } ( \mathbf { W } )$ . On the other hand, the larger the $\gamma$ , the faster the singular value decays, and the smaller the generalization error gap. Therefore, our generalization error bound demonstrates an appealing property of our proposed method: by directly controlling the singular value distribution of the learned word embedding, we are able to achieve a trade-off between the training loss and generalization error.
112
+
113
+ Remark 4.3. For the generalization error bound in (4.3), penalizing the largest singular value could reduce this upper bound. It validates the method proposed in Gao et al. (2019b), which implicitly penalizes the largest singular value (c.f. Section 5 in Gao et al. (2019b)). Compared with their method, the error term $\tilde { \cal O } ( N \sqrt { m ^ { 1 - 2 \gamma } / ( 2 \gamma - 1 ) } / \sqrt { n } )$ suggests that by explicitly manipulating the singular value distribution, our method has a better control of the tail sum of the singular values.
114
+
115
+ # 5 EXPERIMENTS
116
+
117
+ We demonstrate the effectiveness of our proposed spectrum control algorithm on two tasks: language modeling and machine translation. We compare our results with the state-of-the-art models. In our experiments, we try both exponential and polynomial singular value decays, and present the one with the better result. The performances of exponential decay and polynomial decay are very close (See Appendix D). In practice we found that for large scale dataset its better to use polynomial decay and for small scale dataset its better to use exponential decay. We also present the training time and memory cost of our method in Appendix C.
118
+
119
+ # 5.1 LANGUAGE MODELING
120
+
121
+ Datasets We consider two benchmark datasets for language modeling: WikiText-2 and WikiText103, which consist of pre-processed Wikipedia articles and were introduced by Merity et al. (2018a). WikiText-2 is a small dataset with around 2 million words and 30K vocabulary size, while WikiText103 is a significantly large dataset with around 103 million words and 260K vocabulary size.
122
+
123
+ Model Configuration On the small WikiText-2 dataset, we implement our method based on the state-of-the-art AWD-LSTM model (Merity et al., 2018a). It is a 3-layer LSTM model with 1150 dimensional hidden states and 400 dimensional embeddings. We also follow the same regularization and optimization procedures introduced in (Merity et al., 2018a). The implementation of our method is based on the open-source code3 for AWD-LSTM. On the large WikiText-103 dataset, we implement our method based on the state-of-the-art Transformer-XL based models (Dai et al., 2019). We follow the same settings reported in (Dai et al., 2019), and our implementation is based on the official code4 for Transformer-XL. To evaluate the performance of our method more thoroughly, we consider two Transformer-XL models with different number of layers. The first is the standard Transformer-XL model with 16 layers used in (Dai et al., 2019). For the second, we consider a smaller Transformer-XL model with just 4 layers and other configurations unchanged.
124
+
125
+ Parameters For the parameters $\{ \lambda _ { i } \} _ { i = 1 } ^ { 4 }$ of the orthogonal regularizations, we tune them by grid search over $\{ 0 . 0 1 , 0 . 1 , 1 , 1 0 \}$ . For the parameters $\lambda _ { e } , \lambda _ { p }$ of the spectrum control, we tune them over the grid $\{ 0 . 1 , 1 , 1 0 , 1 0 0 \}$ . We try different singular value distributions, and the best distributions for AWD-LSTM and Transformer-XL are exponential and polynomial, respectively.
126
+
127
+ Results of the LSTM Model on WikiText-2 We first present the results of language modeling on the small dataset WikiText-2 using LSTM models. In Table 1 we compare the validation/test perplexity5 of the baseline AWD-LSTM model (Merity et al., 2018a), the cosine similarity regularization (MLE-CosReg) model (Gao et al., 2019b), and the models trained using our method under three different settings (Merity et al., 2018a): without finetune, with finetune and with further continuous cache pointer. Compared with the baselines, our method achieves $2 . 3 / 2 . 9 / 2 . 3$ test perplexity reduction under all three settings; compared with the MLE-CosReg method, our method achieves $1 . 5 / 1 . 2 / 0 . 3$ test perplexity reduction under all three settings.
128
+
129
+ Results of the Transformer-XL Model on WikiText-103 We next show the results of language modeling on the large dataset WikiText-103 using Transformer-XL models. Table 2 compares the validation/test perplexity of Transformer-XL based models (Dai et al., 2019) and the models trained by our method on WikiText-103 dataset. The results demonstrate that our method consistently improves upon the small Transformer-XL model (0.9 test perplexity reduction) and the standard Transformer-XL model (0.8 test perplexity reduction).
130
+
131
+ Table 1: Comparison of different methods in terms of perplexity on WikiText-2 dataset for the task of language modeling.
132
+
133
+ <table><tr><td>Method</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td colspan="4">Existing results</td></tr><tr><td>Variational LSTM (Inan et al., 2017)</td><td>51M</td><td>91.5</td><td>87.0</td></tr><tr><td>2-layer skip connection LSTM (Mandt et al.,2017)</td><td>24M</td><td>69.1</td><td>65.9</td></tr><tr><td colspan="4">w/o finetune</td></tr><tr><td>AWD-LSTM(Merity et al.,2018a)</td><td>33M</td><td>69.1</td><td>66.0</td></tr><tr><td>MLE-CosReg (Gao et al.,2019b)</td><td>33M</td><td>68.2</td><td>65.2</td></tr><tr><td>Ours</td><td>33M</td><td>66.3</td><td>63.7</td></tr><tr><td colspan="4">+ finetune</td></tr><tr><td>AWD-LSTM (Merity et al.,2018a)</td><td>33M</td><td>68.6</td><td>65.8</td></tr><tr><td>MLE-CosReg (Gao et al.,2019b)</td><td>33M</td><td>67.1</td><td>64.1</td></tr><tr><td>Ours</td><td>33M</td><td>65.3</td><td>62.9</td></tr><tr><td colspan="4">+ continuous cache pointer</td></tr><tr><td>AWD-LSTM (Merity et al., 2018a)</td><td>33M</td><td>53.8</td><td>52.0</td></tr><tr><td>MLE-CosReg (Gao et al.,2019b)</td><td>33M</td><td>51.7</td><td>50.0</td></tr><tr><td>Ours</td><td>33M</td><td>51.1</td><td>49.7</td></tr></table>
134
+
135
+ Table 2: Comparison of different methods in terms of perplexity on WikiText-103 dataset for the task of language modeling.
136
+
137
+ <table><tr><td>Method</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td colspan="4">Existing results</td></tr><tr><td>4 layer QRNN (Merity et al.,2018b) Hebbian + Cache (Rae et al.,2018)</td><td>151M 1</td><td>32.0 29.7</td><td>33.0 29.9</td></tr><tr><td>Small Transformer-XL (Dai et al., 2019) Ours</td><td>120M 120M</td><td>29.6 29.0</td><td>30.4 29.5</td></tr><tr><td>Standard Transformer-XL (Dai et al.,2019) Ours</td><td>151M 151M</td><td>23.1 22.9</td><td>24.0 23.2</td></tr></table>
138
+
139
+ Analysis We study the output embedding matrix of Transformer-XL trained on WikiText-103 using our method. In particular, we want to evaluate the isotropy of the learned word representations. We consider the partition function $\begin{array} { r } { Z ( \mathbf { a } ) \ = \ \sum _ { i = 1 } ^ { N } \exp ( \left. \mathbf { w } _ { i } , \mathbf { a } \right. ) } \end{array}$ introduced in (Arora et al., 2016b), where $\mathbf { w } _ { i }$ is the $i$ -th row of the embedding matrix $\mathbf { W } \in \mathbb { R } ^ { N \times d }$ and $\mathbf { a } ~ \in ~ S ^ { d - 1 }$ is a unit vector. According to Lemma 2.1 in (Arora et al., 2016b), if the word representation vectors are isotropic, $Z ( \mathbf { a } )$ is close to some constant with high probability for all unit vectors. Thus to empirically measure the isotropy of the learned word representations, we consider two criteria based on $Z ( \mathbf { a } )$ :
140
+
141
+ $$
142
+ I _ { 1 } ( \mathbf { W } ) = \frac { \operatorname* { m i n } _ { \mathbf { a } \in \mathcal { E } } Z ( \mathbf { a } ) } { \operatorname* { m a x } _ { \mathbf { a } \in \mathcal { E } } Z ( \mathbf { a } ) } \quad \mathrm { a n d } \quad I _ { 2 } ( \mathbf { W } ) = \sqrt { \frac { \sum _ { \mathbf { a } \in \mathcal { E } } ( Z ( \mathbf { a } ) - \bar { Z } ( \mathbf { a } ) ) ^ { 2 } } { | \mathcal { E } | \bar { Z } ( \mathbf { a } ) ^ { 2 } } } ,
143
+ $$
144
+
145
+ where $\mathcal { E }$ is the set of eigenvectors of $\mathbf { W } ^ { \top } \mathbf { W }$ , as suggested by Mu & Viswanath (2018). We also propose to check sampled standard deviation measure $I _ { 2 } ( \mathbf { W } )$ (normalized by its average, i.e., $\bar { Z } ( \mathbf { a } ) \mathrm { . }$ ). We have $I _ { 1 } ( \mathbf { W } ) \in [ 0 , 1 ]$ and $I _ { 2 } ( \mathbf { W } ) \geq 0$ . Larger $I _ { 1 } ( \mathbf { W } )$ and smaller $I _ { 2 } ( \mathbf { W } )$ indicate more isotropic for word embeddings. We uniformly sample 40K words from the vocabulary (around 260K) of WikiText-103 to compute these two criteria. The left half of Table 3 summarizes the values of $I _ { 1 } ( \mathbf { W } )$ and $I _ { 2 } ( \mathbf { W } )$ , which are averaged over 10 runs, for the baseline method and our method. We can see from the results that our method significantly improves the isotropy of the learned word representations in terms of both criteria.
146
+
147
+ # 5.2 MACHINE TRANSLATION
148
+
149
+ We also apply our spectrum control method to machine translation tasks. Given a source sentence s, the decoder of an neural machine translation (NMT) model is to predict the next word in the target sentence t and the previous decoded words in t. In the following we use the state-of-the-art Transformer-based NMT model as our baseline.
150
+
151
+ Table 3: Comparison of different methods in terms of isotropy for the tasks of language modeling and machine translation. (For perfect isotropy, $I _ { 1 } ( { \bf W } ) = 1 , \bar { I _ { 2 } } ( { \bf W } ) = 0 .$ )
152
+
153
+ <table><tr><td colspan="3">Language Modeling</td><td colspan="3">Machine Translation</td></tr><tr><td>Method</td><td>1(W)</td><td>12(W)</td><td>Method</td><td>I1(W)</td><td>12(W)</td></tr><tr><td>Standard Transformer-XL</td><td>0.24</td><td>0.037</td><td>Transformer-Base</td><td>0.31</td><td>0.031</td></tr><tr><td>Ours</td><td>0.63</td><td>0.022</td><td>Ours</td><td>0.88</td><td>0.005</td></tr></table>
154
+
155
+ Table 4: Comparison of different methods in terms of BLEU scores on the task of $\mathrm { D e } { } \mathrm { E n }$ machine translation, trained on IWSLT 2014 dataset.
156
+
157
+ <table><tr><td rowspan="2">IWSLT2014De-→En</td><td colspan="4">Method</td></tr><tr><td>Adversarial (Wang et al., 2019a)</td><td>Dual-learning (Wang et al., 2019b)</td><td>Transformer-Base (Wang et al., 2019b)</td><td>Ours</td></tr><tr><td>BLEU 1</td><td>35.18</td><td>35.44</td><td>34.01</td><td>35.50</td></tr></table>
158
+
159
+ Datasets We compare various NMT models on the IWSLT 2014 German English (De-En) and WMT 14 English German $\left( E n – D e \right)$ datasets. For IWSLT 2014 De-En, we follow the same setup as in (Gehring et al., 2017). More specifically, we have 160K sentence pairs as the training data, 7K sentence pairs as the validation data, and we combine tst2010, tst2011, tst2012, dev2010 and dev2012 datasets to form our test data. For the large scale WMT 14 En-De, we have 4.5 million sentence pairs as our training data, and we use newstest2014 as our test data dataset (Cettolo et al., 2014).
160
+
161
+ Model Configuration We implement our method on top of Transformer model (Vaswani et al., 2017). In particular, we consider the Transformer-Base architecture (Vaswani et al., 2017) for IWSLT 2014 De-En, which has a 6-layer encoder and 6-layer decoder with 512 dimensional hidden states and embeddings, except that we choose the dimension of the inner feed-forward layer as 1024 instead of 2048 and the number of attention heads is set to be 4 rather than 8. For WMT 14 En-De, we consider the original Transformer-Base and Transformer-Big architectures (Vaswani et al., 2017), which have a 6-layer encoder and 6-layer decoder with 512 and 1024 dimensional embeddings, respectively. Our implementation is based on the open-sourced code6 provided by Ott et al. (2018). We follow the same procedures as in the language modeling task to choose the regularization parameters. The best results for this task on IWSLT 2014 De-En are from the models where the singular values are controlled by exponential distribution, and the best results for this task on WMT 14 En-De are from the models where the singular values are controlled by polynomial distribution.
162
+
163
+ Results Comparisons of different methods in terms of BLEU scores for IWSLT 2014 De-En are summarized in Table 4. Compared with the baseline models, our method improves the BLEU score7 from 34.01 to 35.50 on the German English task, close to 1.5 gain on BLEU score; our method is also better than 35.18 reported in (Wang et al., 2019a), and 35.44 reported in (Wang et al., 2019b). Table 5 summarizes different methods in terms of BLEU scores for WMT 14 En-De. The results show that our method achieves 1.15 and 0.92 BLEU score improvements on this task for base and big models, respectively. In addition, our method is also better than 28.38 and 28.94 reported in Gao et al. (2019b) for base and big models.
164
+
165
+ Analysis We also study the learned word embedding matrix of the Transformer trained on IWSLT 2014 De-En using our method in terms of isotropy. The values of $I _ { 1 } ( \mathbf { W } )$ and $I _ { 2 } ( \mathbf { W } )$ are reported in the right half of Table 3, we compute these two values based on all the tokens. It shows that the isotropy of the learned word representations using our method increases significantly in terms of these criteria, from very anisotropic to nearly isotropic. We also demonstrate the projected word embedding matrices and the singular value distributions of different methods in Figure 3. The plots show that the learned word representations from our method are distributed isotropically in the space, which is in contrast to the narrow cone distribution from the baseline method.
166
+
167
+ Table 5: Comparison of different methods in terms of BLEU scores on the task of $\mathrm { E n \to }$ De machine translation, trained on WMT 2014 dataset.
168
+
169
+ <table><tr><td>Method</td><td>BLEU</td></tr><tr><td>Transformer-Base(Vaswani etal.,2017)</td><td>27.30</td></tr><tr><td>Transformer-Base (Gao et al.,2019b) Transformer-Base+ Ours</td><td>28.38</td></tr><tr><td></td><td>28.45</td></tr><tr><td>Transformer-Big (Vaswani et al., 2017)</td><td>28.40</td></tr><tr><td>Transformer-Big (Gao et al.,2019b) Transformer-Big+Ours</td><td>28.94 29.32</td></tr></table>
170
+
171
+ ![](images/e6ae23229cfc65fcf3c141c428a455df1cc1fe054c94ed273dd69d5d665c9fe0.jpg)
172
+ Figure 3: (a) Word embedding for the vanilla Transformer, which has a narrow cone distribution; (b) Word embedding for Transformer using spectrum control, which has a uniform distribution; (c) Normalized singular value for different methods, which shows a slow decay of our method.
173
+
174
+ # 6 CONCLUSIONS AND FUTURE WORK
175
+
176
+ In this paper, we tackle the degeneration problem that occurs at the output embeddings in the softmax layer used in neural language generation models. We develop a novel spectrum control method to explicitly guide the spectra training of the output embedding matrix with some slow-decaying singular value prior distributions. Our proposed method is shown to alleviate the degeneration problem and improve isotropy of the learned contextualized word representations. Thorough experimental results demonstrate the advantage of our method over the state-of-the-art neural models for language model and machine translation. Since our work is orthogonal to Wang et al. (2019a), it would be interesting to combine the adversarial softmax training with our spectrum control method, and investigate its performance. For the future work, we would also like to investigate how the frequency-agnostic word representations in (Gong et al., 2018) relate to the single value distribution of the output embedding matrix.
177
+
178
+ # REFERENCES
179
+
180
+ Zeyuan Allen-Zhu, Yuanzhi Li, and Yingyu Liang. Learning and generalization in overparameterized neural networks, going beyond two layers. NeurIPS, 2019.
181
+ Sanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. A latent variable model approach to pmi-based word embeddings. TACL, 4:385–399, 2016a.
182
+ Sanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. A latent variable model approach to pmi-based word embeddings. TACL, 4:385–399, 2016b.
183
+ Sanjeev Arora, Yingyu Liang, and Tengyu Ma. A simple but tough-to-beat baseline for sentence embeddings. 2016c.
184
+ Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICML, 2015.
185
+ Peter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. JMLR, 2002.
186
+ Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. In Proceedings of the Twentieth Conference on Computational Natural Language Learning, 2016.
187
+
188
+ Mauro Cettolo, Jan Niehues, Sebastian Stuker, Luisa Bentivogli, and Marcello Federico. Report on ¨ the 11th iwslt evaluation campaign, iwslt 2014. In SLT, 2014.
189
+
190
+ Patrick Chen, Si Si, Yang Li, Ciprian Chelba, and Cho-Jui Hsieh. Groupreduce: Block-wise lowrank approximation for neural language model shrinking. In Advances in Neural Information Processing Systems, pp. 10988–10998, 2018.
191
+
192
+ Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. ACL, 2019.
193
+
194
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019.
195
+
196
+ Kawin Ethayarajh. How contextual are contextualized word representations? comparing the geometry of bert, elmo, and gpt-2 embeddings. EMNLP, 2019.
197
+
198
+ Octavian-Eugen Ganea, Sylvain Gelly, Gary Becigneul, and Aliaksei Severyn. Breaking the softmax ´ bottleneck via learnable monotonic pointwise non-linearities. ICML, 2019.
199
+
200
+ Jianfeng Gao, Michel Galley, Lihong Li, et al. Neural approaches to conversational ai. Foundations and Trends $\textsuperscript { \textregistered }$ in Information Retrieval, 13(2-3):127–298, 2019a.
201
+
202
+ Jun Gao, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tieyan Liu. Representation degeneration problem in training natural language generation models. In ICLR, 2019b.
203
+
204
+ Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In ICML, pp. 1243–1252, 2017.
205
+
206
+ Chengyue Gong, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tie-Yan Liu. Frage: frequency-agnostic word representation. In NIPS, 2018.
207
+
208
+ A. Graves, A. Mohamed, and G. Hinton. Speech recognition with deep recurrent neural networks. In ICASSP, 2013.
209
+
210
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
211
+
212
+ Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. In ICLR, 2017.
213
+
214
+ Haoming Jiang, Zhehui Chen, Minshuo Chen, Feng Liu, Dingding Wang, and Tuo Zhao. On computation and generalization of generative adversarial networks under spectrum control. In ICLR, 2019.
215
+
216
+ Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
217
+
218
+ Sekitoshi Kanai, Yasuhiro Fujiwara, Yuki Yamanaka, and Shuichi Adachi. Sigsoftmax: Reanalysis of the softmax bottleneck. In NIPS, 2018.
219
+
220
+ Nitish Shirish Keskar, Bryan McCann, Lav R. Varshney, Caiming Xiong, and Richard Socher. Ctrl: A conditional transformer language model for controllable generation. arXiv:1909.05858, 2019.
221
+
222
+ Percy Liang. Cs229t/stat231: Statistical learning theory (winter 2016), 2014.
223
+
224
+ Stephan Mandt, Matthew D Hoffman, and David M Blei. Stochastic gradient descent as approximate bayesian inference. JMLR, 2017.
225
+
226
+ Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing LSTM language models. In ICLR, 2018a.
227
+
228
+ Stephen Merity, Nitish Shirish Keskar, and Richard Socher. An analysis of neural language modeling at multiple scales. arXiv preprint arXiv:1803.08240, 2018b.
229
+
230
+ Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013.
231
+
232
+ Jiaqi Mu and Pramod Viswanath. All-but-the-top: Simple and effective postprocessing for word representations. In ICLR, 2018.
233
+
234
+ Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. In Proceedings of the Third Conference on Machine Translation, 2018.
235
+
236
+ Aldo Pacchiano, Niladri S Chatterji, and Peter L Bartlett. Online learning with kernel losses. ICML, 2019.
237
+
238
+ Nikolaos Pappas and James Henderson. Deep residual output layers for neural language generation. In ICML, 2019.
239
+
240
+ Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In EMNLP, 2014.
241
+
242
+ Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In NAACL, 2018.
243
+
244
+ Ofir Press and Lior Wolf. Using the output embedding to improve language models. In EACL, 2017.
245
+
246
+ Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019.
247
+
248
+ Jack Rae, Chris Dyer, Peter Dayan, and Timothy Lillicrap. Fast parametric learning with activation memorization. In ICML, 2018.
249
+
250
+ Jianheng Tang, Tiancheng Zhao, Chenyan Xiong, Xiaodan Liang, Eric P. Xing, and Zhiting Hu. Target-guided open-domain conversation. In ACL, 2019.
251
+
252
+ Shubham Toshniwal, Anjuli Kannan, Chung-Cheng Chiu, Yonghui Wu, Tara Sainath, and Karen Livescu. A comparison of techniques for language model integration in encoder-decoder speech recognition. In IEEE Workshop on Spoken Language Technology, 2018.
253
+
254
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
255
+
256
+ Dilin Wang, Chengyue Gong, and Qiang Liu. Improving neural language modeling via adversarial training. In ICML, 2019a.
257
+
258
+ Yiren Wang, Yingce Xia, Tianyu He, Fei Tian, Tao Qin, ChengXiang Zhai, and Tie-Yan Liu. Multiagent dual learning. In ICLR, 2019b.
259
+
260
+ Yuting Wei, Fanny Yang, and Martin J Wainwright. Early stopping for kernel boosting algorithms: A general analysis with localized complexities. In NIPS, 2017.
261
+
262
+ Zhilin Yang, Zihang Dai, Ruslan Salakhutdinov, and William W. Cohen. Breaking the softmax bottleneck: A high-rank RNN language model. In ICLR, 2018.
263
+
264
+ Jiong Zhang, Qi Lei, and Inderjit Dhillon. Stabilizing gradients for deep neural networks via efficient svd parameterization. In International Conference on Machine Learning, pp. 5801–5809, 2018.
265
+
266
+ # APPENDIX
267
+
268
+ # A PROOF OF THEOREM 4.1
269
+
270
+ Preliminaries We briefly review the general statistical learning framework. More specifically, let $\mathcal { X }$ and $\mathcal { V }$ be the feature and label spaces, and suppose $\mathcal { D }$ is an unknown distribution over $\mathcal { X } \times \mathcal { V }$ . Let $\mathcal { F } \subseteq \mathcal { V } ^ { \mathcal { X } }$ be the hypothesis class that we use to make prediction, and $\ell : \mathcal { V } \times \mathcal { V } \mathbb { R }$ be the loss function. In addition, we define the function class $\ell _ { \mathcal { F } } = \{ ( \mathbf { x } , y ) \ell ( f ( \mathbf { x } ) , y ) : f \in \mathcal { F } \}$ as the composition of the functions in $\mathcal { F }$ and loss $\ell$ . Therefore, the goal is to minimize the expected risk $L _ { D } = \mathbb { E } _ { ( \mathbf { x } , y ) \sim \mathcal { D } } \ell ( f ( \mathbf { x } ) , y )$ with some function $f \in { \mathcal { F } }$ .
271
+
272
+ According to the problem setup in Section 4.3, we have $n$ i.i.d. training examples $S = \{ ( \mathbf { h } _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n }$ drawn from $\mathcal { D }$ , where the hidden state $\mathbf { h } _ { i } \in \mathbb { R } ^ { d }$ is the feature vector and $y _ { i }$ is the corresponding label. Suppose there exist a learning algorithm that maps the training dataset $S$ to a function $f \in { \mathcal { F } }$ , and we want to measure the gap between the empirical risk $L _ { S }$ and and the population risk $L _ { \mathcal { D } }$ , i.e., $| L _ { D } - L _ { S } |$ , where $\textstyle L _ { S } = \sum _ { i = 1 } ^ { n } \ell ( f ( \mathbf { h } _ { i } ) , y _ { i } ) / n$ . This gap is known as the generalization error.
273
+
274
+ To bound the generalization error, we use the Rademacher complexity (Bartlett & Mendelson, 2002). Let $\mathcal { F } \subseteq \mathbb { R } ^ { \mathcal { Z } }$ be a function class and $S = \{ \mathbf { z } _ { 1 } , \ldots . . . , \mathbf { z } _ { n } \}$ be a set of examples of size $n$ , the empirical Rademacher complexity is defined as
275
+
276
+ $$
277
+ { \widehat { \mathfrak { R } } } _ { S } ( { \mathcal { F } } ) : = { \frac { 1 } { n } } \mathbb { E } _ { \rho } { \biggl [ } \operatorname* { s u p } _ { f \in { \mathcal { F } } } \sum _ { i = 1 } ^ { n } \rho _ { i } f ( \mathbf { x } _ { i } ) { \biggr ] } ,
278
+ $$
279
+
280
+ where $\rho _ { 1 } , \ldots , \rho _ { n }$ are i.i.d. Rademacher random variables with $\mathbb { P } ( \rho _ { i } = 1 ) = \mathbb { P } ( \rho _ { i } =$ $- 1 ) = 1 / 2$ .
281
+
282
+ According to the loss function $L _ { S }$ defined in (4.2), we are considering $N$ function classes $\{ \mathcal { F } _ { k } \} _ { k = 1 } ^ { N }$ with $\mathcal { F } _ { k } = \{ f : \mathbf { h } \langle \mathbf { w } _ { k } , \mathbf { h } \rangle$ , $\mathbf { w } _ { k } = \mathbf { e } ^ { k \top } \mathbf { W } , \mathbf { W } \in \mathcal { P } ( \gamma ) , \mathbf { h } \in \mathbb { R } ^ { d } \}$ , where $\mathbf { e } ^ { k }$ is a $d$ -dimensional vector with $k$ -th element to be one and others to be zero, and the loss $\ell : \mathbb { R } ^ { N } \to \mathbb { R }$ . We have the following Lemma to bound the generalization error based on the empirical Rademacher complexity, which was proved in Corollary A.11 in Allen-Zhu et al. (2019).
283
+
284
+ Lemma A.1. (Allen-Zhu et al., 2019) If $\mathcal { F } _ { 1 } \ldots , \mathcal { F } _ { N }$ are $_ \mathrm { N }$ classes of functions $\mathbb { R } ^ { d } \to \mathbb { R }$ , the loss function $\ell : \mathbb { R } ^ { N } \to \mathbb { R }$ is $G$ -Lipschitz continuous and $| \ell ( \cdot ) | \leq B$ for any $\mathbf { z } \sim \mathcal { D }$ , then with probability at least $1 - \delta$ , we have
285
+
286
+ $$
287
+ \begin{array}{c} \operatorname* { s u p } _ { f _ { 1 } \in { \mathcal { F } } _ { 1 } , \ldots , f _ { n } \in { \mathcal { F } } _ { N } } \left| { \mathbb { E } } \left[ \ell \left( f _ { 1 } ( \mathbf { z } ) , \ldots , f _ { N } ( \mathbf { z } ) \right) \right] - { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } \ell ( f ( \mathbf { z } _ { i } ) ) \right| \leq C _ { 1 } G \sum _ { k = 1 } ^ { N } { \widehat { \mathfrak { N } } } _ { S } ( { \mathcal { F } } _ { k } ) \\ { + C _ { 2 } { \frac { B \sqrt { \log ( 1 / \delta ) } } { \sqrt { n } } } , } \end{array}
288
+ $$
289
+
290
+ where the expectation is taken over the distribution $\mathcal { D }$ .
291
+
292
+ Equipped with this lemma, we now present the proof of our main result.
293
+
294
+ Proof of Theorem 4.1. According to the problem setup in Section 4, we have $N$ classes of functions $\{ \mathcal { F } _ { k } \} _ { k = 1 } ^ { N }$ and let the singular value decomposition of W as
295
+
296
+ $\mathbf { W } = \mathbf { U } \boldsymbol { \Sigma } \mathbf { V } ^ { \top }$ and $\mathbf { u } _ { k }$ is the $k$ -th row of U. Therefore, we have
297
+
298
+ $$
299
+ \widehat { \mathfrak { M } } _ { S } ( \mathcal { F } _ { k } ) = \mathbb { E } _ { \rho } \bigg [ \operatorname* { s u p } _ { f \in \mathcal { F } _ { k } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \rho _ { i } \langle \mathbf { w } _ { k } , \mathbf { h } _ { i } \rangle \bigg ] = \mathbb { E } _ { \rho } \bigg [ \operatorname* { s u p } _ { f \in \mathcal { F } _ { k } } \frac { 1 } { n } \langle \mathbf { V } \Sigma \mathbf { u } _ { k } ^ { \intercal } , \mathbf { h } _ { \rho } \rangle \bigg ]
300
+ $$
301
+
302
+ where $\begin{array} { r } { \mathbf { h } _ { \rho } \ : = \ : \sum _ { i = 1 } ^ { n } \rho _ { i } \mathbf { h } _ { i } } \end{array}$ and the last inequality is due to the definition of $\mathbf { w } _ { k } ~ =$ $\mathbf { V } \pmb { \Sigma } \mathbf { u } _ { k } ^ { \top }$ . Therefore, we have
303
+
304
+ $$
305
+ \begin{array} { r l } & { \widehat { \mathfrak { N } } _ { S } ( \mathcal { F } _ { k } ) \leq \mathbb { E } _ { \rho } \bigg [ \displaystyle \operatorname* { s u p } _ { f \in \mathcal { F } _ { k } } \frac { 1 } { n } \| \nabla \Sigma \mathbf { u } _ { k } ^ { \intercal } \| _ { 1 } \| \mathbf { h } _ { \rho } \| _ { \infty } \bigg ] } \\ & { \qquad \leq \frac { V } { n } \mathbb { E } _ { \rho } \bigg [ \displaystyle \operatorname* { s u p } _ { f \in \mathcal { F } _ { k } } \| \Sigma \mathbf { u } _ { k } ^ { \intercal } \| _ { 1 } \| \mathbf { h } _ { \rho } \| _ { \infty } \bigg ] } \\ & { \qquad \leq \frac { V \sqrt { \sum _ { j = 1 } ^ { d } \sigma _ { j } ^ { 2 } } } { n } \mathbb { E } _ { \rho } \bigg [ \displaystyle \operatorname* { s u p } _ { f \in \mathcal { F } _ { k } } \| \mathbf { h } _ { \rho } \| _ { \infty } \bigg ] , } \end{array}
306
+ $$
307
+
308
+ where the second inequality is due to $\| \mathbf { V } \| _ { 1 } \leq V$ and the last one comes from $\begin{array} { r } { \| \Sigma \mathbf { u } _ { k } ^ { \top } \| _ { 1 } = \sum _ { j = 1 } ^ { d } \sigma _ { j } | u _ { k j } | \leq \sqrt { \sum _ { j = 1 } ^ { d } \sigma _ { j } ^ { 2 } } } \end{array}$ . In addition, according to Theorem 12 in Liang (2014) , we have
309
+
310
+ $$
311
+ \mathbb { E } _ { \rho } \big [ \| \mathbf { h } _ { \rho } \| _ { \infty } \big ] \leq H \sqrt { 2 n \log d } ,
312
+ $$
313
+
314
+ Therefore, we can get
315
+
316
+ $$
317
+ { \widehat { \mathfrak { R } } } _ { S } ( { \mathcal { F } } _ { k } ) \leq V H { \frac { { \sqrt { \sum _ { i = 1 } ^ { m } \sigma _ { i } ^ { 2 } } } + { \sqrt { \sum _ { i > m } \sigma _ { i } ^ { 2 } } } } { \sqrt { \mathfrak { n } } } } { \sqrt { 2 \log d } } .
318
+ $$
319
+
320
+ As a result, we can get
321
+
322
+ $$
323
+ \sum _ { k = 1 } ^ { N } \widehat { \mathfrak { R } } _ { S } ( \mathcal { F } _ { k } ) \leq N V H \frac { \sqrt { \sum _ { i = 1 } ^ { m } \sigma _ { i } ^ { 2 } } + \sqrt { \sum _ { i > m } \sigma _ { i } ^ { 2 } } } { \sqrt { n } } \sqrt { 2 \log d } .
324
+ $$
325
+
326
+ Since for $\mathcal { P } ( \gamma ) ~ = ~ \mathcal { P } _ { e } ( \gamma )$ , we have $\sigma _ { j } ~ \le ~ c _ { 1 } \exp ( - c _ { 2 } j ^ { \gamma } ) ~ \le ~ c _ { 1 } / ( c _ { 2 } j ^ { \gamma } )$ , and for $\mathcal { P } ( \gamma ) = \mathcal { P } _ { p } ( \gamma )$ , we have $\sigma _ { j } \leq c _ { 3 } j ^ { - \gamma }$ . Thus for $\gamma > 1 / 2$ , we have
327
+
328
+ $$
329
+ \sum _ { j > m } \sigma _ { j } ^ { 2 } \leq \sum _ { j > m } \frac { c _ { 4 } } { j ^ { 2 \gamma } } \leq c _ { 4 } \int _ { m + 1 } ^ { \infty } x ^ { - 2 \gamma } d x \leq \frac { c _ { 4 } } { ( 2 \gamma - 1 ) } ( m + 1 ) ^ { 1 - 2 \gamma } ,
330
+ $$
331
+
332
+ where $c _ { 4 } = ( c _ { 1 } / c _ { 2 } ) ^ { 2 }$ if $\mathcal { P } ( \gamma ) = \mathcal { P } _ { e } ( \gamma )$ and $c _ { 4 } = c _ { 3 } ^ { 2 }$ if $\mathcal { P } ( \gamma ) = \mathcal { P } _ { p } ( \gamma )$
333
+
334
+ Therefore, plugging this upper bound into (A.3), we have
335
+
336
+ $$
337
+ \sum _ { \ k = 1 } ^ { N } \widehat { \mathfrak { R } } _ { S } ( \mathcal { F } _ { k } ) \leq \frac { N V H \sqrt { 2 \log d } \sqrt { \sum _ { j = 1 } ^ { m } \sigma _ { j } ^ { 2 } } } { \sqrt { n } } + c _ { 5 } \frac { N V H \sqrt { 2 \log d } \sqrt { m ^ { 1 - 2 \gamma } / ( 2 \gamma - 1 ) } } { \sqrt { n } } .
338
+ $$
339
+
340
+ Where $c _ { 5 } = c 1 / c 5$ if $\mathcal { P } ( \gamma ) = \mathcal { P } _ { e } ( \gamma )$ and $c _ { 5 } = c _ { 3 }$ if $\mathcal { P } ( \gamma ) = \mathcal { P } _ { p } ( \gamma )$ .
341
+
342
+ According to Lemma A.1, since $\ell$ is $G$ -Lipschitz continuous and $| \ell ( \cdot ) | \leq B$ , we have
343
+
344
+ $$
345
+ \begin{array} { r l } & { \underset { \mathbf { W } \in \mathcal { P } ( \gamma ) } { \operatorname* { s u p } } \left| L _ { \mathcal { D } } ( \mathbf { W } ) - L _ { S } ( \mathbf { W } ) \right| \leq c _ { 6 } G N V H \sqrt { \log d } \frac { \sqrt { \sum _ { j = 1 } ^ { m } \sigma _ { j } ^ { 2 } } + \sqrt { \frac { m ^ { 1 - 2 \gamma } } { ( 2 \gamma - 1 ) } } } { \sqrt { n } } } \\ & { \qquad + c _ { 7 } B \sqrt { \frac { \log ( 1 / \delta ) } { n } } . } \end{array}
346
+ $$
347
+
348
+ Table 6: Comparison of different penalty functions in terms of perplexity on WikiText-2 dataset.
349
+
350
+ <table><tr><td>Method</td><td>Validation</td><td>Test</td></tr><tr><td>AWD-LSTM (Merity et al., 2018a)</td><td>69.1</td><td>66.0</td></tr><tr><td>Spectrum Normalization</td><td>76.3</td><td>72.5</td></tr><tr><td>SN+D-Optimal Regularizer</td><td>98.3</td><td>94.8</td></tr><tr><td>Ours</td><td>66.3</td><td>63.7</td></tr></table>
351
+
352
+ B EXPERIMENTAL RESULTS FOR OTHER PENALTY FUNCTIONS
353
+
354
+ In this section, we also implement our method with the penalty function proposed in Jiang et al. (2019) for training GANs. We consider WikiText-2 dataset, and all the experimental settings are same as before. Table 6 demonstrates the performance of our method using the Spectrum Normalization (SN) and $\mathbf { S N + D }$ -Optimal Regularizer, which can achieve the best performance of training GANs in their paper. The results show that their proposed penalty function can deteriorate the training of neural language models. This is because their method is motivated from training GANs, and will encourage all the singular values close to the largest one. If we use such penalty function to train neural language models, the learned word representations will lose the power of modeling contextual information. Therefore, our proposed spectrum control method is essential to improve the training of neural language generation.
355
+
356
+ # C TRAINING TIME AND MEMORY COST
357
+
358
+ In this section, we compare the training time and memory cost of our method with the baseline method, i.e., AWD-LSTM (Merity et al., 2018a) and standard Trandformer-XL (Dai et al., 2019). More specifically, we test our method and the baseline method on the same machine on WikiText-2 WikiText-103, and WMT 14 datasets. For WikiText-2 dataset, we use one NVIDIA Tesla V100 GPU and set the batch size to be 80. For WikiText-103 dataset, we use four NVIDIA Tesla V100 GPU and set the batch size to be 40. For WMT 14, we use four NVIDIA Tesla V100 GPU and set the max token as 3500. The training time and memory cost for a single GPU are summarized in Table 7. The results illustrate that our method is only $1 . 1 7 \times$ , $1 . 1 8 \times$ , and $1 . 2 4 \times$ slower than the baseline methods on WikiText-2, WikiText-103 and WMT 14 datasets, respectively. In addition, our method will cost $1 . 0 6 \times , 1 . 3 2 \times$ and $1 . 1 1 \times$ memory compared with the baseline methods on WikiText2, WikiText-103, and WMT 14 datasets, respectively.
359
+
360
+ Table 7: Comparisons of our method and baseline method in terms of the average training time per epoch and the memory cost.
361
+
362
+ <table><tr><td>Method</td><td>WikiText-2</td><td>WikiText-103</td><td>WMT14</td></tr><tr><td>Training time</td><td></td><td></td><td></td></tr><tr><td>Baseline</td><td>61 sec</td><td>2681 sec</td><td>5991 sec</td></tr><tr><td>Ours</td><td>70 sec</td><td>3152 sec</td><td>7421 sec</td></tr><tr><td>Memory cost</td><td></td><td></td><td></td></tr><tr><td>Baseline</td><td>8.9 GB</td><td>11.4 GB</td><td>14.2 GB</td></tr><tr><td>Ours</td><td>9.5 GB</td><td>15.0 GB</td><td>15.7 GB</td></tr></table>
363
+
364
+ Table 8: Comparisons of different priors on different datasets.
365
+
366
+ <table><tr><td>Dataset</td><td>Exponential Decay</td><td>Polynomial Decay</td></tr><tr><td>Language Modeling</td><td>Test PPL</td><td>Test PPL</td></tr><tr><td>WikiText-2</td><td>63.7</td><td>64.2</td></tr><tr><td>WikiText-103</td><td>23.4</td><td>23.2</td></tr><tr><td>Machine Translation</td><td>BLEU</td><td>BLEU</td></tr><tr><td>IWSLT2014De-→En</td><td>35.50</td><td>35.40</td></tr><tr><td>WMT14En→De</td><td>28.37</td><td>28.45</td></tr></table>
367
+
368
+ # D COMPARISON OF TWO PRIORS
369
+
370
+ In this section we present the performance of our method on different tasks using different prior distributions. Table 8 suggests that the overall performance of these two prior distributions on different tasks are similar. In addition, the results show that it is better to use polynomial decay for large scale dataset and exponential decay for small scale dataset.
parse/train/ByxY8CNtvr/ByxY8CNtvr_content_list.json ADDED
@@ -0,0 +1,1875 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "IMPROVING NEURAL LANGUAGE GENERATION WITH SPECTRUM CONTROL ",
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": "Lingxiao Wang1, Jing Huang2, Kevin Huang2, Ziniu $\\mathbf { H } \\mathbf { u } ^ { 1 }$ , Guangtao $\\mathbf { W a n g } ^ { 2 }$ , Quanquan $\\mathbf { G u } ^ { 1 }$ ",
17
+ "bbox": [
18
+ 186,
19
+ 164,
20
+ 823,
21
+ 180
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "1Department of Computer Science, University of California, Los Ange 2JD AI Research, Mountain View, CA 94034 {lingxw,bull,qgu}@cs.ucla.edu {jing.huang,kevin.huang3,guangtao.wang}@jd.com ",
28
+ "bbox": [
29
+ 184,
30
+ 181,
31
+ 643,
32
+ 237
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "ABSTRACT ",
39
+ "text_level": 1,
40
+ "bbox": [
41
+ 454,
42
+ 272,
43
+ 544,
44
+ 287
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "Recent Transformer-based models such as Transformer-XL and BERT have achieved huge success on various natural language processing tasks. However, contextualized embeddings at the output layer of these powerful models tend to degenerate and occupy an anisotropic cone in the vector space, which is called the representation degeneration problem. In this paper, we propose a novel spectrum control approach to address this degeneration problem. The core idea of our method is to directly guide the spectra training of the output embedding matrix with a slow-decaying singular value prior distribution through a reparameterization framework. We show that our proposed method encourages isotropy of the learned word representations while maintains the modeling power of these contextual neural models. We further provide a theoretical analysis and insight on the benefit of modeling singular value distribution. We demonstrate that our spectrum control method outperforms the state-of-the-art Transformer-XL modeling for language model, and various Transformer-based models for machine translation, on common benchmark datasets for these tasks. ",
51
+ "bbox": [
52
+ 233,
53
+ 300,
54
+ 764,
55
+ 507
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 INTRODUCTION ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 176,
65
+ 531,
66
+ 336,
67
+ 546
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Neural language generation (NLG) is an important task with many practical applications, such as automatic speech recognition (Graves et al., 2013; Toshniwal et al., 2018), text generation (Bowman et al., 2016; Radford et al., 2019; Keskar et al., 2019), machine translation (Bahdanau et al., 2015; Vaswani et al., 2017) and dialog systems (Gao et al., $2 0 1 9 \\mathrm { a }$ ; Tang et al., 2019). Most NLG models utilize a complex encoding model to map a given context into a hidden state vector, and then predict the next word distribution by multiplying the encoded vector with the output embedding layer, followed by a softmax layer. In the past few years, it has witnessed a significant progress in NLG by improving the encoding model, from the recurrent neural network (RNN) (Bahdanau et al., 2015; Jozefowicz et al., 2016; Merity et al., 2018a) based models to the current Transformer-based models (Vaswani et al., 2017; Devlin et al., 2019; Dai et al., 2019; Radford et al., 2019). However, embeddings in the softmax output layer have been shown not capable enough to model the conditional probability (Yang et al., 2018). ",
74
+ "bbox": [
75
+ 174,
76
+ 558,
77
+ 825,
78
+ 724
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Recently, Gao et al. (2019b) pointed out another limitation of the output embeddings: the representation degeneration problem. They showed that the singular value distribution of the output embedding matrix tends to decay very fast, and the embedding space is squeezed into a narrow cone (as shown in Figure 1(a) and 1(c) in 2-D plots). Such anisotropic shape (Ethayarajh, 2019) is very different from what one would expect from an expressive word embedding space (Arora et al., 2016a; Mu & Viswanath, 2018). Therefore, several efforts (Gao et al., 2019b; Wang et al., 2019a) have been made to address the degeneration problem. ",
85
+ "bbox": [
86
+ 173,
87
+ 727,
88
+ 825,
89
+ 824
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Unlike previous approaches that applied implicit regularization to singular values of the output embedding matrix, we propose a spectrum control (SC) approach, which was inspired by the spectral control technique used for Generative Adversarial Network (GAN) training (Jiang et al., 2019), to explicitly control the singular value distribution. We first reparameterize the output embedding matrix W by its singular value decomposition (SVD): $\\mathbf { W } = \\mathbf { U } \\pmb { \\Sigma } \\mathbf { V } ^ { \\top }$ , where $\\mathbf { U } , \\mathbf { V }$ are column orthonormal matrices, and $\\pmb { \\Sigma }$ is a diagonal matrix of singular values. Then we guide the training of $\\pmb { \\Sigma }$ by a predefined slow-decaying prior distribution, such as a polynomial decay distribution, or an exponential decay distribution. At the end of training, the distribution of singular values of the embedding matrix gets close to the prior distribution. Our spectrum control approach alleviates the representation degeneration problem by encouraging the diversity of word representations and improving isotropic property of these representations (see Figure 2), even on top of the powerful Transformer-based models. ",
96
+ "bbox": [
97
+ 174,
98
+ 827,
99
+ 823,
100
+ 924
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "image",
106
+ "img_path": "images/6aabc7dcf220659a7e78cd780ad4495be37f425567d5096648550374e4b349e4.jpg",
107
+ "image_caption": [
108
+ "Figure 1: Projected word embeddings1and singular value distributions. (a) and (c): 2-D visualization of word embedding matrices of Transformer-XL for language modeling and Transformer for machine translation; (b) and (d): Normalized singular value distributions of embedding matrices. "
109
+ ],
110
+ "image_footnote": [],
111
+ "bbox": [
112
+ 199,
113
+ 106,
114
+ 808,
115
+ 200
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "image",
121
+ "img_path": "images/362900f46113b115804fab2e6286e00172299464a40406cbcdc0c01f6a72288d.jpg",
122
+ "image_caption": [
123
+ "Figure 2: Projected word embeddings and singular value distributions using our spectrum control method. (a) and (c): 2-D visualization of word embedding matrices of Transformer-XL for language modeling and Transformer for machine translation; (b) and (d): Normalized singular value distributions of embedding matrices. "
124
+ ],
125
+ "image_footnote": [],
126
+ "bbox": [
127
+ 194,
128
+ 267,
129
+ 807,
130
+ 361
131
+ ],
132
+ "page_idx": 1
133
+ },
134
+ {
135
+ "type": "text",
136
+ "text": "",
137
+ "bbox": [
138
+ 174,
139
+ 449,
140
+ 825,
141
+ 518
142
+ ],
143
+ "page_idx": 1
144
+ },
145
+ {
146
+ "type": "text",
147
+ "text": "We further present a theoretical analysis to justify our method. The results suggest that it is beneficial to directly guide the singular value distribution of the embedding matrix throughout the training process and control the decay rate of these singular values. We demonstrate the effectiveness of our training framework with extensive experimental results on two tasks: language modeling and machine translation. Our spectrum control method outperforms the latest state-of-the-art TransformerXL model on WikiText-103 dataset for language modeling; and obtains close to 1.5 BLEU improvement on IWSLT 2014 German-English translation task compared to the Transformer baseline model. ",
148
+ "bbox": [
149
+ 174,
150
+ 521,
151
+ 825,
152
+ 618
153
+ ],
154
+ "page_idx": 1
155
+ },
156
+ {
157
+ "type": "text",
158
+ "text": "2 RELATED WORK ",
159
+ "text_level": 1,
160
+ "bbox": [
161
+ 176,
162
+ 633,
163
+ 344,
164
+ 650
165
+ ],
166
+ "page_idx": 1
167
+ },
168
+ {
169
+ "type": "text",
170
+ "text": "In this paper, we mainly focus on the output embedding matrix that is used in the softmax output layer for language generation tasks. This embedding matrix is also used as input word embeddings, which is known as weight tying trick. The weight tying not only reduces the number of parameters but also enjoys theoretical benefits (Inan et al., 2017). Thus the weight tying has been successfully applied to many state-of-the-art models for language modeling and machine translation (Merity et al., 2018a; Vaswani et al., 2017; Yang et al., 2018). ",
171
+ "bbox": [
172
+ 174,
173
+ 661,
174
+ 825,
175
+ 744
176
+ ],
177
+ "page_idx": 1
178
+ },
179
+ {
180
+ "type": "text",
181
+ "text": "However, there are certain issues with the softmax output layer. Yang et al. (2018) first identified a problem called “softmax bottleneck” that the softmax output layer does not have enough capacity to model natural language due to its connection with the rank bottleneck in matrix factorization. A simple and effective method called Mixture of Softmaxes (MoS) was proposed to deal with this issue. Follow-up work in Kanai et al. (2018); Ganea et al. (2019) tried to replace softmax with alternative activation functions. Kanai et al. (2018) proposed to use sigsoftmax, which is composed of a multiplication of an exponential function and sigmoid function. Ganea et al. (2019) proposed a Linear-Monotonic-Softmax (LMS) model that generalized the approach in Kanai et al. (2018) by learning parametric point-wise increasing functions to optimally distort the logits before feeding them into the softmax layer. Pappas & Henderson (2019) instead resorted to a powerful deep residual nonlinear output mapping while using a single softmax function without modifying its dimensionality or rank. ",
182
+ "bbox": [
183
+ 173,
184
+ 747,
185
+ 825,
186
+ 886
187
+ ],
188
+ "page_idx": 1
189
+ },
190
+ {
191
+ "type": "text",
192
+ "text": "",
193
+ "bbox": [
194
+ 173,
195
+ 103,
196
+ 821,
197
+ 132
198
+ ],
199
+ "page_idx": 2
200
+ },
201
+ {
202
+ "type": "text",
203
+ "text": "Another line of work focuses on increasing the expressive power of the output embedding matrix by adding a cosine similarity regularization term (Gao et al., 2019b), or adversarial noise (Wang et al., 2019a). Gao et al. (2019b) analyzed the representation degeneration problem that the output embeddings tend to degenerate and be distributed into a narrow cone. A regularization term based on the summation of pairwise cosine similarity among all words was proposed to increase the representation power of word embeddings. Wang et al. (2019a) pointed out the computation of regularization term in (Gao et al., 2019b) depends on the size of the vocabulary and hence is costly. Instead, they proposed a simple yet highly effective adversarial training method that adds adversarial noises to the output embedding layer when training the models. They proved in theory that this adversarial training increases the distances between two different words, and thus encourages the diversity of the embedding vectors. Our work follows this line of thought, but takes a different approach: motivated by the spectrum control method for GAN training (Jiang et al., 2019), we propose to directly guide the singular values by a slow-decaying prior distribution during the model training process. We show that the anisotropic behavior of the contextualized word representations from powerful Transformer-based models (Ethayarajh, 2019) are alleviated by our spectrum control approach. ",
204
+ "bbox": [
205
+ 173,
206
+ 135,
207
+ 825,
208
+ 342
209
+ ],
210
+ "page_idx": 2
211
+ },
212
+ {
213
+ "type": "text",
214
+ "text": "3 PROBLEM SETUP ",
215
+ "text_level": 1,
216
+ "bbox": [
217
+ 176,
218
+ 373,
219
+ 348,
220
+ 390
221
+ ],
222
+ "page_idx": 2
223
+ },
224
+ {
225
+ "type": "text",
226
+ "text": "In this section, we briefly introduce the neural models for language generation, and illustrate the singular value decay phenomena of existing neural language models. We first introduce some notations used in the rest of the paper. ",
227
+ "bbox": [
228
+ 174,
229
+ 410,
230
+ 823,
231
+ 453
232
+ ],
233
+ "page_idx": 2
234
+ },
235
+ {
236
+ "type": "text",
237
+ "text": "Notation: For a $d$ -dimensional vector $\\mathbf { x } \\in \\mathbb { R } ^ { d }$ , we use $\\begin{array} { r } { \\| \\mathbf { x } \\| _ { q } = ( \\sum _ { i = 1 } ^ { d } | x _ { i } | ^ { q } ) ^ { 1 / q } } \\end{array}$ , where $0 < q < \\infty$ to denote its $\\ell _ { q }$ -norm, and $\\left\\| \\mathbf { x } \\right\\| _ { \\infty } = \\operatorname* { m a x } _ { i } \\left| x _ { i } \\right|$ to be its infinity norm. For a matrix $\\mathbf { A } \\in \\mathbb { R } ^ { d _ { 1 } \\times d _ { 2 } }$ , let $\\mathbf { A } _ { i * }$ be the $i$ -th row of $\\mathbf { A }$ , and we use $\\| \\mathbf { A } \\| _ { 2 } , \\| \\mathbf { A } \\| _ { F } , \\| \\mathbf { A } \\| _ { 1 }$ to denote its spectral norm, Frobenius norm, and matrix 1-norm. Given two sequences $\\left\\{ a _ { n } \\right\\}$ and $\\left\\{ b _ { n } \\right\\}$ , if there exists a constant $0 < C <$ $\\infty$ such that $a _ { n } \\leq C b _ { n }$ , we write $a _ { n } = O ( b _ { n } )$ , and we use ${ \\widetilde { O } } ( \\cdot )$ to hide the logarithmic factors. ",
238
+ "bbox": [
239
+ 174,
240
+ 455,
241
+ 825,
242
+ 532
243
+ ],
244
+ "page_idx": 2
245
+ },
246
+ {
247
+ "type": "text",
248
+ "text": "3.1 NEURAL LANGUAGE GENERATION ",
249
+ "text_level": 1,
250
+ "bbox": [
251
+ 176,
252
+ 560,
253
+ 455,
254
+ 574
255
+ ],
256
+ "page_idx": 2
257
+ },
258
+ {
259
+ "type": "text",
260
+ "text": "We first briefly review the softmax output layer typically used in neural language generation models. We define the joint probability of a given length- $n$ sentence of words (tokens) $\\mathbf { s } _ { n } = \\left( \\mathbf { y } _ { 1 } , \\ldots , \\mathbf { y } _ { n } \\right)$ as the following product of conditional probabilities ",
261
+ "bbox": [
262
+ 174,
263
+ 587,
264
+ 825,
265
+ 630
266
+ ],
267
+ "page_idx": 2
268
+ },
269
+ {
270
+ "type": "equation",
271
+ "img_path": "images/fca22f412843026bfa90e2198c88ab3edf1125c0eebb8698d90b480000438085.jpg",
272
+ "text": "$$\n\\mathbb { P } ( \\mathbf { s } _ { n } ) = \\prod _ { t = 1 } ^ { n } \\mathbb { P } ( \\mathbf { y } _ { t } | \\mathbf { c } _ { t } ) ,\n$$",
273
+ "text_format": "latex",
274
+ "bbox": [
275
+ 423,
276
+ 631,
277
+ 573,
278
+ 671
279
+ ],
280
+ "page_idx": 2
281
+ },
282
+ {
283
+ "type": "text",
284
+ "text": "where $\\mathbf { y } _ { t } \\in \\mathcal { V }$ is the $t$ -th word in sentence ${ \\bf s } _ { n }$ , and $\\nu$ represents the word vocabulary, $\\mathbf { c } _ { t } = \\mathbf { y } _ { 1 : t - 1 } =$ $\\left( \\mathbf { y } _ { 1 } , \\ldots , \\mathbf { y } _ { t - 1 } \\right)$ is referred to as the context of word $\\mathbf { y } _ { t }$ . In addition, the context $\\mathbf { c } _ { t }$ is usually modeled by a fixed size vector $\\mathbf { h } _ { t } \\in \\mathbb { R } ^ { d }$ , which is referred to as the hidden state, using some neural networks such as LSTM (Hochreiter & Schmidhuber, 1997) and Transformer (Vaswani et al., 2017). Then, the probability distribution of the output word $\\mathbf { y } _ { t }$ given the context $\\mathbf { c } _ { t }$ , i.e., $\\mathbb { P } ( \\mathbf { y } _ { t } | \\mathbf { c } _ { t } )$ in (3.1), is parameterized as the following softmax function: ",
285
+ "bbox": [
286
+ 173,
287
+ 671,
288
+ 825,
289
+ 755
290
+ ],
291
+ "page_idx": 2
292
+ },
293
+ {
294
+ "type": "equation",
295
+ "img_path": "images/4d8daab0f5a2ae46ca29c658528d8c3e4add532f062dae7926341ade63955d73.jpg",
296
+ "text": "$$\n\\mathbb { P } ( Y _ { t } = \\mathbf { y } _ { t } | \\mathbf { c } _ { t } ) = \\mathbb { P } ( Y _ { t } = \\mathbf { y } _ { t } | \\mathbf { h } _ { t } ) = \\frac { \\exp ( \\mathbf { h } _ { t } ^ { \\top } \\mathbf { W } _ { \\mathcal { Z } ( \\mathbf { y } _ { t } ) \\ast } ) } { \\sum _ { i = 1 } ^ { N } \\exp ( \\mathbf { h } _ { t } ^ { \\top } \\mathbf { W } _ { i \\ast } ) } ,\n$$",
297
+ "text_format": "latex",
298
+ "bbox": [
299
+ 307,
300
+ 755,
301
+ 687,
302
+ 795
303
+ ],
304
+ "page_idx": 2
305
+ },
306
+ {
307
+ "type": "text",
308
+ "text": "where $\\mathbf { W } \\in \\mathbb { R } ^ { N \\times d }$ is the weight matrix and is usually tied with the input word embedding matrix (Press & Wolf, 2017; Inan et al., 2017), $N = | \\nu |$ is the vocabulary size, $d$ is the embedding dimension, $\\mathcal { T } ( \\mathbf { y } _ { t } )$ represents the index of word $\\mathbf { y } _ { t }$ in vocabulary $\\nu$ . In the following discussion, we call output weight matrix W as the word embedding matrix of the neural language model since it is tied with the input word embedding matrix. ",
309
+ "bbox": [
310
+ 174,
311
+ 795,
312
+ 825,
313
+ 866
314
+ ],
315
+ "page_idx": 2
316
+ },
317
+ {
318
+ "type": "text",
319
+ "text": "In this paper we focus on the output layer of the neural model for language generation, i.e., the softmax layer in (3.2), as in (Yang et al., 2018; Kanai et al., 2018; Ganea et al., 2019; Gao et al., 2019b). We will examine the singular value distribution of $\\mathbf { W }$ and propose a different approach to increase the expressive power of the word embedding. ",
320
+ "bbox": [
321
+ 174,
322
+ 868,
323
+ 825,
324
+ 924
325
+ ],
326
+ "page_idx": 2
327
+ },
328
+ {
329
+ "type": "text",
330
+ "text": "3.2 FAST SINGULAR VALUE DECAY ",
331
+ "text_level": 1,
332
+ "bbox": [
333
+ 176,
334
+ 103,
335
+ 434,
336
+ 117
337
+ ],
338
+ "page_idx": 3
339
+ },
340
+ {
341
+ "type": "text",
342
+ "text": "As we mentioned before, the singular values of W tend to drop very fast and it may interact with the cone-shaped embedding space. More specifically, Figure 1(b) and 1(d) illustrate the distributions of the normalized singular values of the Transformer-XL based language model2 (Dai et al., 2019) and the Transformer-based machine translation model (Vaswani et al., 2017) trained on WikiText103 (Merity et al., 2018a) and IWSLT 2014 De-En (Cettolo et al., 2014) datasets, respectively. The plots show a fast singular value decay phenomenon, i.e., there is a huge drop between the first and remaining singular values. Such a phenomenon has also been observed in some previous work (Gao et al., 2019b; Wang et al., 2019a). ",
343
+ "bbox": [
344
+ 174,
345
+ 126,
346
+ 825,
347
+ 237
348
+ ],
349
+ "page_idx": 3
350
+ },
351
+ {
352
+ "type": "text",
353
+ "text": "Figure 1(a) and 1(c) present the distributions of the projected word embeddings of the aforementioned two models. We can see from the plots that the projected word embeddings are distributed into some narrow cone shapes, which implies an anisotropic property of the learned word representations, i.e., the embedding vectors are not uniformly distributed in the space. The detailed analysis in Ethayarajh (2019) also confirms that contextualized word embeddings learnt from ELMo (Peters et al., 2018) (LSTM-based model), BERT and GPT-2 (Devlin et al., 2019; Radford et al., 2019) (Transformer-based models) indeed tend to be anisotropic. ",
354
+ "bbox": [
355
+ 174,
356
+ 239,
357
+ 825,
358
+ 337
359
+ ],
360
+ "page_idx": 3
361
+ },
362
+ {
363
+ "type": "text",
364
+ "text": "These contextualized word embeddings have shown great success on many NLP tasks. However, static word embeddings, such as Word2Vec (Mikolov et al., 2013) and GloVe (Pennington et al., 2014) have been shown (Arora et al., 2016b; Mu & Viswanath, 2018) to be isotropic with great expressive power. Hence it may be also beneficial to increase the expressive power of the contextualized word embedding by increasing its isotropy. This motivates us to alleviate the fast singular value decay phenomenon to increase the isotropy of the learned word representations. ",
365
+ "bbox": [
366
+ 173,
367
+ 338,
368
+ 825,
369
+ 422
370
+ ],
371
+ "page_idx": 3
372
+ },
373
+ {
374
+ "type": "text",
375
+ "text": "4 PROPOSED METHOD ",
376
+ "text_level": 1,
377
+ "bbox": [
378
+ 176,
379
+ 440,
380
+ 377,
381
+ 457
382
+ ],
383
+ "page_idx": 3
384
+ },
385
+ {
386
+ "type": "text",
387
+ "text": "To alleviate the fast singular value decay phenomenon, we propose to guide the singular value distribution of the contextualized word embedding throughout the training. As a result, we can achieve a trade-off between modeling contextual information, that tends to make word representations anisotropic, and the expressive power of word representations, that tends to be isotropic. ",
388
+ "bbox": [
389
+ 174,
390
+ 469,
391
+ 825,
392
+ 526
393
+ ],
394
+ "page_idx": 3
395
+ },
396
+ {
397
+ "type": "text",
398
+ "text": "4.1 SVD REPARAMETERIZATION ",
399
+ "text_level": 1,
400
+ "bbox": [
401
+ 176,
402
+ 541,
403
+ 413,
404
+ 555
405
+ ],
406
+ "page_idx": 3
407
+ },
408
+ {
409
+ "type": "text",
410
+ "text": "Following the previous work (Jiang et al., 2019), we propose to apply singular value decomposition (SVD) based reparameterization to the embedding matrix W, i.e., $\\mathbf { W } \\mathbf { \\bar { \\Phi } } = \\mathbf { U } \\pmb { \\Sigma } \\mathbf { V } ^ { \\top }$ , where ${ \\textbf { U } } \\in$ $\\mathbb { R } ^ { N \\times d } , \\mathbf { V } \\in \\mathbb { R } ^ { { \\hat { d } } \\times d }$ are column orthonormal matrices, and $\\pmb { \\Sigma } \\in \\mathbb { R } ^ { d \\times d }$ is a diagonal matrix with $\\Sigma _ { k k } = \\sigma _ { k }$ being the $k$ -th largest singular value of $\\mathbf { W }$ . Note that SVD reparameterization is standard and has been widely used in the literature such as model compression (Chen et al., 2018), training DNNs (Zhang et al., 2018), and analyzing word embeddings (Arora et al., 2016c). Given the SVD reparameterization, we can control the singular values of the embedding matrix $\\mathbf { W }$ by constraining the matrix $\\mathbf { E }$ , and the conditional distribution in (3.2) can be rewritten as follows: ",
411
+ "bbox": [
412
+ 173,
413
+ 564,
414
+ 825,
415
+ 675
416
+ ],
417
+ "page_idx": 3
418
+ },
419
+ {
420
+ "type": "text",
421
+ "text": "where $\\mathcal { P }$ is a feasible set to represent the singular value distribution of the embedding matrix $\\mathbf { W }$ . ",
422
+ "bbox": [
423
+ 176,
424
+ 715,
425
+ 808,
426
+ 729
427
+ ],
428
+ "page_idx": 3
429
+ },
430
+ {
431
+ "type": "text",
432
+ "text": "To ensure the orthogonal constraints in (4.1), we propose to use the orthogonal regularization for $\\mathbf { U } , \\mathbf { V }$ during the training process, which has been previously used in (Jiang et al., 2019). In particular, we use the following regularization, which is a linear combination of Frobenius norm and spectral norm errors: $\\lambda _ { 1 } \\| \\mathbf { U } ^ { \\mathsf { T } } \\mathbf { U } ^ { - } - \\mathbf { I } \\| _ { F } ^ { 2 } + \\lambda _ { 2 } \\| \\mathbf { V } ^ { \\mathsf { T } } \\mathbf { V } - \\mathbf { I } \\| _ { F } ^ { 2 } + \\lambda _ { 3 } \\| \\mathbf { U } ^ { \\mathsf { T } } \\mathbf { U } - \\mathbf { I } \\| _ { 2 } ^ { 2 } + \\lambda _ { 4 } \\| \\mathbf { V } ^ { \\mathsf { T } } \\mathbf { V } - \\mathbf { I } \\| _ { 2 } ^ { 2 }$ , where $\\{ \\lambda _ { i } \\} _ { i = 1 } ^ { 4 }$ are positive regularization parameters. ",
433
+ "bbox": [
434
+ 174,
435
+ 729,
436
+ 825,
437
+ 801
438
+ ],
439
+ "page_idx": 3
440
+ },
441
+ {
442
+ "type": "text",
443
+ "text": "4.2 SPECTRUM CONTROL ",
444
+ "text_level": 1,
445
+ "bbox": [
446
+ 176,
447
+ 816,
448
+ 362,
449
+ 830
450
+ ],
451
+ "page_idx": 3
452
+ },
453
+ {
454
+ "type": "text",
455
+ "text": "Recall the SVD of $\\mathbf { W } = \\mathbf { U } \\pmb { \\Sigma } \\mathbf { V } ^ { \\top }$ , and we consider the following two types of the singular value distribution for $\\pmb { \\Sigma }$ , which is inspired by the eigenvalue distribution of kernel methods (Wei et al., 2017; Pacchiano et al., 2019): ",
456
+ "bbox": [
457
+ 174,
458
+ 838,
459
+ 825,
460
+ 881
461
+ ],
462
+ "page_idx": 3
463
+ },
464
+ {
465
+ "type": "text",
466
+ "text": "• Exponential decay: we say the singular values $\\{ \\sigma _ { k } \\} _ { k = 1 } ^ { d }$ of $\\mathbf { W }$ satisfy the exponential decay if $\\mathbf { W } \\in \\mathcal { P } _ { e } ( \\gamma ) = \\{ \\mathbf { W } \\in \\mathbb { R } ^ { N \\times d } \\mid \\sigma _ { k } \\leq c _ { 1 } \\exp ( - c _ { 2 } \\bar { k } ^ { \\gamma } ) , k = 1 , \\ldots , d , \\gamma > 0 , c _ { 1 } , c _ { 2 } > 0 \\} \\mid \\mathbf { W } \\in \\mathbb { R } ^ { N \\times d } .$ 0 are universal constants}. ",
467
+ "bbox": [
468
+ 176,
469
+ 103,
470
+ 823,
471
+ 148
472
+ ],
473
+ "page_idx": 4
474
+ },
475
+ {
476
+ "type": "text",
477
+ "text": "• Polynomial decay: we say the singular values $\\{ \\sigma _ { k } \\} _ { k = 1 } ^ { d }$ of $\\mathbf { W }$ satisfy the polynomial decay if $\\mathbf { W } \\in \\mathcal { P } _ { p } ( \\gamma ) = \\left\\{ \\mathbf { W } \\in \\mathbb { R } ^ { N \\times d } \\mid \\sigma _ { k } \\leq c _ { 1 } k ^ { - \\gamma } , k = 1 , \\ldots , d , \\gamma > 0 , c _ { 1 } > 0 \\right\\}$ is a universal constant $\\}$ . ",
478
+ "bbox": [
479
+ 173,
480
+ 152,
481
+ 823,
482
+ 184
483
+ ],
484
+ "page_idx": 4
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "For $\\mathcal { P } _ { e } ( \\gamma )$ and $\\mathcal { P } _ { p } ( \\gamma )$ , the parameter $\\gamma$ controls the rate of singular value decay: the larger $\\gamma$ is, the faster singular value decay will be. To ensure the learned word embedding matrix W have the desired singular value distributions, we propose to add the following regularizations to our training objective: $\\begin{array} { r } { \\mathcal { R } _ { e } ( \\Sigma ) = \\lambda _ { e } \\sum _ { k = 1 } ^ { d } \\left( \\sigma _ { k } - c _ { 1 } \\exp ( - c _ { 2 } k ^ { \\gamma } ) \\right) ^ { 2 } } \\end{array}$ for exponential decay and $\\begin{array} { r } { \\mathcal { R } _ { p } ( \\Sigma ) = \\lambda _ { p } \\sum _ { k = 1 } ^ { d } \\left( \\sigma _ { k } - c _ { 1 } k ^ { - \\gamma } \\right) ^ { 2 } } \\end{array}$ for polynomial decay, where $\\lambda _ { e } , \\lambda _ { p }$ are positive regularization parameters. Although the concept of “spectrum control” was previously used in Jiang et al. (2019) to improve the training of GANs, our spectrum control method is trying to solve a totally different problem, i.e., neural language generation, and its motivation is coming from a very different perspective, i.e., the representation degeneration of the word representations. In addition, our method of controlling the singular value with prior distributions is significantly different from the penalty function used in their method. Finally, our method is essential to improve the performance of the neural language generation, while the penalty function proposed in Jiang et al. (2019) can deteriorate the training of neural language models, as we illustrated in Appendix B. ",
489
+ "bbox": [
490
+ 173,
491
+ 190,
492
+ 825,
493
+ 380
494
+ ],
495
+ "page_idx": 4
496
+ },
497
+ {
498
+ "type": "text",
499
+ "text": "4.3 THEORETICAL ANALYSIS ",
500
+ "text_level": 1,
501
+ "bbox": [
502
+ 176,
503
+ 395,
504
+ 392,
505
+ 409
506
+ ],
507
+ "page_idx": 4
508
+ },
509
+ {
510
+ "type": "text",
511
+ "text": "In this subsection, we show some theoretical insights on why our proposed method can improve the performance of the NLG model. In particular, we follow the similar setup as considered in (Gao et al., 2019b), i.e., focusing on the optimization of the embedding matrix $\\mathbf { W } \\in \\mathbb { R } ^ { N \\times d }$ and assume all the other parameters are fixed and well-optimized. In practice, we use our method to train the models from scratch. Therefore, according to the output layer in (3.2), we consider the following empirical risk minimization problem: given a training dataset $S = \\{ ( \\mathbf { h } _ { i } , y _ { i } ) \\} _ { i = 1 } ^ { n }$ with each example drawn i.i.d. from some unknown but fixed distribution $\\mathcal { D }$ , and $\\mathbf { h } _ { i } \\in \\mathbb { R } ^ { d }$ as a hidden state, $y _ { i } \\in \\{ 1 , \\ldots , N \\}$ as its associated label, our goal is to minimize the training loss as follows: ",
512
+ "bbox": [
513
+ 173,
514
+ 416,
515
+ 825,
516
+ 530
517
+ ],
518
+ "page_idx": 4
519
+ },
520
+ {
521
+ "type": "equation",
522
+ "img_path": "images/3442e36f3f28b864e30cf0cf3253087b15bf093375199df4f44b6ff0c74704d3.jpg",
523
+ "text": "$$\n\\operatorname* { m i n } _ { \\mathbf { W } \\in \\mathbb { R } ^ { N \\times d } } L _ { S } ( \\mathbf { W } ) = \\frac { 1 } { n } \\sum _ { i = 1 } ^ { n } \\ell \\bigl ( \\mathbf { h } _ { i } ^ { \\top } \\mathbf { W } , y _ { i } \\bigr ) ,\n$$",
524
+ "text_format": "latex",
525
+ "bbox": [
526
+ 364,
527
+ 530,
528
+ 632,
529
+ 570
530
+ ],
531
+ "page_idx": 4
532
+ },
533
+ {
534
+ "type": "text",
535
+ "text": "where $\\ell \\big ( \\mathbf { h } _ { i } ^ { \\top } \\mathbf { W } , y _ { i } \\big )$ is the cross-entropy loss with respect to $\\mathbf { h } _ { i } ^ { \\top } \\mathbf { W }$ and $y _ { i }$ . The cross-entropy loss defined above is widely used to train NLG models, and is also used to compute the perplexity of the trained model, which is the benchmark criterion to evaluate the performance of language models. ",
536
+ "bbox": [
537
+ 173,
538
+ 571,
539
+ 823,
540
+ 614
541
+ ],
542
+ "page_idx": 4
543
+ },
544
+ {
545
+ "type": "text",
546
+ "text": "In addition, we define the expected loss as follows $L _ { \\mathcal { D } } ( \\mathbf { W } ) = \\mathbb { E } [ \\ell \\left( \\mathbf { h } ^ { \\top } \\mathbf { W } , y \\right) ]$ , where the expectation is taken over the distribution $\\mathcal { D }$ of the training data. ",
547
+ "bbox": [
548
+ 174,
549
+ 616,
550
+ 823,
551
+ 645
552
+ ],
553
+ "page_idx": 4
554
+ },
555
+ {
556
+ "type": "text",
557
+ "text": "Let $\\begin{array} { r } { \\widehat { \\mathbf { W } } = \\arg \\operatorname* { m i n } _ { \\mathbf { W } \\in \\mathcal { P } ( \\gamma ) } L _ { S } ( \\mathbf { W } ) , } \\end{array}$ , where $\\mathcal { P } ( \\gamma ) = \\mathcal { P } _ { e } ( \\gamma )$ for exponential decay and $\\mathcal { P } ( \\gamma ) = \\mathcal { P } _ { p } ( \\gamma )$ for polynomial decay. We assume the right singular vector matrix satisfies $\\| \\mathbf { V } \\| _ { 1 } ~ \\leq ~ V$ for all $\\mathbf { W } \\in \\mathcal { P } ( \\gamma )$ . Now, we are ready to provide the main theory of our method (The proof can be found in Appendix A). ",
558
+ "bbox": [
559
+ 173,
560
+ 648,
561
+ 825,
562
+ 708
563
+ ],
564
+ "page_idx": 4
565
+ },
566
+ {
567
+ "type": "text",
568
+ "text": "Theorem 4.1. Under previously stated conditions, suppose that $| \\ell ( \\cdot ) | \\leq B$ , $\\ell$ is $G$ -Lipschitz continuous, and $\\| \\mathbf { h } _ { i } \\| _ { \\infty } \\leq H$ for all $i = 1 , \\ldots , n$ . If we choose $\\gamma > 1 / 2$ , then with probability at least $1 - \\delta$ , we have ",
569
+ "bbox": [
570
+ 173,
571
+ 713,
572
+ 825,
573
+ 755
574
+ ],
575
+ "page_idx": 4
576
+ },
577
+ {
578
+ "type": "equation",
579
+ "img_path": "images/b12bfd088c8887660fd5861e0609f7fd6f741c82378e6fd49ecbd903a9ef7f5b.jpg",
580
+ "text": "$$\nL _ { \\mathcal { D } } ( \\widehat { \\mathbf { W } } ) \\leq \\operatorname* { m i n } _ { \\mathbf { W } \\in \\mathcal { P } ( \\gamma ) } L _ { S } ( \\mathbf { W } ) + \\frac { C _ { 1 } A N \\Big ( \\sqrt { \\sum _ { j = 1 } ^ { m - 1 } \\sigma _ { j } ^ { 2 } } + \\sqrt { m ^ { 1 - 2 \\gamma } / ( 2 \\gamma - 1 ) } \\Big ) + C _ { 2 } B \\sqrt { \\log ( 1 / \\delta ) } } { \\sqrt { n } } ,\n$$",
581
+ "text_format": "latex",
582
+ "bbox": [
583
+ 178,
584
+ 755,
585
+ 815,
586
+ 800
587
+ ],
588
+ "page_idx": 4
589
+ },
590
+ {
591
+ "type": "text",
592
+ "text": "where $C _ { 1 } , C _ { 2 }$ are absolute constants, $m \\in [ 2 , d ]$ , $A = G V H { \\sqrt { \\log d } }$ . ",
593
+ "bbox": [
594
+ 173,
595
+ 815,
596
+ 620,
597
+ 832
598
+ ],
599
+ "page_idx": 4
600
+ },
601
+ {
602
+ "type": "text",
603
+ "text": "Remark 4.2. According to Theorem 4.1, the expected loss of the learned embedding matrix $\\widehat { \\bf W }$ consists of two terms. The first term represents the training loss, the second term is the generalization error gap. Specifically, the smaller the $\\gamma$ , the larger the feasible set $\\mathcal { P } ( \\gamma )$ , thus the smaller the training loss $\\mathrm { m i n } _ { \\mathbf { W } \\in \\mathcal { P ( \\gamma ) } } L _ { S } ( \\mathbf { W } )$ . On the other hand, the larger the $\\gamma$ , the faster the singular value decays, and the smaller the generalization error gap. Therefore, our generalization error bound demonstrates an appealing property of our proposed method: by directly controlling the singular value distribution of the learned word embedding, we are able to achieve a trade-off between the training loss and generalization error. ",
604
+ "bbox": [
605
+ 173,
606
+ 839,
607
+ 825,
608
+ 924
609
+ ],
610
+ "page_idx": 4
611
+ },
612
+ {
613
+ "type": "text",
614
+ "text": "",
615
+ "bbox": [
616
+ 173,
617
+ 103,
618
+ 823,
619
+ 132
620
+ ],
621
+ "page_idx": 5
622
+ },
623
+ {
624
+ "type": "text",
625
+ "text": "Remark 4.3. For the generalization error bound in (4.3), penalizing the largest singular value could reduce this upper bound. It validates the method proposed in Gao et al. (2019b), which implicitly penalizes the largest singular value (c.f. Section 5 in Gao et al. (2019b)). Compared with their method, the error term $\\tilde { \\cal O } ( N \\sqrt { m ^ { 1 - 2 \\gamma } / ( 2 \\gamma - 1 ) } / \\sqrt { n } )$ suggests that by explicitly manipulating the singular value distribution, our method has a better control of the tail sum of the singular values. ",
626
+ "bbox": [
627
+ 174,
628
+ 135,
629
+ 825,
630
+ 207
631
+ ],
632
+ "page_idx": 5
633
+ },
634
+ {
635
+ "type": "text",
636
+ "text": "5 EXPERIMENTS ",
637
+ "text_level": 1,
638
+ "bbox": [
639
+ 176,
640
+ 222,
641
+ 326,
642
+ 237
643
+ ],
644
+ "page_idx": 5
645
+ },
646
+ {
647
+ "type": "text",
648
+ "text": "We demonstrate the effectiveness of our proposed spectrum control algorithm on two tasks: language modeling and machine translation. We compare our results with the state-of-the-art models. In our experiments, we try both exponential and polynomial singular value decays, and present the one with the better result. The performances of exponential decay and polynomial decay are very close (See Appendix D). In practice we found that for large scale dataset its better to use polynomial decay and for small scale dataset its better to use exponential decay. We also present the training time and memory cost of our method in Appendix C. ",
649
+ "bbox": [
650
+ 174,
651
+ 247,
652
+ 825,
653
+ 344
654
+ ],
655
+ "page_idx": 5
656
+ },
657
+ {
658
+ "type": "text",
659
+ "text": "5.1 LANGUAGE MODELING ",
660
+ "text_level": 1,
661
+ "bbox": [
662
+ 174,
663
+ 356,
664
+ 379,
665
+ 369
666
+ ],
667
+ "page_idx": 5
668
+ },
669
+ {
670
+ "type": "text",
671
+ "text": "Datasets We consider two benchmark datasets for language modeling: WikiText-2 and WikiText103, which consist of pre-processed Wikipedia articles and were introduced by Merity et al. (2018a). WikiText-2 is a small dataset with around 2 million words and 30K vocabulary size, while WikiText103 is a significantly large dataset with around 103 million words and 260K vocabulary size. ",
672
+ "bbox": [
673
+ 174,
674
+ 376,
675
+ 823,
676
+ 431
677
+ ],
678
+ "page_idx": 5
679
+ },
680
+ {
681
+ "type": "text",
682
+ "text": "Model Configuration On the small WikiText-2 dataset, we implement our method based on the state-of-the-art AWD-LSTM model (Merity et al., 2018a). It is a 3-layer LSTM model with 1150 dimensional hidden states and 400 dimensional embeddings. We also follow the same regularization and optimization procedures introduced in (Merity et al., 2018a). The implementation of our method is based on the open-source code3 for AWD-LSTM. On the large WikiText-103 dataset, we implement our method based on the state-of-the-art Transformer-XL based models (Dai et al., 2019). We follow the same settings reported in (Dai et al., 2019), and our implementation is based on the official code4 for Transformer-XL. To evaluate the performance of our method more thoroughly, we consider two Transformer-XL models with different number of layers. The first is the standard Transformer-XL model with 16 layers used in (Dai et al., 2019). For the second, we consider a smaller Transformer-XL model with just 4 layers and other configurations unchanged. ",
683
+ "bbox": [
684
+ 174,
685
+ 441,
686
+ 825,
687
+ 594
688
+ ],
689
+ "page_idx": 5
690
+ },
691
+ {
692
+ "type": "text",
693
+ "text": "Parameters For the parameters $\\{ \\lambda _ { i } \\} _ { i = 1 } ^ { 4 }$ of the orthogonal regularizations, we tune them by grid search over $\\{ 0 . 0 1 , 0 . 1 , 1 , 1 0 \\}$ . For the parameters $\\lambda _ { e } , \\lambda _ { p }$ of the spectrum control, we tune them over the grid $\\{ 0 . 1 , 1 , 1 0 , 1 0 0 \\}$ . We try different singular value distributions, and the best distributions for AWD-LSTM and Transformer-XL are exponential and polynomial, respectively. ",
694
+ "bbox": [
695
+ 174,
696
+ 603,
697
+ 823,
698
+ 660
699
+ ],
700
+ "page_idx": 5
701
+ },
702
+ {
703
+ "type": "text",
704
+ "text": "Results of the LSTM Model on WikiText-2 We first present the results of language modeling on the small dataset WikiText-2 using LSTM models. In Table 1 we compare the validation/test perplexity5 of the baseline AWD-LSTM model (Merity et al., 2018a), the cosine similarity regularization (MLE-CosReg) model (Gao et al., 2019b), and the models trained using our method under three different settings (Merity et al., 2018a): without finetune, with finetune and with further continuous cache pointer. Compared with the baselines, our method achieves $2 . 3 / 2 . 9 / 2 . 3$ test perplexity reduction under all three settings; compared with the MLE-CosReg method, our method achieves $1 . 5 / 1 . 2 / 0 . 3$ test perplexity reduction under all three settings. ",
705
+ "bbox": [
706
+ 174,
707
+ 669,
708
+ 825,
709
+ 781
710
+ ],
711
+ "page_idx": 5
712
+ },
713
+ {
714
+ "type": "text",
715
+ "text": "Results of the Transformer-XL Model on WikiText-103 We next show the results of language modeling on the large dataset WikiText-103 using Transformer-XL models. Table 2 compares the validation/test perplexity of Transformer-XL based models (Dai et al., 2019) and the models trained by our method on WikiText-103 dataset. The results demonstrate that our method consistently improves upon the small Transformer-XL model (0.9 test perplexity reduction) and the standard Transformer-XL model (0.8 test perplexity reduction). ",
716
+ "bbox": [
717
+ 174,
718
+ 790,
719
+ 825,
720
+ 875
721
+ ],
722
+ "page_idx": 5
723
+ },
724
+ {
725
+ "type": "table",
726
+ "img_path": "images/818ba594f7939d8d5308c5362bf06e8a23162b8245729d8b70870c3353d6a161.jpg",
727
+ "table_caption": [
728
+ "Table 1: Comparison of different methods in terms of perplexity on WikiText-2 dataset for the task of language modeling. "
729
+ ],
730
+ "table_footnote": [],
731
+ "table_body": "<table><tr><td>Method</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td colspan=\"4\">Existing results</td></tr><tr><td>Variational LSTM (Inan et al., 2017)</td><td>51M</td><td>91.5</td><td>87.0</td></tr><tr><td>2-layer skip connection LSTM (Mandt et al.,2017)</td><td>24M</td><td>69.1</td><td>65.9</td></tr><tr><td colspan=\"4\">w/o finetune</td></tr><tr><td>AWD-LSTM(Merity et al.,2018a)</td><td>33M</td><td>69.1</td><td>66.0</td></tr><tr><td>MLE-CosReg (Gao et al.,2019b)</td><td>33M</td><td>68.2</td><td>65.2</td></tr><tr><td>Ours</td><td>33M</td><td>66.3</td><td>63.7</td></tr><tr><td colspan=\"4\">+ finetune</td></tr><tr><td>AWD-LSTM (Merity et al.,2018a)</td><td>33M</td><td>68.6</td><td>65.8</td></tr><tr><td>MLE-CosReg (Gao et al.,2019b)</td><td>33M</td><td>67.1</td><td>64.1</td></tr><tr><td>Ours</td><td>33M</td><td>65.3</td><td>62.9</td></tr><tr><td colspan=\"4\">+ continuous cache pointer</td></tr><tr><td>AWD-LSTM (Merity et al., 2018a)</td><td>33M</td><td>53.8</td><td>52.0</td></tr><tr><td>MLE-CosReg (Gao et al.,2019b)</td><td>33M</td><td>51.7</td><td>50.0</td></tr><tr><td>Ours</td><td>33M</td><td>51.1</td><td>49.7</td></tr></table>",
732
+ "bbox": [
733
+ 223,
734
+ 135,
735
+ 771,
736
+ 364
737
+ ],
738
+ "page_idx": 6
739
+ },
740
+ {
741
+ "type": "table",
742
+ "img_path": "images/955d119f00836df30d9b28143e53c2e03ec589da0b1dfd74b0c2ca37ab72536e.jpg",
743
+ "table_caption": [
744
+ "Table 2: Comparison of different methods in terms of perplexity on WikiText-103 dataset for the task of language modeling. "
745
+ ],
746
+ "table_footnote": [],
747
+ "table_body": "<table><tr><td>Method</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td colspan=\"4\">Existing results</td></tr><tr><td>4 layer QRNN (Merity et al.,2018b) Hebbian + Cache (Rae et al.,2018)</td><td>151M 1</td><td>32.0 29.7</td><td>33.0 29.9</td></tr><tr><td>Small Transformer-XL (Dai et al., 2019) Ours</td><td>120M 120M</td><td>29.6 29.0</td><td>30.4 29.5</td></tr><tr><td>Standard Transformer-XL (Dai et al.,2019) Ours</td><td>151M 151M</td><td>23.1 22.9</td><td>24.0 23.2</td></tr></table>",
748
+ "bbox": [
749
+ 246,
750
+ 419,
751
+ 748,
752
+ 540
753
+ ],
754
+ "page_idx": 6
755
+ },
756
+ {
757
+ "type": "text",
758
+ "text": "Analysis We study the output embedding matrix of Transformer-XL trained on WikiText-103 using our method. In particular, we want to evaluate the isotropy of the learned word representations. We consider the partition function $\\begin{array} { r } { Z ( \\mathbf { a } ) \\ = \\ \\sum _ { i = 1 } ^ { N } \\exp ( \\left. \\mathbf { w } _ { i } , \\mathbf { a } \\right. ) } \\end{array}$ introduced in (Arora et al., 2016b), where $\\mathbf { w } _ { i }$ is the $i$ -th row of the embedding matrix $\\mathbf { W } \\in \\mathbb { R } ^ { N \\times d }$ and $\\mathbf { a } ~ \\in ~ S ^ { d - 1 }$ is a unit vector. According to Lemma 2.1 in (Arora et al., 2016b), if the word representation vectors are isotropic, $Z ( \\mathbf { a } )$ is close to some constant with high probability for all unit vectors. Thus to empirically measure the isotropy of the learned word representations, we consider two criteria based on $Z ( \\mathbf { a } )$ : ",
759
+ "bbox": [
760
+ 173,
761
+ 571,
762
+ 826,
763
+ 676
764
+ ],
765
+ "page_idx": 6
766
+ },
767
+ {
768
+ "type": "equation",
769
+ "img_path": "images/06bd752e093e106be155cc54a881d687d0dfcea1ba9bf4fb6b5a42ec26bbb430.jpg",
770
+ "text": "$$\nI _ { 1 } ( \\mathbf { W } ) = \\frac { \\operatorname* { m i n } _ { \\mathbf { a } \\in \\mathcal { E } } Z ( \\mathbf { a } ) } { \\operatorname* { m a x } _ { \\mathbf { a } \\in \\mathcal { E } } Z ( \\mathbf { a } ) } \\quad \\mathrm { a n d } \\quad I _ { 2 } ( \\mathbf { W } ) = \\sqrt { \\frac { \\sum _ { \\mathbf { a } \\in \\mathcal { E } } ( Z ( \\mathbf { a } ) - \\bar { Z } ( \\mathbf { a } ) ) ^ { 2 } } { | \\mathcal { E } | \\bar { Z } ( \\mathbf { a } ) ^ { 2 } } } ,\n$$",
771
+ "text_format": "latex",
772
+ "bbox": [
773
+ 264,
774
+ 676,
775
+ 732,
776
+ 718
777
+ ],
778
+ "page_idx": 6
779
+ },
780
+ {
781
+ "type": "text",
782
+ "text": "where $\\mathcal { E }$ is the set of eigenvectors of $\\mathbf { W } ^ { \\top } \\mathbf { W }$ , as suggested by Mu & Viswanath (2018). We also propose to check sampled standard deviation measure $I _ { 2 } ( \\mathbf { W } )$ (normalized by its average, i.e., $\\bar { Z } ( \\mathbf { a } ) \\mathrm { . }$ ). We have $I _ { 1 } ( \\mathbf { W } ) \\in [ 0 , 1 ]$ and $I _ { 2 } ( \\mathbf { W } ) \\geq 0$ . Larger $I _ { 1 } ( \\mathbf { W } )$ and smaller $I _ { 2 } ( \\mathbf { W } )$ indicate more isotropic for word embeddings. We uniformly sample 40K words from the vocabulary (around 260K) of WikiText-103 to compute these two criteria. The left half of Table 3 summarizes the values of $I _ { 1 } ( \\mathbf { W } )$ and $I _ { 2 } ( \\mathbf { W } )$ , which are averaged over 10 runs, for the baseline method and our method. We can see from the results that our method significantly improves the isotropy of the learned word representations in terms of both criteria. ",
783
+ "bbox": [
784
+ 174,
785
+ 719,
786
+ 825,
787
+ 832
788
+ ],
789
+ "page_idx": 6
790
+ },
791
+ {
792
+ "type": "text",
793
+ "text": "5.2 MACHINE TRANSLATION ",
794
+ "text_level": 1,
795
+ "bbox": [
796
+ 174,
797
+ 845,
798
+ 388,
799
+ 861
800
+ ],
801
+ "page_idx": 6
802
+ },
803
+ {
804
+ "type": "text",
805
+ "text": "We also apply our spectrum control method to machine translation tasks. Given a source sentence s, the decoder of an neural machine translation (NMT) model is to predict the next word in the target sentence t and the previous decoded words in t. In the following we use the state-of-the-art Transformer-based NMT model as our baseline. ",
806
+ "bbox": [
807
+ 174,
808
+ 867,
809
+ 823,
810
+ 924
811
+ ],
812
+ "page_idx": 6
813
+ },
814
+ {
815
+ "type": "table",
816
+ "img_path": "images/b234361fbdfef7ccb914fb7e425018512f49012e7178f4eac16b337b5d33c220.jpg",
817
+ "table_caption": [
818
+ "Table 3: Comparison of different methods in terms of isotropy for the tasks of language modeling and machine translation. (For perfect isotropy, $I _ { 1 } ( { \\bf W } ) = 1 , \\bar { I _ { 2 } } ( { \\bf W } ) = 0 .$ ) "
819
+ ],
820
+ "table_footnote": [],
821
+ "table_body": "<table><tr><td colspan=\"3\">Language Modeling</td><td colspan=\"3\">Machine Translation</td></tr><tr><td>Method</td><td>1(W)</td><td>12(W)</td><td>Method</td><td>I1(W)</td><td>12(W)</td></tr><tr><td>Standard Transformer-XL</td><td>0.24</td><td>0.037</td><td>Transformer-Base</td><td>0.31</td><td>0.031</td></tr><tr><td>Ours</td><td>0.63</td><td>0.022</td><td>Ours</td><td>0.88</td><td>0.005</td></tr></table>",
822
+ "bbox": [
823
+ 222,
824
+ 135,
825
+ 776,
826
+ 200
827
+ ],
828
+ "page_idx": 7
829
+ },
830
+ {
831
+ "type": "table",
832
+ "img_path": "images/b73e0c68ea5d41239e28b071a233c526901b40f898517e0c4f4b92ad9d5871bf.jpg",
833
+ "table_caption": [
834
+ "Table 4: Comparison of different methods in terms of BLEU scores on the task of $\\mathrm { D e } { } \\mathrm { E n }$ machine translation, trained on IWSLT 2014 dataset. "
835
+ ],
836
+ "table_footnote": [],
837
+ "table_body": "<table><tr><td rowspan=\"2\">IWSLT2014De-→En</td><td colspan=\"4\">Method</td></tr><tr><td>Adversarial (Wang et al., 2019a)</td><td>Dual-learning (Wang et al., 2019b)</td><td>Transformer-Base (Wang et al., 2019b)</td><td>Ours</td></tr><tr><td>BLEU 1</td><td>35.18</td><td>35.44</td><td>34.01</td><td>35.50</td></tr></table>",
838
+ "bbox": [
839
+ 186,
840
+ 256,
841
+ 810,
842
+ 319
843
+ ],
844
+ "page_idx": 7
845
+ },
846
+ {
847
+ "type": "text",
848
+ "text": "Datasets We compare various NMT models on the IWSLT 2014 German English (De-En) and WMT 14 English German $\\left( E n – D e \\right)$ datasets. For IWSLT 2014 De-En, we follow the same setup as in (Gehring et al., 2017). More specifically, we have 160K sentence pairs as the training data, 7K sentence pairs as the validation data, and we combine tst2010, tst2011, tst2012, dev2010 and dev2012 datasets to form our test data. For the large scale WMT 14 En-De, we have 4.5 million sentence pairs as our training data, and we use newstest2014 as our test data dataset (Cettolo et al., 2014). ",
849
+ "bbox": [
850
+ 173,
851
+ 353,
852
+ 825,
853
+ 450
854
+ ],
855
+ "page_idx": 7
856
+ },
857
+ {
858
+ "type": "text",
859
+ "text": "Model Configuration We implement our method on top of Transformer model (Vaswani et al., 2017). In particular, we consider the Transformer-Base architecture (Vaswani et al., 2017) for IWSLT 2014 De-En, which has a 6-layer encoder and 6-layer decoder with 512 dimensional hidden states and embeddings, except that we choose the dimension of the inner feed-forward layer as 1024 instead of 2048 and the number of attention heads is set to be 4 rather than 8. For WMT 14 En-De, we consider the original Transformer-Base and Transformer-Big architectures (Vaswani et al., 2017), which have a 6-layer encoder and 6-layer decoder with 512 and 1024 dimensional embeddings, respectively. Our implementation is based on the open-sourced code6 provided by Ott et al. (2018). We follow the same procedures as in the language modeling task to choose the regularization parameters. The best results for this task on IWSLT 2014 De-En are from the models where the singular values are controlled by exponential distribution, and the best results for this task on WMT 14 En-De are from the models where the singular values are controlled by polynomial distribution. ",
860
+ "bbox": [
861
+ 174,
862
+ 464,
863
+ 825,
864
+ 631
865
+ ],
866
+ "page_idx": 7
867
+ },
868
+ {
869
+ "type": "text",
870
+ "text": "Results Comparisons of different methods in terms of BLEU scores for IWSLT 2014 De-En are summarized in Table 4. Compared with the baseline models, our method improves the BLEU score7 from 34.01 to 35.50 on the German English task, close to 1.5 gain on BLEU score; our method is also better than 35.18 reported in (Wang et al., 2019a), and 35.44 reported in (Wang et al., 2019b). Table 5 summarizes different methods in terms of BLEU scores for WMT 14 En-De. The results show that our method achieves 1.15 and 0.92 BLEU score improvements on this task for base and big models, respectively. In addition, our method is also better than 28.38 and 28.94 reported in Gao et al. (2019b) for base and big models. ",
871
+ "bbox": [
872
+ 174,
873
+ 645,
874
+ 825,
875
+ 756
876
+ ],
877
+ "page_idx": 7
878
+ },
879
+ {
880
+ "type": "text",
881
+ "text": "Analysis We also study the learned word embedding matrix of the Transformer trained on IWSLT 2014 De-En using our method in terms of isotropy. The values of $I _ { 1 } ( \\mathbf { W } )$ and $I _ { 2 } ( \\mathbf { W } )$ are reported in the right half of Table 3, we compute these two values based on all the tokens. It shows that the isotropy of the learned word representations using our method increases significantly in terms of these criteria, from very anisotropic to nearly isotropic. We also demonstrate the projected word embedding matrices and the singular value distributions of different methods in Figure 3. The plots show that the learned word representations from our method are distributed isotropically in the space, which is in contrast to the narrow cone distribution from the baseline method. ",
882
+ "bbox": [
883
+ 174,
884
+ 768,
885
+ 825,
886
+ 881
887
+ ],
888
+ "page_idx": 7
889
+ },
890
+ {
891
+ "type": "table",
892
+ "img_path": "images/2a563a8152942ea324187d1f8aea69bf74df1de3ef1da0043973cc8b1739b617.jpg",
893
+ "table_caption": [
894
+ "Table 5: Comparison of different methods in terms of BLEU scores on the task of $\\mathrm { E n \\to }$ De machine translation, trained on WMT 2014 dataset. "
895
+ ],
896
+ "table_footnote": [],
897
+ "table_body": "<table><tr><td>Method</td><td>BLEU</td></tr><tr><td>Transformer-Base(Vaswani etal.,2017)</td><td>27.30</td></tr><tr><td>Transformer-Base (Gao et al.,2019b) Transformer-Base+ Ours</td><td>28.38</td></tr><tr><td></td><td>28.45</td></tr><tr><td>Transformer-Big (Vaswani et al., 2017)</td><td>28.40</td></tr><tr><td>Transformer-Big (Gao et al.,2019b) Transformer-Big+Ours</td><td>28.94 29.32</td></tr></table>",
898
+ "bbox": [
899
+ 338,
900
+ 135,
901
+ 658,
902
+ 232
903
+ ],
904
+ "page_idx": 8
905
+ },
906
+ {
907
+ "type": "image",
908
+ "img_path": "images/e6ae23229cfc65fcf3c141c428a455df1cc1fe054c94ed273dd69d5d665c9fe0.jpg",
909
+ "image_caption": [
910
+ "Figure 3: (a) Word embedding for the vanilla Transformer, which has a narrow cone distribution; (b) Word embedding for Transformer using spectrum control, which has a uniform distribution; (c) Normalized singular value for different methods, which shows a slow decay of our method. "
911
+ ],
912
+ "image_footnote": [],
913
+ "bbox": [
914
+ 184,
915
+ 255,
916
+ 818,
917
+ 377
918
+ ],
919
+ "page_idx": 8
920
+ },
921
+ {
922
+ "type": "text",
923
+ "text": "6 CONCLUSIONS AND FUTURE WORK ",
924
+ "text_level": 1,
925
+ "bbox": [
926
+ 174,
927
+ 446,
928
+ 503,
929
+ 463
930
+ ],
931
+ "page_idx": 8
932
+ },
933
+ {
934
+ "type": "text",
935
+ "text": "In this paper, we tackle the degeneration problem that occurs at the output embeddings in the softmax layer used in neural language generation models. We develop a novel spectrum control method to explicitly guide the spectra training of the output embedding matrix with some slow-decaying singular value prior distributions. Our proposed method is shown to alleviate the degeneration problem and improve isotropy of the learned contextualized word representations. Thorough experimental results demonstrate the advantage of our method over the state-of-the-art neural models for language model and machine translation. Since our work is orthogonal to Wang et al. (2019a), it would be interesting to combine the adversarial softmax training with our spectrum control method, and investigate its performance. For the future work, we would also like to investigate how the frequency-agnostic word representations in (Gong et al., 2018) relate to the single value distribution of the output embedding matrix. ",
936
+ "bbox": [
937
+ 173,
938
+ 472,
939
+ 825,
940
+ 626
941
+ ],
942
+ "page_idx": 8
943
+ },
944
+ {
945
+ "type": "text",
946
+ "text": "REFERENCES ",
947
+ "text_level": 1,
948
+ "bbox": [
949
+ 176,
950
+ 641,
951
+ 285,
952
+ 656
953
+ ],
954
+ "page_idx": 8
955
+ },
956
+ {
957
+ "type": "text",
958
+ "text": "Zeyuan Allen-Zhu, Yuanzhi Li, and Yingyu Liang. Learning and generalization in overparameterized neural networks, going beyond two layers. NeurIPS, 2019. \nSanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. A latent variable model approach to pmi-based word embeddings. TACL, 4:385–399, 2016a. \nSanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. A latent variable model approach to pmi-based word embeddings. TACL, 4:385–399, 2016b. \nSanjeev Arora, Yingyu Liang, and Tengyu Ma. A simple but tough-to-beat baseline for sentence embeddings. 2016c. \nDzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICML, 2015. \nPeter L Bartlett and Shahar Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. JMLR, 2002. \nSamuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. In Proceedings of the Twentieth Conference on Computational Natural Language Learning, 2016. ",
959
+ "bbox": [
960
+ 171,
961
+ 662,
962
+ 826,
963
+ 925
964
+ ],
965
+ "page_idx": 8
966
+ },
967
+ {
968
+ "type": "text",
969
+ "text": "Mauro Cettolo, Jan Niehues, Sebastian Stuker, Luisa Bentivogli, and Marcello Federico. Report on ¨ the 11th iwslt evaluation campaign, iwslt 2014. In SLT, 2014. ",
970
+ "bbox": [
971
+ 169,
972
+ 103,
973
+ 823,
974
+ 132
975
+ ],
976
+ "page_idx": 9
977
+ },
978
+ {
979
+ "type": "text",
980
+ "text": "Patrick Chen, Si Si, Yang Li, Ciprian Chelba, and Cho-Jui Hsieh. Groupreduce: Block-wise lowrank approximation for neural language model shrinking. In Advances in Neural Information Processing Systems, pp. 10988–10998, 2018. ",
981
+ "bbox": [
982
+ 176,
983
+ 141,
984
+ 823,
985
+ 184
986
+ ],
987
+ "page_idx": 9
988
+ },
989
+ {
990
+ "type": "text",
991
+ "text": "Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. ACL, 2019. ",
992
+ "bbox": [
993
+ 174,
994
+ 193,
995
+ 823,
996
+ 236
997
+ ],
998
+ "page_idx": 9
999
+ },
1000
+ {
1001
+ "type": "text",
1002
+ "text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019. ",
1003
+ "bbox": [
1004
+ 171,
1005
+ 244,
1006
+ 821,
1007
+ 275
1008
+ ],
1009
+ "page_idx": 9
1010
+ },
1011
+ {
1012
+ "type": "text",
1013
+ "text": "Kawin Ethayarajh. How contextual are contextualized word representations? comparing the geometry of bert, elmo, and gpt-2 embeddings. EMNLP, 2019. ",
1014
+ "bbox": [
1015
+ 174,
1016
+ 284,
1017
+ 821,
1018
+ 314
1019
+ ],
1020
+ "page_idx": 9
1021
+ },
1022
+ {
1023
+ "type": "text",
1024
+ "text": "Octavian-Eugen Ganea, Sylvain Gelly, Gary Becigneul, and Aliaksei Severyn. Breaking the softmax ´ bottleneck via learnable monotonic pointwise non-linearities. ICML, 2019. ",
1025
+ "bbox": [
1026
+ 174,
1027
+ 321,
1028
+ 823,
1029
+ 352
1030
+ ],
1031
+ "page_idx": 9
1032
+ },
1033
+ {
1034
+ "type": "text",
1035
+ "text": "Jianfeng Gao, Michel Galley, Lihong Li, et al. Neural approaches to conversational ai. Foundations and Trends $\\textsuperscript { \\textregistered }$ in Information Retrieval, 13(2-3):127–298, 2019a. ",
1036
+ "bbox": [
1037
+ 173,
1038
+ 359,
1039
+ 823,
1040
+ 390
1041
+ ],
1042
+ "page_idx": 9
1043
+ },
1044
+ {
1045
+ "type": "text",
1046
+ "text": "Jun Gao, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tieyan Liu. Representation degeneration problem in training natural language generation models. In ICLR, 2019b. ",
1047
+ "bbox": [
1048
+ 173,
1049
+ 397,
1050
+ 823,
1051
+ 428
1052
+ ],
1053
+ "page_idx": 9
1054
+ },
1055
+ {
1056
+ "type": "text",
1057
+ "text": "Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional sequence to sequence learning. In ICML, pp. 1243–1252, 2017. ",
1058
+ "bbox": [
1059
+ 173,
1060
+ 435,
1061
+ 823,
1062
+ 467
1063
+ ],
1064
+ "page_idx": 9
1065
+ },
1066
+ {
1067
+ "type": "text",
1068
+ "text": "Chengyue Gong, Di He, Xu Tan, Tao Qin, Liwei Wang, and Tie-Yan Liu. Frage: frequency-agnostic word representation. In NIPS, 2018. ",
1069
+ "bbox": [
1070
+ 173,
1071
+ 474,
1072
+ 823,
1073
+ 503
1074
+ ],
1075
+ "page_idx": 9
1076
+ },
1077
+ {
1078
+ "type": "text",
1079
+ "text": "A. Graves, A. Mohamed, and G. Hinton. Speech recognition with deep recurrent neural networks. In ICASSP, 2013. ",
1080
+ "bbox": [
1081
+ 173,
1082
+ 512,
1083
+ 823,
1084
+ 542
1085
+ ],
1086
+ "page_idx": 9
1087
+ },
1088
+ {
1089
+ "type": "text",
1090
+ "text": "Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997. ",
1091
+ "bbox": [
1092
+ 171,
1093
+ 551,
1094
+ 823,
1095
+ 580
1096
+ ],
1097
+ "page_idx": 9
1098
+ },
1099
+ {
1100
+ "type": "text",
1101
+ "text": "Hakan Inan, Khashayar Khosravi, and Richard Socher. Tying word vectors and word classifiers: A loss framework for language modeling. In ICLR, 2017. ",
1102
+ "bbox": [
1103
+ 171,
1104
+ 589,
1105
+ 825,
1106
+ 619
1107
+ ],
1108
+ "page_idx": 9
1109
+ },
1110
+ {
1111
+ "type": "text",
1112
+ "text": "Haoming Jiang, Zhehui Chen, Minshuo Chen, Feng Liu, Dingding Wang, and Tuo Zhao. On computation and generalization of generative adversarial networks under spectrum control. In ICLR, 2019. ",
1113
+ "bbox": [
1114
+ 176,
1115
+ 627,
1116
+ 823,
1117
+ 670
1118
+ ],
1119
+ "page_idx": 9
1120
+ },
1121
+ {
1122
+ "type": "text",
1123
+ "text": "Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016. ",
1124
+ "bbox": [
1125
+ 171,
1126
+ 679,
1127
+ 825,
1128
+ 709
1129
+ ],
1130
+ "page_idx": 9
1131
+ },
1132
+ {
1133
+ "type": "text",
1134
+ "text": "Sekitoshi Kanai, Yasuhiro Fujiwara, Yuki Yamanaka, and Shuichi Adachi. Sigsoftmax: Reanalysis of the softmax bottleneck. In NIPS, 2018. ",
1135
+ "bbox": [
1136
+ 173,
1137
+ 717,
1138
+ 825,
1139
+ 747
1140
+ ],
1141
+ "page_idx": 9
1142
+ },
1143
+ {
1144
+ "type": "text",
1145
+ "text": "Nitish Shirish Keskar, Bryan McCann, Lav R. Varshney, Caiming Xiong, and Richard Socher. Ctrl: A conditional transformer language model for controllable generation. arXiv:1909.05858, 2019. ",
1146
+ "bbox": [
1147
+ 176,
1148
+ 756,
1149
+ 823,
1150
+ 786
1151
+ ],
1152
+ "page_idx": 9
1153
+ },
1154
+ {
1155
+ "type": "text",
1156
+ "text": "Percy Liang. Cs229t/stat231: Statistical learning theory (winter 2016), 2014. ",
1157
+ "bbox": [
1158
+ 174,
1159
+ 794,
1160
+ 679,
1161
+ 810
1162
+ ],
1163
+ "page_idx": 9
1164
+ },
1165
+ {
1166
+ "type": "text",
1167
+ "text": "Stephan Mandt, Matthew D Hoffman, and David M Blei. Stochastic gradient descent as approximate bayesian inference. JMLR, 2017. ",
1168
+ "bbox": [
1169
+ 169,
1170
+ 818,
1171
+ 823,
1172
+ 848
1173
+ ],
1174
+ "page_idx": 9
1175
+ },
1176
+ {
1177
+ "type": "text",
1178
+ "text": "Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing LSTM language models. In ICLR, 2018a. ",
1179
+ "bbox": [
1180
+ 173,
1181
+ 856,
1182
+ 823,
1183
+ 886
1184
+ ],
1185
+ "page_idx": 9
1186
+ },
1187
+ {
1188
+ "type": "text",
1189
+ "text": "Stephen Merity, Nitish Shirish Keskar, and Richard Socher. An analysis of neural language modeling at multiple scales. arXiv preprint arXiv:1803.08240, 2018b. ",
1190
+ "bbox": [
1191
+ 173,
1192
+ 895,
1193
+ 820,
1194
+ 924
1195
+ ],
1196
+ "page_idx": 9
1197
+ },
1198
+ {
1199
+ "type": "text",
1200
+ "text": "Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. ",
1201
+ "bbox": [
1202
+ 171,
1203
+ 103,
1204
+ 823,
1205
+ 133
1206
+ ],
1207
+ "page_idx": 10
1208
+ },
1209
+ {
1210
+ "type": "text",
1211
+ "text": "Jiaqi Mu and Pramod Viswanath. All-but-the-top: Simple and effective postprocessing for word representations. In ICLR, 2018. ",
1212
+ "bbox": [
1213
+ 173,
1214
+ 140,
1215
+ 823,
1216
+ 170
1217
+ ],
1218
+ "page_idx": 10
1219
+ },
1220
+ {
1221
+ "type": "text",
1222
+ "text": "Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. In Proceedings of the Third Conference on Machine Translation, 2018. ",
1223
+ "bbox": [
1224
+ 173,
1225
+ 178,
1226
+ 821,
1227
+ 208
1228
+ ],
1229
+ "page_idx": 10
1230
+ },
1231
+ {
1232
+ "type": "text",
1233
+ "text": "Aldo Pacchiano, Niladri S Chatterji, and Peter L Bartlett. Online learning with kernel losses. ICML, 2019. ",
1234
+ "bbox": [
1235
+ 173,
1236
+ 215,
1237
+ 823,
1238
+ 246
1239
+ ],
1240
+ "page_idx": 10
1241
+ },
1242
+ {
1243
+ "type": "text",
1244
+ "text": "Nikolaos Pappas and James Henderson. Deep residual output layers for neural language generation. In ICML, 2019. ",
1245
+ "bbox": [
1246
+ 174,
1247
+ 253,
1248
+ 823,
1249
+ 284
1250
+ ],
1251
+ "page_idx": 10
1252
+ },
1253
+ {
1254
+ "type": "text",
1255
+ "text": "Jeffrey Pennington, Richard Socher, and Christopher Manning. Glove: Global vectors for word representation. In EMNLP, 2014. ",
1256
+ "bbox": [
1257
+ 173,
1258
+ 291,
1259
+ 823,
1260
+ 321
1261
+ ],
1262
+ "page_idx": 10
1263
+ },
1264
+ {
1265
+ "type": "text",
1266
+ "text": "Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In NAACL, 2018. ",
1267
+ "bbox": [
1268
+ 173,
1269
+ 329,
1270
+ 823,
1271
+ 359
1272
+ ],
1273
+ "page_idx": 10
1274
+ },
1275
+ {
1276
+ "type": "text",
1277
+ "text": "Ofir Press and Lior Wolf. Using the output embedding to improve language models. In EACL, 2017. ",
1278
+ "bbox": [
1279
+ 173,
1280
+ 367,
1281
+ 823,
1282
+ 383
1283
+ ],
1284
+ "page_idx": 10
1285
+ },
1286
+ {
1287
+ "type": "text",
1288
+ "text": "Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019. ",
1289
+ "bbox": [
1290
+ 173,
1291
+ 391,
1292
+ 823,
1293
+ 421
1294
+ ],
1295
+ "page_idx": 10
1296
+ },
1297
+ {
1298
+ "type": "text",
1299
+ "text": "Jack Rae, Chris Dyer, Peter Dayan, and Timothy Lillicrap. Fast parametric learning with activation memorization. In ICML, 2018. ",
1300
+ "bbox": [
1301
+ 173,
1302
+ 429,
1303
+ 823,
1304
+ 458
1305
+ ],
1306
+ "page_idx": 10
1307
+ },
1308
+ {
1309
+ "type": "text",
1310
+ "text": "Jianheng Tang, Tiancheng Zhao, Chenyan Xiong, Xiaodan Liang, Eric P. Xing, and Zhiting Hu. Target-guided open-domain conversation. In ACL, 2019. ",
1311
+ "bbox": [
1312
+ 173,
1313
+ 465,
1314
+ 823,
1315
+ 496
1316
+ ],
1317
+ "page_idx": 10
1318
+ },
1319
+ {
1320
+ "type": "text",
1321
+ "text": "Shubham Toshniwal, Anjuli Kannan, Chung-Cheng Chiu, Yonghui Wu, Tara Sainath, and Karen Livescu. A comparison of techniques for language model integration in encoder-decoder speech recognition. In IEEE Workshop on Spoken Language Technology, 2018. ",
1322
+ "bbox": [
1323
+ 176,
1324
+ 503,
1325
+ 823,
1326
+ 547
1327
+ ],
1328
+ "page_idx": 10
1329
+ },
1330
+ {
1331
+ "type": "text",
1332
+ "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017. ",
1333
+ "bbox": [
1334
+ 173,
1335
+ 555,
1336
+ 821,
1337
+ 585
1338
+ ],
1339
+ "page_idx": 10
1340
+ },
1341
+ {
1342
+ "type": "text",
1343
+ "text": "Dilin Wang, Chengyue Gong, and Qiang Liu. Improving neural language modeling via adversarial training. In ICML, 2019a. ",
1344
+ "bbox": [
1345
+ 174,
1346
+ 593,
1347
+ 821,
1348
+ 623
1349
+ ],
1350
+ "page_idx": 10
1351
+ },
1352
+ {
1353
+ "type": "text",
1354
+ "text": "Yiren Wang, Yingce Xia, Tianyu He, Fei Tian, Tao Qin, ChengXiang Zhai, and Tie-Yan Liu. Multiagent dual learning. In ICLR, 2019b. ",
1355
+ "bbox": [
1356
+ 173,
1357
+ 631,
1358
+ 821,
1359
+ 661
1360
+ ],
1361
+ "page_idx": 10
1362
+ },
1363
+ {
1364
+ "type": "text",
1365
+ "text": "Yuting Wei, Fanny Yang, and Martin J Wainwright. Early stopping for kernel boosting algorithms: A general analysis with localized complexities. In NIPS, 2017. ",
1366
+ "bbox": [
1367
+ 176,
1368
+ 669,
1369
+ 821,
1370
+ 699
1371
+ ],
1372
+ "page_idx": 10
1373
+ },
1374
+ {
1375
+ "type": "text",
1376
+ "text": "Zhilin Yang, Zihang Dai, Ruslan Salakhutdinov, and William W. Cohen. Breaking the softmax bottleneck: A high-rank RNN language model. In ICLR, 2018. ",
1377
+ "bbox": [
1378
+ 176,
1379
+ 707,
1380
+ 821,
1381
+ 737
1382
+ ],
1383
+ "page_idx": 10
1384
+ },
1385
+ {
1386
+ "type": "text",
1387
+ "text": "Jiong Zhang, Qi Lei, and Inderjit Dhillon. Stabilizing gradients for deep neural networks via efficient svd parameterization. In International Conference on Machine Learning, pp. 5801–5809, 2018. ",
1388
+ "bbox": [
1389
+ 174,
1390
+ 744,
1391
+ 821,
1392
+ 775
1393
+ ],
1394
+ "page_idx": 10
1395
+ },
1396
+ {
1397
+ "type": "text",
1398
+ "text": "APPENDIX ",
1399
+ "text_level": 1,
1400
+ "bbox": [
1401
+ 176,
1402
+ 102,
1403
+ 272,
1404
+ 118
1405
+ ],
1406
+ "page_idx": 11
1407
+ },
1408
+ {
1409
+ "type": "text",
1410
+ "text": "A PROOF OF THEOREM 4.1 ",
1411
+ "text_level": 1,
1412
+ "bbox": [
1413
+ 176,
1414
+ 145,
1415
+ 415,
1416
+ 162
1417
+ ],
1418
+ "page_idx": 11
1419
+ },
1420
+ {
1421
+ "type": "text",
1422
+ "text": "Preliminaries We briefly review the general statistical learning framework. More specifically, let $\\mathcal { X }$ and $\\mathcal { V }$ be the feature and label spaces, and suppose $\\mathcal { D }$ is an unknown distribution over $\\mathcal { X } \\times \\mathcal { V }$ . Let $\\mathcal { F } \\subseteq \\mathcal { V } ^ { \\mathcal { X } }$ be the hypothesis class that we use to make prediction, and $\\ell : \\mathcal { V } \\times \\mathcal { V } \\mathbb { R }$ be the loss function. In addition, we define the function class $\\ell _ { \\mathcal { F } } = \\{ ( \\mathbf { x } , y ) \\ell ( f ( \\mathbf { x } ) , y ) : f \\in \\mathcal { F } \\}$ as the composition of the functions in $\\mathcal { F }$ and loss $\\ell$ . Therefore, the goal is to minimize the expected risk $L _ { D } = \\mathbb { E } _ { ( \\mathbf { x } , y ) \\sim \\mathcal { D } } \\ell ( f ( \\mathbf { x } ) , y )$ with some function $f \\in { \\mathcal { F } }$ . ",
1423
+ "bbox": [
1424
+ 173,
1425
+ 181,
1426
+ 825,
1427
+ 306
1428
+ ],
1429
+ "page_idx": 11
1430
+ },
1431
+ {
1432
+ "type": "text",
1433
+ "text": "According to the problem setup in Section 4.3, we have $n$ i.i.d. training examples $S = \\{ ( \\mathbf { h } _ { i } , y _ { i } ) \\} _ { i = 1 } ^ { n }$ drawn from $\\mathcal { D }$ , where the hidden state $\\mathbf { h } _ { i } \\in \\mathbb { R } ^ { d }$ is the feature vector and $y _ { i }$ is the corresponding label. Suppose there exist a learning algorithm that maps the training dataset $S$ to a function $f \\in { \\mathcal { F } }$ , and we want to measure the gap between the empirical risk $L _ { S }$ and and the population risk $L _ { \\mathcal { D } }$ , i.e., $| L _ { D } - L _ { S } |$ , where $\\textstyle L _ { S } = \\sum _ { i = 1 } ^ { n } \\ell ( f ( \\mathbf { h } _ { i } ) , y _ { i } ) / n$ . This gap is known as the generalization error. ",
1434
+ "bbox": [
1435
+ 173,
1436
+ 308,
1437
+ 825,
1438
+ 415
1439
+ ],
1440
+ "page_idx": 11
1441
+ },
1442
+ {
1443
+ "type": "text",
1444
+ "text": "To bound the generalization error, we use the Rademacher complexity (Bartlett & Mendelson, 2002). Let $\\mathcal { F } \\subseteq \\mathbb { R } ^ { \\mathcal { Z } }$ be a function class and $S = \\{ \\mathbf { z } _ { 1 } , \\ldots . . . , \\mathbf { z } _ { n } \\}$ be a set of examples of size $n$ , the empirical Rademacher complexity is defined as ",
1445
+ "bbox": [
1446
+ 174,
1447
+ 416,
1448
+ 825,
1449
+ 468
1450
+ ],
1451
+ "page_idx": 11
1452
+ },
1453
+ {
1454
+ "type": "equation",
1455
+ "img_path": "images/95e545af3e7e62526f7e139e5ec57ec6375a15b4ce0b45fa19c0246a2c4dc37b.jpg",
1456
+ "text": "$$\n{ \\widehat { \\mathfrak { R } } } _ { S } ( { \\mathcal { F } } ) : = { \\frac { 1 } { n } } \\mathbb { E } _ { \\rho } { \\biggl [ } \\operatorname* { s u p } _ { f \\in { \\mathcal { F } } } \\sum _ { i = 1 } ^ { n } \\rho _ { i } f ( \\mathbf { x } _ { i } ) { \\biggr ] } ,\n$$",
1457
+ "text_format": "latex",
1458
+ "bbox": [
1459
+ 357,
1460
+ 469,
1461
+ 637,
1462
+ 517
1463
+ ],
1464
+ "page_idx": 11
1465
+ },
1466
+ {
1467
+ "type": "text",
1468
+ "text": "where $\\rho _ { 1 } , \\ldots , \\rho _ { n }$ are i.i.d. Rademacher random variables with $\\mathbb { P } ( \\rho _ { i } = 1 ) = \\mathbb { P } ( \\rho _ { i } =$ $- 1 ) = 1 / 2$ . ",
1469
+ "bbox": [
1470
+ 176,
1471
+ 517,
1472
+ 821,
1473
+ 553
1474
+ ],
1475
+ "page_idx": 11
1476
+ },
1477
+ {
1478
+ "type": "text",
1479
+ "text": "According to the loss function $L _ { S }$ defined in (4.2), we are considering $N$ function classes $\\{ \\mathcal { F } _ { k } \\} _ { k = 1 } ^ { N }$ with $\\mathcal { F } _ { k } = \\{ f : \\mathbf { h } \\langle \\mathbf { w } _ { k } , \\mathbf { h } \\rangle$ , $\\mathbf { w } _ { k } = \\mathbf { e } ^ { k \\top } \\mathbf { W } , \\mathbf { W } \\in \\mathcal { P } ( \\gamma ) , \\mathbf { h } \\in \\mathbb { R } ^ { d } \\}$ , where $\\mathbf { e } ^ { k }$ is a $d$ -dimensional vector with $k$ -th element to be one and others to be zero, and the loss $\\ell : \\mathbb { R } ^ { N } \\to \\mathbb { R }$ . We have the following Lemma to bound the generalization error based on the empirical Rademacher complexity, which was proved in Corollary A.11 in Allen-Zhu et al. (2019). ",
1480
+ "bbox": [
1481
+ 173,
1482
+ 554,
1483
+ 825,
1484
+ 661
1485
+ ],
1486
+ "page_idx": 11
1487
+ },
1488
+ {
1489
+ "type": "text",
1490
+ "text": "Lemma A.1. (Allen-Zhu et al., 2019) If $\\mathcal { F } _ { 1 } \\ldots , \\mathcal { F } _ { N }$ are $_ \\mathrm { N }$ classes of functions $\\mathbb { R } ^ { d } \\to \\mathbb { R }$ , the loss function $\\ell : \\mathbb { R } ^ { N } \\to \\mathbb { R }$ is $G$ -Lipschitz continuous and $| \\ell ( \\cdot ) | \\leq B$ for any $\\mathbf { z } \\sim \\mathcal { D }$ , then with probability at least $1 - \\delta$ , we have ",
1491
+ "bbox": [
1492
+ 173,
1493
+ 667,
1494
+ 825,
1495
+ 722
1496
+ ],
1497
+ "page_idx": 11
1498
+ },
1499
+ {
1500
+ "type": "equation",
1501
+ "img_path": "images/ca194334b819a1f720b9e2ae3e9765cf60db9e083f6b190a3dfdf1c6367f0400.jpg",
1502
+ "text": "$$\n\\begin{array}{c} \\operatorname* { s u p } _ { f _ { 1 } \\in { \\mathcal { F } } _ { 1 } , \\ldots , f _ { n } \\in { \\mathcal { F } } _ { N } } \\left| { \\mathbb { E } } \\left[ \\ell \\left( f _ { 1 } ( \\mathbf { z } ) , \\ldots , f _ { N } ( \\mathbf { z } ) \\right) \\right] - { \\frac { 1 } { n } } \\sum _ { i = 1 } ^ { n } \\ell ( f ( \\mathbf { z } _ { i } ) ) \\right| \\leq C _ { 1 } G \\sum _ { k = 1 } ^ { N } { \\widehat { \\mathfrak { N } } } _ { S } ( { \\mathcal { F } } _ { k } ) \\\\ { + C _ { 2 } { \\frac { B \\sqrt { \\log ( 1 / \\delta ) } } { \\sqrt { n } } } , } \\end{array}\n$$",
1503
+ "text_format": "latex",
1504
+ "bbox": [
1505
+ 181,
1506
+ 723,
1507
+ 810,
1508
+ 818
1509
+ ],
1510
+ "page_idx": 11
1511
+ },
1512
+ {
1513
+ "type": "text",
1514
+ "text": "where the expectation is taken over the distribution $\\mathcal { D }$ . ",
1515
+ "bbox": [
1516
+ 174,
1517
+ 815,
1518
+ 601,
1519
+ 833
1520
+ ],
1521
+ "page_idx": 11
1522
+ },
1523
+ {
1524
+ "type": "text",
1525
+ "text": "Equipped with this lemma, we now present the proof of our main result. ",
1526
+ "bbox": [
1527
+ 174,
1528
+ 844,
1529
+ 738,
1530
+ 863
1531
+ ],
1532
+ "page_idx": 11
1533
+ },
1534
+ {
1535
+ "type": "text",
1536
+ "text": "Proof of Theorem 4.1. According to the problem setup in Section 4, we have $N$ classes of functions $\\{ \\mathcal { F } _ { k } \\} _ { k = 1 } ^ { N }$ and let the singular value decomposition of W as ",
1537
+ "bbox": [
1538
+ 174,
1539
+ 888,
1540
+ 825,
1541
+ 925
1542
+ ],
1543
+ "page_idx": 11
1544
+ },
1545
+ {
1546
+ "type": "text",
1547
+ "text": "$\\mathbf { W } = \\mathbf { U } \\boldsymbol { \\Sigma } \\mathbf { V } ^ { \\top }$ and $\\mathbf { u } _ { k }$ is the $k$ -th row of U. Therefore, we have ",
1548
+ "bbox": [
1549
+ 173,
1550
+ 99,
1551
+ 671,
1552
+ 119
1553
+ ],
1554
+ "page_idx": 12
1555
+ },
1556
+ {
1557
+ "type": "equation",
1558
+ "img_path": "images/64f0e7c6609c772e336a9b873c78bcd7bcaca4e3a54a688e9fd87ee11517d169.jpg",
1559
+ "text": "$$\n\\widehat { \\mathfrak { M } } _ { S } ( \\mathcal { F } _ { k } ) = \\mathbb { E } _ { \\rho } \\bigg [ \\operatorname* { s u p } _ { f \\in \\mathcal { F } _ { k } } \\frac { 1 } { n } \\sum _ { i = 1 } ^ { n } \\rho _ { i } \\langle \\mathbf { w } _ { k } , \\mathbf { h } _ { i } \\rangle \\bigg ] = \\mathbb { E } _ { \\rho } \\bigg [ \\operatorname* { s u p } _ { f \\in \\mathcal { F } _ { k } } \\frac { 1 } { n } \\langle \\mathbf { V } \\Sigma \\mathbf { u } _ { k } ^ { \\intercal } , \\mathbf { h } _ { \\rho } \\rangle \\bigg ]\n$$",
1560
+ "text_format": "latex",
1561
+ "bbox": [
1562
+ 210,
1563
+ 119,
1564
+ 743,
1565
+ 165
1566
+ ],
1567
+ "page_idx": 12
1568
+ },
1569
+ {
1570
+ "type": "text",
1571
+ "text": "where $\\begin{array} { r } { \\mathbf { h } _ { \\rho } \\ : = \\ : \\sum _ { i = 1 } ^ { n } \\rho _ { i } \\mathbf { h } _ { i } } \\end{array}$ and the last inequality is due to the definition of $\\mathbf { w } _ { k } ~ =$ $\\mathbf { V } \\pmb { \\Sigma } \\mathbf { u } _ { k } ^ { \\top }$ . Therefore, we have ",
1572
+ "bbox": [
1573
+ 174,
1574
+ 166,
1575
+ 823,
1576
+ 200
1577
+ ],
1578
+ "page_idx": 12
1579
+ },
1580
+ {
1581
+ "type": "equation",
1582
+ "img_path": "images/d3ce13eacdf7e4595b5f28de9fbc93c6bdb0b79b05a80e3a07950d5482ab1dc1.jpg",
1583
+ "text": "$$\n\\begin{array} { r l } & { \\widehat { \\mathfrak { N } } _ { S } ( \\mathcal { F } _ { k } ) \\leq \\mathbb { E } _ { \\rho } \\bigg [ \\displaystyle \\operatorname* { s u p } _ { f \\in \\mathcal { F } _ { k } } \\frac { 1 } { n } \\| \\nabla \\Sigma \\mathbf { u } _ { k } ^ { \\intercal } \\| _ { 1 } \\| \\mathbf { h } _ { \\rho } \\| _ { \\infty } \\bigg ] } \\\\ & { \\qquad \\leq \\frac { V } { n } \\mathbb { E } _ { \\rho } \\bigg [ \\displaystyle \\operatorname* { s u p } _ { f \\in \\mathcal { F } _ { k } } \\| \\Sigma \\mathbf { u } _ { k } ^ { \\intercal } \\| _ { 1 } \\| \\mathbf { h } _ { \\rho } \\| _ { \\infty } \\bigg ] } \\\\ & { \\qquad \\leq \\frac { V \\sqrt { \\sum _ { j = 1 } ^ { d } \\sigma _ { j } ^ { 2 } } } { n } \\mathbb { E } _ { \\rho } \\bigg [ \\displaystyle \\operatorname* { s u p } _ { f \\in \\mathcal { F } _ { k } } \\| \\mathbf { h } _ { \\rho } \\| _ { \\infty } \\bigg ] , } \\end{array}\n$$",
1584
+ "text_format": "latex",
1585
+ "bbox": [
1586
+ 325,
1587
+ 202,
1588
+ 669,
1589
+ 342
1590
+ ],
1591
+ "page_idx": 12
1592
+ },
1593
+ {
1594
+ "type": "text",
1595
+ "text": "where the second inequality is due to $\\| \\mathbf { V } \\| _ { 1 } \\leq V$ and the last one comes from $\\begin{array} { r } { \\| \\Sigma \\mathbf { u } _ { k } ^ { \\top } \\| _ { 1 } = \\sum _ { j = 1 } ^ { d } \\sigma _ { j } | u _ { k j } | \\leq \\sqrt { \\sum _ { j = 1 } ^ { d } \\sigma _ { j } ^ { 2 } } } \\end{array}$ . In addition, according to Theorem 12 in Liang (2014) , we have ",
1596
+ "bbox": [
1597
+ 173,
1598
+ 342,
1599
+ 826,
1600
+ 404
1601
+ ],
1602
+ "page_idx": 12
1603
+ },
1604
+ {
1605
+ "type": "equation",
1606
+ "img_path": "images/d9ae4a2fce97ae2d1a73e8b3785a19c0b2cb99a1ae488b92eb141ef8dba11e24.jpg",
1607
+ "text": "$$\n\\mathbb { E } _ { \\rho } \\big [ \\| \\mathbf { h } _ { \\rho } \\| _ { \\infty } \\big ] \\leq H \\sqrt { 2 n \\log d } ,\n$$",
1608
+ "text_format": "latex",
1609
+ "bbox": [
1610
+ 383,
1611
+ 404,
1612
+ 611,
1613
+ 429
1614
+ ],
1615
+ "page_idx": 12
1616
+ },
1617
+ {
1618
+ "type": "text",
1619
+ "text": "Therefore, we can get ",
1620
+ "bbox": [
1621
+ 174,
1622
+ 429,
1623
+ 349,
1624
+ 445
1625
+ ],
1626
+ "page_idx": 12
1627
+ },
1628
+ {
1629
+ "type": "equation",
1630
+ "img_path": "images/4cabcd437695ea65e864931ed0d07c1403189769b5108b92d763219afc554022.jpg",
1631
+ "text": "$$\n{ \\widehat { \\mathfrak { R } } } _ { S } ( { \\mathcal { F } } _ { k } ) \\leq V H { \\frac { { \\sqrt { \\sum _ { i = 1 } ^ { m } \\sigma _ { i } ^ { 2 } } } + { \\sqrt { \\sum _ { i > m } \\sigma _ { i } ^ { 2 } } } } { \\sqrt { \\mathfrak { n } } } } { \\sqrt { 2 \\log d } } .\n$$",
1632
+ "text_format": "latex",
1633
+ "bbox": [
1634
+ 294,
1635
+ 445,
1636
+ 702,
1637
+ 489
1638
+ ],
1639
+ "page_idx": 12
1640
+ },
1641
+ {
1642
+ "type": "text",
1643
+ "text": "As a result, we can get ",
1644
+ "bbox": [
1645
+ 174,
1646
+ 489,
1647
+ 354,
1648
+ 506
1649
+ ],
1650
+ "page_idx": 12
1651
+ },
1652
+ {
1653
+ "type": "equation",
1654
+ "img_path": "images/5c8dd68fcf1db63828578f5e1a3e3df3be40518f236831589a7bef0d8dc19c5f.jpg",
1655
+ "text": "$$\n\\sum _ { k = 1 } ^ { N } \\widehat { \\mathfrak { R } } _ { S } ( \\mathcal { F } _ { k } ) \\leq N V H \\frac { \\sqrt { \\sum _ { i = 1 } ^ { m } \\sigma _ { i } ^ { 2 } } + \\sqrt { \\sum _ { i > m } \\sigma _ { i } ^ { 2 } } } { \\sqrt { n } } \\sqrt { 2 \\log d } .\n$$",
1656
+ "text_format": "latex",
1657
+ "bbox": [
1658
+ 267,
1659
+ 506,
1660
+ 727,
1661
+ 556
1662
+ ],
1663
+ "page_idx": 12
1664
+ },
1665
+ {
1666
+ "type": "text",
1667
+ "text": "Since for $\\mathcal { P } ( \\gamma ) ~ = ~ \\mathcal { P } _ { e } ( \\gamma )$ , we have $\\sigma _ { j } ~ \\le ~ c _ { 1 } \\exp ( - c _ { 2 } j ^ { \\gamma } ) ~ \\le ~ c _ { 1 } / ( c _ { 2 } j ^ { \\gamma } )$ , and for $\\mathcal { P } ( \\gamma ) = \\mathcal { P } _ { p } ( \\gamma )$ , we have $\\sigma _ { j } \\leq c _ { 3 } j ^ { - \\gamma }$ . Thus for $\\gamma > 1 / 2$ , we have ",
1668
+ "bbox": [
1669
+ 173,
1670
+ 556,
1671
+ 826,
1672
+ 593
1673
+ ],
1674
+ "page_idx": 12
1675
+ },
1676
+ {
1677
+ "type": "equation",
1678
+ "img_path": "images/e33a1d0856a57694cc52a0dc3ce0363d576e74e5a65ac591c858c86fdfe46621.jpg",
1679
+ "text": "$$\n\\sum _ { j > m } \\sigma _ { j } ^ { 2 } \\leq \\sum _ { j > m } \\frac { c _ { 4 } } { j ^ { 2 \\gamma } } \\leq c _ { 4 } \\int _ { m + 1 } ^ { \\infty } x ^ { - 2 \\gamma } d x \\leq \\frac { c _ { 4 } } { ( 2 \\gamma - 1 ) } ( m + 1 ) ^ { 1 - 2 \\gamma } ,\n$$",
1680
+ "text_format": "latex",
1681
+ "bbox": [
1682
+ 250,
1683
+ 593,
1684
+ 745,
1685
+ 638
1686
+ ],
1687
+ "page_idx": 12
1688
+ },
1689
+ {
1690
+ "type": "text",
1691
+ "text": "where $c _ { 4 } = ( c _ { 1 } / c _ { 2 } ) ^ { 2 }$ if $\\mathcal { P } ( \\gamma ) = \\mathcal { P } _ { e } ( \\gamma )$ and $c _ { 4 } = c _ { 3 } ^ { 2 }$ if $\\mathcal { P } ( \\gamma ) = \\mathcal { P } _ { p } ( \\gamma )$ ",
1692
+ "bbox": [
1693
+ 171,
1694
+ 640,
1695
+ 694,
1696
+ 660
1697
+ ],
1698
+ "page_idx": 12
1699
+ },
1700
+ {
1701
+ "type": "text",
1702
+ "text": "Therefore, plugging this upper bound into (A.3), we have ",
1703
+ "bbox": [
1704
+ 174,
1705
+ 661,
1706
+ 627,
1707
+ 678
1708
+ ],
1709
+ "page_idx": 12
1710
+ },
1711
+ {
1712
+ "type": "equation",
1713
+ "img_path": "images/88cd55d22e7229f9cbd0bc2256eaa9be4d0da9d324f288191ff260b8fbddf050.jpg",
1714
+ "text": "$$\n\\sum _ { \\ k = 1 } ^ { N } \\widehat { \\mathfrak { R } } _ { S } ( \\mathcal { F } _ { k } ) \\leq \\frac { N V H \\sqrt { 2 \\log d } \\sqrt { \\sum _ { j = 1 } ^ { m } \\sigma _ { j } ^ { 2 } } } { \\sqrt { n } } + c _ { 5 } \\frac { N V H \\sqrt { 2 \\log d } \\sqrt { m ^ { 1 - 2 \\gamma } / ( 2 \\gamma - 1 ) } } { \\sqrt { n } } .\n$$",
1715
+ "text_format": "latex",
1716
+ "bbox": [
1717
+ 181,
1718
+ 678,
1719
+ 825,
1720
+ 731
1721
+ ],
1722
+ "page_idx": 12
1723
+ },
1724
+ {
1725
+ "type": "text",
1726
+ "text": "Where $c _ { 5 } = c 1 / c 5$ if $\\mathcal { P } ( \\gamma ) = \\mathcal { P } _ { e } ( \\gamma )$ and $c _ { 5 } = c _ { 3 }$ if $\\mathcal { P } ( \\gamma ) = \\mathcal { P } _ { p } ( \\gamma )$ . ",
1727
+ "bbox": [
1728
+ 174,
1729
+ 737,
1730
+ 692,
1731
+ 757
1732
+ ],
1733
+ "page_idx": 12
1734
+ },
1735
+ {
1736
+ "type": "text",
1737
+ "text": "According to Lemma A.1, since $\\ell$ is $G$ -Lipschitz continuous and $| \\ell ( \\cdot ) | \\leq B$ , we have ",
1738
+ "bbox": [
1739
+ 174,
1740
+ 758,
1741
+ 828,
1742
+ 791
1743
+ ],
1744
+ "page_idx": 12
1745
+ },
1746
+ {
1747
+ "type": "equation",
1748
+ "img_path": "images/1ae1e7c258d56dc0ec481813e3e884a76eb1ac326f49224a466e91d176da95e3.jpg",
1749
+ "text": "$$\n\\begin{array} { r l } & { \\underset { \\mathbf { W } \\in \\mathcal { P } ( \\gamma ) } { \\operatorname* { s u p } } \\left| L _ { \\mathcal { D } } ( \\mathbf { W } ) - L _ { S } ( \\mathbf { W } ) \\right| \\leq c _ { 6 } G N V H \\sqrt { \\log d } \\frac { \\sqrt { \\sum _ { j = 1 } ^ { m } \\sigma _ { j } ^ { 2 } } + \\sqrt { \\frac { m ^ { 1 - 2 \\gamma } } { ( 2 \\gamma - 1 ) } } } { \\sqrt { n } } } \\\\ & { \\qquad + c _ { 7 } B \\sqrt { \\frac { \\log ( 1 / \\delta ) } { n } } . } \\end{array}\n$$",
1750
+ "text_format": "latex",
1751
+ "bbox": [
1752
+ 212,
1753
+ 790,
1754
+ 784,
1755
+ 890
1756
+ ],
1757
+ "page_idx": 12
1758
+ },
1759
+ {
1760
+ "type": "table",
1761
+ "img_path": "images/d0031cae58f5f474d47f206d6fa1e0f21158231796ac083db23b0656364f01c9.jpg",
1762
+ "table_caption": [
1763
+ "Table 6: Comparison of different penalty functions in terms of perplexity on WikiText-2 dataset. "
1764
+ ],
1765
+ "table_footnote": [],
1766
+ "table_body": "<table><tr><td>Method</td><td>Validation</td><td>Test</td></tr><tr><td>AWD-LSTM (Merity et al., 2018a)</td><td>69.1</td><td>66.0</td></tr><tr><td>Spectrum Normalization</td><td>76.3</td><td>72.5</td></tr><tr><td>SN+D-Optimal Regularizer</td><td>98.3</td><td>94.8</td></tr><tr><td>Ours</td><td>66.3</td><td>63.7</td></tr></table>",
1767
+ "bbox": [
1768
+ 316,
1769
+ 121,
1770
+ 678,
1771
+ 190
1772
+ ],
1773
+ "page_idx": 13
1774
+ },
1775
+ {
1776
+ "type": "text",
1777
+ "text": "B EXPERIMENTAL RESULTS FOR OTHER PENALTY FUNCTIONS ",
1778
+ "bbox": [
1779
+ 174,
1780
+ 220,
1781
+ 712,
1782
+ 238
1783
+ ],
1784
+ "page_idx": 13
1785
+ },
1786
+ {
1787
+ "type": "text",
1788
+ "text": "In this section, we also implement our method with the penalty function proposed in Jiang et al. (2019) for training GANs. We consider WikiText-2 dataset, and all the experimental settings are same as before. Table 6 demonstrates the performance of our method using the Spectrum Normalization (SN) and $\\mathbf { S N + D }$ -Optimal Regularizer, which can achieve the best performance of training GANs in their paper. The results show that their proposed penalty function can deteriorate the training of neural language models. This is because their method is motivated from training GANs, and will encourage all the singular values close to the largest one. If we use such penalty function to train neural language models, the learned word representations will lose the power of modeling contextual information. Therefore, our proposed spectrum control method is essential to improve the training of neural language generation. ",
1789
+ "bbox": [
1790
+ 173,
1791
+ 252,
1792
+ 825,
1793
+ 463
1794
+ ],
1795
+ "page_idx": 13
1796
+ },
1797
+ {
1798
+ "type": "text",
1799
+ "text": "C TRAINING TIME AND MEMORY COST ",
1800
+ "text_level": 1,
1801
+ "bbox": [
1802
+ 174,
1803
+ 481,
1804
+ 521,
1805
+ 498
1806
+ ],
1807
+ "page_idx": 13
1808
+ },
1809
+ {
1810
+ "type": "text",
1811
+ "text": "In this section, we compare the training time and memory cost of our method with the baseline method, i.e., AWD-LSTM (Merity et al., 2018a) and standard Trandformer-XL (Dai et al., 2019). More specifically, we test our method and the baseline method on the same machine on WikiText-2 WikiText-103, and WMT 14 datasets. For WikiText-2 dataset, we use one NVIDIA Tesla V100 GPU and set the batch size to be 80. For WikiText-103 dataset, we use four NVIDIA Tesla V100 GPU and set the batch size to be 40. For WMT 14, we use four NVIDIA Tesla V100 GPU and set the max token as 3500. The training time and memory cost for a single GPU are summarized in Table 7. The results illustrate that our method is only $1 . 1 7 \\times$ , $1 . 1 8 \\times$ , and $1 . 2 4 \\times$ slower than the baseline methods on WikiText-2, WikiText-103 and WMT 14 datasets, respectively. In addition, our method will cost $1 . 0 6 \\times , 1 . 3 2 \\times$ and $1 . 1 1 \\times$ memory compared with the baseline methods on WikiText2, WikiText-103, and WMT 14 datasets, respectively. ",
1812
+ "bbox": [
1813
+ 174,
1814
+ 513,
1815
+ 825,
1816
+ 742
1817
+ ],
1818
+ "page_idx": 13
1819
+ },
1820
+ {
1821
+ "type": "table",
1822
+ "img_path": "images/8fd063a7ee6abb3c0dbe5e25569c6dd3413e5e6b9f8fad4987577119edb057d0.jpg",
1823
+ "table_caption": [
1824
+ "Table 7: Comparisons of our method and baseline method in terms of the average training time per epoch and the memory cost. "
1825
+ ],
1826
+ "table_footnote": [],
1827
+ "table_body": "<table><tr><td>Method</td><td>WikiText-2</td><td>WikiText-103</td><td>WMT14</td></tr><tr><td>Training time</td><td></td><td></td><td></td></tr><tr><td>Baseline</td><td>61 sec</td><td>2681 sec</td><td>5991 sec</td></tr><tr><td>Ours</td><td>70 sec</td><td>3152 sec</td><td>7421 sec</td></tr><tr><td>Memory cost</td><td></td><td></td><td></td></tr><tr><td>Baseline</td><td>8.9 GB</td><td>11.4 GB</td><td>14.2 GB</td></tr><tr><td>Ours</td><td>9.5 GB</td><td>15.0 GB</td><td>15.7 GB</td></tr></table>",
1828
+ "bbox": [
1829
+ 320,
1830
+ 789,
1831
+ 673,
1832
+ 900
1833
+ ],
1834
+ "page_idx": 13
1835
+ },
1836
+ {
1837
+ "type": "table",
1838
+ "img_path": "images/6b5423384cffecd87cfabd9ec1ab2ba6573657f0ea795890b77ded435ebd073b.jpg",
1839
+ "table_caption": [
1840
+ "Table 8: Comparisons of different priors on different datasets. "
1841
+ ],
1842
+ "table_footnote": [],
1843
+ "table_body": "<table><tr><td>Dataset</td><td>Exponential Decay</td><td>Polynomial Decay</td></tr><tr><td>Language Modeling</td><td>Test PPL</td><td>Test PPL</td></tr><tr><td>WikiText-2</td><td>63.7</td><td>64.2</td></tr><tr><td>WikiText-103</td><td>23.4</td><td>23.2</td></tr><tr><td>Machine Translation</td><td>BLEU</td><td>BLEU</td></tr><tr><td>IWSLT2014De-→En</td><td>35.50</td><td>35.40</td></tr><tr><td>WMT14En→De</td><td>28.37</td><td>28.45</td></tr></table>",
1844
+ "bbox": [
1845
+ 287,
1846
+ 121,
1847
+ 707,
1848
+ 231
1849
+ ],
1850
+ "page_idx": 14
1851
+ },
1852
+ {
1853
+ "type": "text",
1854
+ "text": "D COMPARISON OF TWO PRIORS ",
1855
+ "text_level": 1,
1856
+ "bbox": [
1857
+ 174,
1858
+ 260,
1859
+ 464,
1860
+ 277
1861
+ ],
1862
+ "page_idx": 14
1863
+ },
1864
+ {
1865
+ "type": "text",
1866
+ "text": "In this section we present the performance of our method on different tasks using different prior distributions. Table 8 suggests that the overall performance of these two prior distributions on different tasks are similar. In addition, the results show that it is better to use polynomial decay for large scale dataset and exponential decay for small scale dataset. ",
1867
+ "bbox": [
1868
+ 173,
1869
+ 290,
1870
+ 826,
1871
+ 378
1872
+ ],
1873
+ "page_idx": 14
1874
+ }
1875
+ ]
parse/train/ByxY8CNtvr/ByxY8CNtvr_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ByxY8CNtvr/ByxY8CNtvr_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1ekF2EYDH/H1ekF2EYDH.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1ekF2EYDH/H1ekF2EYDH_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1ekF2EYDH/H1ekF2EYDH_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/H1ekF2EYDH/H1ekF2EYDH_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HJYoqzbC-/HJYoqzbC-.md ADDED
@@ -0,0 +1,233 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A COMPARISON OF SECOND-ORDER METHODS FOR DEEP CONVOLUTIONAL NEURAL NETWORKS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ Despite many second-order methods have been proposed to train neural networks, most of the results were done on smaller single layer fully connected networks, so we still cannot conclude whether it’s useful in training deep convolutional networks. In this study, we conduct extensive experiments to answer the question ”whether second-order method is useful for deep learning?”. In our analysis, we find out although currently second-order methods are too slow to be applied in practice, it can reduce training loss in fewer number of iterations compared with SGD. In addition, we have the following interesting findings: (1) When using a large batch size, inexact-Newton methods will converge much faster than SGD. Therefore inexact-Newton method could be a better choice in distributed training of deep networks. (2) Quasi-newton methods are competitive with SGD even when using ReLu activation function (which has no curvature) on residual networks. However, current methods are too sensitive to parameters and not easy to tune for different settings. Therefore, quasi-newton methods with more selfadjusting mechanisms might be more useful than SGD in training deeper networks.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ In training deep neural networks and many other machine learning models, first-order methods have been extensively used. Stochastic Gradient Descent (SGD) method has shown positive results on various tasks in practice. It is very easy to implement and suitable to be applied in large-scale machine learning. However, SGD also has certain disadvantages. Practical success usually comes with laborious work of hyper-parameter searching. Furthermore, pure SGD often struggles to regions of loss surface with largely varying magnitudes of curvature (Dauphin et al., 2014). More importantly, it is very difficult to parallelize SGD—when increasing batch size, it is known that SGD will converge slowly and often obtain a solution with relatively poor generalization error (Keskar et al., 2016; Kawaguchi et al., 2017).
12
+
13
+ Second-order methods, on the other hand, improves the search direction using exact or approximate Hessian. Using curvature information enables such methods to make more progress per step than first-order methods relying solely on the gradient. Unfortunately, it is relatively hard to implement an efficient second-order method for large-scale deep neural networks. As parameters in the model scale up to millions, storing full hessian matrix is simply infeasible. Besides, larger datasets makes calculating exact or approximate hessian over whole dataset impossible. We will need to adopt the same mini-batch scheme as in SGD—using sub-sampled hessian in a data batch to calculate the update direction. Stochastic hessian cannot guarantee the approximated local quadratic problem to be positive semidefinite. Consequently the calculated update direction might not be a descent direction and the guarantee of the faster convergence rate of second-order method might not hold.
14
+
15
+ To overcome these challenges, few second-order methods have been proposed in the literature. Most of these methods can be categorized into into stochastic inexact-Newton methods and stochastic quasi-Newton methods, and both types of methods show certain advantages in their experimental results. However, when we try to answer the question ”whether second-order method is useful for deep learning”, we are still unsure the answer. The reasons are as follows.
16
+
17
+ First, the reported results in previous methods usually are based on reduce of training loss versus number of epochs. But to compute an update direction, these methods incur the extra costs of having to compute second-order information, so overall training time might become too long to really use those methods in practice. We need a comparison of training loss versus training time to evaluate the applicability of second-order methods.
18
+
19
+ More importantly, previous methods are mostly tested on simple networks such as multi-layer fully connected networks rather than deep convolutional network, which is deemed as the standard model in applying neural networks these days. Indeed, a similar study has been conducted before (Ngiam et al., 2011), but models used in the study are mostly shallow autoencoders and only one secondorder method is compared. It is still not obvious to us the advantage of second-order methods and to what extent these methods are useful in training modern deep networks, especially convolutional neural networks.
20
+
21
+ Hence, instead of proposing yet another second-order method, in this study we step back to experiment with some representative second-order methods on two datasets with various settings, and analyze both success and failure cases of second-order methods to conclude the advantages and limits of it. And we hope these information can be used in the future when designing new second-order methods.
22
+
23
+ Through this study, our major findings are as follows.
24
+
25
+ • Second-order methods can achieve better training loss in fewer number of epochs. This confirms that curvature information is still useful when training convolutional networks.
26
+ • Larger batch size benefits inexact-Newton methods more than SGD but not the case for quasi-Newton methods.
27
+ • Currently, second-order methods are too slow to be considered practical in training deep neural networks as compared to SGD.
28
+ • Network structures with zero second-order derivatives will deteriorate performance of inexact-Newton methods but not quasi-Newton methods.
29
+ • Fixed learning rate is not applicable to second-order methods
30
+
31
+ We will review the existing second-order works in the next section, and experimental and analysis will be given subsequently to support our claims above.
32
+
33
+ # 2 EXISTING SECOND-ORDER METHODS
34
+
35
+ Essentially, second-order methods obtain the update direction by minimizing a quadratic approximate function around the current solution, and the update rule can often be written as
36
+
37
+ $$
38
+ w _ { k + 1 } = w _ { k } - \alpha _ { k } H _ { k } { \hat { \nabla } } f ( w _ { k } ) ,
39
+ $$
40
+
41
+ where $H _ { k }$ is the inverse of Hessian or its approximation. For large-scale deep network training, due to the huge amount of parameters, all second-order methods need to approximate the calculation of (1) in certain ways. Based on the approximations they made, second-order methods can be categorized into following types.
42
+
43
+ # 2.1 STOCHASTIC INEXACT-NEWTON METHODS
44
+
45
+ The first family of algorithms, called ”inexact-Newton method”, use exact Hessian inverse as $H _ { k }$ but compute $H _ { k } \nabla f ( w _ { k } )$ inexactly. In (Martens & Sutskever, 2011), a ”Hessian-free” approach is proposed. By using hessian-vector products, Newton updates can be solved by Conjugate Gradient (CG) inexactly, in which the search direction is computed by applying CG to the Newton method, and terminating it once it has made sufficient progress. Hessian-vector products can be computed efficiently using a form of automatic differentiation supported by most popular deep learning frameworks. (Wang et al., 2015) proposed a similar method which solves Newton equation with gradient replaced by linear combination of current and previous gradients. In practice, this method does not show prominent improvement over basic inexact-Newton method; therefore, we choose method in (Martens & Sutskever, 2011) to represent this category.
46
+
47
+ # 2.2 STOCHASTIC QUASI-NEWTON METHODS
48
+
49
+ Recently, several stochastic quasi-Newton algorithms have been developed for large-scale machine learning (Wang et al., 2017; Curtis, 2016; Keskar & Berahas, 2016; Ramamurthy & Duffy, 2016; Byrd et al., 2016). These methods use approximate hessian instead of the real one for (1), and they differ from each other by using different criteria to obtain curvature pairs and different frequencies of updating. Basically, the spirit of Quasi-Newton methods is to obtain a lower per-iteration cost but good enough second-order approximation to have better update per iteration. (Wang et al., 2017) and (Curtis, 2016) modify the BFGS update rule to prevent the updates steps from becoming unbounded values. (Byrd et al., 2016) extends L-BFGS method by decoupling of the parameter updates from the curvature estimation to achieve a better stability when dealing with large-scale problems. (Keskar & Berahas, 2016) further extended this direction by adding more checking conditions to make sure the update direction is likely descendent. In addition, they approximate empirical fisher information matrix instead of hessian matrix. (Ramamurthy & Duffy, 2016) proposed to use rank one approximation in a limited memory version manner. It combines L-SR1 method with either Line Search or Trust Region scheme to optimize the model. Notice that not all methods above are proposed specifically for non-convex problems. But even as proposed in (Keskar & Berahas, 2016) which claims its applicability for non-convex problem, in our implementation we found out the empirical fisher information becomes too small and the corresponding update is negligible. Both (Wang et al., 2017) and (Curtis, 2016) don’t provide large-scale derivation in their methods and to directly implement their method, large size of hessian information needed to be stored, which is in feasible in our experiments. Therefore, we only choose (Byrd et al., 2016) and (Ramamurthy & Duffy, 2016) to represent this category.
50
+
51
+ # 2.3 STOCHASTIC GAUSS-NEWTON METHODS
52
+
53
+ Gauss-Newton is a positive semidefinite approximation to the hessian matrix. In (Botev et al., 2017), an efficient block-diagonal approximation to the Gauss-Newton matrix for multi-layer fully connected networks is proposed. It represents the approximation by Kronecker Product and factorize it to achieve an easier calculation. A similar work was done in (Martens & Grosse, 2015). The difference is that in (Martens & Grosse, 2015), Fisher-information matrix instead of hessian matrix is approximated. Although we want to include this type of optimization methods in comparison, these methods requires dedicate implementation for each type of neural network. When the network contains layers that are not fully connected and possibly with weight sharing, such as convolutional layers, it is hard to exploit the Kronecker product structure to form the Gauss-Newton matrix. Since we are focusing on convolutional neural networks in this paper, we did not take this category into comparison.
54
+
55
+ # 2.4 TRUST-REGION METHODS
56
+
57
+ Trust region methods are another important family of second-order methods. Instead of solving the linear system in (1), they obtain the update direction by minimizing the quadratic approximation around the current solution with the norm constraints. The 2-norm constraint, known as “trust region”, is used to prevent the iterate from moving too far. However, this non-convex quadratic subproblem with bounded constraint is non-trivial to solve for large-scale applications, thus trust region methods have not been studied much for training deep networks. Similar to trust region method, cubic regularization method (Nesterov & Polyak, 2006) solves a similar subproblem but replaces the bounded constraints by cubic regularization. Just before submitting this work, a recent paper (Xu et al., 2017b;a) on arXiv tested a trust region method and cubic regularization method on multi-layer perceptons, but it has not been applied to convolutional neural network. We will try to include this type of methods into comparison in the future.
58
+
59
+ # 3 EXPERIMENTAL SETUPS
60
+
61
+ # 3.1 DATASETS
62
+
63
+ We will use MNIST and CIFAR-10 datasets in the experiments. MNIST consists of 60,000 1x28x28 images of hand-written digits. In this study, we report results based on all 60,000 images including both training and validation sets. CIFAR-10 dataset consists of $6 0 , 0 0 0 \ 3 \mathrm { x } 3 2 \mathrm { x } 3 2$ colour images in 10 classes, with 6,000 images per class. We follow the same setting as provided with 50,000 training images and 10,000 test images. There are many data augmentation methods mentioned in the literature; however, as our analysis focuses more on optimization rather than achieving highest accuracy, we didn’t augment datasets.
64
+
65
+ Table 1: Testing accuracy achieved by SGD for eahc model.
66
+
67
+ <table><tr><td></td><td>MNIST</td><td>CIFAR-10</td></tr><tr><td>LeNet</td><td>99.2</td><td>69</td></tr><tr><td>AlexNet</td><td>99.4</td><td>77.48</td></tr><tr><td>DRN</td><td>99.3</td><td>82.3</td></tr></table>
68
+
69
+ # 3.2 MODELS
70
+
71
+ In this study, we are interested in analyzing performance of second-order methods on convolutional neural networks. We first start with the basic LeNet5 (LeCun et al., 1995), and then test results with AlexNet (Krizhevsky et al., 2012), which can be thought as adding more layer of convolutions with larger number of filters. Last, we evaluate optimization methods on latest 18-layer Deep Residual Network(DRN) (He et al., 2016). For LeNet, we have 2 convolutional layers with 20 and $5 0 ~ 5 \mathrm { x } 5$ filters. For AlexNet, 3 convolutional layers with 64, 64, 128 5x5 filters are used. For DRN, we follow the same implementation as listed in (He et al., 2016). Best testing accuracy achieved by fixed learning rate SGD for each model is listed in Table 1.
72
+
73
+ Notice that there are certain different settings we used as compared to standard deep neural networks. First, the nonlinear activation unit used in all our implementations except few designed experiments is tanh instead of ReLu. As we will show in the following discussions, ReLu will cause the vanishing second-order information and thus prohibit the training with stochastic inexact-Newton methods. Second, we used fixed learning rate of SGD instead of having a decaying schedule. As this study mainly wants to investigate the effectiveness of second-order information over first-order gradients, we stick to the most basic usage of first-order method.
74
+
75
+ Finally, we restrict ourselves to SGD without momentum since our goal is to study whether secondorder information is useful. Because of these reasons and no data augmentation, our reported best test accuracy might not be the same as in the literature. We verified that with decaying schedule, data augmentation and momentum used, our DRN implementation on CIFAR-10 can achieve around $9 3 \%$ test accuracy and this is almost the same as in (He et al., 2016).
76
+
77
+ # 3.3 OPTIMIZATION METHODS
78
+
79
+ We will compare SGD with one inexact-Newton method and two quasi-Newton methods. For inexact-Newton method, we compare with the hessian-free method proposed in (Martens & Sutskever, 2011), which uses Stochastic Hessian and full Gradient (SHG), and compute the update direction by conjugate gradient method. Computation of full gradient is time-consuming and sometimes is not necessary when applying this method. On MNIST with LeNet model, we show in Figure 1 that SHG with larger full gradient used is indeed better, but it’s not significantly better than only partial gradients. Therefore, in our experiment when applying SHG we will only use $2 0 \%$ of data to compute the gradient. For quasi-Newton method, we use L-SR1 (SR1) (Ramamurthy & Duffy, 2016) and Stochastic Quasi-Newton method (SQN) (Bollapragada et al., 2016) as representative. In this study, results are based on selecting batch size as 100 except for certain designed experiments. As we are trying to understand the best applicability of each method, all the hyper-parameters are tuned to achieve the best possible results.
80
+
81
+ # 3.4 FIX LEARNING RATE VERSUS LINE SEARCH
82
+
83
+ While in (Byrd et al., 2016) a decaying schedule $1 / k$ ,where $\mathbf { k }$ is the current number of iteration, is proposed to be the step size of each update, in practice we find out this scheme does not work on most of our experiments. Instead, we improve the stability by applying line search to find out the
84
+
85
+ ![](images/b59153e177dc1e92dcd9b117b4555c7a9632a2f00d40b3ed70354a30cb3db724.jpg)
86
+ Figure 1: Percentage of data (or simply one batch) used to calculate gradient used in SHG method. We can see $2 0 \%$ data to compute gradient is enough. One epoch refers to iterate whole dataset once. Following figures follow the same definition.
87
+
88
+ step size. We adopt the backtracking line search and accept the step size whenever it satisfies the following sufficient decrease condition (see (Wright, 2008)):
89
+
90
+ $$
91
+ \begin{array} { r } { f ( w + \eta p ) - f ( w ) \leq 0 . 1 \eta \nabla f ( w ) ^ { T } p , } \end{array}
92
+ $$
93
+
94
+ where $p$ is the search direction, and both gradient and function values are computed using the current batch. In this study, without further notice, SGD and GD will use well tuned fix learning rate and we will apply line search for SHG, SQN and SR1. Due to this finding, we are also interested in knowing whether line search is essential when applying second-order methods. Analysis will be provided below.
95
+
96
+ # 4 RESULTS AND ANALYSIS
97
+
98
+ # 4.1 SHG OUTPERFORMS SGD IN NUMBER OF TRAINING STEPS BUT SGD IS SUBSTANTIALLY FASTER
99
+
100
+ We show MNIST results in Figure 2 and CIFAR-10 results in Figure 3. Is second-order methods useful in training deep neural network? By only looking at number of epochs to minimize training objective, we can clearly answer yes. SHG method performs well on both datasets, and quasi-Newton methods have slightly worse performance on MNIST but are significantly better than SGD on CIFAR-10. Another point to notice is that we could not find a set of parameters to make SQN work with AlexNet on CIFAR-10. This signals that quasi-Netwon methods without parameter control or self-adjusting features can easily fall short in training non-convex problems.
101
+
102
+ It might be argued that as each update, SHG accesses much more data $2 0 \%$ of total as mentioned) than SGD (one batch), so it is self-evident that SHG can have better results. Nevertheless, we also include the Gradient Descent (GD) method to verify that amount of data accessed is not the key to performance in this case. In each iteration, GD will use average gradient of $2 0 \%$ of data to be the update direction. So GD has same number of updates as SGD, and access same amount of data as SHG in each update. If amount of data accessed were the key, GD should have a similar performance as SHG method. But we can clearly tell from the both figures that GD has a very different training loss curve from SHG. GD is actually worse than SGD in most cases which indicates that aggregated gradient information is not helpful in training deep neural networks. This verifies the effectiveness of second-order information.
103
+
104
+ Thus, second-order methods sound like a promising optimization method in deep learning. But when we look at the time spent to optimize as shown in Figure 4 and 5, clearly second-order methods won’t be a practical choice. SHG takes hundred to thousand times more to finish the training. This is because SHG needs to computes (almost) full gradient information. As the training data grows larger, this will be a demanding computational task. We also include time required to achieve a designated accuracy for both datasets. SGD is still substantially faster than all second-order methods. Quasi-Newton methods in general take shorter time to train and achieve decent testing results. Especially SQN is the fastest among three second-order methods. It is because SQN decouples the computation of update pairs and parameter updates. Therefore, in each iteration the required computation is reduced.
105
+
106
+ ![](images/7d506e26a930b7527165cf6abceebf01fdf9417aa89a6a04371e953423bf8ad0.jpg)
107
+ Figure 2: Average training loss versus epochs of SGD, SHG, GD, SR1, SQN on MNIST dataset. SHG is slightly faster than SGD. Quasi-Newton methods are comparable to SGD.
108
+
109
+ In our implementation, computation of full gradient is done by iterating many smaller batches. Ideally, we could parallelize this operation to accelerate the SHG method so SHG might become competitive to SGD in time when distributed training is available. Furthermore, in next section we will show SHG benefits from big batches, which is also a good feature for parallelizing the computation.
110
+
111
+ <table><tr><td rowspan=2 colspan=1></td><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>CIFAR-10</td></tr><tr><td rowspan=1 colspan=1>LeNet AlexNet</td><td rowspan=1 colspan=1>LeNet AlexNet</td></tr><tr><td rowspan=1 colspan=1>SGD</td><td rowspan=1 colspan=1>4.4 4.0</td><td rowspan=1 colspan=1>89.7 51.3</td></tr><tr><td rowspan=1 colspan=1>SHG</td><td rowspan=1 colspan=1>183 122</td><td rowspan=1 colspan=1>1422 1856</td></tr><tr><td rowspan=1 colspan=1>SQN</td><td rowspan=1 colspan=1>71.9 50.7</td><td rowspan=1 colspan=1>229 NA</td></tr><tr><td rowspan=1 colspan=1>SR1</td><td rowspan=1 colspan=1>172.9 121.9</td><td rowspan=1 colspan=1>2744 483</td></tr></table>
112
+
113
+ Table 2: Time(sec) required to achieve desginated testing accuracy, MNIST: $9 8 \%$ and CIFAR$1 0 { : } 7 3 \%$
114
+
115
+ # 4.2 SHG PERFORMS BETTER UNDER BIG BATCH SETTING
116
+
117
+ It has been observed that increasing the batch size will hurt the convergence speed of SGD (Goyal et al., 2017; ?; You et al., 2017). Therefore, it is interesting to see the performance of second-order methods as we increase batch size.
118
+
119
+ In Figure 6, we test the performance of SQN when we increase batch size. As we can see, SQN works well when batch size is small but the training becomes stagnant when batch size becomes larger. We believe it’s because there are many hyper-parameters in quasi-Newton methods such as batch size, number of curvature pairs to use, learning rate and frequency of updates. Again without a good controlling mechanism, the approximation computed might be noisy and sudden change one of any parameters alone will make the algorithm problematic. Same situation can be observed in SR1 as shown in Figure 7. Its performance becomes worse than SGD when the batch size is increased.
120
+
121
+ ![](images/117b56239de3b838f5a2111aad818b00fbcd5ed9375305f67f650f29b9b28567.jpg)
122
+ Figure 3: Average training loss versus epochs of SGD, SHG, GD, SR1, SQN on CIFAR-10 dataset. Clearly both inexact-Newton and quasi-Newton methods optimize the training loss faster than SGD.
123
+
124
+ On the other hand, the behavior is totally different for inexact-Newton method such as SHG—SHG benefits from bigger batches, as shown in Figure 8. Although the effect of larger batches seems to be stronger for SGD when batch size grows to 400, SHG with even larger sizes (e.g., 3200) will outperform SGD more when compared to smaller batch sizes. This implies unlike first-order methods which rely on the noisy of gradient estimation to jump out the valley, curvature information captured by SHG is enough to optimize the objective function, and larger batch size of hessian-vector product used in SHG leads to better results. When batch size is larger, it’s even easier to parallelize and compute the full gradient part. This shows a good direction to apply second-order methods in the future.
125
+
126
+ # 4.3 LIMITS OF SECOND-ORDER METHODS: RELU UNIT AND IDENTITY LINK
127
+
128
+ At first glance, second-order methods especially SHG can achieve good results with standard deep convolutional neural networks. But when it comes to Deep Residual Network, the story is different as shown in Figure 9. SHG is able to train a DRN on MNIST but not CIFAR-10. As derived in (Botev et al., 2017), hessian matrix of multi-layer fully connected network will be related to this recursive pre-activation hessian $_ \mathrm { H }$ :
129
+
130
+ $$
131
+ H _ { \lambda } = B _ { \lambda } W _ { \lambda + 1 } ^ { T } H _ { \lambda + 1 } W _ { \lambda + 1 } B _ { \lambda } + D _ { \lambda }
132
+ $$
133
+
134
+ where we could define the diagonal matrices:
135
+
136
+ $$
137
+ B _ { \lambda } = \mathrm { d i a g } ( f _ { \lambda } ^ { \prime } ( h _ { \lambda } ) )
138
+ $$
139
+
140
+ ![](images/eb9810a45d4749ae95baaaea5fd1b3f94b3231311e964401a335c607b61f74e1.jpg)
141
+ Figure 4: Average training loss versus time of SGD,SHG,GD,SR1,SQN on MNIST dataset.
142
+
143
+ $$
144
+ D _ { \lambda } = \mathrm { d i a g } ( f _ { \lambda } ^ { \prime \prime } ( h _ { \lambda } ) { \frac { \partial E } { \partial a _ { \lambda } } } )
145
+ $$
146
+
147
+ where E is the total loss, f is the activation function and $a _ { \lambda }$ is the activation of certain layer $\lambda$ . Therefore, if ReLu is used as nonlinear unit of the network, it will have zero second-order derivatives so part of the hessian information will be lost. In addition, identity link used in the DRN also has zero second-order derivatives. Since DRN contains both designs, we are not sure which unit deteriorates SHG more. Therefore, we design an ablation test to verify the effects.
148
+
149
+ First, we compare AlexNet with tanh and AlexNet with ReLu. This is a straightforward comparison to understand the influence of using ReLu. Next, we take AlexNet with tanh and substitute the last convolutional layer in AlexNet with a single residual block. Within the block, again tanh is used instead of ReLu and we keep the identity link. Although it’s a relatively shallow network compared to the one used in DRN, it’s enough to tell the influence of using identity link. As shown in Figure 10 and 11, both designs will deteriorate the performance of SHG. And ReLu posts stronger challenges to this type of second-order methods. This is a really problematic issue as nowadays, popularity of DRN grows fast and likely it will become the standard type of neural network. Without an efficient way of solving this problem means SHG won’t be useful even it can be parallelized. On contrary, quasi-Newton methods use first-order information to approximate second-order information. Despite the second-order information is disrupted by vanishing effect, it can still receive gradients to complete the calculation. Besides, we observe that it converges to smaller training loss than SGD on both MNIST and CIFAR-10. It has the potential to be applied in training deeper residual networks.
150
+
151
+ The reason why SHG still works on training MNIST is likely due to the fact that images in MNIST are simple patterns with most parts black. So the information lost is not severe enough to stop us from training. But in general it should become an issue on most of real-world datasets.
152
+
153
+ ![](images/0d3556ad7c642e95de87bf6052fc72cded8492d2b05dd6a8a4cb119f45bab3b3.jpg)
154
+ Figure 5: Average training loss versus time of SGD,SHG,GD,SR1,SQN on CIFAR-10 dataset. SGD in practice requires minimal computations and consequently faster than second-order methods.
155
+
156
+ ![](images/9c3282b1f4dd944c86b7ee53d56cb51770c23488c71a6b24676c292c3a8152a7.jpg)
157
+ Figure 6: Effect of changing batch size of SQN method. SQN fails to generalize the performance to larger batches. In principle SQN is sentitive to hyper-parameters.
158
+
159
+ 4.4 LINE SEARCH IS ESSENTIAL TO SECOND-ORDER METHODS
160
+
161
+ In this part, we replace the line search computations with well tuned fixed learning rate. In sum, second-order methods will not work on most of cases as shown in figure 12. As each update might not be descent direction, larger step sizes usually cause model to explode at certain point of training. With a fixed step size, only smaller values could be chosen. Consequently, the training process is relatively stagnant. The full capability of second-order methods cannot be achieved.
162
+
163
+ ![](images/74ae4feb605195a28019dc66325dda32d6ab1ea5934a00b68a403b8db7de6fa9.jpg)
164
+ Figure 7: Effect of changing batch size of SGD and SR1 methods. SR1 is sensitive to batch size too. As batch size grows, SGD outperforms SR1 on both datasets.
165
+
166
+ # 5 CONCLUSIONS
167
+
168
+ Second-order information is helpful to reduce the number of training epochs needed but it severely suffers from computational cost. So presently, light-weight first-order methods still dominate the optimization of deep neural network. Fortunately, both inexact-Newton methods and quasi-Newton methods seem to have certain ways to improve in the future. For inexact-Newton methods, parallelization is obviously the most promising direction to further study. With bigger batches and proper distributed system supported, it has a chance to achieve competitive results in practical timing constraints. Nevertheless, we will need to figure out how to deal with vanishing second-order information to make it really useful in deep learning.
169
+
170
+ For quasi-Newton method, although currently it is fast enough to be considered as the same order as SGD, a good balance between the precision of approximation and frequency of updates should still be considered to further cut the computational time. In addition, a more efficient and safer selfadjusting or correction mechanism can be added to make it stable under different setup of parameters and batch sizes. In addition, from preliminary analysis, quasi-Newton methods show competitive results when training DRN on both MNIST and CIFAR-10. This is another interesting research direction to explore.
171
+
172
+ ![](images/4a918bceba5e9385e39b1f7c96b0f2a700d0ac7950318a60be570be7fd2d1e52.jpg)
173
+ Figure 8: Effect of changing batch size of SGD and SHG methods. SGD benefits a bit when batch size grows to 400 but not larger. SHG outperforms SGD significantly when batch size keeps growing. Notice that large batch size means smaller number of updates in each epoch.
174
+
175
+ ![](images/01f1b93fae803d8b3498c2594f848a5aed9db7f4bb78ef4f9e7b1e4fd1ce8251.jpg)
176
+ Figure 9: Results of training regular DRN with ReLu activation. Although SHG can still optimize DRN on MNIST well, it fails to converge to better training loss on CIFAR-10 dataset.
177
+
178
+ ![](images/559aacb55b499ae8f3adffc23415cfe7b7fa142d5858ef6c4e4de60fffd5673b.jpg)
179
+ Figure 10: Effect of using ReLu in AlextNet. Left figure is Regular AlexNet with tanh activation and right figure is AlexNet with ReLu activation. Apparently using ReLu in deep neural networks deteriorates performance of SHG but not SR1.
180
+
181
+ ![](images/d00c6857b425ff567092c45773ca41afcb1c801186eaec4f86561ba9261fb259.jpg)
182
+ Figure 11: Effect of adding Identity expression in AlexNet. Left figure is Regular AlexNet with tanh activation and right figure is AlexNet with last convolutional layer replaced by a residual block. The influence of identity link is not as strong as ReLu but still affects the performance of SHG.
183
+
184
+ ![](images/79dcb4b7b16dfaafa0731fe712a223c1698a3c8d4f8aeb4888bb26c17b66b192.jpg)
185
+ Figure 12: Effect of using fixed learning rate of SGD and SR1 methods. Second-order methods cannot work with fixed learning rate.
186
+
187
+ # REFERENCES
188
+
189
+ Raghu Bollapragada, Richard Byrd, and Jorge Nocedal. Exact and inexact subsampled newton methods for optimization. arXiv preprint arXiv:1609.08502, 2016.
190
+
191
+ Aleksandar Botev, Hippolyt Ritter, and David Barber. Practical gauss-newton optimisation for deep learning. In ICML, 2017.
192
+
193
+ Richard H Byrd, Samantha L Hansen, Jorge Nocedal, and Yoram Singer. A stochastic quasi-newton method for large-scale optimization. SIAM Journal on Optimization, 26(2):1008–1031, 2016.
194
+
195
+ Frank Curtis. A self-correcting variable-metric algorithm for stochastic optimization. In International Conference on Machine Learning, pp. 632–641, 2016.
196
+
197
+ Yann N Dauphin, Razvan Pascanu, Caglar Gulcehre, Kyunghyun Cho, Surya Ganguli, and Yoshua Bengio. Identifying and attacking the saddle point problem in high-dimensional non-convex optimization. In Advances in neural information processing systems, pp. 2933–2941, 2014.
198
+
199
+ Priya Goyal, Piotr Dollar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, An-´ drew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: Training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
200
+
201
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
202
+
203
+ Kenji Kawaguchi, Leslie Pack Kaelbling, and Yoshua Bengio. Generalization in deep learning. arXiv preprint arXiv:1710.05468, 2017.
204
+
205
+ Nitish Shirish Keskar and Albert S Berahas. adaqn: An adaptive quasi-newton algorithm for training rnns. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 1–16. Springer, 2016.
206
+
207
+ Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016.
208
+
209
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
210
+
211
+ Yann LeCun, LD Jackel, Leon Bottou, Corinna Cortes, John S Denker, Harris Drucker, Isabelle ´ Guyon, UA Muller, Eduard Sackinger, Patrice Simard, et al. Learning algorithms for classification: A comparison on handwritten digit recognition. Neural networks: the statistical mechanics perspective, 261:276, 1995.
212
+
213
+ James Martens and Roger Grosse. Optimizing neural networks with kronecker-factored approximate curvature. In ICML, 2015.
214
+
215
+ James Martens and Ilya Sutskever. Learning recurrent neural networks with hessian-free optimization. In Proceedings of the 28th International Conference on Machine Learning (ICML-11), pp. 1033–1040, 2011.
216
+
217
+ Yurii Nesterov and Boris T Polyak. Cubic regularization of newton method and its global performance. Mathematical Programming, 108(1):177–205, 2006.
218
+
219
+ Jiquan Ngiam, Adam Coates, Ahbik Lahiri, Bobby Prochnow, Quoc V Le, and Andrew Y Ng. On optimization methods for deep learning. In Proceedings of the 28th international conference on machine learning (ICML-11), pp. 265–272, 2011.
220
+
221
+ Vivek Ramamurthy and Nigel Duffy. L-sr1: A second order optimization method for deep learning. https://openreview.net/pdf?id=By1snw5gl, 2016.
222
+
223
+ Chien-Chih Wang, Chun-Heng Huang, and Chih-Jen Lin. Subsampled hessian newton methods for supervised learning. Neural computation, 2015.
224
+
225
+ Xiao Wang, Shiqian Ma, Donald Goldfarb, and Wei Liu. Stochastic quasi-newton methods for nonconvex stochastic optimization. SIAM Journal on Optimization, 27(2):927–956, 2017.
226
+
227
+ Jorge Nocedal Stephen J Wright. Numerical optimization. 2008.
228
+
229
+ Peng Xu, Farbod Roosta-Khorasan, and Michael W Mahoney. Second-order optimization for nonconvex machine learning: An empirical study. arXiv preprint arXiv:1708.07827, 2017a.
230
+
231
+ Peng Xu, Farbod Roosta-Khorasani, and Michael W Mahoney. Newton-type methods for nonconvex optimization under inexact hessian information. arXiv preprint arXiv:1708.07164, 2017b.
232
+
233
+ Yang You, Zhao Zhang, Cho-Jui Hsieh, and James Demmel. 100-epoch imagenet training with alexnet in 24 minutes. arXiv preprint arXiv:1709.05011, 2017.
parse/train/HJYoqzbC-/HJYoqzbC-_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HJgC60EtwB/HJgC60EtwB.md ADDED
@@ -0,0 +1,589 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ROBUST REINFORCEMENT LEARNING FOR CONTINUOUS CONTROL WITH MODEL MISSPECIFICATION
2
+
3
+ Daniel J. Mankowitz∗, Nir Levine∗, Rae Jeong, Abbas Abdolmaleki, Jost Tobias Springenberg, Yuanyuan Shi†, Jackie Kay, Timothy Mann, Todd Hester, Martin Riedmiller DeepMind {dmankowitz, nirlevine, raejeong, aabdolmaleki, springenberg yyshi, kayj, timothymann, toddhester, riedmiller}@google.com
4
+
5
+ # ABSTRACT
6
+
7
+ We provide a framework for incorporating robustness – to perturbations in the transition dynamics which we refer to as model misspecification – into continuous control Reinforcement Learning (RL) algorithms. We specifically focus on incorporating robustness into a state-of-the-art continuous control RL algorithm called Maximum a-posteriori Policy Optimization (MPO). We achieve this by learning a policy that optimizes for a worst case expected return objective and derive a corresponding robust entropy-regularized Bellman contraction operator. In addition, we introduce a less conservative, soft-robust, entropy-regularized objective with a corresponding Bellman operator. We show that both, robust and soft-robust policies, outperform their non-robust counterparts in nine Mujoco domains with environment perturbations. In addition, we show improved robust performance on a high-dimensional, simulated, dexterous robotic hand. Finally, we present multiple investigative experiments that provide a deeper insight into the robustness framework. This includes an adaptation to another continuous control RL algorithm as well as learning the uncertainty set from offline data. Performance videos can be found online at https://sites.google.com/view/robust-rl.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ Reinforcement Learning (RL) algorithms typically learn a policy that optimizes for the expected return (Sutton & Barto, 1998). That is, the policy aims to maximize the sum of future expected rewards that an agent accumulates in a particular task. This approach has yielded impressive results in recent years, including playing computer games with super human performance (Mnih et al., 2015; Tessler et al., 2016), multi-task RL (Rusu et al., 2016; Devin et al., 2017; Teh et al., 2017; Mankowitz et al., 2018b; Riedmiller et al., 2018) as well as solving complex continuous control robotic tasks (Duan et al., 2016; Abdolmaleki et al., 2018b; Kalashnikov et al., 2018; Haarnoja et al., 2018).
12
+
13
+ The current crop of RL agents are typically trained in a single environment (usually a simulator). As a consequence, an issue that is faced by many of these agents is the sensitivity of the agent’s policy to environment perturbations. Perturbing the dynamics of the environment during test time, which may include executing the policy in a real-world setting, can have a significant negative impact on the performance of the agent (Andrychowicz et al., 2018; Peng et al., 2018; Derman et al., 2018; Di Castro et al., 2012; Mankowitz et al., 2018a). This is because the training environment is not necessarily a very good model of the perturbations that an agent may actually face, leading to potentially unwanted, sub-optimal behaviour. There are many types of environment perturbations. These include changing lighting/weather conditions, sensor noise, actuator noise, action delays etc (Dulac-Arnold et al., 2019).
14
+
15
+ It is desirable to train agents that are agnostic to environment perturbations. This is especially crucial in the Sim2Real setting (Andrychowicz et al., 2018; Peng et al., 2018; Wulfmeier et al., 2017; Rastogi et al., 2018; Christiano et al., 2016) where a policy is trained in a simulator and then executed on a real-world domain. As an example, consider a robotic arm that executes a control policy to perform a specific task in a factory. If, for some reason, the arm needs to be replaced and the specifications do not exactly match, then the control policy still needs to be able to perform the task with the ‘perturbed’ robotic arm dynamics. In addition, sensor noise due to malfunctioning sensors, as well as actuator noise, may benefit from a robust policy to deal with these noise-induced perturbations.
16
+
17
+ Model misspecification: For the purpose of this paper, we refer to an agent that is trained in one environment and performs in a different, perturbed version of the environment (as in the above examples) as model misspecification. By incorporating robustness into our agents, we correct for this misspecification yielding improved performance in the perturbed environment(s).
18
+
19
+ In this paper, we propose a framework for incorporating robustness into continuous control RL algorithms. We specifically focus on robustness to model misspecification in the transition dynamics. Our main contributions are as follows:
20
+
21
+ (1) We incorporate robustness into a state-of-the-art continuous control RL algorithm called Maximum a-posteriori Policy Optimization (MPO) (Abdolmaleki et al., 2018b) to yield Robust MPO (R-MPO). We also carry out an additional experiment, where we incorporate robustness into an additional continuous RL algorithm called Stochastic Value Gradients (SVG) (Heess et al., 2015b).
22
+
23
+ (2) Entropy regularization encourages exploration and helps prevent early convergence to sub-optimal policies (Nachum et al., 2017). To incorporate these advantages, we: (i) Extend the Robust Bellman operator (Iyengar, 2005) to robust and soft-robust entropy-regularized versions, and show that these operators are contraction mappings. In addition, we (ii) extend MPO to Robust Entropy-regularized MPO (RE-MPO) and Soft RE-MPO (SRE-MPO) and show that they perform at least as well as R-MPO and in some cases significantly better. All the derivations have been deferred to Appendices B, C and D.
24
+
25
+ We want to emphasize that, while the theoretical contributions are novel, our most significant contribution is that of the extensive experimental analysis we have performed to analyze the robustness performance of our agent. Specifically:
26
+
27
+ (3) We present experimental results in nine Mujoco domains showing that RE-MPO, SRE-MPO and R-MPO, SR-MPO outperform both E-MPO and MPO respectively.
28
+
29
+ (4) To ensure that our method scales, we show robust performance on a high-dimensional, simulated, dexterous robotic hand called Shadow hand which outperforms the non-robust MPO baseline.
30
+
31
+ (5) Multiple investigative experiments to better understand the robustness framework. These include (i) an analysis of modifying the uncertainty set; (ii) comparing our technique to data augmentation; (iii) a comparison to domain randomization; (iv) comparing with and without entropy regularization; (v) We also train the transition models from offline data and use them as the uncertainty set to run R-MPO. We show that R-MPO with learned transition models as the uncertainty set can lead to improved performance over R-MPO.
32
+
33
+ # 2 BACKGROUND
34
+
35
+ A Markov Decision Process (MDP) is defined as the tuple $\langle S , A , r , \gamma , P \rangle$ where $S$ is the state space, $A$ the action space, $r : S \times A \to \mathbb { R }$ is a bounded reward function; $\gamma \in [ 0 , 1 ]$ is the discount factor and $P : S \times \bar { A } \Delta ^ { S }$ maps state-action pairs to a probability distribution over next states. We use $\Delta ^ { S }$ to denote the $\vert S \vert - 1$ simplex. The goal of a Reinforcement Learning agent for the purpose of control is to learn a policy $\pi : S \Delta ^ { A }$ which maps a state and action to a probability of executing the action from the given state so as to maximize the expected return $\begin{array} { r } { J ( \pi ) \dot { = } \mathbb { E } ^ { \pi } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } ] } \end{array}$ where $r _ { t }$ is a random variable reprlue function is defined as e a $t$ (Sutton & Barto, 2018). Thed the action value function as $\begin{array} { r } { V ^ { \pi } ( s ) \overline { { \mathbf { \psi } } } = \mathbb { E } ^ { \pi } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } | s _ { 0 } = s ] } \end{array}$
36
+ $Q ^ { \pi } ( s , a ) = r ( s , a ) + \gamma \mathbb { E } _ { s ^ { \prime } \sim P ( \cdot | s , a ) } [ V ^ { \pi } ( s ^ { \prime } ) ]$ .
37
+
38
+ A Robust MDP (R-MDP) is defined as a tuple $\langle S , A , r , \gamma , \mathcal { P } \rangle$ where $S , A , r$ and $\gamma$ are defined as above; ${ \mathcal { P } } ( s , a ) \subseteq { \mathcal { M } } ( S )$ is an uncertainty set where ${ \mathcal { M } } ( S )$ is the set of probability measures over next states $s ^ { \prime } \in S$ . This is interpreted as an agent selecting a state and action pair, and the next state $s ^ { \prime }$ is determined by a conditional measure $\bar { p ( s ^ { \prime } | s , a ) } \in \bar { \mathcal { P } } ( s , a )$ (Iyengar, 2005). A robust policy optimizes for the worst-case expected return objective: $\begin{array} { r } { J _ { \mathrm { R } } ( \pi ) \dot { = } \operatorname* { i n f } _ { p \in \mathcal { P } } \bar { \mathbb { E } } ^ { p , \pi } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } ] } \end{array}$ .
39
+
40
+ The robust value function is defined as $\begin{array} { r } { V _ { \mathrm { R } } ^ { \pi } ( s ) = \operatorname* { i n f } _ { p \in { \mathcal P } } \mathbb { E } ^ { p , \pi } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } | s _ { 0 } = s ] } \end{array}$ and the robust action value function as $\begin{array} { r } { Q _ { \mathrm { R } } ^ { \pi } \big ( s , a \big ) = r ( s , a ) + \gamma \operatorname* { i n f } _ { p \in { \mathcal P } } \mathbb E _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ V _ { \mathrm { R } } ^ { \pi } ( s ^ { \prime } ) ] } \end{array}$ . Both the robust Bellman operator $T _ { \mathrm { R } } ^ { \pi } : \mathcal { R } ^ { | S | } \mathcal { R } ^ { | S | }$ for a fixed policy and the optimal robust Bellman operator $T _ { \mathrm { R } } v ( s ) =$ $\mathrm { m a x } _ { \pi } T _ { \mathrm { R } } ^ { \pi } v ( s )$ have previously been shown to be contractions (Iyengar, 2005). A rectangularity assumption on the uncertainty set (Iyengar, 2005) ensures that “nature” can choose a worst-case transition function independently for every state $s$ and action $a$ .
41
+
42
+ Maximum A-Posteriori Policy Optimization (MPO) (Abdolmaleki et al., 2018a;b) is a continuous control RL algorithm that performs an expectation maximization form of policy iteration. There are two steps comprising policy evaluation and policy improvement. The policy evaluation step receives as input a policy $\pi _ { k }$ and evaluates an action-value function $Q _ { \theta } ^ { \pi _ { k } } ( s , a )$ by minimizing the squared TD error: $\begin{array} { r } { \operatorname* { m i n } _ { \theta } \big ( r _ { t } + \gamma Q _ { \hat { \theta } } ^ { \pi _ { k } } \big ( s _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi _ { k } ( \cdot | s _ { t + 1 } ) \big ) - Q _ { \theta } ^ { \pi _ { k } } ( s _ { t } , a _ { t } ) \big ) ^ { 2 } . } \end{array}$ , where $\hat { \theta }$ denotes the parameters of a target network (Mnih et al., 2015) that are periodically updated from $\theta$ . In practice we use a replay-buffer of samples in order to perform the policy evaluation step. The second step comprises a policy improvement step. The policy improvement step consists of optimizing the objective $\bar { J } ( s , \dot { \pi } ) = \mathbf { \bar { E } } _ { \pi } [ \dot { Q } _ { \theta } ^ { \pi _ { k } } ( s , a ) ]$ for states $s$ drawn from a state distribution $\mu ( s )$ In practice the state distribution samples are drawn from an experience replay. By improving $\bar { J }$ in all states $s$ , we improve our objective. To do so, a two step procedure is performed.
43
+
44
+ First, we construct a non-parametric estimate $q$ such that ${ \bar { J } } ( s , q ) \geq { \bar { J } } ( s , \pi _ { k } )$ . This is done by maximizing $\textstyle { \bar { J } } ( s , q )$ while ensuring that the solution, locally, stays close to the current policy $\pi _ { k }$ ; i.e. $\bar { \mathbb { E } } _ { \mu ( s ) } ^ { - } [ \mathbf { K L } ( q ( \cdot | s ) , \pi _ { k } ( \cdot | s ) ) ] ^ { - } < \epsilon$ . This optimization has a closed form solution given as $q ( a | s ) \propto \pi _ { k } ( a | s ) \exp Q _ { \theta } ^ { \pi _ { k } } ( s , a ) \big / \eta$ , where $\eta$ is a temperature parameter that can be computed by minimizing a convex dual function (Abdolmaleki et al. (2018b)). Second, we project this nonparametric representation back onto a parameterized policy by solving the optimization problem $\begin{array} { r } { \overline { { \pi } } _ { k + 1 } = \arg \operatorname* { m i n } _ { \pi } \mathbb { E } _ { \mu ( s ) } [ \mathrm { K L } ( q ( a | s ) \| \pi ( \bar { a } | s ) ] } \end{array}$ , where $\pi _ { k + 1 }$ is the new and improved policy and where one typically employs additional regularization (Abdolmaleki et al., 2018a). Note that this amounts to supervised learning with samples drawn fron $q ( a | s )$ ; see Abdolmaleki et al. (2018a) for details.
45
+
46
+ # 3 ROBUST MPO
47
+
48
+ To incorporate robustness into MPO, we focus on learning a worst-case value function in the policy evaluation step. Note that this policy evaluation step can be incorporated into any actor-critic algorithm. In particular, instead of optimizing the squared TD error, we optimize the worst-case squared TD error, which is defined as:
49
+
50
+ $$
51
+ \operatorname* { m i n } _ { \theta } \biggl ( r _ { t } + \gamma \operatorname* { i n f } _ { p \in \mathcal { P } ( s _ { t } , a _ { t } ) } \biggl [ Q _ { \hat { \theta } } ^ { \pi _ { k } } \bigl ( s _ { t + 1 } \sim p ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi _ { k } ( \cdot | s _ { t + 1 } ) ) \biggr ] - Q _ { \theta } ^ { \pi _ { k } } \bigl ( s _ { t } , a _ { t } \bigr ) \biggr ) ^ { 2 } \ ,
52
+ $$
53
+
54
+ where $\mathcal { P } ( s _ { t } , a _ { t } )$ is an uncertainty set for the current state $s _ { t }$ and action $a _ { t } ; \pi _ { k }$ is the current network’s policy, and $\hat { \theta }$ denotes the target network parameters. It is in this policy evaluation step (Line 3 in Algorithms 1,2 and 3 in Appendix I) that the Bellman operators in the previous sections are applied.
55
+
56
+ Relation to MPO: In MPO, this replaces the current policy evaluation step. The robust Bellman operator (Iyengar, 2005) ensures that this process converges to a unique fixed point for the policy $\pi _ { k }$ . This is achieved by repeated application of the robust Bellman operator during the policy evaluation step until convergence to the fixed point. Since the proposal policy $q ( a | s )$ (see Section 2) is proportional to the robust action value estimate $Q _ { \theta } ^ { \pi _ { k } } ( s , a )$ , it intuitively yields a robust policy as the policy is being generated from a worst-case value function. The fitting of the policy network to the proposal policy yields a robust network policy $\pi _ { k + 1 }$ .
57
+
58
+ Entropy-regularized MPO: Entropy-regularization encourages exploration and helps prevent early convergence to sub-optimal policies (Nachum et al., 2017). To incorporate these advantages, we extended the Robust Bellman operator (Iyengar, 2005) to robust and soft-robust entropy-regularized versions (See Appendix B and C respectively for a detailed overview and the corresponding derivations) and show that these operators are contraction mappings (Theorem 1 below and Theorem 2 in Appendix E) and yield a well-known value-iteration bound with respect to the max norm.
59
+
60
+ Theorem 1. The robust entropy-regularized Bellman operator $\mathcal { T } _ { R - K L } ^ { \pi }$ for a fixed policy $\pi$ is a contraction operator. Specifically: $\forall U , V \in \mathbb { R } ^ { | S | }$ and $\gamma \in ( 0 , 1 )$ , we have, $\lVert T _ { R - K L } ^ { \pi } U - T _ { R - K L } ^ { \pi } V \rVert \leq \gamma \lVert U - V \rVert$ .
61
+
62
+ In addition, we extended MPO to Robust Entropy-regularized MPO (RE-MPO) and Soft RE-MPO (SRE-MPO) (see Appendix D for a detailed overview and derivations) and show that they perform at least as well as R-MPO and in some cases significantly better. All the derivations have been deferred to the Appendix. The corresponding algorithms for R-MPO, RE-MPO and SRE-MPO can be found in Appendix I.
63
+
64
+ # 4 EXPERIMENTS
65
+
66
+ We now present experiments on nine different continuous control domains (four of which we show in the paper and the rest can be found in Appendix H.4) from the DeepMind control suite (Tassa et al., 2018). In addition, we present an experiment on a high-dimensional dexterous, robotic hand called Shadow hand (ShadowRobot, 2019). In our experiments, we found that the entropy-regularized version of Robust MPO had similar performance and in some cases, slightly better performance than the expected return version of Robust MPO without entropy-regularization. We therefore decided to include experiments of our agent optimizing the entropy-regularized objective (non-robust, robust and soft-robust versions). This corresponds to (a) non-robust E-MPO baseline, (b) Robust E-MPO (REMPO) and (c) Soft-Robust E-MPO (SRE-MPO). From hereon in, it is assumed that the algorithms optimize for the entropy-regularized objective unless otherwise stated.
67
+
68
+ Appendix: In Appendix H.4, we present results of our agent optimizing for the expected return objective without entropy regularization (for the non-robust, robust and soft-robust versions). This corresponds to (a’) non-robust MPO baseline, (b’) R-MPO and (c’) SR-MPO.
69
+
70
+ The experiments are divided into three sections. The first section details the setup for robust and soft-robust training. The next section compares robust and soft-robust performance to the non-robust MPO baseline in each of the domains. The final section is a set of investigative experiments to gain additional insights into the performance of the robust and soft-robust agents.
71
+
72
+ Setup: For each domain, the robust agent is trained using a pre-defined uncertainty set consisting of three task perturbations 1. Each of the three perturbations corresponds to a particular perturbation of the Mujoco domain. For example, in Cartpole, the uncertainty set consists of three different pole lengths. Both the robust and non-robust agents are evaluated on a test set of three unseen task perturbations. In the Cartpole example, this would correspond to pole lengths that the agent has not seen during training. The chosen values of the uncertainty set and evaluation set for each domain can be found in Appendix H.3. Note that it is common practice to manually select the pre-defined uncertainty set and the unseen test environments. Practitioners often have significant domain knowledge and can utilize this when choosing the uncertainty set (Derman & Mannor, 2019; Derman et al., 2018; Di Castro et al., 2012; Mankowitz et al., 2018a; Tamar et al., 2014).
73
+
74
+ During training, the robust, soft-robust and non-robust agents act in an unperturbed environment which we refer to as the nominal environment. During the TD learning update, the robust agent calculates an infimum between Q values from each next state realization for each of the uncertainty set task perturbations (the soft-robust agent computes an average, which corresponds to a uniform distribution over $\mathcal { P }$ , instead of an infimum). Each transition model is a different instantiation of the Mujoco task. The robust and soft-robust agents are exposed to more state realizations than the non-robust agent. However, as we show in our ablation studies, significantly increasing the number of samples and the diversity of the samples for the non-robust agent still results in poor performance compared to the robust and soft-robust agents.
75
+
76
+ # 4.1 MAIN EXPERIMENTS
77
+
78
+ Mujoco Domains: We compare the performance of non-robust MPO to the robust and soft-robust variants. Each training run consists of $3 0 k$ episodes and the experiments are repeated 5 times. In the bar plots, the y-axis indicates the average reward (with standard deviation) and the $\mathbf { X }$ -axis indicates different unseen evaluation environment perturbations starting from the first perturbation (Env0) onwards. Increasing environment indices correspond to increasingly large perturbations. For example, in Figure 1 (top left), Env0, Env1 and Env2 for the Cartpole Balance task represents the pole perturbed to lengths of 2.0, 2.2 and 2.3 meters respectively. Figure 1 shows the performance of three Mujoco domains (The remaining six domains are in Appendix H.4). The bar plots indicate the performance of E-MPO (red), RE-MPO (blue) and SRE-MPO (green) on the held-out test perturbations. This color scheme is consistent throughtout the experiments unless otherwise stated. As can be seen in each of the figures, RE-MPO attains improved performance over E-MPO. This same trend holds true for all nine domains. SRE-MPO outperforms the non-robust baseline in all but the Cheetah domain, but is not able to outperform RE-MPO. An interesting observation can be seen in the video for the Walker walk task (https://sites.google.com/view/robust-rl), where the RE-MPO agent learns to ‘drag’ its leg which is a fundamentally different policy to that of the non-robust agent which learns a regular gait movement.
79
+
80
+ ![](images/384f20c1bb9060876ccdefc2195d502b5f069065e092a1a2a283a73a2f88b6e3.jpg)
81
+ Figure 1: Three domains showing RE-MPO (blue), SRE-MPO (green) and E-MPO (red). The addition six domains can be found in the appendix. In addition, the results for R-MPO, SR-MPO and MPO can be found in Appendix H.4 with similar results.
82
+
83
+ ![](images/6e886f4e6e1cb347581d6cc6c26492a6e9a0a2bd68e595a44c73ab34737af797.jpg)
84
+ Figure 2: (1) The Shadow hand domain (left) and results for RE-MPO and E-MPO (middle left). (2) A larger test set: the figures show the performance of RE-MPO (blue), SRE-MPO (green) and E-MPO (red) for a test set that extends from the nominal environment to significant perturbations outside the training set for Cartpole Balance (middle right) and Pendulum Swingup (right).
85
+
86
+ Appendix: The appendix contains additional experiments with the non entropy-regularized versions of the algorithms where again the robust (R-MPO) and soft robust (SR-MPO) versions of MPO outperform the non-robust version (MPO).
87
+
88
+ Shadow hand domain: This domain consists of a dexterous, simulated robotic hand called Shadow hand whose goal is to rotate a cube into a pre-defined orientation (ShadowRobot, 2019). The state space is a 79 dimensional vector and consisting of angular positions and velocities, the cube orientation and goal orientation. The action space is a 20 dimensional vector and consisting of the desired angular velocity of the hand actuators. The reward is a function of the current orientation of the cube relative to the desired orientation. The uncertainty set consists of three models which correspond to increasingly smaller sizes of the cube that the agent needs to orientate. The agent is evaluated on a different, unseen holdout set. The values can be found in Appendix H.3. We compare RE-MPO to E-MPO trained agents. Episodes are 200 steps long corresponding to approximately 10 seconds of interaction. Each experiment is run for $6 k$ episodes and is repeated 5 times. As seen in Figure 2, RE-MPO outperforms E-MPO, especially as the size of the cube decreases (from Env0 to Env2). This is an especially challenging problem due to the high-dimensionality of the task. As seen in the videos (https://sites.google.com/view/robust-rl), the RE-MPO agent is able to manipulate significantly smaller cubes than it had observed in the nominal simulator.
89
+
90
+ ![](images/8a74b7d1a2447fc73db5b81504a2d8cb11dfc6af9a2f9422b2110731b27c3af7.jpg)
91
+ Figure 3: (1) Domain Randomization (DR): Domain randomization performance for the Cartpole balance (left) and Pendulum swingup (middle left) tasks. 3 (2) Stochastic Value Gradients (SVG): Two right images show the performance of Robust Entropy-regularized SVG (RE-SVG) and SRE-SVG compared to E-SVG for Pendulum and Cartpole respectively.
92
+
93
+ # 4.2 INVESTIGATIVE EXPERIMENTS
94
+
95
+ This section aims to investigate and try answer various questions that may aid in explaining the performance of the robust and non-robust agents respectively. Each investigative experiment is conducted on the Cartpole Balance and Pendulum Swingup domains.
96
+
97
+ What if we increase the number of training samples? One argument is that the robust agent has access to more samples since it calculates the Bellman update using the infimum of three different environment realizations. To balance this is effect, the non-robust agent was trained for three times more episodes than the robust agents. Training with significantly more samples does not increase the performance of the non-robust agent and, can even decreases the performance, as a result of overfitting to the nominal domain. See Appendix H.5, Figure 12 for the results.
98
+
99
+ What about Domain Randomization? A subsequent point would be that the robust agent sees more diverse examples compared to the non-robust agent from each of the perturbed environments. We therefore trained the non-robust agent in a domain randomization setting (Andrychowicz et al., 2018; Peng et al., 2018). We compare our method to two variants of DR. The first variant Limited-DR uses the same perturbations as in the uncertainty set of RE-MPO. Here, we compare which method better utilizes a limited set of perturbations to learn a robust policy. As seen in Figure 3 (left and middle left for Carpole Balance and Pendulum Swingup respectively), RE-MPO yields significantly better performance given the limited set of perturbations. The second variant Full-DR performs regular DR on a significantly larger set of 100 perturbations in the Pendulum Swingup task. In this setting, DR, which uses 30 times more perturbations, improves but still does not outperform RE-MPO (which still only uses three perturbations). This result can be seen in Figure 13, Appendix H.5.
100
+
101
+ What is the intuitive difference between DR and RE-MPO/SRE-MPO? DR defines the loss to be the expectation of TD-errors over the uncertainty set. Each TD error is computed using a state, action, reward, next state $< s , a , r , s ^ { \prime } >$ trajectory from a particular perturbed environment, (selected uniformly from the uncertainty set). These TD errors are then averaged together. This is a form of data augmentation and the resulting behaviour is the average across all of this data. RE-MPO/SREMPO: In the case of robustness, the TD error is computed such that the target action value function is computed as a worst case value function with respect to the uncertainty set. This means that the learned policy is explicitly searching for adversarial examples during training to account for worst-case performance. In the soft-robust case, the subtle yet important difference (as seen in the experiments) with DR is that the TD loss is computed with the average target action value function with respect to next states (as opposed to averaging the TD errors of each individual perturbed environment as in DR). This results in different gradient updates being used to update the action value function compared to DR.
102
+
103
+ A larger test set: It is also useful to view the performance of the agent from the nominal environment to increasingly large perturbations in the unseen test set (see Appendix H.3 for values). These graphs can be seen in Figure 2 for Cartpole Balance and Pendulum Swingup respectively. As expected, the robust agent maintains a higher level of performance compared to the non-robust agent. Initially, the soft-robust agent outperforms the robust agent, but its performance degrades as the perturbations increase which is consistent with the results of Derman et al. (2018). In addition, the robust and soft-robust agents are competitive with the non-robust agent in the nominal environment.
104
+
105
+ ![](images/23373fd48aa27095e75cd836182bfdd09759019f52e4ed4e271021340eab7701.jpg)
106
+ Figure 4: Modifying the uncertainty set: Pendulum Swingup when modifying the third perturbation of the uncertainty set to values of 1.2 (left), 1.3 (middle) and 2.0 (right) meters respectively.
107
+
108
+ Modifying the uncertainty set: We now evaluate the performance of the agent for different uncertainty sets. For Pendulum Swingup, the original uncertainty set values of the pendulum arm are 1.0, 1.1 and 1.4 meters. We modified the final perturbation to values of 1.2, 1.3 and 2.0 meters respectively. The agent is evaluated on unseen lengths of 1.5, 1.6 and 1.7 meters. An increase in performance can be seen in Figure 4 as the third perturbation approaches that of the unseen evaluation environments. Thus it appears that if the agent is able to approximately capture the dynamics of the unseen test environments within the training set, then the robust agent is able to adapt to the unseen test environments. The results for cartpole balance can be seen in Appendix H.5, Figure 14.
109
+
110
+ What about incorporating Robustness into other algorithms? To show the generalization of this robustness approach, we incorporate it into the critic of the Stochastic Value Gradient (SVG) continuous control RL algorithm (See Appendix H.1). As seen in Figure 3, Robust Entropy-regularized SVG (RE-SVG) and Soft RE-SVG (SRE-SVG) significantly outperform the non-robust Entropyregularized SVG (E-SVG) baseline in both Cartpole and Pendulum.
111
+
112
+ Robust entropy-regularized return vs. robust expected return: When comparing the robust entropy-regularized return performance to the robust expected return, we found that the entropyregularized return appears to do no worse than the expected return. In some cases, e.g., Cheetah, the entropy-regularized objective performs significantly better (see Appendix H.5, Figure 11).
113
+
114
+ Different Nominal Models: In this paper the nominal model was always chosen as the smallest perturbation parameter value from the uncertainty set. This was done to highlight the strong performance of robust policies to increasingly large environment perturbations. However, what if we set the nominal model as the median or largest perturbation with respect to the chosen uncertainty set for each agent? As seen in Appendix H.5, Figure 15, the closer (further) the nominal model is to (from) the holdout set, the better (worse) the performance of the non-robust agent. However, in all cases, the robust agent still performs at least as well as (and sometimes better than) the non-robust agent.
115
+
116
+ What about learning the uncertainty set from offline data? In real-world settings, such as robotics and industrial control centers (Gao, 2014), there may be a nominal simulator available as well as offline data captured from the real-world system(s). These data could be used to train transition models to capture the dynamics of the task at hand. For example, a set of robots in a factory might each be performing the same task, such as picking up a box. In industrial control cooling centers, there are a number of cooling units in each center responsible for cooling the overall system. In both of these examples, each individual robot and cooling unit operate with slightly different dynamics due to slight fluctuations in the specifications of the designed system, wear-and-tear as well as sensor calibration errors. As a result, an uncertainty set of transition models can be trained from data generated by each robot or cooling unit.
117
+
118
+ However, can we train a set of transition models from these data, utilize them as the uncertainty set in R-MPO and still yield robust performance when training on a nominal simulator? To answer this question, we mimicked the above scenarios by generating datasets for the Cartpole Swingup and the Pendulum swingup tasks. For Cartpole swingup, we varied the length of the pole and generated a dataset for each pole length. For Pendulum Swingup, we varied the mass of the pole and generated the corresponding datasets. We then trained transition models on increasingly large data batches ranging from 100 to one million datapoints for each pole length and pole mass respectively. We then utilized each set of transition models for different data batch sizes as the uncertainty set and ran R-MPO on each task. We term this variant of R-MPO, Data-Driven Robust MPO (DDR-MPO). The results can be seen in Figure 5. There are a number of interesting observations from this analysis. (1) As expected, on small batches of data, the models are too inaccurate and result in poor performance. (2) An interesting insight is that as the data batch size increases, DDR-MPO starts to outperform R-MPO, especially for increasingly large perturbations. The hypothesis here is that due to the transition models being more accurate, but not perfect, adversarial examples are generated in a small region around the nominal next state observation, yielding an increasingly robust agent. (3) As the batch size increases further, and the transition models get increasingly close to the ground truth models, DDR-MPO converges to the performance of R-MPO.
119
+
120
+ ![](images/fbd9c441b405815d2c53a8e30ae012f506db5576f4e138fc4580801b9e35e699.jpg)
121
+ Figure 5: Training uncertainty sets of transition models on different batch sizes of offline data. The performance of Data Driven R-MPO (DDR-MPO) can be seen in the figures above for Cartpole Swingup (left) and Pendulum Swingup (right) respectively.
122
+
123
+ # 5 RELATED WORK
124
+
125
+ From a theoretical perspective, Robust Bellman operators were introduced in (Iyengar, 2005; Nilim & Ghaoui, 2005; Wiesemann et al., 2013; Hansen & Sargent, 2011; Tamar et al., 2014). Our theoretical work extends this operator to the entropy regularized setting, for both the robust and soft-robust formulation, and modifies the MPO optimization formulation accordingly. A more closely related work from a theoretical perspective is that of Grau-Moya et al. (2016) who introduces a formulation for robustness to model misspecification. This work is a special case of robust MDPs where they introduce a robust Bellman operator that regularizes the immediate reward with two KL terms; one entropy term capturing model uncertainty with respect to a base model, and the other term being entropy regularization with respect to a base policy. Our work differs from this work in a number of respects: (1) Their uncertainty set is represented by a KL constraint which has the effect of restricting the set of admissible transition models. Our setup does not have these restrictions. (2) The uncertainty set elements from Grau-Moya et al. (2016) output a probability distribution over model parameter space whereas the uncertainty set elements in our formulation output a distribution over next states.
126
+
127
+ Mankowitz et al. (2018a) learn robust options, also known as temporally extended actions (Sutton et al., 1999), using policy gradient. Robust solutions tend to be overly conservative. To combat this, Derman et al. (2018) extend the actor-critic two-timescale stochastic approximation algorithm to a ‘soft-robust’ formulation to yield a less, conservative solution. Di Castro et al. (2012) introduce a robust implementation of Deep Q Networks (Mnih et al., 2015). Domain Randomization (DR) (Andrychowicz et al., 2018; Peng et al., 2018) is a technique whereby an agent trains on different perturbations of the environment. The agent batch averages the learning error of these different perturbed trajectories together to yield an agent that is robust to environment perturbations. This can be viewed as a data augmentation technique where the resulting behaviour is the average across all of the data. There are also works that look into robustness to action stochasticity (Fox et al., 2015; Braun et al., 2011; Rubin et al., 2012).
128
+
129
+ # 6 CONCLUSION
130
+
131
+ We have presented a framework for incorporating robustness - to perturbations in the transition dynamics, which we refer to as model misspecification - into continuous control RL algorithms. This framework is suited to continuous control algorithms that learn a value function, such as an actor critic setup. We specifically focused on incorporating robustness into MPO as well as our entropyregularized version of MPO (E-MPO). In addition, we presented an experiment which incorporates robustness into the SVG algorithm. From a theoretical standpoint, we adapted MPO to an entropyregularized version (E-MPO); we then incorporated robustness into the policy evaluation step of both algorithms to yield Robust MPO (R-MPO) and Robust E-MPO (RE-MPO) as well as the soft-robust variants (SR-MPO/SRE-MPO). This was achieved by deriving the corresponding robust and softrobust entropy-regularized Bellman operators to ensure that the policy evaluation step converges in each case. We have extensive experiments showing that the robust versions outperform the non-robust counterparts on nine Mujoco domains as well as a high-dimensional dexterous, simulated robotic hand called Shadow hand (ShadowRobot, 2019). We also provide numerous investigative experiments to understand the robust and soft-robust policy in more detail. This includes an experiment showing improved robust performance over R-MPO when using an uncertainty set of transition models learned from offline data.
132
+
133
+ # REFERENCES
134
+
135
+ Abbas Abdolmaleki, Jost Tobias Springenberg, Jonas Degrave, Steven Bohez, Yuval Tassa, Dan Belov, Nicolas Heess, and Martin A. Riedmiller. Relative entropy regularized policy iteration. CoRR, abs/1812.02256, 2018a. URL http://arxiv.org/abs/1812.02256.
136
+ Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos, Nicolas Heess, and Martin Riedmiller. Maximum a posteriori policy optimisation. arXiv preprint arXiv:1806.06920, 2018b.
137
+ Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, et al. Learning dexterous in-hand manipulation. arXiv preprint arXiv:1808.00177, 2018.
138
+ Daniel A. Braun, Pedro A. Ortega, Evangelos Theodorou, and Stefan Schaal. Path integral control and bounded rationality. 2011 IEEE Symposium on Adaptive Dynamic Programming and Reinforcement Learning (ADPRL), pp. 202–209, 2011.
139
+ Paul F. Christiano, Zain Shah, Igor Mordatch, Jonas Schneider, Trevor Blackwell, Joshua Tobin, Pieter Abbeel, and Wojciech Zaremba. Transfer from simulation to real world through learning deep inverse dynamics model. CoRR, abs/1610.03518, 2016. URL http://arxiv.org/abs/ 1610.03518.
140
+ Esther Derman, Daniel J Mankowitz, Timothy A Mann, and Shie Mannor. Soft-robust actor-critic policy-gradient. arXiv preprint arXiv:1803.04848, 2018.
141
+ Mankowitz Daniel J Mann Timothy A Derman, Esther and Shie Mannor. A bayesian approach to robust reinforcement learning. In Association for Uncertainty in Artificial Intelligence, 2019.
142
+ Coline Devin, Abhishek Gupta, Trevor Darrell, Pieter Abbeel, and Sergey Levine. Learning modular neural network policies for multi-task and multi-robot transfer. 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 2169–2176, 2017.
143
+ Dotan Di Castro, Aviv Tamar, and Shie Mannor. Policy gradients with variance related risk criteria. arXiv preprint arXiv:1206.6404, 2012.
144
+ Yan Duan, Xi Chen, Rein Houthooft, John Schulman, and Pieter Abbeel. Benchmarking deep reinforcement learning for continuous control. In ICML, 2016.
145
+ Gabriel Dulac-Arnold, Daniel J. Mankowitz, and Todd Hester. Challenges of real-world reinforcement learning. CoRR, abs/1904.12901, 2019. URL http://arxiv.org/abs/1904.12901.
146
+ Roy Fox, Ari Pakman, and Naftali Tishby. G-learning: Taming the noise in reinforcement learning via soft updates. CoRR, abs/1512.08562, 2015. URL http://arxiv.org/abs/1512.08562.
147
+ Jim Gao. Machine learning applications for data center optimization. 2014.
148
+ Jordi Grau-Moya, Felix Leibfried, Tim Genewein, and Daniel A. Braun. Planning with informationprocessing constraints and model uncertainty in markov decision processes. CoRR, abs/1604.02080, 2016. URL http://arxiv.org/abs/1604.02080.
149
+ Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft actor-critic algorithms and applications. CoRR, abs/1812.05905, 2018.
150
+
151
+ Lars Peter Hansen and Thomas Sargent. Robustness. Princeton University Press, 11 2011. ISBN 9780691114422.
152
+
153
+ Nicolas Heess, Gregory Wayne, David Silver, Tim Lillicrap, Tom Erez, and Yuval Tassa. Learning continuous control policies by stochastic value gradients. In Advances in Neural Information Processing Systems 28 (NIPS). 2015a.
154
+
155
+ Nicolas Heess, Gregory Wayne, David Silver, Timothy Lillicrap, Tom Erez, and Yuval Tassa. Learning continuous control policies by stochastic value gradients. In Advances in Neural Information Processing Systems, pp. 2944–2952, 2015b.
156
+
157
+ Garud N Iyengar. Robust dynamic programming. Mathematics of Operations Research, 30(2): 257–280, 2005.
158
+
159
+ Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, and Sergey Levine. Scalable deep reinforcement learning for vision-based robotic manipulation. In CoRL, 2018.
160
+
161
+ Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
162
+
163
+ Daniel J Mankowitz, Timothy A Mann, Pierre-Luc Bacon, Doina Precup, and Shie Mannor. Learning robust options. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018a.
164
+
165
+ Daniel J. Mankowitz, Augustin Zídek, André Barreto, Dan Horgan, Matteo Hessel, John Quan, Junhyuk Oh, Hado van Hasselt, David Silver, and Tom Schaul. Unicorn: Continual learning with a universal, off-policy agent. CoRR, abs/1802.08294, 2018b. URL http://arxiv.org/abs/ 1802.08294.
166
+
167
+ Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, 2015.
168
+
169
+ Ofir Nachum, Mohammad Norouzi, Kelvin Xu, and Dale Schuurmans. Bridging the gap between value and policy based reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2775–2785, 2017.
170
+
171
+ Arnab Nilim and Laurent El Ghaoui. Robust control of markov decision processes with uncertain transition matrices. Operations Research, 53:780–798, 2005.
172
+
173
+ Xue Bin Peng, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Sim-to-real transfer of robotic control with dynamics randomization. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 1–8. IEEE, 2018.
174
+
175
+ Divyam Rastogi, Ivan Koryakovskiy, and Jens Kober. Sample-efficient reinforcement learning via difference models. In Machine Learning in Planning and Control of Robot Motion Workshop at ICRA, 2018.
176
+
177
+ Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the 31st International Conference on Machine Learning (ICML), 2014.
178
+
179
+ Martin A. Riedmiller, Roland Hafner, Thomas Lampe, Michael Neunert, Jonas Degrave, Tom Van de Wiele, Volodymyr Mnih, Nicolas Heess, and Jost Tobias Springenberg. Learning by playing - solving sparse reward tasks from scratch. In ICML, 2018.
180
+
181
+ Jonathan Rubin, Ohad Shamir, and Naftali Tishby. Trading value and information in mdps. 2012.
182
+
183
+ Andrei A. Rusu, Sergio Gomez Colmenarejo, Çaglar Gülçehre, Guillaume Desjardins, James Kirkpatrick, Razvan Pascanu, Volodymyr Mnih, Koray Kavukcuoglu, and Raia Hadsell. Policy distillation. CoRR, abs/1511.06295, 2016.
184
+
185
+ John Schulman, Xi Chen, and Pieter Abbeel. Equivalence between policy gradients and soft q-learning. arXiv preprint arXiv:1704.06440, 2017.
186
+
187
+ ShadowRobot. ShadowRobot Dexterous Hand. https://www.shadowrobot. com/wp-content/uploads/shadow_dexterous_hand_technical specification_E_20190221.pdf, 2019. [Online; accessed 25-September-2019].
188
+
189
+ Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. MIT Press, 1998. URL http://www-anw.cs.umass.edu/\~rich/book/the-book.html.
190
+
191
+ Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018.
192
+
193
+ Richard S Sutton, Doina Precup, and Satinder Singh. Between mdps and semi-mdps: A framework for temporal abstraction in reinforcement learning. Artificial intelligence, 112(1-2):181–211, 1999.
194
+
195
+ Aviv Tamar, Shie Mannor, and Huan Xu. Scaling up robust mdps using function approximation. In International Conference on Machine Learning, pp. 181–189, 2014.
196
+
197
+ Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, Timothy P. Lillicrap, and Martin A. Riedmiller. Deepmind control suite. CoRR, abs/1801.00690, 2018. URL http://arxiv.org/abs/ 1801.00690.
198
+
199
+ Yee Whye Teh, Victor Bapst, Wojciech Czarnecki, John Quan, James Kirkpatrick, Raia Hadsell, Nicolas Heess, and Razvan Pascanu. Distral: Robust multitask reinforcement learning. In NIPS, 2017.
200
+
201
+ Chen Tessler, Shahar Givony, Tom Zahavy, Daniel J. Mankowitz, and Shie Mannor. A deep hierarchical approach to lifelong learning in minecraft. CoRR, abs/1604.07255, 2016. URL http://arxiv.org/abs/1604.07255.
202
+
203
+ Wolfram Wiesemann, Daniel Kuhn, and Berç Rustem. Robust markov decision processes. Math. Oper. Res., 38(1):153–183, February 2013. ISSN 0364-765X. doi: 10.1287/moor.1120.0566. URL http://dx.doi.org/10.1287/moor.1120.0566.
204
+
205
+ Markus Wulfmeier, Ingmar Posner, and Pieter Abbeel. Mutual alignment transfer learning. arXiv preprint arXiv:1707.07907, 2017.
206
+
207
+ # A BACKGROUND
208
+
209
+ Entropy-regularized Reinforcement Learning: Entropy regularization encourages exploration and helps prevent early convergence to sub-optimal policies (Nachum et al., 2017). We make use of the relative entropy-regularized RL objective defined as $J _ { \mathrm { K L } } ( \pi ; \bar { \pi } ) = \mathbb { E } ^ { \pi } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } ( r _ { t } -$ $\tau \mathrm { K L } \left( \pi ( \cdot | s _ { t } ) \| \bar { \pi } ( \cdot | s _ { t } ) ) \right) \rfloor$ where $\tau$ is a temperature parameter and $\mathrm { K L } \left( \pi ( \cdot | s _ { t } ) \| \bar { \pi } ( \cdot | s _ { t } ) \right)$ is the KullbackLeibler (KL) divergence between the current policy $\pi$ and a reference policy $\bar { \pi }$ given a state $s _ { t }$ (Schulman et al., 2017). The entropy-regularized value function is defined as $V _ { \mathrm { K L } } ^ { \pi } ( s ; \bar { \pi } ) =$ $\begin{array} { r } { \mathbb { E } ^ { \pi } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } ( r _ { t } - \tau \mathrm { K L } \left( \pi ( \cdot | s _ { t } ) \| \bar { \pi } ( \cdot | s _ { t } ) \right) ) \bar { | } s _ { 0 } = s ] } \end{array}$ KL. Intuitively, augmenting the rewards with the KL term regularizes the policy by forcing it to be ‘close’ in some sense to the base policy.
210
+
211
+ # B ROBUST ENTROPY-REGULARIZED BELLMAN OPERATOR
212
+
213
+ (Relative-)Entropy regularization has been shown to encourage exploration and prevent early convergence to sub-optimal policies (Nachum et al., 2017). To take advantage of this idea when developing a robust RL algorithm we extend the robust Bellman operator to a robust entropy regularized Bellman operator and prove that it is a contraction.4 We also show that well-known value iteration bounds can be attained using this operator. We first define the robust entropy-regularized value function as $\begin{array} { r } { V _ { \mathrm { R - K L } } ^ { \pi } ( s ; \bar { \pi } ) = \mathbb { E } _ { a \sim \pi ( \cdot | s ) } [ r ( s , a ) - \tau \log { \frac { \pi ( \cdot | s ) } { \bar { \pi } ( \cdot | s ) } } + \gamma \operatorname* { i n f } _ { p \in \mathcal { P } } \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot | s , a ) } [ V _ { \mathrm { R - K L } } ^ { \pi } ( s ^ { \prime } ; \bar { \pi } ) ] ] } \end{array}$ . For the remainder of this section, we drop the sub-and superscripts, as well as the reference policy conditioning, from the value function $V _ { \mathrm { R - K L } } ^ { \pi } ( s ; \bar { \pi } )$ , and simply represent it as $V ( s )$ for brevity. We define the robust entropy-regularized Bellman operator for a fixed policy $\pi$ in Equation 2, and show it is a max norm contraction (Theorem 1).
214
+
215
+ $$
216
+ \begin{array} { r l r } { \mathcal { T } _ { \mathrm { R \mathrm { - } K L } } ^ { \pi } V ( s ) } & { = } & { \mathbb { E } _ { a \sim \pi ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \pi ( \cdot \vert s ) } { \bar { \pi } ( \cdot \vert s ) } + \gamma \operatorname* { i n f } _ { p \in \mathcal { P } } \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ V ( s ^ { \prime } ) ] ] \enspace , } \end{array}
217
+ $$
218
+
219
+ Theorem 1. The robust entropy-regularized Bellman operator $\mathcal { T } _ { R - K L } ^ { \pi }$ for a fixed policy $\pi$ is a contraction operator. Specifically: $\forall U , V \in \mathbb { R } ^ { | S | }$ and $\gamma \in ( 0 , 1 )$ , we have, $\lVert T _ { R - K L } ^ { \pi } U - T _ { R - K L } ^ { \pi } V \rVert \leq \gamma \lVert U - V \rVert$
220
+
221
+ The proof can be found in the (Appendix E, Theorem 1). Using the optimal robust entropy-regularized Bellman operator $T _ { \mathrm { R - K L } } = \operatorname* { s u p } _ { \pi } T _ { \mathrm { R - K L } } ^ { \pi }$ , which is shown to also be a contraction operator in Appendix E, Theorem 2, a standard value iteration error bound can be derived (Appendix $\mathrm { E }$ , Corollary 1).
222
+
223
+ # C Soft-ROBUST ENTROPY-REGULARIZED BELLMAN OPERATOR
224
+
225
+ In this section, we derive a soft-robust entropy-regularized Bellman operator and show that it is also a $\gamma$ -contraction in the max norm. First, we define the average transition model as $\bar { p } = \mathbb { E } ^ { p \sim w } [ p ]$ which corresponds to the average transition model distributed according to some distribution $w$ over the uncertainty set $\mathcal { P }$ . This average transition model induces an average stationary distribution (see Derman et al. (2018)). The soft-robust entropy-regularized value function is defined as $\begin{array} { r } { V _ { \mathrm { S R - K L } } ^ { \pi } ( s ; \bar { \pi } ) = \mathbb { E } _ { a \sim \pi ( \cdot | s ) } [ r ( s , a ) - \tau \log { \frac { \pi ( \cdot | s ) } { \bar { \pi } ( \cdot | s ) } } ] + \gamma \mathbb { E } _ { s ^ { \prime } \sim \bar { p } ( \cdot | s , a ) } [ V _ { \mathrm { S R - K L } } ^ { \pi } ( s ^ { \prime } ; \bar { \pi } ) ] } \end{array}$ . Again, for ease of notation, we denote $V _ { \mathrm { S R - K L } } ^ { \pi } ( s ; \bar { \pi } ) = V ( s )$ for the remainder of the section. The soft-robust entropyregularized Bellman operator for a fixed policy $\pi$ is defined as:
226
+
227
+ $$
228
+ \begin{array} { r l r } { \mathcal { T } _ { \mathrm { S R - K L } } ^ { \pi } V ( s ) } & { = } & { \mathbb { E } _ { a \sim \pi ( \cdot | s ) } [ r ( s , a ) - \tau \log \frac { \pi ( \cdot | s ) } { \overline { { \pi } } ( \cdot | s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim \overline { { p } } ( \cdot | s , a ) } [ V ( s ^ { \prime } ) ] ] \enspace , } \end{array}
229
+ $$
230
+
231
+ which is also a contraction mapping (see Appendix F, Theorem 3) and yields the same bound as Corollary 1 for the optimal soft-robust Bellman operator derived in Appendix F, Theorem 4.
232
+
233
+ # D ROBUST ENTROPY-REGULARIZED POLICY EVALUATION
234
+
235
+ To extend Robust policy evaluation to robust entropy-regularized policy evaluation, two key steps need to be performed: (1) optimize for the entropy-regularized expected return as opposed to the regular expected return and modify the TD update accordingly; (2) Incorporate robustness into the entropy-regularized expected return and modify the entropy-regularized TD update. To achieve (1), we define the entropy-regularized expected return as $Q _ { \mathrm { K L } } ^ { \bar { \pi } _ { k } } ( s , a ; \bar { \pi } ) ~ =$ $\boldsymbol { r } ( s , a ) - \tau \mathrm { K L } ( \pi _ { k } ( \cdot | s ) | | \bar { \boldsymbol { \pi } } ( \cdot | s ) ) + \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot | s , a ) } [ \hat { V } _ { \mathrm { K L } } ^ { \bar { \pi } _ { k } } ( \bar { s ^ { \prime } } ; \bar { \boldsymbol { \pi } } ) ]$ , and show in Appendix G that performing policy evaluation with the entropy-regularized value function is equivalent to optimizing the entropy-regularized squared TD error (same as Eq. equation 4, only omitting the inf operator). To achieve (2), we optimize for the robust entropy regularized expected return objective defined as $\begin{array} { r } { Q _ { \mathrm { R - K L } } ^ { \pi _ { k } } ( s , a ; \bar { \pi } ) = \bar { r ( \boldsymbol { s } , a ) } - \tau \mathrm { K L } ( \pi _ { k } ( \cdot | \boldsymbol { s } ) | | \bar { \pi } ( \cdot | \boldsymbol { s } ) ) + \operatorname* { i n f } _ { p \in \mathcal { P } } \mathbb { E } _ { \boldsymbol { s } ^ { \prime } \sim p ( \cdot | \boldsymbol { s } , a ) } [ V _ { \mathrm { R - K L } } ^ { \pi _ { k } } ( \boldsymbol { s } ^ { \prime } ; \bar { \boldsymbol { \pi } } ) ] } \end{array}$ , yielding the robust entropy-regularized squared TD error:
236
+
237
+ $$
238
+ \begin{array} { r l } & { \underset { \theta } { \mathrm { m i n } } \Bigg ( r _ { t } + \gamma \underset { p \in \mathcal { P } ( s _ { t } , a _ { t } ) } { \mathrm { i n f } } \left[ \widetilde { Q } _ { \mathbb { R } \times \mathrm { K L } , \tilde { \theta } } ^ { \pi _ { k } } ( s _ { t + 1 } \sim p ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi _ { k } ( \cdot | s _ { t + 1 } ) ; \bar { \pi } ) \right. } \\ & { ~ \left. ~ - \tau \mathbf { K L } \big ( \pi _ { k } ( \cdot | s _ { t + 1 } \sim p ( \cdot | s _ { t } , a _ { t } ) ) \| \bar { \pi } ( \cdot | s _ { t + 1 } \sim p ( \cdot | s _ { t } , a _ { t } ) ) \big ) \right] - \widetilde { Q } _ { \mathrm { R } \times \mathrm { K L } , \theta } ^ { \pi _ { k } } ( s _ { t } , a _ { t } ; \bar { \pi } ) \Bigg ) ^ { 2 } , } \end{array}
239
+ $$
240
+
241
+ where $Q _ { \mathrm { R - K L } } ^ { \pi _ { k } } ( s , a ; \bar { \pi } ) = \widetilde Q _ { \mathrm { R - K L } } ^ { \pi _ { k } } ( s , a ; \bar { \pi } ) - \tau { \bf K L } ( \pi _ { k } ( \cdot | s ) \| \bar { \pi } ( \cdot | s ) )$ . For the soft-robust setting, we remove the infimum from the TD update and replace the next state transition function $p ( \cdot | s _ { t } , a _ { t } )$ with the average next state transition function $\bar { p } ( \cdot | s _ { t } , a _ { t } )$ .
242
+
243
+ Relation to MPO: As in the previous section, this step replaces the policy evaluation step of MPO. Our robust entropy-regularized Bellman operator $T _ { \mathrm { R - K L } } ^ { \pi _ { k } }$ and soft-robust entropy-regularized Bellman operator $T _ { \mathrm { S R - K L } } ^ { \pi _ { k } }$ ensures that this process converges to a unique fixed point for the policy $\pi _ { k }$ for the robust and soft-robust cases respectively. We use $\pi _ { k - 1 }$ as the reference policy . The pseudo code for the R-MPO, RE-MPO and Soft-Robust Entropy-regularized MPO (SRE-MPO) algorithms can be found in Appendix I (Algorithms 1, 2 and 3 respectively).
244
+
245
+ # E PROOFS
246
+
247
+ # Theorem 1.
248
+
249
+ Proof. We follow the proofs from (Tamar et al., 2014; Iyengar, 2005), and adapt them to account for the additional entropy regularization for a fixed policy $\pi$ . Let $U , V \in \mathbb { R } ^ { | S | }$ , and $s \in S$ an arbitrary state. Assume ${ \mathcal { T } } _ { \mathrm { R - K L } } ^ { \pi } { \bar { U } } ( s ) { \bar { \ } } \geq { \mathcal { T } } _ { \mathrm { R - K L } } ^ { \pi } V ( s )$ . Let $\epsilon > 0$ be an arbitrary positive number.
250
+
251
+ By the definition of the inf operator, there exists $p _ { s } \in \mathcal { P }$ such that,
252
+
253
+ $$
254
+ \begin{array} { r l } & { \mathbb { E } _ { a \sim \pi ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \pi ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p _ { s } ( \cdot \vert s , a ) } [ V ( s ^ { \prime } ) ] ] } \\ & { \qquad < \displaystyle \operatorname* { i n f } _ { p \in \mathcal { P } } \mathbb { E } _ { a \sim \pi ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \pi ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ V ( s ^ { \prime } ) ] ] + \epsilon } \end{array}
255
+ $$
256
+
257
+ In addition, we have by definition that:
258
+
259
+ $$
260
+ \begin{array} { r l } & { \mathbb { E } _ { a \sim \pi ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \pi ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p _ { s } ( \cdot \vert s , a ) } [ U ( s ^ { \prime } ) ] ] } \\ & { \qquad \geq \displaystyle \operatorname* { i n f } _ { p \in \mathcal { P } } \mathbb { E } _ { a \sim \pi ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \pi ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ U ( s ^ { \prime } ) ] ] } \end{array}
261
+ $$
262
+
263
+ Thus, we have,
264
+
265
+ $$
266
+ \begin{array} { r l } { { 0 \leq { \mathcal T } _ { \mathrm { R - K L } } ^ { \pi } U ( s ) - { \mathcal T } _ { \mathrm { R - K L } } ^ { \pi } V ( s ) } } \\ & { < \mathbb { E } _ { a \sim \pi ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \pi ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p _ { s } ( \cdot \vert s , a ) } [ U ( s ^ { \prime } ) ] ] } \\ & { ~ - \mathbb { E } _ { a \sim \pi ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \pi ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p _ { s } ( \cdot \vert s , a ) } [ V ( s ^ { \prime } ) ] ] + \epsilon } \\ & { = \mathbb { E } _ { a \sim \pi ( \cdot \vert s ) , s ^ { \prime } \sim p _ { s } ( \cdot \vert s , a ) } [ \gamma U ( s ^ { \prime } ) ] - \mathbb { E } _ { a \sim \pi ( \cdot \vert s ) , s ^ { \prime } \sim p _ { s } ( \cdot \vert s , a ) } [ \gamma V ( s ^ { \prime } ) ] + \epsilon } \\ & { \leq \gamma \Vert U - V \Vert + \epsilon } \end{array}
267
+ $$
268
+
269
+ Applying a similar argument for the case ${ \mathcal { T } } _ { \mathrm { R - K L } } U ( s ) \leq { \mathcal { T } } _ { \mathrm { R - K L } } V ( s )$ results in
270
+
271
+ $$
272
+ \lvert T _ { \mathrm { R - K L } } ^ { \pi } U - \mathcal { T } _ { \mathrm { R - K L } } ^ { \pi } V \rvert < \gamma \lvert \lvert U - V \rvert \rvert + \epsilon .
273
+ $$
274
+
275
+ Since $\epsilon$ is an arbitrary positive number, we establish the result, i.e.,
276
+
277
+ $$
278
+ \lvert T _ { \mathrm { R - K L } } ^ { \pi } U - T _ { \mathrm { R - K L } } ^ { \pi } V \rvert \leq \gamma \lvert \lvert U - V \rvert \rvert .
279
+ $$
280
+
281
+ # Theorem 2.
282
+
283
+ Proof. We follow a similar argument to the proof of Theorem 1. Let $U , V \in \mathbb { R } ^ { | S | }$ , and $s \in S$ an arbitrary state. Assume ${ \mathcal { T } } _ { \mathrm { R - K L } } { \bar { U } } ( s ) \geq { \mathcal { T } } _ { \mathrm { R - K L } } { \bar { V } } ( s )$ . Let $\epsilon > 0$ be an arbitrary positive number. By definition of the sup operator, there exists ${ \hat { \pi } } \in \Pi$ such that,
284
+
285
+ $$
286
+ \operatorname* { i n f } _ { p \in \mathcal { P } } \mathbb { E } _ { a \sim \hat { \pi } ( \cdot | s ) } [ r ( s , a ) - \tau \log \frac { \hat { \pi } ( \cdot | s ) } { \overline { { \pi } } ( \cdot | s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot | s , a ) } [ U ( s ^ { \prime } ) ] ] > \mathcal { T } _ { \mathrm { R - K L } } U ( s ) - \epsilon
287
+ $$
288
+
289
+ In addition, by the definition of the inf operator, there exists $p _ { s } \in \mathcal { P }$ such that,
290
+
291
+ $$
292
+ \begin{array} { r l } & { \mathbb { E } _ { a \sim \hat { \pi } ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \hat { \pi } ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p _ { s } ( \cdot \vert s , a ) } [ V ( s ^ { \prime } ) ] ] } \\ & { \qquad < \displaystyle \operatorname* { i n f } _ { p \in \mathcal { P } } \mathbb { E } _ { a \sim \hat { \pi } ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \hat { \pi } ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ V ( s ^ { \prime } ) ] ] + \epsilon } \end{array}
293
+ $$
294
+
295
+ Thus, we have,
296
+
297
+ $$
298
+ \begin{array} { r l } & { 0 \leq { \widetilde { T } _ { \mathrm { K } \times \mathrm { K } } } U ( s ) - { \widetilde { T } _ { \mathrm { K } \times \mathrm { L } } } V ( s ) } \\ & { \quad < \quad \underset { p \in \mathcal { P } } { \overset { \cdot } { \longrightarrow } } ( \underset { s \sim \mathcal { P } ( \cdot \vert s ) } { \overset { \cdot } { \prod } } [ F ( s , a ) - \tau ] \log \frac { \hat { \pi } ( \cdot \vert s ) } { \widetilde { \pi } ( \cdot \vert s ) } + { \gamma } { \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } } [ U ( s ^ { \prime } ) ] ] + \epsilon ) } \\ & { \quad - \quad \underset { p \in \mathcal { P } } { \overset { \cdot } { \longrightarrow } } ( \underset { s \sim \mathcal { P } ( \cdot \vert s ) } { \overset { \cdot } { \prod } } [ r ( s , a ) - \tau ] \log \frac { \hat { \pi } ( \cdot \vert s ) } { \widetilde { \pi } ( \cdot \vert s ) } + { \gamma } { \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , s ) } } [ { s ^ { \prime } ( s ) } ] ) \sqrt { ( \nu ^ { \prime } s ^ { \prime } ) } \vert \vert \rangle } \\ & { \quad < \quad \underset { ( { \mathbb { E } _ { o \sim \widetilde { \pi } ( \cdot \vert s ) } } [ r ( s , a ) - \tau ] \log \frac { \hat { \pi } ( \cdot \vert s ) } { \widetilde { \pi } ( \cdot \vert s \rangle ) } } { \overset { \cdot } { \longrightarrow } } + { \gamma } { \mathbb { E } _ { s ^ { \prime } \sim p _ { \mathcal { K } } ( \cdot \vert s , a ) } } [ U ( s ^ { \prime } ) ] ] + \epsilon ) } \\ & { \quad - \ ( \underset { ( { \mathbb { E } _ { o \sim \widetilde { \pi } ( \cdot \vert s ) } } [ r ( s , a ) - \tau ] \log \frac { \hat { \pi } ( \cdot \vert s ) } { \widetilde { \pi } ( \cdot \vert s \rangle ) } } + { \gamma } { \mathbb { E } _ { s ^ { \prime } \sim p _ { \mathcal { K } } ( \cdot \vert s , a ) } } [ V ( s ^ { \prime } ) ] ] - \epsilon ) } \\ & \quad = \underset ( { \mathbb { E } _ { o \sim \widetilde { \pi } ( \cdot \vert s \rangle ) } } [ \gamma ( s , a ) - \tau ] \log \frac { \hat { \pi } ( \cdot \vert s \rangle ) } { \widetilde { \pi } ( \cdot \vert s \rangle ) } + { \gamma } \end{array}
299
+ $$
300
+
301
+ Applying a similar argument for the case ${ \mathcal { T } } _ { \mathrm { R - K L } } U ( s ) \leq { \mathcal { T } } _ { \mathrm { R - K L } } V ( s )$ results in
302
+
303
+ $$
304
+ | \mathcal { T } _ { \mathrm { R - K L } } U - \mathcal { T } _ { \mathrm { R - K L } } V | < \gamma \Vert U - V \Vert + 2 \epsilon .
305
+ $$
306
+
307
+ Since $\epsilon$ is an arbitrary positive number, we establish the result, i.e.,
308
+
309
+ $$
310
+ \begin{array} { r } { | \mathcal { T } _ { \mathrm { R - K L } } U - \mathcal { T } _ { \mathrm { R - K L } } V | \leq \gamma \Vert U - V \Vert . } \end{array}
311
+ $$
312
+
313
+ Corollary 1. Let $\pi _ { N }$ be the greedy policy after applying $N$ value iteration steps. The bound between the optimal value function $V ^ { * }$ and $V ^ { \pi _ { N } }$ , the value function that is induced by $\pi _ { N }$ , is given by, $\begin{array} { r l r } { { \| V ^ { * } - V ^ { \pi _ { N } } \| \le \ \frac { 2 \gamma \epsilon } { ( 1 - \gamma ) ^ { 2 } } + \frac { 2 \gamma ^ { N + 1 } } { ( 1 - \gamma ) } \| V ^ { * } - V _ { 0 } \| } } \end{array}$ , where $\begin{array} { r } { \epsilon = \operatorname* { m a x } _ { 0 \leq k \leq N } \| \mathcal { T } _ { R \cdot K L } V _ { k } - V _ { k + 1 } \| } \end{array}$ is the function approximation error, and $V _ { 0 }$ is the initial value function.
314
+
315
+ Proof. From Berteskas (1996), we have the following proposition:
316
+
317
+ Let $V ^ { * }$ be the optimal value function, $V$ some arbitrary value function, $\pi$ the greedy policy with respect to $V$ , and $V ^ { \pi }$ the value function that is induced by $\pi$ . Thus,
318
+
319
+ $$
320
+ \| V ^ { * } - V ^ { \pi } \| \leq \frac { 2 \gamma } { ( 1 - \gamma ) } \| V ^ { * } - V \|
321
+ $$
322
+
323
+ Next, define the maximum projected loss to be:
324
+
325
+ $$
326
+ \epsilon = \operatorname* { m a x } _ { 0 \leq k \leq N } { \| \mathcal { T } _ { \mathrm { R - K L } } V _ { k } - V _ { k + 1 } \| }
327
+ $$
328
+
329
+ We can now derive a bound on the loss between the optimal value function $V ^ { * }$ and the value function obtained after $N$ updates of value iteration (denoted by $V _ { N }$ ) as follows:
330
+
331
+ $$
332
+ \begin{array} { r l } & { \| V ^ { * } - V _ { N } \| \leq \| V ^ { * } - \mathcal { T } _ { \mathrm { R \mathrm { - } K L } } V _ { N - 1 } \| + \| T _ { \mathrm { R \mathrm { - } K L } } V _ { N - 1 } - V _ { N } \| } \\ & { \qquad = \| T _ { \mathrm { R \mathrm { - } K L } } V ^ { * } - \mathcal { T } _ { \mathrm { R \mathrm { - } K L } } V _ { N - 1 } \| + \| T _ { \mathrm { R \mathrm { - } K L } } V _ { N - 1 } - V _ { N } \| } \\ & { \qquad \leq \gamma \| V ^ { * } - V _ { N - 1 } \| + \| T _ { \mathrm { R \mathrm { - } K L } } V _ { N - 1 } - V _ { N } \| } \\ & { \qquad \leq \gamma \| V ^ { * } - V _ { N - 1 } \| + \epsilon } \\ & { \qquad \leq ( 1 + \gamma + \cdot \cdot \cdot + \gamma ^ { N - 1 } ) \epsilon + \gamma ^ { N } \| V ^ { * } - V _ { 0 } \| } \\ & { \qquad \leq \frac { \epsilon } { ( 1 - \gamma ) } + \gamma ^ { N } \| V ^ { * } - V _ { 0 } \| } \end{array}
333
+ $$
334
+
335
+ Then, using Lemma $\mathrm { E }$ , we get:
336
+
337
+ $$
338
+ \begin{array} { r l } { { \| V ^ { * } - V ^ { \pi N } \| \le \frac { 2 \gamma } { ( 1 - \gamma ) } \| V ^ { * } - V _ { N } \| } } \\ & { \le \frac { 2 \gamma } { ( 1 - \gamma ) } \frac { \epsilon } { ( 1 - \gamma ) } + \frac { 2 \gamma } { ( 1 - \gamma ) } \gamma ^ { N } \| V ^ { * } - V _ { 0 } \| } \\ & { = \frac { 2 \gamma \epsilon } { ( 1 - \gamma ) ^ { 2 } } + \frac { 2 \gamma ^ { N + 1 } } { ( 1 - \gamma ) } \| V ^ { * } - V _ { 0 } \| } \end{array}
339
+ $$
340
+
341
+ which establishes the result.
342
+
343
+ # F SOFT-ROBUST ENTROPY-REGULARIZED BELLMAN OPERATOR
344
+
345
+ # Theorem 3.
346
+
347
+ Proof. For an arbitrary $U , V \in \mathbb { R } ^ { | S | }$ and for a fixed policy $\pi$ :
348
+
349
+ $$
350
+ \begin{array} { r l } { \left| \left| T _ { \mathrm { S R L } } ^ { \pi } U ( s ) - \mathcal T _ { \mathrm { S R L } } ^ { \pi } V ( s ) \right| \right| _ { \infty } } & { = } \\ & { = \operatorname* { s u p } \Bigg | \mathbb { E } _ { a \sim \pi ( \cdot | s ) } \big [ r ( s , a ) - \tau \log \frac { \pi \big ( \cdot | s \big ) } { \overline { { \pi } } \big ( \cdot | s \big ) } + \gamma \mathbb { E } _ { a ^ { \star } \sim \pi \widetilde { \phi } ( \cdot | s , a ) } \big | U ( s ^ { \prime } ) \big ] \Bigg | } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad } \\ & & { = - \mathbb { E } _ { a \sim \pi ( \cdot | s ) } \big [ r ( s , a ) - \tau \log \frac { \pi ( \cdot | s ) } { \overline { { \pi } } \big ( \cdot | s \big ) } + \gamma \mathbb { E } _ { a ^ { \star } \sim \pi ( \cdot | s , a ) } \big | V ( s ^ { \prime } ) \big ] \Bigg | \Bigg | } \\ & { = \gamma \operatorname* { s u p } _ { \alpha \sim \pi ( \cdot ) } \Big | \sum _ { j } \widetilde { \rho } ( s ^ { \prime } | s , a ) \big | U ( s ^ { \prime } ) - V ( s ^ { \prime } ) \big | \Big | } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \quad \times } \\ & { \leq \gamma \operatorname* { s u p } _ { \alpha \sim \pi ^ { \prime } } \widetilde { \rho } ( s ^ { \prime } | s , a ) \big | U ( s ^ { \prime } ) - V ( s ^ { \prime } ) \big | } \\ & { \leq \gamma \operatorname* { s u p } _ { \alpha \sim \pi ^ { \prime } } \widetilde { \rho } ( s ^ { \prime } | s , a ) \big | U ( s ^ { \prime } ) - V ( s ^ { \prime } ) \big | _ { \infty } } \\ & { \leq \gamma \| U - V \| _ { \infty } } \end{array}
351
+ $$
352
+
353
+ # Theorem 4.
354
+
355
+ Proof. Let $U , V \in \mathbb { R } ^ { | S | }$ , and $s \in S$ an arbitrary state. Assume ${ \mathcal { T } } _ { \mathrm { S R - K L } } U ( s ) \geq { \mathcal { T } } _ { \mathrm { S R - K L } } V ( s )$ . Let $\epsilon > 0$ be an arbitrary positive number. By definition of the sup operator, there exists ${ \hat { \pi } } \in \Pi$ such that,
356
+
357
+ $$
358
+ \mathbb { E } _ { a \sim \hat { \pi } ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \hat { \pi } ( \cdot \vert s ) } { \bar { \pi } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim \bar { p } ( \cdot \vert s , a ) } [ U ( s ^ { \prime } ) ] ] > \mathcal { T } _ { \mathrm { S R - K L } } U ( s ) - \epsilon
359
+ $$
360
+
361
+ Thus, we have,
362
+
363
+ $$
364
+ \begin{array} { r l } & { 0 \leq \mathcal { T } _ { \mathrm { S R } , \mathrm { K L } } U ( s ) - \mathcal { T } _ { \mathrm { S R } \times \mathrm { L } } V ( s ) } \\ & { \quad < ( \mathbb { E } _ { a \sim \hat { \pi } ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \hat { \pi } ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ U ( s ^ { \prime } ) ] ] + \epsilon ) } \\ & { \quad - \left( \underset { \pi \in \mathbb { T } } { \operatorname* { s u p } } \mathbb { E } _ { a \sim \pi ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \pi ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { a ^ { \prime } \sim p ( \cdot \vert s , a ) } [ V ( s ^ { \prime } ) ] ] \right) } \\ & { \quad \leq \left( \mathbb { E } _ { a \sim \hat { \pi } ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \hat { \pi } ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ U ( s ^ { \prime } ) ] ] + \epsilon \right) } \\ & { \quad - \left( \mathbb { E } _ { a \sim \hat { \pi } ( \cdot \vert s ) } [ r ( s , a ) - \tau \log \frac { \hat { \pi } ( \cdot \vert s ) } { \overline { { \pi } } ( \cdot \vert s ) } + \gamma \mathbb { E } _ { a ^ { \prime } \sim p ( \cdot \vert s , a ) } [ V ( s ^ { \prime } ) ] ] \right) } \\ & { \quad = \mathbb { E } _ { a \sim \hat { \pi } ( \cdot \vert s ) , s ^ { \prime } \sim \hat { \pi } ( \cdot \vert s , a ) } [ \gamma U ( s ^ { \prime } ) ] - \mathbb { E } _ { a \sim \hat { \pi } ( \cdot \vert s ) } \exp ( \cdot \vert s , a ) [ \gamma V ( s ^ { \prime } ) ] + \epsilon } \end{array}
365
+ $$
366
+
367
+ $\leq \gamma \| U - V \| + \epsilon$ Applying a similar argument for the case ${ \mathcal { T } } _ { \mathrm { S R - K L } } U ( s ) \leq { \mathcal { T } } _ { \mathrm { S R - K L } } V ( s )$ results in
368
+
369
+ $$
370
+ \begin{array} { r } { \lvert \mathcal { T } _ { \mathrm { S R - K L } } U - \mathcal { T } _ { \mathrm { S R - K L } } V \rvert < \gamma \lVert U - V \rVert + \epsilon . } \end{array}
371
+ $$
372
+
373
+ Since $\epsilon$ is an arbitrary positive number, we establish the result, i.e.,
374
+
375
+ $$
376
+ \lvert \mathcal { T } _ { \mathrm { S R - K L } } U - \mathcal { T } _ { \mathrm { S R - K L } } V \rvert \leq \gamma \lVert U - V \rVert .
377
+ $$
378
+
379
+ # G ENTROPY-REGULARIZED POLICY EVALUATION
380
+
381
+ This section describes: (1) modification to the TD update for the expected return to optimize for the entropy-regularized expected return, (2) additional modification to account for robustness.
382
+
383
+ We start with (1).
384
+
385
+ The entropy-regularized value function is defined as:
386
+
387
+ $$
388
+ V _ { \mathrm { K L } } ^ { \pi } ( \boldsymbol { s } ; \bar { \pi } ) = \mathbb { E } ^ { \pi } [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } ( r _ { t } - \tau \mathrm { K L } ( \pi ( \cdot | \boldsymbol { s } _ { t } ) | | \bar { \pi } ( \cdot | \boldsymbol { s } _ { t } ) ) ) | \boldsymbol { s } _ { 0 } = \boldsymbol { s } ]
389
+ $$
390
+
391
+ and the corresponding entropy-regularized action value function is given by:
392
+
393
+ $$
394
+ \begin{array} { r l r } { Q _ { \mathrm { K L } } ^ { \pi } ( s , a ; \bar { \pi } ) } & { = } & { \mathbb { E } ^ { \pi } [ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } ( r _ { t } - \tau \mathrm { K L } ( \pi ( \cdot | s _ { t } ) | | \bar { \pi } ( \cdot | s _ { t } ) ) ) | s _ { 0 } = s , a _ { 0 } = a ] } \\ & { = } & { r ( s , a ) - \tau \mathrm { K L } ( \pi ( \cdot | s ) | | \bar { \pi } ( \cdot | s ) ) + \mathbb { E } _ { s ^ { \prime } \sim p ( \cdot | s , a ) } [ V _ { \mathrm { K L } } ^ { \pi } ( s ^ { \prime } ; \bar { \pi } ) ] } \end{array}
395
+ $$
396
+
397
+ Next, we define:
398
+
399
+ $$
400
+ \begin{array} { r } { \widetilde { Q } _ { \mathrm { K L } } ^ { \pi } ( s , a ; \bar { \pi } ) = r ( s , a ) + { \mathbb E } _ { s ^ { \prime } \sim p ( \cdot \vert s , a ) } [ V _ { \mathrm { K L } } ^ { \pi } ( s ^ { \prime } ; \bar { \pi } ) ] } \end{array}
401
+ $$
402
+
403
+ thus,
404
+
405
+ $$
406
+ Q _ { \mathrm { K L } } ^ { \pi } ( \boldsymbol { s } , \boldsymbol { a } ; \bar { \pi } ) = \widetilde { Q } _ { \mathrm { K L } } ^ { \pi } ( \boldsymbol { s } , \boldsymbol { a } ; \bar { \pi } ) - \tau \mathbf { K L } ( \pi ( \cdot | \boldsymbol { s } ) \| \bar { \pi } ( \cdot | \boldsymbol { s } ) ) )
407
+ $$
408
+
409
+ Therefore, we have the following relationship:
410
+
411
+ $$
412
+ \begin{array} { r } { V _ { \mathrm { K L } } ^ { \pi } ( s ^ { \prime } ; \bar { \pi } ) = \mathbb { E } _ { a \sim \pi ( \cdot | s ) } \biggl [ Q _ { \mathrm { K L } } ^ { \pi } ( s , a ; \bar { \pi } ) \biggr ] = \mathbb { E } _ { a \sim \pi ( \cdot | s ) } \biggl [ \widetilde { Q } _ { \mathrm { K L } } ^ { \pi } ( s , a ; \bar { \pi } ) - \tau \mathbf { K L } ( \pi ( \cdot | s ) | | \bar { \pi } ( \cdot | s ) ) \biggr ] } \end{array}
413
+ $$
414
+
415
+ We now retrieve the TD update for the entropy-regularized action value function:
416
+
417
+ $$
418
+ \begin{array} { r l } & { \delta _ { t } = r _ { t } - \tau \mathrm { K L } ( \pi ( \cdot | s _ { t } ) | | \overline { { \pi } } ( \cdot | s _ { t } ) ) + \gamma Q _ { \mathrm { K L } } ^ { \pi } ( s _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi ( \cdot | s _ { t + 1 } ) ; \overline { { \pi } } ) } \\ & { \qquad - Q _ { \mathrm { K L } } ^ { \pi } ( s _ { t } , a _ { t } ; \overline { { \pi } } ) } \\ & { = r _ { t } - \tau \mathrm { K L } ( \pi ( \cdot | s _ { t } ) | | \overline { { \pi } } ( \cdot | s _ { t } ) ) + \gamma Q _ { \mathrm { K L } } ^ { \pi } ( s _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi ( \cdot | s _ { t + 1 } ) ; \overline { { \pi } } ) } \\ & { \qquad - \widetilde Q _ { \mathrm { K L } } ^ { \pi } ( s _ { t } , a _ { t } ; \overline { { \pi } } ) + \tau \mathrm { K L } ( \pi ( \cdot | s _ { t } ) | | \overline { { \pi } } ( \cdot | s _ { t } ) ) } \\ & { = r _ { t } + \gamma Q _ { \mathrm { K L } } ^ { \pi } ( s _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi ( \cdot | s _ { t + 1 } ) ; \overline { { \pi } } ) - \widetilde Q _ { \mathrm { K L } } ^ { \pi } ( s _ { t } , a _ { t } ; \overline { { \pi } } ) } \\ & { = r _ { t } + \gamma \bigg [ \widetilde Q _ { \mathrm { K L } } ^ { \pi } ( s _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi ( \cdot | s _ { t + 1 } ) ; \overline { { \pi } } ) } \\ & { \qquad - \tau \mathrm { K L } ( \pi ( \cdot | s _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } ) ) | | \overline { { \pi } } ( \cdot | s _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } ) ) \bigg ] - \widetilde Q _ { \mathrm { K L } } ^ { \pi } ( s _ { t } , a _ { t } ; \overline { { \pi } } ) } \end{array}
419
+ $$
420
+
421
+ Note that in the above TD update we replaced $Q _ { \mathrm { K L } } ^ { \pi }$ with $\widetilde { Q } _ { \mathrm { K L } } ^ { \pi }$
422
+
423
+ Next, we move to (2).
424
+
425
+ Before extending the TD update to the robust case, we first consider the robust entropy-regularized value function, which is defined as:
426
+
427
+ $$
428
+ \begin{array} { r l r } { V _ { \mathrm { R - K L } } ^ { \pi } ( s ; \bar { \pi } ) } & { = } & { \displaystyle \operatorname* { i n f } _ { p \in \mathcal { P } } \mathbb { E } ^ { p , \pi } [ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } ( r _ { t } - \tau \mathrm { K L } ( \pi ( \cdot | s _ { t } ) | | \bar { \pi } ( \cdot | s _ { t } ) ) ) | s _ { 0 } = s ] } \end{array}
429
+ $$
430
+
431
+ Applying similar steps as above yields the following TD update:
432
+
433
+ $$
434
+ \begin{array} { r l } { \delta _ { t } = r _ { t } - \tau \mathrm { K L } \big ( \pi ( \cdot | s _ { t } ) \| \overline { { \pi } } ( \cdot | s _ { t } ) \big ) + \gamma \operatorname* { i n f } _ { p \in \mathbb { P } } Q _ { \mathrm { \tiny { R e f f } } } ^ { \pi } \big ( s _ { t + 1 } \sim p \big ( \cdot | s _ { t } , a _ { t } \big ) , a _ { t + 1 } \sim \pi \big ( \cdot | s _ { t + 1 } \big ) ; \overline { { \pi } } \big ) } & { } \\ { - Q _ { \mathrm { \tiny { R e f f } } } ^ { \pi } \big ( s _ { t } , a _ { t } ; \overline { { \pi } } \big ) } & { } \\ { = r _ { t } - \tau \mathrm { K L } \big ( \pi ( \cdot | s _ { t } ) \big ) \| \overline { { \pi } } ( \cdot | s _ { t } ) \big ) + \gamma \operatorname* { i n f } _ { p \in \mathbb { P } } Q _ { \mathrm { \tiny { R e f f } } } ^ { \pi } \big ( s _ { t + 1 } \sim p \big ( \cdot | s _ { t } , a _ { t } \big ) , a _ { t + 1 } \sim \pi \big ( \cdot | s _ { t + 1 } \big ) ; \overline { { \pi } } \big ) } & { } \\ { - \widetilde { Q } _ { \mathrm { \tiny { R e f f } } } ^ { \pi } \big ( s _ { t } , a _ { t } ; \overline { { \pi } } \big ) + \tau \mathrm { K L } \big ( \pi ( \cdot | s _ { t } ) \big | \overline { { \pi } } ( \cdot | s _ { t } ) \big ) } & { } \\ { = r _ { t } + \gamma \operatorname* { i n f } _ { p \in \mathbb { P } } Q _ { \mathrm { \tiny { R e f f } } } ^ { \pi } \big ( s _ { t + 1 } \sim p \big ( \cdot | s _ { t } , a _ { t } \big ) , a _ { t + 1 } \sim \pi \big ( \cdot | s _ { t + 1 } \big ) ; \overline { { \pi } } \big ) - \widetilde { Q } _ { \mathrm { \tiny { R e f f } } } ^ { \pi } \big ( s _ { t } , a _ { t } ; \overline { { \pi } } \big ) } & { } \\ = r _ { t } + \gamma \operatorname* { i n f } _ { p \in \mathbb { P } } \Big [ \widetilde { Q } _ { \mathrm { \tiny { R e f } } } ^ { \pi } \big ( s _ { t + 1 } \sim p ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi \big ( \cdot \end{array}
435
+ $$
436
+
437
+ Table 1: Hyperparameters for SVG
438
+
439
+ <table><tr><td>Hyperparameters Policy net</td><td>SVG</td></tr><tr><td>Q function net</td><td>200-200-200 500-500-500</td></tr><tr><td>Discount factor (y) Adam learning rate</td><td>0.99</td></tr><tr><td></td><td>0.0003</td></tr><tr><td>Replay buffer size</td><td>1000000</td></tr><tr><td>Target network update period</td><td>200</td></tr><tr><td>Batch size</td><td>1024</td></tr><tr><td>Activation function</td><td>elu</td></tr><tr><td>Tanh on output of layer norm</td><td>Yes</td></tr><tr><td>Layer norm on first layer</td><td>Yes</td></tr><tr><td>Tanh on Gaussian mean</td><td>Yes</td></tr><tr><td>Min variance</td><td>0.1</td></tr><tr><td>Max variance</td><td>unbounded</td></tr></table>
440
+
441
+ # H EXPERIMENTS
442
+
443
+ # H.1 ADDITIONAL DETAILS ON THE SVG BASELINE
444
+
445
+ For the stochastic value gradients SVG(0) baseline we use the same policy parameterization as for our algorithm, e.g. we have
446
+
447
+ $$
448
+ \pi _ { \boldsymbol { \theta } } = \mathcal { N } ( \mu _ { \boldsymbol { \theta } } ( s ) , \sigma _ { \boldsymbol { \theta } } ^ { 2 } ( s ) I ) ,
449
+ $$
450
+
451
+ where $I$ denotes the identity matrix and $\sigma _ { \theta } ( s )$ is computed from the network output via a softplus activation function.
452
+
453
+ To obtain a baseline that is, in spirit, similar to our algorithm we used SVG in combination with Entropy regularization. That is, we optimize the policy via gradiend ascent, following the reparameterized gradient for a given state s sampled from the replay:
454
+
455
+ $$
456
+ \nabla _ { \boldsymbol { \theta } } \mathbb { E } _ { \pi _ { \boldsymbol { \theta } } ( a | s ) } [ Q ( a , s ) ] + \alpha \mathrm { H } \Big ( \pi _ { \boldsymbol { \theta } } ( a | s ) \Big ) ,
457
+ $$
458
+
459
+ which can be computed, using the reparameterization trick, as
460
+
461
+ $$
462
+ \begin{array} { r } { \mathbb { E } _ { \zeta \sim \mathcal { N } ( 0 , I ) } [ \nabla _ { \theta } g _ { \theta } ( s , \zeta ) \nabla _ { g } Q ( g _ { \theta } ( s , \zeta ) , s ) ] + \alpha \nabla _ { \theta } \mathrm { H } \Big ( \pi _ { \theta } ( a | s ) \Big ) , } \end{array}
463
+ $$
464
+
465
+ where $g _ { \theta } ( s , \zeta ) = \mu _ { \theta } ( s ) + \sigma _ { \theta } ( ) * \zeta$ is now a deterministic function of a sample from the standard multivariate normal distribution. See e.g. Heess et al. (2015a) (for SVG) as well as Rezende et al. (2014); Kingma & Welling (2013) (for the reparameterization trick) for a detailed explanation.
466
+
467
+ # H.2 EXPERIMENT DETAILS FOR MPO AND SVG
468
+
469
+ In this section we outline the details on the hyperparameters used for the MPO and SVG algorithms. All experiments use a feed-forward two layer neural network with 50 neurons to map the current state of the network to the mean and diagonal covariance of the Gaussian policy. The policy is given by a Gaussian distribution with a diagonal covariance matrix. The neural network outputs the mean $\dot { \mu } = \mu ( s )$ and diagonal Cholesky factors $A = A ( s )$ , such that $\Sigma = A A ^ { T }$ . The diagonal factor $A$ has positive diagonal elements enforced by the softplus transform $A _ { i i } \log ( 1 + \exp ( A _ { i i } ) )$ to ensure positive definiteness of the diagonal covariance matrix. Tables 2 and 1 show the hyperparameters used for the MPO and SVG algorithms.
470
+
471
+ # H.3 UNCERTAINTY SET PARAMETERS
472
+
473
+ Table 3 contains the chosen uncertainty set values for each of the domains and the corresponding holdout set perturbations. The final column of the table contains the parameter that was perturbed.
474
+
475
+ Table 2: Hyperparameters for MPO
476
+
477
+ <table><tr><td>Hyperparameters</td><td>MPO</td></tr><tr><td>Policy net Number of actions sampled per state</td><td>200-200-200 15</td></tr><tr><td>Q function net</td><td>500-500-500</td></tr><tr><td>E</td><td>0.1</td></tr><tr><td>Eμ</td><td>0.01</td></tr><tr><td>£</td><td>0.00001</td></tr><tr><td>Discount factor(y)</td><td>0.99</td></tr><tr><td>Adam learning rate</td><td>0.0003</td></tr><tr><td>Replay buffer size</td><td>1000000</td></tr><tr><td>Target network update period</td><td>200</td></tr><tr><td>Batch size</td><td>1024</td></tr><tr><td>Activation function</td><td></td></tr><tr><td></td><td>elu</td></tr><tr><td>Layer norm on first layer</td><td>Yes</td></tr><tr><td>Tanh on output of layer norm</td><td>Yes</td></tr><tr><td>Tanh on Gaussian mean</td><td>No</td></tr><tr><td>Min variance Max variance</td><td>Zero unbounded</td></tr></table>
478
+
479
+ Table 3: The parameters chosen for the uncertainty set perturbations as well as the holdout set perturbations. The final column contains the parameter that was perturbed.
480
+
481
+ <table><tr><td rowspan=1 colspan=1>Domain</td><td rowspan=1 colspan=1>UncertaintySetPerturbations</td><td rowspan=1 colspan=1>Hold-out TestPerturbations</td><td rowspan=1 colspan=1>Parameter</td></tr><tr><td rowspan=1 colspan=1>Acrobot</td><td rowspan=1 colspan=1>1.0,1.025,1.05 meters</td><td rowspan=1 colspan=1>1.15,1.2,1.25 meters</td><td rowspan=1 colspan=1>First pole length</td></tr><tr><td rowspan=1 colspan=1>Cartpole Balance</td><td rowspan=1 colspan=1>0.5,1.9,2.1 meters</td><td rowspan=1 colspan=1>2.0,2.2,2.3 meters</td><td rowspan=1 colspan=1>Pole length</td></tr><tr><td rowspan=1 colspan=1>Cartpole Swingup</td><td rowspan=1 colspan=1>1.0,1.4,1.7 meters</td><td rowspan=1 colspan=1>1.2,1.5,1.8 meters</td><td rowspan=1 colspan=1>Pole Length</td></tr><tr><td rowspan=1 colspan=1>Cheetah Run</td><td rowspan=1 colspan=1>0.4,0.45,0.5 meters</td><td rowspan=1 colspan=1>0.3,0.325,0.35 meters</td><td rowspan=1 colspan=1>Torso Length</td></tr><tr><td rowspan=1 colspan=1>Hopper Hop</td><td rowspan=1 colspan=1>-0.32,-0.33,-0.34 meters</td><td rowspan=1 colspan=1>-0.4,-0.45,-0.5 meters</td><td rowspan=1 colspan=1>Calf Length</td></tr><tr><td rowspan=1 colspan=1>Hopper Stand</td><td rowspan=1 colspan=1>-0.32,-0.33,-0.34 meters</td><td rowspan=1 colspan=1>-0.4,-0.475,-0.5 meters</td><td rowspan=1 colspan=1>Calf Length</td></tr><tr><td rowspan=1 colspan=1>Pendulum Swingup</td><td rowspan=1 colspan=1>1.0, 1.1, 1.4 Kg</td><td rowspan=1 colspan=1>1.5, 1.6, 1.7 Kg</td><td rowspan=1 colspan=1>Ball Mass</td></tr><tr><td rowspan=1 colspan=1>Walker Run</td><td rowspan=1 colspan=1>0.225,0.2375,0.25 meters</td><td rowspan=1 colspan=1>0.35,0.375,0.4 meters</td><td rowspan=1 colspan=1>Thigh Lengths</td></tr><tr><td rowspan=1 colspan=1>Walker Walk</td><td rowspan=1 colspan=1>0.225,0.2375,0.25 meters</td><td rowspan=1 colspan=1>0.35,0.375,0.4 meters</td><td rowspan=1 colspan=1>Thigh Lengths</td></tr><tr><td rowspan=1 colspan=1>Shadow hand</td><td rowspan=1 colspan=1>0.025,0.022,0.02 meters</td><td rowspan=1 colspan=1>0.021,0.018,0.015 meters</td><td rowspan=1 colspan=1>Half-cube width</td></tr><tr><td rowspan=1 colspan=1>Cartpole Balance:Larger Test Set</td><td rowspan=1 colspan=1>0.5,1.9,2.1 meters</td><td rowspan=1 colspan=1>0.5,0.7, 0.9,1.1,1.3,1.5,1.7,1.9 meters</td><td rowspan=1 colspan=1>Pole Length</td></tr><tr><td rowspan=1 colspan=1>Pendulum Swingup:Larger Test Set</td><td rowspan=1 colspan=1>1.0,1.1,1.4 meters</td><td rowspan=1 colspan=1>1.0, 1.1, 1.2,1.3,1.4,1.5 meters</td><td rowspan=1 colspan=1>Pole Length</td></tr><tr><td rowspan=1 colspan=1>Pendulum Swingup - Offline datasets</td><td rowspan=1 colspan=1>1.0, 1.1, 1.2 Kg</td><td rowspan=1 colspan=1>1.5,1.6, 1.7 Kg</td><td rowspan=1 colspan=1>Ball Mass</td></tr><tr><td rowspan=1 colspan=1>Cartpole Swingup-Offline datasets</td><td rowspan=1 colspan=1>1.0,1.4,1.7 meters</td><td rowspan=1 colspan=1>1.2,1.5,1.8 meters</td><td rowspan=1 colspan=1>Pole Length</td></tr></table>
482
+
483
+ # H.4 MAIN EXPERIMENTS
484
+
485
+ This section contains two sets of plots. Figure 6 contains bar plots comparing the performance of RE-MPO (blue bars), SRE-MPO (green bars) and E-MPO (red bars) across nine Mujoco domains. The performance of the agents as a function of evaluation steps is shown in Figure 7 for all nine domains respectively. Figrue 8 shows the bar plots for R-MPO, SR-MPO and MPO and Figure 9 shows the corresponding performance of the agents as a function of evaluation steps.
486
+
487
+ # H.5 INVESTIGATIVE EXPERIMENTS
488
+
489
+ This section contains additional investigative experiments that were mentioned in the main paper.
490
+
491
+ Figure 11 presents the difference in performance between the entropy-regularized agents and the non entropy-regularized agents agents. Although the performance is comparable (left figure), the entropy-regularized version performs no worse on average than the non-entropy-regularized agent. In addition, there are some tasks where there is a large improvement in performance, such as the
492
+
493
+ ![](images/66809113236fe51a1193c48c20671ed1322dd62116e7c90260b661212709cc79.jpg)
494
+ Figure 6: All nine domains showing RE-MPO (blue), SRE-MPO (green) and E-MPO (red).
495
+
496
+ ![](images/08f25b1d988e4b7cb07ee4cf53d8c3329477cef62d6a65e27f7df22336f2174f.jpg)
497
+ Figure 7: All nine domains showing RE-MPO (blue), SRE-MPO (green) and E-MPO (red) as a function of evaluation steps during training.
498
+
499
+ ![](images/f7bb80ee755ac9ede589ca4012194dcb50435c030d4b419950a1a53033369a79.jpg)
500
+ Figure 8: All nine domains showing R-MPO (blue), SR-MPO (green) and MPO (red).
501
+
502
+ ![](images/def58c44b6046f1a88a1323125b13a6ee011f6e90ddf17d106456fda68e7c086.jpg)
503
+ Figure 9: All nine domains showing R-MPO (blue), SR-MPO (green) and MPO (red) as a function of evaluation steps during training.
504
+
505
+ ![](images/d4a21f0cf1c7969e1a8312430e375d8cea6178ba5beccaeb1489e73454f0273c.jpg)
506
+ Figure 10: Increasing the range of the training uncertainty set for Cartpole balance (top row) and Pendulum swingup (bottom row).
507
+
508
+ ![](images/3606537428ba4adfdb34a0b5fe2fe4377ad18a548c3a2531a3f5dfbffd7cb18f.jpg)
509
+ Figure 11: Comparing entropy-regularized objective to the non-entropy regularized objective (left figure). The entropy-regularized version does no worse than the non entropy-regularized setup and in some cases, for example Cheetah, performs considerably better than the expected return objective (right figure).
510
+
511
+ Cheetah task for the entropy-regularized agent variants non entropy-regularized agent variants (right figure).
512
+
513
+ Training with more samples: Adding three times more samples to the non-robust baseline still yields significantly inferior performance compared to that of the robust and soft-robust versions as seen in Figure 12 for Cartpole balance and Pendulum swingup respectively.
514
+
515
+ What about Domain Randomization? The DR results are shown in Figure 13. As can be seen in the figure, RE-MPO makes better use of a limited number of perturbations compared to Limited-DR in Cartpole Balance (left) and Pendulum Swingup (middle) respectively. If the number of perturbations are increased to 100 (right figure) for Pendulum Swingup, DR, which uses approximately 30 times more perturbations, improves but still does not outperform RE-MPO.
516
+
517
+ Modifying the uncertainty set: Figure 14 contains the performance for cartpole balance (top row) and pendulum swingup (bottom row) when modifying the uncertainty set. For the Cartpole Balance task, the original uncertainty set training values are 0.5, 1.4 and 2.1 meters for the cartpole arm length. We modified the third perturbation (2.1 meters) of the uncertainty set to pole lengths of 1.5, 2.5 and 3.5 meters respectively. The agent is evaluated on pole lengths of 2.0, 2.2 and 2.3 meters respectively. As seen in the top row of Figure 14, as the training perturbation is near the evaluation set, the performance of the robust and soft-robust agents are near optimal. However, as the perturbation increases further (i.e., 3.5 meters), there is a drop in robustness performance. This is probably due to the agent learning a policy that is robust with respect to perturbations that are relatively far from the unseen evaluation set. However, the agent still performs significantly better than the non-robust baseline in each case. For Pendulum Swingup, the original uncertainty set values of the pendulum arm are 1.0, 1.1 and 1.4 meters. We modified the final perturbation to values of 1.2, 1.3 and 2.0 meters respectively. The agent is evaluated on unseen lengths of 1.5, 1.6 and 1.7 meters. A significant increase in performance can be seen in the bottom row of Figure 14 as the third perturbation approaches that of the unseen evaluation environments. Thus it appears that if the agent is able to approximately capture the dynamics of the unseen test environments within the training set, then the robust agent is able to adapt to the unseen test environments. Figure 10 presents the evaluation curves for the corresponding Cartpole Balance (top row) and Pendulum swingup (bottom row) tasks as the third perturbation of the uncertainty set is modified.
518
+
519
+ ![](images/bfb3ab9079e24db4bc7d35eaecc3fa314292f24729e9c9b6f6c496c7f1a9bf57.jpg)
520
+ Figure 12: Additional Training Samples: Two plots show 3 times more additional training samples for non-robust E-MPO (dark grey) in the Cartpole Balance and Pendulum Swingup tasks respectively.
521
+
522
+ ![](images/07d0a27243fbc30ffd582870e7e56437f24f5ad9990c59f0aaf2541e950f3c86.jpg)
523
+ Figure 13: Domain Randomization (DR): Domain randomization performance for the Cartpole balance (left) and Pendulum swingup (middle) tasks. As we increase the number of perturbations for DR to 100 (right figure), we see that performance improves but still does not outperform RE-MPO, which still only uses 3 perturbations.
524
+
525
+ Different Nominal Models: Figure 15 indicates the effect of changing the nominal model to the median and largest perturbation from the uncertainty set for the Cartpole balance (top row) and Pendulum swingup (bottom row) tasks respectively. For Cartpole, since the median and largest perturbations are significantly closer to the evaluation set, performance of the non-robust, robust and soft-robust agents are comparable. However, for Pendulum swingup, the middle actor is still far from the evaluation set and here the robust agent significantly outperforms the non-robust agent.
526
+
527
+ ![](images/d009d3d6b628b7e62d4c37d726ebb519140e4e0b95edff432367bbd245e28001.jpg)
528
+ Figure 14: Modifying the uncertainty set: The top row indicates the change in performance for Cartpole balance as the third perturbation of the uncertainty set is modified to 1.5, 2.5 and 3.5 meters respectively. The bottom row shows the performance for Pendulum Swingup for final perturbation changes of 1.2, 1.3 and 2.0 meters respectively.
529
+
530
+ ![](images/8df11eb4506ffc04d5fc5f7aa79eb74771b22648423babe0dd98fa8c760e3823.jpg)
531
+ Figure 15: Changing the nominal model: The top two figures indicate setting the nominal model as the median and largest perturbation of the uncertainty set for Cartpole Balance respectively. The right two figures are the same setting but for the Pendulum swingup domain. Legend: E-MPO (red), RE-MPO (blue), SRE-MPO (green).
532
+
533
+ # Algorithm 1 Robust MPO (R-MPO) algorithm for a single iteration
534
+
535
+ 1: given batch-size (K), number of actions $( \mathrm { N } )$ , old-policy $\pi _ { k }$ and replay-buffer
536
+ 2: // Step 1: Perform policy evaluation on $\pi _ { k }$ to yield $\dot { Q } _ { \theta } ^ { \pi _ { k } }$
537
+ 3:
538
+
539
+ $$
540
+ \operatorname* { m i n } _ { \theta } \biggl ( r _ { t } + \gamma \operatorname* { i n f } _ { p \in \mathcal { P } ( s _ { t } , a _ { t } ) } \biggl [ Q _ { \hat { \theta } } ^ { \pi _ { k } } \bigl ( s _ { t + 1 } \sim p ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi _ { k } ( \cdot | s _ { t + 1 } ) ) \biggr ] - Q _ { \theta } ^ { \pi _ { k } } \bigl ( s _ { t } , a _ { t } \bigr ) \biggr ) ^ { 2 } \ ,
541
+ $$
542
+
543
+ # 4: repeat
544
+
545
+ # I ALGORITHM
546
+
547
+ The Robust MPO algorithm is defined as Algorithm 1. The algorithm can be divided into three steps: Step (1) perform policy evaluation on the policy $\pi _ { k }$ ; Step (2) build a proposal distribution $q ( a \bar { | } s )$ from the action value function $Q _ { \theta } ^ { \pi _ { k } }$ ; Step (3) update the policy by minimizing the KL divergence between the proposal distribution $q$ and the policy $\pi$ . The corresponding robust entropy-regularized version can be seen in Algorithm 2 and the soft-robust entropy-regularized version in Algorithm 3.
548
+
549
+ 2: // Step 1: Perform policy evaluation on 1: given batch-size (K), number of actions $( \mathrm { N } )$ $\pi _ { k }$ , old-policy to yield ${ \dot { Q } } _ { \theta } ^ { \pi _ { k } }$ $\pi _ { k }$ and replay-buffer
550
+ 3:
551
+
552
+ $$
553
+ \begin{array} { r l } & { \underset { \theta } { \mathrm { m i n } } \Bigg ( r _ { t } + \gamma \underset { p \in \mathcal { P } ( s _ { t } , a _ { t } ) } { \mathrm { i n f } } \left[ \widetilde { Q } _ { \mathbf { R } \times \mathbf { K } , \hat { \theta } } ^ { \pi _ { k } } ( s _ { t + 1 } \sim p ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi _ { k } ( \cdot | s _ { t + 1 } ) ; \bar { \pi } ) \right. } \\ & { \qquad \left. - \tau \mathrm { K L } ( \pi _ { k } ( \cdot | s _ { t + 1 } \sim p ( \cdot | s _ { t } , a _ { t } ) ) | | \bar { \pi } ( \cdot | s _ { t + 1 } \sim p ( \cdot | s _ { t } , a _ { t } ) ) ) \right] - \widetilde { Q } _ { \mathrm { K L } , \theta } ^ { \pi _ { k } } ( s _ { t } , a _ { t } ; \bar { \pi } ) \Bigg ) ^ { 2 } , } \end{array}
554
+ $$
555
+
556
+ # 4: repeat
557
+
558
+ 5: Sample batch of size $_ \mathrm { N }$ from replay buffer
559
+
560
+ 6: // Step 2: sample based policy (weights)
561
+
562
+ 18: until Fixed number of steps
563
+ 19: return πk+1
564
+
565
+ # Algorithm 3 Soft-Robust Entropy-Regularized MPO (SRE-MPO) algorithm for a single iteration
566
+
567
+ 1: given batch-size (K), number of actions $( \mathrm { N } )$ , old-policy $\pi _ { k }$ and replay-buffer
568
+ 2: // Step 1: Perform policy evaluation on $\pi _ { k }$ to yield $Q _ { \theta } ^ { \pi _ { k } }$
569
+ 3:
570
+
571
+ $$
572
+ \begin{array} { r l } & { \underset { \theta } { \operatorname* { m i n } } \biggl ( r _ { t } + \gamma \biggl [ \widetilde { Q } _ { \scriptscriptstyle { \mathbf { R } \times \mathbf { K } \perp , \hat { \theta } } } ^ { \pi _ { k } } \bigl ( s _ { t + 1 } \sim \bar { p } ( \cdot | s _ { t } , a _ { t } ) , a _ { t + 1 } \sim \pi _ { k } ( \cdot | s _ { t + 1 } ) ; \bar { \pi } \bigr ) } \\ & { \qquad - \tau { \mathbf { K } \mathbf { L } } \bigl ( \pi _ { k } ( \cdot | s _ { t + 1 } \sim \bar { p } ( \cdot | s _ { t } , a _ { t } ) ) \| \bar { \pi } ( \cdot | s _ { t + 1 } \sim \bar { p } ( \cdot | s _ { t } , a _ { t } ) ) \bigr ) \biggr ] - \widetilde { Q } _ { \mathrm { K L } , \theta } ^ { \pi _ { k } } \bigl ( s _ { t } , a _ { t } ; \bar { \pi } \bigr ) \biggr ) ^ { 2 } , } \end{array}
573
+ $$
574
+
575
+ # 4: repeat
576
+
577
+ 5: Sample batch of size $_ \mathrm { N }$ from replay buffer
578
+
579
+ 6: // Step 2: sample based policy (weights)
580
+
581
+ 7: $q ( a _ { i } | s _ { j } ) = q _ { i j }$ , computed as:
582
+ 8: for $\mathbf { j } = 1 , . . . , K$ do
583
+ 9: for $\mathrm { i } = 1 , . . . , N$ do
584
+ 10: $a _ { i } \sim \pi _ { \mathrm { k } } ( a | s _ { j } )$
585
+ 11: $Q _ { i j } = Q ^ { \pi _ { k } } ( s _ { j } , a _ { i } )$
586
+ 12: qij = Compute Weights $\lbrace Q _ { i j } \rbrace _ { i = 1 \ldots N } )$ {see (Abdolmaleki et al., 2018b)}
587
+
588
+ 18: until Fixed number of steps
589
+ 19: return πk+1
parse/train/HJgC60EtwB/HJgC60EtwB_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HJgC60EtwB/HJgC60EtwB_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HJgC60EtwB/HJgC60EtwB_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HklY120cYm/HklY120cYm.md ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CLARINET: PARALLEL WAVE GENERATION IN END-TO-END TEXT-TO-SPEECH
2
+
3
+ Wei Ping∗ Kainan Peng∗ Jitong Chen∗
4
+ {pingwei01, pengkainan, chenjitong01}@baidu.com
5
+ Baidu Research
6
+ 1195 Bordeaux Dr, Sunnyvale, CA 94089
7
+
8
+ # ABSTRACT
9
+
10
+ In this work, we propose a new solution for parallel wave generation by WaveNet. In contrast to parallel WaveNet (van den Oord et al., 2018), we distill a Gaussian inverse autoregressive flow from the autoregressive WaveNet by minimizing a regularized KL divergence between their highly-peaked output distributions. Our method computes the KL divergence in closed-form, which simplifies the training algorithm and provides very efficient distillation. In addition, we introduce the first text-to-wave neural architecture for speech synthesis, which is fully convolutional and enables fast end-to-end training from scratch. It significantly outperforms the previous pipeline that connects a text-to-spectrogram model to a separately trained WaveNet (Ping et al., 2018). We also successfully distill a parallel waveform synthesizer conditioned on the hidden representation in this end-to-end model. 1
11
+
12
+ # 1 INTRODUCTION
13
+
14
+ Speech synthesis, also called text-to-speech (TTS), is traditionally done with complex multi-stage hand-engineered pipelines (Taylor, 2009). Recent successes of deep learning methods for TTS lead to high-fidelity speech synthesis (van den Oord et al., 2016a), much simpler “end-to-end” pipelines (Sotelo et al., 2017; Wang et al., 2017; Ping et al., 2018), and a single TTS model that reproduces thousands of different voices (Ping et al., 2018).
15
+
16
+ WaveNet (van den Oord et al., 2016a) is an autoregressive generative model for waveform synthesis. It operates at a very high temporal resolution of raw audios (e.g., 24,000 samples per second). Its convolutional structure enables parallel processing at training by teacher-forcing the complete sequence of audio samples. However, the autoregressive nature of WaveNet makes it prohibitively slow at inference, because each sample must be drawn from the output distribution before it can be passed in as input at the next time-step. In order to generate high-fidelity speech in real time, one has to develop highly engineered inference kernels (e.g., Arık et al., 2017a).
17
+
18
+ Most recently, van den Oord et al. (2018) proposed a teacher-student framework to distill a parallel feed-forward network from an autoregressive teacher WaveNet. The non-autoregressive student model can generate high-fidelity speech at 20 times faster than real-time. To backpropagate through random samples during distillation, parallel WaveNet employs the mixture of logistics (MoL) distribution (Salimans et al., 2017) as the output distribution for teacher WaveNet, and a logistic distribution based inverse autoregressive flow (IAF) (Kingma et al., 2016) as the student model. It minimizes a set of losses including the KL divergence between the output distributions of the student and teacher networks. However, one has to apply Monte Carlo method to approximate the intractable KL divergence between the logistic and MoL distributions, which may introduce large variances in gradients for highly peaked distributions, and lead to an unstable training in practice.
19
+
20
+ In this work, we propose a novel parallel wave generation method based on the Gaussian IAF. Specifically, we make the following contributions:
21
+
22
+ 1. We demonstrate that a single variance-bounded Gaussian is sufficient for modeling the raw waveform in WaveNet without degradation of audio quality. In contrast to the quantized surrogate loss (Salimans et al., 2017) in parallel WaveNet, our Gaussian autoregressive WaveNet is simply trained with maximum likelihood estimation (MLE).
23
+ 2. We distill a Gaussian IAF from the autoregressive WaveNet by minimizing a regularized KL divergence between their peaked output distributions. Our method provides closed-form estimation of KL divergence, which largely simplifies the distillation algorithm and stabilizes the training process.
24
+ 3. In previous studies, “end-to-end" speech synthesis actually refers to the text-to-spectrogram models with a separate waveform synthesizer (i.e., vocoder) (Sotelo et al., 2017; Wang et al., 2017). We introduce the first text-to-wave neural architecture for TTS, which is fully convolutional and enables fast end-to-end training from scratch. In our architecture, the WaveNet module is conditioned on the hidden states instead of mel-spectrograms (Ping et al., 2018; Shen et al., 2018), which is crucial to the success of training from scratch. Our text-to-wave model significantly outperforms the separately trained pipeline (Ping et al., 2018) in naturalness.
25
+ 4. We also successfully distill a parallel neural vocoder conditioned on the learned hidden representation within the end-to-end architecture. The text-to-wave model with the parallel vocoder obtains competitive results as the model with an autoregressive vocoder.
26
+
27
+ We organize the rest of this paper as follows. Section 2 discusses related work. We propose the parallel wave generation method in Section 3, and present the text-to-wave architecture in Section 4. We report experimental results in Section 5 and conclude the paper in Section 6.
28
+
29
+ # 2 RELATED WORK
30
+
31
+ Neural speech synthesis has obtained the state-of-the-art results and gained a lot of attention recently. Several neural TTS systems were proposed, including Deep Voice 1 (Arık et al., 2017a), Deep Voice 2 (Arık et al., 2017b), Deep Voice 3 (Ping et al., 2018), Tacotron (Wang et al., 2017), Tacotron 2 (Shen et al., 2018), Char2Wav (Sotelo et al., 2017), and VoiceLoop (Taigman et al., 2018). Deep Voice 1 & 2 retain the traditional TTS pipeline, which has separate grapheme-to-phoneme, phoneme duration, fundamental frequency, and waveform synthesis models. In contrast, Deep Voice 3, Tacotron, and Char2Wav employ the attention based sequence-to-sequence models (Bahdanau et al., 2015), yielding more compact architectures. In the literature, these models are usually referred to as “end-to-end” speech synthesis. However, they actually depend on a traditional vocoder (Morise et al., 2016), the Griffin-Lim algorithm (Griffin and Lim, 1984), or a separately trained neural vocoder (Ping et al., 2018; Shen et al., 2018) to convert the predicted spectrogram to raw audio. In this work, we propose the first text-to-wave neural architecture for TTS based on Deep Voice 3 (Ping et al., 2018).
32
+
33
+ The neural network based vocoders, such as WaveNet (van den Oord et al., 2016a) and SampleRNN (Mehri et al., 2017), play a very important role in recent advances of speech synthesis. In a TTS system, WaveNet can be conditioned on linguistic features, fundamental frequency $( F _ { 0 } )$ , phoneme durations (van den Oord et al., 2016a; Arık et al., 2017a), or the predicted mel-spectrograms from a text-to-spectrogram model (Ping et al., 2018). We test our parallel waveform synthesis method by conditioning it on mel-spectrograms and hidden representation within the end-to-end model.
34
+
35
+ Normalizing flows (Rezende and Mohamed, 2015; Dinh et al., 2014) are a family of stochastic generative models, in which a simple initial distribution is transformed into a more complex one by applying a series of invertible transformations. Normalizing flow provides arbitrarily complex posterior distribution, making it well suited for the inference network in variational autoencoder (Kingma and Welling, 2014). Inverse autoregressive flow (IAF) (Kingma et al., 2016) is a special type of normalizing flow where each invertible transformation is based on an autoregressive neural network. Thus, IAF can reuse the most successful autoregressive architecture, such as PixelCNN and WaveNet (van den Oord et al., 2016b;a). Learning an IAF with maximum likelihood can be very slow. In this work, we distill a Gaussian IAF from a pretrained autoregressive generative model by minimizing a numerically stable variant of KL divergence.
36
+
37
+ Knowledge distillation is originally proposed for compressing large models to smaller ones (Bucilua et al., 2006). In deep learning (Hinton et al., 2015), a smaller student network is distilled from the teacher network by minimizing the loss between their outputs (e.g., L2 or cross-entropy). In parallel WaveNet, a non-autoregressvie student-net is distilled from an autoregressive WaveNet by minimizing the reverse KL divergence (Murphy, 2014). Similar techniques are applied in non-autoregressive models for machine translation (Gu et al., 2018; Kaiser et al., 2018; Lee et al., 2018; Roy et al., 2018).
38
+
39
+ # 3 PARALLEL WAVE GENERATION
40
+
41
+ In this section, we present the Gaussian autoregressive WaveNet as the teacher-net and the Gaussian inverse autoregressive flow as the student-net. Then, we develop our knowledge distillation algorithm.
42
+
43
+ # 3.1 GAUSSIAN AUTOREGRESSIVE WAVENET
44
+
45
+ WaveNet models the joint distribution of high dimensional waveform $\pmb { x } = \{ x _ { 1 } , \dots , x _ { T } \}$ as the product of conditional distributions using the chain rules of probability,
46
+
47
+ $$
48
+ p ( \pmb { x } \mid \pmb { c } ; \pmb { \theta } ) = \prod _ { t = 1 } ^ { T } p ( x _ { t } \mid x _ { < t } , \pmb { c } ; \pmb { \theta } ) ,
49
+ $$
50
+
51
+ where $x _ { t }$ is the $t$ -th variable of $_ { \textbf { \em x } }$ , $x _ { < t }$ represent all variables before $t$ -step, $^ c$ is the conditioner 2 (e.g., mel-spectrogram or hidden states in Section 4), and $\pmb \theta$ are parameters of the model. The autoregressive WaveNet takes $x _ { < t }$ as input, and outputs the probability distribution over $x _ { t }$ .
52
+
53
+ Parallel WaveNet (van den Oord et al., 2018) advocates mixture of logistics (MoL) distribution in $\mathrm { P i x e l C N N + + }$ (Salimans et al., 2017) for autoregressive teacher-net, as it requires much fewer output units compared to categorical distribution (e.g., 65,536 softmax units for 16-bit audios). Actually, the output distribution of student-net is required to be differentiable over samples $_ { \textbf { \em x } }$ and allow backpropagation from teacher to student in distillation. As a result, one also needs to choose a continuous distribution for teacher WaveNet. Directly maximizing the log-likelihood of MoL is prone to numerical issues, and one has to employ the quantized surrogate loss introduced in $\mathrm { P i x e l C N N + + }$ .
54
+
55
+ In this work, we demonstrate that a single Gaussian output distribution for WaveNet suffices to model the raw waveform. It might raise the modeling capacity concern because we use the single Gaussian instead of mixture of Gaussians (Chung et al., 2015). We will demonstrate their comparable performance in experiment. Specifically, the conditional distribution of $x _ { t }$ given previous samples is,
56
+
57
+ $$
58
+ p ( \boldsymbol { x } _ { t } \mid \boldsymbol { x } _ { < t } ; \pmb { \theta } ) = \mathcal { N } \big ( \mu ( \boldsymbol { x } _ { < t } ; \pmb { \theta } ) , \sigma ( \boldsymbol { x } _ { < t } ; \pmb { \theta } ) \big ) ,
59
+ $$
60
+
61
+ where $\mu ( \boldsymbol { x } _ { < t } ; \boldsymbol { \theta } )$ and $\sigma ( x _ { < t } ; \theta )$ are mean and standard deviation predicted by the autoregressive WaveNet, respectively. In practice, the network predicts $\log \sigma ( x _ { < t } )$ and operates at log-scale for numerical stability. Given observed data, we do maximum likelihood estimation (MLE) for $\pmb \theta$ . Note that, the model may give very accurate prediction of 16-bit discrete $x _ { t }$ without real-valued noise (i.e., $\mu ( x _ { < t } ) \approx x _ { t } )$ , then the log-likelihood calculation can become numerically unstable when it is free to minimize $\sigma ( x _ { < t } )$ . As a result, we clip the predicted $\log \sigma ( x _ { < t } )$ at $^ { - 9 }$ (natural logarithm) before calculating the log-likelihood at training. 3 We discuss the importance of clipping constant for logscale in Appendix A. We also tried the dequantization trick by adding uniform noise $\pmb { u } \in [ 0 , \frac { 2 } { 6 5 5 3 6 } ]$ to the 16-bits samples similar as in image modeling (e.g., Uria et al., 2013). Indeed, these tricks are equivalent, in the sense that they both upper bound the continuous likelihood for modeling quantized data. We prefer the clipping trick, as it explicitly controls the model behavior and simplifies probability density distillation afterwards.
62
+
63
+ # 3.2 GAUSSIAN INVERSE AUTOREGRESSIVE FLOW (IAF)
64
+
65
+ Normalizing flows (Rezende and Mohamed, 2015; Dinh et al., 2017) map a simple initial density $q ( z )$ (e.g., isotropic Gaussian) into a complex one by applying an invertible transformation $\begin{array} { r } { { \bf x } = f ( z { \bf ) } } \end{array}$ . Given $f$ is a bijection, the distribution of $_ { \textbf { \em x } }$ can be obtained through the change of variables formula:
66
+
67
+ $$
68
+ q ( \pmb { x } ) = q ( \pmb { z } ) \left| \operatorname* { d e t } \left( \frac { \partial f ( \pmb { z } ) } { \partial \pmb { z } } \right) \right| ^ { - 1 } ,
69
+ $$
70
+
71
+ where de t ∂f(z)∂z  is the determinant of the Jacobian and is computationally expensive to obtain in general. Inverse autoregressive flow (IAF) (Kingma et al., 2016) is a special normalizing flow with a simple Jacobian determinant. In IAF, $_ { z }$ has the same dimension as $_ { \textbf { \em x } }$ , and the transformation is based on an autoregressive network taking $_ z$ as the input: $x _ { t } = f ( z _ { \leq t } ; \vartheta )$ , where $\vartheta$ are parameters of the model. Note that the $t$ -th variable $x _ { t }$ only depends on previous and current latent variables $z _ { \leq t }$ , thus the Jacobian is a triangular matrix and the determinant is the product of the diagonal entries,
72
+
73
+ $$
74
+ \operatorname* { d e t } \left( \frac { \partial f ( \boldsymbol { z } ) } { \partial \boldsymbol { z } } \right) = \prod _ { t } \frac { \partial f ( \boldsymbol { z } _ { \le t } ) } { \partial \boldsymbol { z } _ { t } } ,
75
+ $$
76
+
77
+ which is easy to calculate. Parallel WaveNet (van den Oord et al., 2018) uses a single logistic distribution based IAF to match its mixture of logistics (MoL) teacher.
78
+
79
+ We use the Gaussian IAF (Kingma et al., 2016) and define the transformation $x _ { t } = f ( z _ { \leq t } ; \vartheta )$ as:
80
+
81
+ $$
82
+ x _ { t } = z _ { t } \cdot \sigma ( z _ { < t } ; \pmb { \vartheta } ) + \mu ( z _ { < t } ; \pmb { \vartheta } ) ,
83
+ $$
84
+
85
+ where the shifting function $\mu ( \boldsymbol { z } _ { < t } ; \boldsymbol { \vartheta } )$ and scaling function $\sigma ( \boldsymbol { z } _ { < t } ; \boldsymbol { \vartheta } )$ are modeled by an autoregressive WaveNet in Section 3.1. The IAF transformation computes $_ { \textbf { \em x } }$ in parallel given $_ z$ , which makes efficient use of resource like GPU. Importantly, if we assume $z _ { t } \sim \mathcal { N } ( z _ { t } \mid \mu _ { 0 } , \sigma _ { 0 } )$ , it is easy to observe that $x _ { t }$ also follows a Gaussian distribution,
86
+
87
+ $$
88
+ q ( x _ { t } \mid z _ { < t } ; \pmb { \vartheta } ) = \mathcal { N } \big ( \mu _ { q } , \sigma _ { q } \big ) ,
89
+ $$
90
+
91
+ where $\mu _ { q } = \mu _ { 0 } \cdot \sigma ( z _ { < t } ; \vartheta ) + \mu ( z _ { < t } ; \vartheta )$ and $\sigma _ { q } = \sigma _ { 0 } \cdot \sigma ( z _ { < t } ; \vartheta )$ . Note that $_ { \textbf { \em x } }$ are highly correlated through the marginalization of latents $_ z$ , and the IAF jointly models $_ { \textbf { \em x } }$ at all timesteps.
92
+
93
+ To evaluate the likelihood of observed data $_ { \textbf { \em x } }$ , we can use the identities Eq. (3) and (4), and plug-in the transformation defined in Eq. (5), which will give us,
94
+
95
+ $$
96
+ q ( \pmb { x } ; \pmb { \vartheta } ) = q ( \pmb { z } ) \left( \prod _ { t } \sigma ( z _ { < t } ; \pmb { \vartheta } ) \right) ^ { - 1 } .
97
+ $$
98
+
99
+ However, one need the inverse transformationn $f ^ { - 1 }$ of Eq. (5),
100
+
101
+ $$
102
+ z _ { t } = \frac { x _ { t } - \mu ( z _ { < t } ; \vartheta ) } { \sigma ( z _ { < t } , \vartheta ) } ,
103
+ $$
104
+
105
+ to compute the corresponding $_ z$ from the observed $_ { \textbf { \em x } }$ , which is autoregressive and slow. As a result, learning an IAF directly through maximum likelihood can be very slow.
106
+
107
+ In general, normalizing flows require a series of transformations until the distribution $q ( { \pmb x } ; { \pmb \vartheta } )$ reaches a desired level of complexity. First, we draw a white noise sample $z ^ { ( 0 ) }$ from the isotropic Gaussian distribution $\mathcal { N } ( 0 , I )$ . Then, we repeatedly apply the transformation $\boldsymbol { z } _ { t } ^ { ( i ) } = f ( \boldsymbol { z } _ { \le t } ^ { ( i - 1 ) } ; \bar { \boldsymbol { \vartheta } } )$ (z(i−1)≤t ; ϑ) defined in Eq. (5) from $z ^ { ( 0 ) } \to \dots z ^ { ( i ) } \to \dots z ^ { ( n ) }$ and we let $x = z ^ { ( n ) }$ . We summarize this procedure in Algorithm 1. Note the parameters are not shared across different flows.
108
+
109
+ # 3.3 KNOWLEDGE DISTILLATION
110
+
111
+ # 3.3.1 REGULARIZED KL DIVERGENCE
112
+
113
+ van den Oord et al. (2018) proposed the probability density distillation method to circumvent the difficulty of maximum likelihood learning for IAF. In distillation, the goal is to minimize the sequence-level reverse KL divergence between the student IAF and pretrained teacher WaveNet. This sequence-level KL divergence can be naively approximated by sampling $_ z$ and $\scriptstyle { \boldsymbol { x } } = f ( { \boldsymbol { z } } )$ from IAF, but it may exhibit high variance. The variance of this estimate can be reduced by marginalizing over the one-step-ahead predictions for each timestep (van den Oord et al., 2018). However, parallel WaveNet has to run a separate Monte Carlo sampling at each timestep, because the per-time-step KL divergence between the logistic and mixture of logistics distribution is still intractable. Indeed, parallel WaveNet first draws a white noise sample $_ { z }$ , then it draws multiple different samples $x _ { t }$ from $\bar { \boldsymbol { q } } ( \boldsymbol { x } _ { t } | \boldsymbol { z } _ { < t } )$ to estimate the intractable integral. Our method only need to draw one sample $_ { z }$ , then it computes the KL divergence in closed-form thanks to the Gaussian setup.
114
+
115
+ # Algorithm 1 Gaussian Inverse Autoregressive Flows as Student Network
116
+
117
+ Input: ${ z ^ { ( 0 ) } \sim \mathcal { N } ( 0 , I ) }$ : white noises; $n$ : number of flows; $\{ \pmb { \vartheta } ^ { ( i ) } \}$ : parameters of autoregressive WaveNet for the $i$ -th flow;
118
+ Output: samples $_ { \textbf { \em x } }$ ; output distribution $q ( x _ { t } \mid z _ { < t } )$ with mean $\mu _ { q } [ t ]$ and standard deviation ${ \sigma } _ { { q } } [ t ]$
119
+ Initialize $\pmb { \mu } _ { z } = 0 , \pmb { \sigma } _ { z } = 1$
120
+ for $i$ -th flow in $[ 1 : n ]$ do Run autoregressive WaveNet $\vartheta ^ { ( i ) }$ by taking $z ^ { ( i - 1 ) }$ as input $\begin{array} { c } { \begin{array} { c } { \mu [ t ] \subset \ d \mu \big ( z _ { < t } ^ { ( i - 1 ) } ; \pmb { \vartheta } ^ { ( i ) } \big ) } \\ { \pmb { \sigma } [ t ] \pmb { \sigma } \big ( z _ { < t } ^ { ( i - 1 ) } ; \pmb { \vartheta } ^ { ( i ) } \big ) } \\ { z ^ { ( i ) } = z ^ { ( i - 1 ) } \odot \pmb { \sigma } + \pmb { \mu } } \\ { \pmb { \sigma } _ { z } = \pmb { \sigma } _ { z } \odot \pmb { \sigma } } \\ { \pmb { \mu } _ { z } = \pmb { \mu } _ { z } \odot \pmb { \sigma } + \pmb { \mu } } \end{array} } \end{array}$
121
+ end for
122
+ x = z(n), µq = µz , σq = σz
123
+ Remark: iterating over $\log \sigma$ in log-scale improves numerical stability in practice.
124
+
125
+ ![](images/b77651c40ba381f1a19b08dc0e7663312b18bab37d16aae5635163c13861a2d5.jpg)
126
+ Figure 1: The empirical histograms of (a) $\log \sigma _ { p }$ in teacher WaveNet and (b) $\log \sigma _ { q }$ in student IAF during density distillation using reverse ${ \mathrm { K L } } ^ { \mathrm { r e g } }$ divergence.
127
+
128
+ Given a white noise sample $_ { z }$ , Algorithm 1 outputs sample $\begin{array} { r } { \mathbf { \boldsymbol { x } } = f ( \boldsymbol { z } ) } \end{array}$ , as well as the output Gaussian distribution $q ( x _ { t } \mid z _ { < t } ; \vartheta )$ with mean $\mu _ { q }$ and standard deviation $\sigma _ { q }$ . We feed the sample $_ { \textbf { \em x } }$ into an autoregressive WaveNet, and obtain its output distribution $p ( x _ { t } \ | \ x _ { < t } ; \pmb \theta )$ with mean $\mu _ { p }$ and standard deviation $\sigma _ { p }$ . One can show that the per-time-step KL divergence between student’s output distribution $q ( x _ { t } | \boldsymbol { z } _ { < t } ; \vartheta )$ and teacher’s $p ( \boldsymbol { x } _ { t } | \boldsymbol { x } _ { < t } ; \boldsymbol { \theta } )$ has closed-form expression (see Appendix D),
129
+
130
+ $$
131
+ \operatorname { K L } { \big ( } q \parallel p { \big ) } = \log { \frac { \sigma _ { p } } { \sigma _ { q } } } + { \frac { \sigma _ { q } ^ { 2 } - \sigma _ { p } ^ { 2 } + ( \mu _ { p } - \mu _ { q } ) ^ { 2 } } { 2 \sigma _ { p } ^ { 2 } } } ,
132
+ $$
133
+
134
+ which also forms an unbiased estimate of the sequence-level KL divergence between student’s distribution $q ( { \pmb x } )$ and teacher $p ( { \pmb x } )$ (see Appendix C).
135
+
136
+ In this submission, we lower bound $\log \sigma _ { p }$ and $\log \sigma _ { q }$ at $^ { - 7 }$ before calculating the KL divergence. 4 However, the division by $\sigma _ { p } ^ { 2 }$ still raises serious numerical problem, when we directly minimize the average KL divergence over all timesteps. To elaborate this, we monitor the empirical histograms of $\sigma _ { p }$ from teacher WaveNet during distillation in Figure 1 (a). One can see that it is mostly distributed around $( e ^ { - 9 } , e ^ { - 2 } )$ , which incurs numerical problem if $\sigma _ { p }$ and $\sigma _ { q }$ have very different magnitudes at the beginning of training. This is because a well-trained WaveNet usually has highly peaked output distributions. The same observation holds true for other output distributions, including mixture of Gaussians and mixture of logistics.
137
+
138
+ To address this problem, we define the following variant of $\mathrm { K L }$ divergence:
139
+
140
+ $$
141
+ \begin{array} { r } { { \bf K } { \bf L } ^ { \mathrm { r e g } } \left( q \parallel p \right) = \lambda \big | \log \sigma _ { p } - \log \sigma _ { q } \big | ^ { 2 } + { \bf K } { \bf L } \left( q \parallel p \right) . } \end{array}
142
+ $$
143
+
144
+ 4Clipping at $- 6$ also works well and could improve numerical stability. See more discussion in Appendix A.
145
+
146
+ One can interpret the first term as regularization,5 which largely stabilizes the optimization process by quickly matching the $\sigma$ ’s from student and teacher models, as demonstrated in Figure 1 (a) and (b). In addition, it does not introduce any bias for matching their probability density functions, as we have the following proposition:
147
+
148
+ Proposition 3.1. For probability distributions in the location-scale family (including Gaussian, logistic distribution etc.), the regularized $K L$ divergence in Eq. (10) still satisfies the following properties: (i) $\mathrm { K L } ^ { r e g } \left( q \parallel p \right) \geq 0$ , and (ii) $\mathrm { K L } ^ { r e g } \left( q \parallel \bar { p } \right) = 0$ if and only if $p = q$ .
149
+
150
+ Given a sample $_ { z }$ and its mapped $_ { \textbf { \em x } }$ , we also test the forward $K L$ divergence between the student’s output distribution $q ( x _ { t } | \boldsymbol { z } _ { < t } ; \vartheta )$ and teacher’s $p ( \boldsymbol { x } _ { t } | \boldsymbol { x } _ { < t } ; \boldsymbol { \theta } )$ ,
151
+
152
+ $$
153
+ \begin{array} { r } { \mathrm { K L } \left( p \parallel q \right) = \mathbb { H } ( p , q ) - \mathbb { H } ( p ) , } \end{array}
154
+ $$
155
+
156
+ where $\mathbb { H } ( p , q )$ is the cross entropy, and $\mathbb H ( p )$ is the entropy of teacher model. One can ignore the entropy term $\mathbb H ( p )$ since we are optimizing student $q$ under a pretrained teacher $p$ . Note that the sample-level forward KLD in Eq. (11) is a biased estimate of sequence-level $\mathbb { L } \left( { \bar { p } } ( { \pmb x } ) \parallel q ( { \pmb x } ) \right)$ . To make it numerically stable, we apply the same regularization term in Eq. (10) and observe very similar empirical distributions of $\log { \sigma }$ in Figure 1.
157
+
158
+ # 3.3.2 STFT LOSS
159
+
160
+ In knowledge distillation, it is a common practice to incorporate an additional loss using the groundtruth dataset (e.g., Kim and Rush, 2016). Empirically, we found that training student IAF with KL divergence loss alone will lead to whisper voices. van den Oord et al. (2018) advocates the average power loss to solve this issue, which is actually coupled with the short length of training audio clip (i.e. 0.32s) in their experiments. As the clip length increases, the average power loss will be less effective. Instead, we compute the frame-level loss between the output samples $_ { \textbf { \em x } }$ from student IAF and corresponding ground-truth audio ${ \bf { x } } _ { n }$ :
161
+
162
+ $$
163
+ \frac { 1 } { B } \bigg \| \big | \mathrm { S T F T } ( \pmb { x } ) \big | - \big | \mathrm { S T F T } ( \pmb { x } _ { n } ) \big | \bigg \| _ { 2 } ^ { 2 } ,
164
+ $$
165
+
166
+ where $\left| \operatorname { S T F T } ( { \pmb x } ) \right|$ are the magnitudes of short-term Fourier transform (STFT), and $B = 1 0 2 5$ is the number of frequency bins as we set FFT size to 2048. We use a $1 2 . 5 \mathrm { m s }$ frame-shift, 50ms window length and Hanning window. Our final loss function is a linear combination of average KL divergence and frame-level loss, and we simply set their coefficients to one in all experiments.
167
+
168
+ # 4 TEXT-TO-WAVE ARCHITECTURE
169
+
170
+ In this section, we present our fully convolutional text-to-wave architecture (see Fig. 2 (a)) for endto-end TTS. Our architecture is based on Deep Voice 3 (DV3), a convolutional attention-based TTS system (Ping et al., 2018). DV3 is capable of converting textual features (e.g., characters, phonemes and stresses) into spectral features (e.g., log-mel spectrograms and log-linear spectrograms). These spectral features can be used as inputs for a separately trained waveform synthesis model, such as WaveNet. In contrast, we directly feed the hidden representation learned from the attention mechanism to the WaveNet through some intermediate processing, and train the whole model from scratch in an end-to-end manner.
171
+
172
+ Note that, conditioning the WaveNet on hidden representation is crucial to the success of training from scratch. Indeed, we tried to condition WaveNet on predicted mel-spectrogram from DV3, thus the gradients of WaveNet loss can backpropagate through DV3 to improve the text-to-spectrogram model. When the whole model is trained from scratch, we found it performs slightly worse than the separate training pipeline. The major reason is that the predicted mel-spectrogram from DV3 can be inaccurate at early training, and may spoil the training of WaveNet. In order to get satisfactory results, one need pretrain DV3 and WaveNet, then fine-tune the whole system (e.g., Zhao et al., 2018).
173
+
174
+ The proposed architecture consists of four components:
175
+
176
+ ![](images/dde2977d1e73c1531708fa9055c6f7cb71445d25b4c89e76a25b99f4d5d5abc7.jpg)
177
+ Figure 2: (a) Text-to-wave model converts textual features into waveform. All components feed their hidden representation to others directly. (b) Bridge-net maps frame-level hidden representation to sample-level through several convolution blocks and transposed convolution layers interleaved with softsign non-linearities. (c) Convolution block is based on gated linear unit.
178
+
179
+ • Encoder: A convolutional encoder as in DV3, which encodes textual features into an internal hidden representation. Decoder: A causal convolutional decoder as in DV3, which decodes the encoder representation with attention into the log-mel spectrogram in an autoregressive manner. Bridge-net: A convolutional intermediate processing block, which processes the hidden representation from the decoder and predict log-linear spectrogram. Unlike the decoder, it is non-causal and can thus utilize future context information. In addition, it upsamples the hidden representation from frame-level to sample-level.
180
+ Vocoder: A Gaussian autoregressive WaveNet to synthesize the waveform, which is conditioned on the upsampled hidden representation from the bridge-net. This component can be replaced by a student IAF distilled from the autoregressive vocoder.
181
+
182
+ The overall objective function is a linear combination of the losses from decoder, bridge-net and vocoder; we simply set all coefficients to one in experiments. We introduce bridge-net to utilize future temporal information as it can apply non-causal convolution. All modules in our architecture are convolutional, which enables fast training 6 and alleviates the common difficulties in RNN-based models (e.g., vanishing and exploding gradient problems (Pascanu et al., 2013)). Throughout the whole model, we use the convolution block from DV3 (see Fig. 2(c)) as the basic building block. It consists of a 1-D convolution with a gated linear unit (GLU) and a residual connection. We set the dropout probability to 0.05 in all experiments. We give further details in the following subsections.
183
+
184
+ # 4.1 ENCODER-DECODER
185
+
186
+ We use the same encoder-decoder architecture as DV3 (Ping et al., 2018). The encoder first converts characters or phonemes into trainable embeddings, followed by a series of convolution blocks to extract long-range textual information. The decoder autoregressively predicts the log-mel spectrograms with an L1 loss (teacher-forced at training). It starts with layers of 1x1 convolution to preprocess the input log-mel spectrogram, and then applies a series of causal convolutions and attentions. A multi-hop attention-based alignment is learned between character embeddings and log-mel spectrograms.
187
+
188
+ # 4.2 BRIDGE-NET
189
+
190
+ The hidden states of decoder are fed to the bridge-net for temporal processing and upsampling. The output hidden representation is then fed to the vocoder for waveform synthesis. Bridge-net consists of a stack of convolution blocks, and two layers of transposed 2-D convolution interleaved with softsign
191
+
192
+ Table 1: Mean Opinion Score (MOS) ratings with $9 5 \%$ confidence intervals using different output distributions for autoregressive WaveNet. We also include the conditional log-likelihoods (CLL) (per dimension) on the same 16 test audios for WaveNet with continuous outputs.
193
+
194
+ <table><tr><td>Output Distribution</td><td>Subjective 5-scale MOS</td><td>Test CLL</td></tr><tr><td>Gaussian</td><td>4.40±0.20</td><td>4.687</td></tr><tr><td>Mixture of Gaussians Mixture of Logistics</td><td>4.38±0.22 4.03 ± 0.27</td><td>4.671 4.590</td></tr><tr><td>Softmax (2048-way)</td><td>4.31 ± 0.23</td><td></td></tr><tr><td>Ground-truth (24 kHz)</td><td>4.54± 0.12</td><td></td></tr></table>
195
+
196
+ <table><tr><td>Distillation method</td><td>Subjective 5-scale MOS</td></tr><tr><td>Student-1 with reverse KLreg Student-1 with forward KLreg Student-2 with reverse KL reg</td><td>4.16± 0.21 4.12 ± 0.20</td></tr></table>
197
+
198
+ Table 2: Mean Opinion Score (MOS) ratings with $9 5 \%$ confidence intervals using different distillation objective functions for student Gaussian IAF. We use the crowdMOS toolkit as in Table 1.
199
+
200
+ to upsample the per-timestep hidden representation from 80 per second to 24,000 per second. The upsampling strides in time are 15 and 20 for the two layers, respectively. Correspondingly, we set the 2-D convolution filter sizes as $( 3 0 , 3 )$ and $( 4 0 , 3 )$ , where the filter sizes (in time) are doubled from strides to avoid the checkerboard artifacts (Odena et al., 2016).
201
+
202
+ # 5 EXPERIMENT
203
+
204
+ In this section, we present several experiments to evaluate the proposed parallel wave generation method and text-to-wave architecture.
205
+
206
+ Data: We use an internal English speech dataset containing about 20 hours of audio from a female speaker with a sampling rate of $4 8 \mathrm { k H z }$ . We downsample the audios to $2 4 \mathrm { k H z }$ .
207
+
208
+ Autoregressive WaveNet: We first show that a single Gaussian output distribution for autoregressive WaveNet suffices to model the raw waveform. We use the similar WaveNet architecture detailed in Arık et al. (2017a) (see Appendix B). We use 80-band log-mel spectrogram as the conditioner. To upsample the conditioner from frame-level (80 per second) to sample-level (24,000 per second), we apply two layers of transposed 2-D convolution (in time and frequency) interleaved with leaky ReLU $\mathit { \Delta } \alpha = 0 . 4$ ). The upsampling strides in time are 15 and 20 for the two layers, respectively. Correspondingly, we set the 2-D convolution filter sizes as $( 3 0 , 3 )$ and $( 4 0 , 3 )$ . We also find that normalizing log-mel spectrogram to the range of [0, 1] improves the synthesized audio quality (e.g., Yamamoto, 2018). We train 20-layers WaveNets conditioned on ground-truth log-mel spectrogram with various output distributions, including single Gaussian, 10-component mixture of Gaussians (MoG), 10-component mixture of Logistics (MoL), and softmax with 2048 linearly quantized channels. We set both residual channel (dimension of the hidden state of every layer) and skip channel (the dimension to which layer outputs are projected prior to the output layer) to 128. We set the filter size of dilated convolutions to 2 for teacher WaveNet. All models share the same architecture except the output distributions, and they are trained for 1000K steps using the Adam optimizer (Kingma and Ba, 2015) with batch-size 8 and 0.5s audio clips. The learning rate is set to 0.001 in the beginning and annealed by half for every 200K steps.
209
+
210
+ We report the mean opinion score (MOS) for naturalness evaluation in Table 1. We use the crowdMOS toolkit (Ribeiro et al., 2011), where batches of samples from these models were presented to workers on Mechanical Turk. The results indicate that the Gaussian autoregressive WaveNet provides comparable results to MoG and softmax outputs, and outperforms MoL in our experiments. We also include the conditional log-likelihoods (CLL) on test audios (conditioned on mel-spectrograms) for continuous output WaveNets, where the Gaussian, MoG, and MoL are trained with the same clipping constant $- 9$ . See more discussions about clipping constant for log-scale variable in Appendix A. MoL obtains slightly worse CLL, as it does not directly optimize the continuous likelihood.
211
+
212
+ Student Gaussian IAF: We distill two 60-layer parallel student-nets from a pre-trained 20-layer Gaussian autoregressive WaveNet. Our student-1 consists six stacked Gaussian IAF and each flow is parameterized by a 10-layer WaveNet with 64 residual channels, 64 skip channels, and filter size 3 in dilated convolutions. Student-2 consists of four stacked Gaussian IAF blocks, which are parameterized by [10, 10, 10, 30]-layer WaveNets respectively, with the same channels and filter size as studuent-1. For student-2, we also reverse the sequence being generated in time between successive IAF blocks and find it improves the performance. Note that the student models share the same conditioner network (layers of transposed 2-D convolution) with teacher WaveNet during distillation. Training conditioner network of student model from scratch leads to worse result. We test both the forward and reverse KL divergences combined with the STFT-loss, and we simply set their combination coefficients to one in all experiments. The student models are trained for 1000K steps using Adam optimizer. The learning rate is set to 0.001 in the beginning and annealed by half for every 200K steps. Surprisingly, we always find good results after only 50K steps of distillation, which perhaps benefits from the closed-form computation of KL divergence. The models are trained longer for extra improvement. We report the MOS evaluation results in Table 2. Both of these distillation methods work well and obtain comparable results. Student-2 outperforms student-1 by generating “clearner” voices. We expect further improvements by incorporating perceptual and contrastive losses introduced in van den Oord et al. (2018) and we will leave it for future work. At inference, the parallel student-net runs ${ \sim } 2 0 $ times faster than real time on NVIDIA GeForce GTX 1080 Ti.
213
+
214
+ Table 3: Mean Opinion Score (MOS) ratings with $9 5 \%$ confidence intervals for comparing the text-to-wave model and separately trained pipeline. We use the crowdMOS toolkit as in Table 1.
215
+
216
+ <table><tr><td>Method</td><td>Subjective 5-scale MOS</td></tr><tr><td>Text-to-WaveModel</td><td>4.15± 0.25</td></tr><tr><td>Text-to-Wave (distilled vocoder)</td><td>4.11 ± 0.24</td></tr><tr><td>DV3 +WaveNet (predicted Mel)</td><td>3.81 ± 0.26</td></tr><tr><td>DV3+ WaveNet (true Mel)</td><td>3.73 ± 0.24</td></tr></table>
217
+
218
+ Text-to-Wave Model: We train the proposed text-to-wave model from scratch and compare it with the separately trained pipeline presented in Deep Voice 3 (DV3) (Ping et al., 2018). We use the same text preprocesssing and joint character-phoneme representation in DV3. The hyper-parameters of encoder and decoder are the same as the single-speaker DV3. The bridge-net has 6 layers of convolution blocks with input/output size of 256. The hyper-parameters of the vocoders are the same as previous subsections. The vocoder part is trained by conditioning on sliced hidden representations corresponding to 0.5s audio clips. Other parts of model are trained on whole-length utterances. The model is trained for $1 . 5 \mathbf { M }$ steps using Adam optimizer with batch size 16. The learning rate is set to 0.001 in the beginning and annealed by half for every 500K steps. We also distill a Gaussian IAF from the trained autoregressive vocoder within this end-to-end model. Both student IAF and autoregressive vocoder are conditioned on the upsampled hidden representation from the bridge-net. For the separately trained pipeline, we train two Gaussian autoregressive WaveNets conditioned on groundtruth mel-spectrogram and predicted mel-spectrogram from DV3, respectively. We run inference on the same unseen text as DV3 and report the MOS results in Table 3. The results demonstrate that the text-to-wave model significantly outperforms the separately trained pipeline. The text-to-wave model with a distilled parallel vocoder gives slightly worse result to the one with autoregressive vocoder. In the separately trained pipeline, training a WaveNet conditioned on predicted mel-spectrograms eases the training/test mismatch, thus outperforms training with ground-truth.
219
+
220
+ # 6 CONCLUSION
221
+
222
+ In this work, we first demonstrate that a single Gaussian output distribution is sufficient for modeling the raw waveform in WaveNet without degeneration of audio quality. Then, we propose a parallel wave generation method based on Gaussian inverse autoregressive flow (IAF), in which the IAF is distilled from the autoregressive WaveNet by minimizing a regularized KL divergence for highly peaked distributions. In contrast to parallel WaveNet, our distillation algorithm estimates the KL divergence in closed-form and largely stabilizes the training procedure. Furthermore, we propose the first text-to-wave neural architecture for TTS, which can be trained from scratch in an end-to-end manner. Our text-to-wave architecture outperforms the separately trained pipeline and opens up the research opportunities for fully end-to-end TTS. We also demonstrate appealing results by distilling a parallel neural vocoder conditioned on the hidden representation within the end-to-end model.
223
+
224
+ # ACKNOWLEDGEMENTS
225
+
226
+ We thank Yongguo Kang, Yu Gu and Tao Sun from Baidu Speech Department for very helpful discussions. We also thank anonymous reviewers for their valuable feedback and suggestions.
227
+
228
+ # REFERENCES
229
+
230
+ S. O. Arık, M. Chrzanowski, A. Coates, G. Diamos, A. Gibiansky, Y. Kang, X. Li, J. Miller, J. Raiman, S. Sengupta, and M. Shoeybi. Deep Voice: Real-time neural text-to-speech. In ICML, 2017a.
231
+ S. O. Arık, G. Diamos, A. Gibiansky, J. Miller, K. Peng, W. Ping, J. Raiman, and Y. Zhou. Deep Voice 2: Multi-speaker neural text-to-speech. In NIPS, 2017b.
232
+ D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015.
233
+ C. Bucilua, R. Caruana, and A. Niculescu-Mizil. Model compression. In ACM SIGKDD, 2006.
234
+ J. Chung, K. Kastner, L. Dinh, K. Goel, A. C. Courville, and Y. Bengio. A recurrent latent variable model for sequential data. In NIPS, 2015.
235
+ L. Dinh, D. Krueger, and Y. Bengio. NICE: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
236
+ L. Dinh, J. Sohl-Dickstein, and S. Bengio. Density estimation using Real NVP. In ICLR, 2017.
237
+ D. Griffin and J. Lim. Signal estimation from modified short-time Fourier transform. IEEE Transactions on Acoustics, Speech, and Signal Processing, 1984.
238
+ J. Gu, J. Bradbury, C. Xiong, V. O. Li, and R. Socher. Non-autoregressive neural machine translation. In ICLR, 2018.
239
+ G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
240
+ Ł. Kaiser, A. Roy, A. Vaswani, N. Pamar, S. Bengio, J. Uszkoreit, and N. Shazeer. Fast decoding in sequence models using discrete latent variables. arXiv preprint arXiv:1803.03382, 2018.
241
+ Y. Kim and A. M. Rush. Sequence-level knowledge distillation. In EMNLP, 2016.
242
+ D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
243
+ D. P. Kingma and M. Welling. Auto-encoding variational Bayes. In ICLR, 2014.
244
+ D. P. Kingma, T. Salimans, R. Jozefowicz, X. Chen, I. Sutskever, and M. Welling. Improving variational inference with inverse autoregressive flow. In NIPS, 2016.
245
+ J. Lee, E. Mansimov, and K. Cho. Deterministic non-autoregressive neural sequence modeling by iterative refinement. arXiv preprint arXiv:1802.06901, 2018.
246
+ S. Mehri, K. Kumar, I. Gulrajani, R. Kumar, S. Jain, J. Sotelo, A. Courville, and Y. Bengio. SampleRNN: An unconditional end-to-end neural audio generation model. In ICLR, 2017.
247
+ M. Morise, F. Yokomori, and K. Ozawa. WORLD: a vocoder-based high-quality speech synthesis system for real-time applications. IEICE Transactions on Information and Systems, 2016.
248
+ K. Murphy. Machine learning, a probabilistic perspective, 2014.
249
+ A. Odena, V. Dumoulin, and C. Olah. Deconvolution and checkerboard artifacts. Distill, 2016. doi: 10.23915/distill.00003. URL http://distill.pub/2016/deconv-checkerboard.
250
+ R. Pascanu, T. Mikolov, and Y. Bengio. On the difficulty of training recurrent neural networks. In ICML, 2013.
251
+ W. Ping, K. Peng, A. Gibiansky, S. O. Arik, A. Kannan, S. Narang, J. Raiman, and J. Miller. Deep Voice 3: Scaling text-to-speech with convolutional sequence learning. In ICLR, 2018.
252
+ D. J. Rezende and S. Mohamed. Variational inference with normalizing flows. In ICML, 2015.
253
+ F. Ribeiro, D. Florêncio, C. Zhang, and M. Seltzer. CrowdMOS: An approach for crowdsourcing mean opinion score studies. In ICASSP, 2011.
254
+ A. Roy, A. Vaswani, A. Neelakantan, and N. Parmar. Theory and experiments on vector quantized autoencoders. arXiv preprint arXiv:1805.11063, 2018.
255
+ T. Salimans, A. Karpathy, X. Chen, and D. P. Kingma. PixelCNN $^ { + + }$ : Improving the PixelCNN with discretized logistic mixture likelihood and other modifications. In ICLR, 2017.
256
+ J. Shen, R. Pang, R. J. Weiss, M. Schuster, N. Jaitly, Z. Yang, Z. Chen, Y. Zhang, Y. Wang, R. SkerryRyan, et al. Natural TTS synthesis by conditioning WaveNet on mel spectrogram predictions. In ICASSP, 2018.
257
+ J. Sotelo, S. Mehri, K. Kumar, J. F. Santos, K. Kastner, A. Courville, and Y. Bengio. Char2wav: End-to-end speech synthesis. ICLR workshop, 2017.
258
+ Y. Taigman, L. Wolf, A. Polyak, and E. Nachmani. VoiceLoop: Voice fitting and synthesis via a phonological loop. In ICLR, 2018.
259
+ P. Taylor. Text-to-Speech Synthesis. Cambridge University Press, 2009.
260
+ B. Uria, I. Murray, and H. Larochelle. Rnade: The real-valued neural autoregressive density-estimator. In Advances in Neural Information Processing Systems, pages 2175–2183, 2013.
261
+ A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. WaveNet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016a.
262
+ A. van den Oord, N. Kalchbrenner, L. Espeholt, O. Vinyals, A. Graves, et al. Conditional image generation with PixelCNN decoders. In NIPS, 2016b.
263
+ A. van den Oord, Y. Li, I. Babuschkin, K. Simonyan, O. Vinyals, K. Kavukcuoglu, G. v. d. Driessche, E. Lockhart, L. C. Cobo, F. Stimberg, et al. Parallel WaveNet: Fast high-fidelity speech synthesis. In ICML, 2018.
264
+ Y. Wang, R. Skerry-Ryan, D. Stanton, Y. Wu, R. J. Weiss, N. Jaitly, Z. Yang, Y. Xiao, Z. Chen, S. Bengio, Q. Le, Y. Agiomyrgiannakis, R. Clark, and R. A. Saurous. Tacotron: Towards end-to-end speech synthesis. In Interspeech, 2017.
265
+ R. Yamamoto. WaveNet vocoder, 2018. URL https://github.com/r9y9/wavenet_ vocoder.
266
+ Y. Zhao, S. Takaki, H.-T. Luong, J. Yamagishi, D. Saito, and N. Minematsu. Wasserstein GAN and waveform loss-based acoustic model training for multi-speaker text-to-speech synthesis systems using a WaveNet vocoder. IEEE Access, 2018.
267
+
268
+ # Appendices
269
+
270
+ # A CLIPPING LOG-SCALE AT TRAINING
271
+
272
+ Clipping for $\log \sigma$ plays an important role in training Gaussian WaveNet. Without the clipping trick, the optimization process become numerically unstable. The clipping constant also controls the model capacity and largely impacts on final speech quality. We discuss its impact for both autoregressive WaveNet and student IAF. Note that, the clipping is only applied at training, not at inference.
273
+
274
+ ![](images/808555fed8c6d9a6e8e3f775f1b1cad1eb5d4c3866f569310b0803a32bc83607.jpg)
275
+ Figure 3: The negative log-likelihoods (per dimension) of Gausssian WaveNet on hold-out audios during training. The learning rates in Adam optimizer are initially set to 0.001 and annealed by half for every 200K steps.
276
+
277
+ # A.1 AUTOREGRESSIVE WAVENET
278
+
279
+ For Gaussian WaveNet alone, smaller clipping constant for $\log \sigma ( x _ { < t } )$ at training usually leads to larger likelihood, but it also need more iterations to converge. Figure 3 shows its impact on log-likelihood and convergence behaviour. From Figure 3 (a)-(d), the validation likelihood improves a lot from with clipping constant $- 7$ to $^ { - 9 }$ , but the improvement is negligible from $^ { - 9 }$ to $- 1 0$ . In addition, (e) shows the numerical instability without clipping, and (f) shows the dequantization with uniform noise u ∈ [0, 265536 ] stabilizes optimization and performs very similar as clipping at $- 1 0$ .
280
+
281
+ For speech quality, models trained with small clipping constant (e.g., $- 9 )$ tend to have less artifacts at convergence, especially for the silence portion of utterances. However, very small clipping constant in teacher WaveNet may raise difficulty for distillation, because the range of $\log \sigma$ will be large (see Figure 4). For different datasets and conditioners, the optimal clipping constant may be different. We suggest $- 9$ as the default for Gaussian teacher, after we tried various datasets (including English, Mandarin) and conditioners (including mel-spectrogram, hidden states, linguistic conditioner).
282
+
283
+ ![](images/90778094f07481c5fd45ecd3f9621822ff18426e1637dded624a66c77ef74dd7.jpg)
284
+ Figure 4: The empirical histograms of predicted $\log \sigma$ (before clipping) in Gaussian WaveNet with different clipping constants during training.
285
+
286
+ # A.2 GAUSSIAN IAF
287
+
288
+ In distillation, we also clip $\log \sigma _ { p }$ and $\log \sigma _ { q }$ for numerical reason before computing the KL divergence (KLD). Note that, the clipping is not applied for the regularization term. In general, larger clipping constant leads to more stable optimization, but it could make the KLD loss less useful. We suggest $- 6$ as the default setting, after we tried various datasets and conditioners.
289
+
290
+ Useful tricks: When we work on student WaveNet with linguistic conditioner on internal Mandarin dataset, we find the following tricks are effective to improve the numerical stability at distillation.
291
+
292
+ • After initial training (e.g., 500 iterations), if the KLD loss is larger than a threshold (e.g., 10.0), we simply mask it as zero, and let the regularization term and STFT loss to help it out. • After initial training, if the global norm of gradients is larger than 1000.0, we clip the gradients by small values $[ - 0 . 1 , 0 . 1 ]$ . Otherwise, we clip the values of gradients to $[ - 5 . 0 , 5 . 0 ]$ . • Larger batch size (e.g., 16) and smaller learning rate (e.g., 0.0002) are helpful to stabilize the distillation.
293
+
294
+ # B DETAILS OF DILATED CONVOLUTION BLOCK
295
+
296
+ We also employ a stack of dilated convolution blocks, where each block has 10 layers and the dilation is doubled at each layer, i.e., $\{ 1 , 2 , 4 , . . . , 5 1 2 \}$ . We add the output hidden states from each layer through residual connection before projecting them to the number of skip channels.
297
+
298
+ In dilated convolution block, we compute the $i$ -th hidden layer $\mathbf { \delta } _ { h } ( i )$ with dialation $2 ^ { i - 1 }$ by gated convolutions (van den Oord et al., 2016b):
299
+
300
+ $$
301
+ \begin{array} { r } { \pmb { h } ^ { ( i ) } = \mathrm { s i g m o i d } ( \pmb { W } _ { g } ^ { ( i ) } \ast \pmb { h } ^ { ( i - 1 ) } + \pmb { A } _ { g } ^ { ( i ) } \cdot \pmb { c } + \pmb { b } _ { g } ^ { ( i ) } ) \odot \mathrm { t a n h } ( \pmb { W } _ { f } ^ { ( i ) } \ast \pmb { h } ^ { ( i - 1 ) } + \pmb { A } _ { f } ^ { ( i ) } \cdot \pmb { c } + \pmb { b } _ { f } ^ { ( i ) } ) , } \end{array}
302
+ $$
303
+
304
+ therein $\boldsymbol { h } ^ { 0 } = \boldsymbol { x }$ is the input of the block, $^ *$ denotes the causal dilated convolution, $\cdot$ represents $1 \times 1$ convolution over the upsampled conditioner $^ c$ , $\odot$ denotes the element-wise multiplication, $W _ { g } ^ { ( i ) } , A _ { g } ^ { ( i ) } , b _ { g } ^ { ( i ) }$ are convolutions and bias parameters at $i$ -th layer for sigmoid gating function, and $W _ { f } ^ { ( i ) } , A _ { f } ^ { ( i ) } , b _ { f } ^ { ( i ) }$ are analogous parameters for tanh function.
305
+
306
+ # C ESTIMATE THE SEQUENCE-LEVEL KL DIVERGENCE
307
+
308
+ The sequence-level KL divergence between student distribution $q ( { \pmb x } )$ and teacher’s $p ( { \pmb x } )$ can be written as,
309
+
310
+ $$
311
+ \begin{array} { r l } & { = \mathbb { E } _ { q ( x ) } \left[ \displaystyle \sum _ { \mathbf { t } = 1 } ^ { T } \log q ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) - \log p ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) \right] } \\ & { \phantom { = \ } } \\ & { = \displaystyle \sum _ { \mathbf { t } = 1 } ^ { T } \mathbb { E } _ { q ( x _ { t } ) \leq \ \Big [ \log q ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) - \log p ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) \Big ] } } \\ & { = \displaystyle \sum _ { \mathbf { t } = 1 } ^ { T } \mathbb { E } _ { q ( x _ { t } ) \leq \ \log \Big [ \log q ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) \Big [ \log q ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) - \log p ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) \Big ] } } \\ & { = \displaystyle \sum _ { \mathbf { t } = 1 } ^ { T } \mathbb { E } _ { q ( x _ { t } ) \leq \ \log \Big [ \mathrm { K L } \big ( q ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) \big [ \log ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) \big ) \Big ] } } \\ & { = \displaystyle \sum _ { \mathbf { t } = 1 } ^ { T } \sum _ { \mathbf { t } = 1 } ^ { T } \Big [ \mathrm { K L } \big ( q ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) \big \lVert p ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) \big \rVert \Big ) } \\ & { = \mathbb { E } _ { q ( x ) \leq \ \frac { T } { \delta } } \left[ \mathrm { K L } \left( q ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) \big \lVert p ( x _ { t } | x _ { \mathbf { c } ( \cdot ) } ) \big \rVert \right) \right] } \end{array}
312
+ $$
313
+
314
+ Note that, the above equality holds for arbitrary distributions. Since $q ( { \pmb x } )$ is an IAF, and $_ { \textbf { \em x } }$ are sampled through $\begin{array} { r } { { \bf x } = f ( z ) } \end{array}$ and $z \sim N ( 0 , I )$ , then
315
+
316
+ $$
317
+ \mathrm { K L } \left( q ( \pmb { x } ) \parallel p ( \pmb { x } ) \right) = \underset { \pmb { x } \sim N ( 0 , I ) } { \mathbb { E } } \Big [ \sum _ { t = 1 } ^ { T } \mathrm { K L } \left( q ( x _ { t } | \mathfrak { z } _ { < t } ) \parallel p ( x _ { t } | \mathfrak { x } _ { < t } ) \right) \Big ] .
318
+ $$
319
+
320
+ Thus, the summation of per-time-step KL divergence is an unbiased estimate of the sequence-level KL divergence.
321
+
322
+ # D KL DIVERGENCE BETWEEN GAUSSIAN DISTRIBUTIONS
323
+
324
+ Given two Gaussian distributions $p ( x ) = \mathcal { N } ( \mu _ { p } , \sigma _ { p } )$ and $\boldsymbol { q } ( \boldsymbol { x } ) = \mathcal { N } ( \mu _ { q } , \sigma _ { q } )$ , their KL divergence is:
325
+
326
+ $$
327
+ \mathrm { K L } \left( q \parallel p \right) = \int q ( x ) \log \frac { q ( x ) } { p ( x ) } d x = \mathbb { H } ( q , p ) - \mathbb { H } ( q )
328
+ $$
329
+
330
+ where $\log \equiv \log _ { e }$ , the entropy,
331
+
332
+ $$
333
+ \begin{array} { r l } & { \mathbb { H } ( q ) = - \displaystyle \int q ( x ) \log q ( x ) d x } \\ & { \quad \quad = - \displaystyle \int q ( x ) \log \left[ ( 2 \pi \sigma q _ { q } ^ { 2 } ) ^ { - \frac { 1 } { 2 } } \exp \big ( - \frac { ( x - \mu _ { q } ) ^ { 2 } } { 2 \sigma _ { q } ^ { 2 } } \big ) \right] d x } \\ & { \quad \quad = \displaystyle \frac { 1 } { 2 } \log \big ( 2 \pi \sigma q _ { q } ^ { 2 } \big ) \int q ( x ) d x + \frac { 1 } { 2 \sigma _ { q } ^ { 2 } } \int q ( x ) ( x - \mu _ { q } ) ^ { 2 } d x } \\ & { \quad \quad = \displaystyle \frac { 1 } { 2 } \log \big ( 2 \pi \sigma q _ { q } ^ { 2 } \big ) \cdot 1 + \frac { 1 } { 2 \sigma _ { q } ^ { 2 } } \cdot \sigma _ { q } ^ { 2 } } \\ & { \quad \quad = \displaystyle \frac { 1 } { 2 } \log \big ( 2 \pi \sigma q _ { q } ^ { 2 } \big ) + \frac { 1 } { 2 } } \end{array}
334
+ $$
335
+
336
+ and the cross entropy,
337
+
338
+ $$
339
+ \begin{array} { r l } { \mathbb { H } ( q , p ) = - \int q ( x ) \log p ( x ) d x } \\ { \ } & { = - \int q ( x ) \log \left[ ( 2 \pi \sigma _ { p } ^ { 2 } ) ^ { - \frac { 1 } { 2 } } \exp \big ( - \frac { ( x - \mu _ { p } ) ^ { 2 } } { 2 \sigma _ { p } ^ { 2 } } \big ) \right] d x } \\ { \ } & { = \frac { 1 } { 2 } \log \big ( 2 \pi \sigma _ { p } ^ { 2 } \big ) \int q ( x ) d x + \frac { 1 } { 2 \sigma _ { p } ^ { 2 } } \int q ( x ) ( x - \mu _ { p } ) ^ { 2 } d x } \\ { \ } & { = \frac { 1 } { 2 } \log \big ( 2 \pi \sigma _ { p } ^ { 2 } ) + \frac { 1 } { 2 \sigma _ { p } ^ { 2 } } \int q ( x ) ( x ^ { 2 } - 2 \mu _ { p } x + \mu _ { p } ^ { 2 } ) d x } \\ { \ } & { = \frac { 1 } { 2 } \log \big ( 2 \pi \sigma _ { p } ^ { 2 } \big ) + \frac { \mu _ { p } ^ { 2 } + \sigma _ { p } ^ { 2 } - 2 \mu _ { p } \mu _ { p } + \mu _ { p } ^ { 2 } } { 2 \sigma _ { p } ^ { 2 } } } \\ { \ } & { = \frac { 1 } { 2 } \log \big ( 2 \pi \sigma _ { p } ^ { 2 } \big ) + \frac { \sigma _ { q } ^ { 2 } + \big ( \mu _ { p } - \mu _ { q } \big ) ^ { 2 } } { 2 \sigma _ { p } ^ { 2 } } . } \end{array}
340
+ $$
341
+
342
+ Combining $\mathbb { H } ( q )$ and $\mathbb { H } ( q , p )$ together, we obtain
343
+
344
+ $$
345
+ \operatorname { K L } { \big ( } q \parallel p { \big ) } = \log { \frac { \sigma _ { p } } { \sigma _ { q } } } + { \frac { \sigma _ { q } ^ { 2 } - \sigma _ { p } ^ { 2 } + ( \mu _ { p } - \mu _ { q } ) ^ { 2 } } { 2 \sigma _ { p } ^ { 2 } } } .
346
+ $$
parse/train/HklY120cYm/HklY120cYm_content_list.json ADDED
@@ -0,0 +1,1513 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "CLARINET: PARALLEL WAVE GENERATION IN END-TO-END TEXT-TO-SPEECH ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 176,
8
+ 98,
9
+ 728,
10
+ 146
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Wei Ping∗ Kainan Peng∗ Jitong Chen∗ \n{pingwei01, pengkainan, chenjitong01}@baidu.com \nBaidu Research \n1195 Bordeaux Dr, Sunnyvale, CA 94089 ",
17
+ "bbox": [
18
+ 191,
19
+ 169,
20
+ 650,
21
+ 231
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 268,
32
+ 544,
33
+ 284
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "In this work, we propose a new solution for parallel wave generation by WaveNet. In contrast to parallel WaveNet (van den Oord et al., 2018), we distill a Gaussian inverse autoregressive flow from the autoregressive WaveNet by minimizing a regularized KL divergence between their highly-peaked output distributions. Our method computes the KL divergence in closed-form, which simplifies the training algorithm and provides very efficient distillation. In addition, we introduce the first text-to-wave neural architecture for speech synthesis, which is fully convolutional and enables fast end-to-end training from scratch. It significantly outperforms the previous pipeline that connects a text-to-spectrogram model to a separately trained WaveNet (Ping et al., 2018). We also successfully distill a parallel waveform synthesizer conditioned on the hidden representation in this end-to-end model. 1 ",
40
+ "bbox": [
41
+ 233,
42
+ 301,
43
+ 766,
44
+ 454
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 487,
55
+ 336,
56
+ 502
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Speech synthesis, also called text-to-speech (TTS), is traditionally done with complex multi-stage hand-engineered pipelines (Taylor, 2009). Recent successes of deep learning methods for TTS lead to high-fidelity speech synthesis (van den Oord et al., 2016a), much simpler “end-to-end” pipelines (Sotelo et al., 2017; Wang et al., 2017; Ping et al., 2018), and a single TTS model that reproduces thousands of different voices (Ping et al., 2018). ",
63
+ "bbox": [
64
+ 174,
65
+ 517,
66
+ 825,
67
+ 587
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "WaveNet (van den Oord et al., 2016a) is an autoregressive generative model for waveform synthesis. It operates at a very high temporal resolution of raw audios (e.g., 24,000 samples per second). Its convolutional structure enables parallel processing at training by teacher-forcing the complete sequence of audio samples. However, the autoregressive nature of WaveNet makes it prohibitively slow at inference, because each sample must be drawn from the output distribution before it can be passed in as input at the next time-step. In order to generate high-fidelity speech in real time, one has to develop highly engineered inference kernels (e.g., Arık et al., 2017a). ",
74
+ "bbox": [
75
+ 174,
76
+ 594,
77
+ 825,
78
+ 693
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Most recently, van den Oord et al. (2018) proposed a teacher-student framework to distill a parallel feed-forward network from an autoregressive teacher WaveNet. The non-autoregressive student model can generate high-fidelity speech at 20 times faster than real-time. To backpropagate through random samples during distillation, parallel WaveNet employs the mixture of logistics (MoL) distribution (Salimans et al., 2017) as the output distribution for teacher WaveNet, and a logistic distribution based inverse autoregressive flow (IAF) (Kingma et al., 2016) as the student model. It minimizes a set of losses including the KL divergence between the output distributions of the student and teacher networks. However, one has to apply Monte Carlo method to approximate the intractable KL divergence between the logistic and MoL distributions, which may introduce large variances in gradients for highly peaked distributions, and lead to an unstable training in practice. ",
85
+ "bbox": [
86
+ 174,
87
+ 699,
88
+ 825,
89
+ 838
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "In this work, we propose a novel parallel wave generation method based on the Gaussian IAF. Specifically, we make the following contributions: ",
96
+ "bbox": [
97
+ 176,
98
+ 844,
99
+ 823,
100
+ 873
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "1. We demonstrate that a single variance-bounded Gaussian is sufficient for modeling the raw waveform in WaveNet without degradation of audio quality. In contrast to the quantized surrogate loss (Salimans et al., 2017) in parallel WaveNet, our Gaussian autoregressive WaveNet is simply trained with maximum likelihood estimation (MLE). \n2. We distill a Gaussian IAF from the autoregressive WaveNet by minimizing a regularized KL divergence between their peaked output distributions. Our method provides closed-form estimation of KL divergence, which largely simplifies the distillation algorithm and stabilizes the training process. \n3. In previous studies, “end-to-end\" speech synthesis actually refers to the text-to-spectrogram models with a separate waveform synthesizer (i.e., vocoder) (Sotelo et al., 2017; Wang et al., 2017). We introduce the first text-to-wave neural architecture for TTS, which is fully convolutional and enables fast end-to-end training from scratch. In our architecture, the WaveNet module is conditioned on the hidden states instead of mel-spectrograms (Ping et al., 2018; Shen et al., 2018), which is crucial to the success of training from scratch. Our text-to-wave model significantly outperforms the separately trained pipeline (Ping et al., 2018) in naturalness. \n4. We also successfully distill a parallel neural vocoder conditioned on the learned hidden representation within the end-to-end architecture. The text-to-wave model with the parallel vocoder obtains competitive results as the model with an autoregressive vocoder. ",
107
+ "bbox": [
108
+ 202,
109
+ 103,
110
+ 825,
111
+ 385
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "We organize the rest of this paper as follows. Section 2 discusses related work. We propose the parallel wave generation method in Section 3, and present the text-to-wave architecture in Section 4. We report experimental results in Section 5 and conclude the paper in Section 6. ",
118
+ "bbox": [
119
+ 178,
120
+ 395,
121
+ 825,
122
+ 436
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "2 RELATED WORK ",
129
+ "text_level": 1,
130
+ "bbox": [
131
+ 176,
132
+ 455,
133
+ 344,
134
+ 472
135
+ ],
136
+ "page_idx": 1
137
+ },
138
+ {
139
+ "type": "text",
140
+ "text": "Neural speech synthesis has obtained the state-of-the-art results and gained a lot of attention recently. Several neural TTS systems were proposed, including Deep Voice 1 (Arık et al., 2017a), Deep Voice 2 (Arık et al., 2017b), Deep Voice 3 (Ping et al., 2018), Tacotron (Wang et al., 2017), Tacotron 2 (Shen et al., 2018), Char2Wav (Sotelo et al., 2017), and VoiceLoop (Taigman et al., 2018). Deep Voice 1 & 2 retain the traditional TTS pipeline, which has separate grapheme-to-phoneme, phoneme duration, fundamental frequency, and waveform synthesis models. In contrast, Deep Voice 3, Tacotron, and Char2Wav employ the attention based sequence-to-sequence models (Bahdanau et al., 2015), yielding more compact architectures. In the literature, these models are usually referred to as “end-to-end” speech synthesis. However, they actually depend on a traditional vocoder (Morise et al., 2016), the Griffin-Lim algorithm (Griffin and Lim, 1984), or a separately trained neural vocoder (Ping et al., 2018; Shen et al., 2018) to convert the predicted spectrogram to raw audio. In this work, we propose the first text-to-wave neural architecture for TTS based on Deep Voice 3 (Ping et al., 2018). ",
141
+ "bbox": [
142
+ 174,
143
+ 486,
144
+ 826,
145
+ 651
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "The neural network based vocoders, such as WaveNet (van den Oord et al., 2016a) and SampleRNN (Mehri et al., 2017), play a very important role in recent advances of speech synthesis. In a TTS system, WaveNet can be conditioned on linguistic features, fundamental frequency $( F _ { 0 } )$ , phoneme durations (van den Oord et al., 2016a; Arık et al., 2017a), or the predicted mel-spectrograms from a text-to-spectrogram model (Ping et al., 2018). We test our parallel waveform synthesis method by conditioning it on mel-spectrograms and hidden representation within the end-to-end model. ",
152
+ "bbox": [
153
+ 174,
154
+ 659,
155
+ 825,
156
+ 742
157
+ ],
158
+ "page_idx": 1
159
+ },
160
+ {
161
+ "type": "text",
162
+ "text": "Normalizing flows (Rezende and Mohamed, 2015; Dinh et al., 2014) are a family of stochastic generative models, in which a simple initial distribution is transformed into a more complex one by applying a series of invertible transformations. Normalizing flow provides arbitrarily complex posterior distribution, making it well suited for the inference network in variational autoencoder (Kingma and Welling, 2014). Inverse autoregressive flow (IAF) (Kingma et al., 2016) is a special type of normalizing flow where each invertible transformation is based on an autoregressive neural network. Thus, IAF can reuse the most successful autoregressive architecture, such as PixelCNN and WaveNet (van den Oord et al., 2016b;a). Learning an IAF with maximum likelihood can be very slow. In this work, we distill a Gaussian IAF from a pretrained autoregressive generative model by minimizing a numerically stable variant of KL divergence. ",
163
+ "bbox": [
164
+ 174,
165
+ 750,
166
+ 825,
167
+ 888
168
+ ],
169
+ "page_idx": 1
170
+ },
171
+ {
172
+ "type": "text",
173
+ "text": "Knowledge distillation is originally proposed for compressing large models to smaller ones (Bucilua et al., 2006). In deep learning (Hinton et al., 2015), a smaller student network is distilled from the teacher network by minimizing the loss between their outputs (e.g., L2 or cross-entropy). In parallel WaveNet, a non-autoregressvie student-net is distilled from an autoregressive WaveNet by minimizing the reverse KL divergence (Murphy, 2014). Similar techniques are applied in non-autoregressive models for machine translation (Gu et al., 2018; Kaiser et al., 2018; Lee et al., 2018; Roy et al., 2018). ",
174
+ "bbox": [
175
+ 174,
176
+ 896,
177
+ 823,
178
+ 924
179
+ ],
180
+ "page_idx": 1
181
+ },
182
+ {
183
+ "type": "text",
184
+ "text": "",
185
+ "bbox": [
186
+ 174,
187
+ 103,
188
+ 825,
189
+ 160
190
+ ],
191
+ "page_idx": 2
192
+ },
193
+ {
194
+ "type": "text",
195
+ "text": "3 PARALLEL WAVE GENERATION ",
196
+ "text_level": 1,
197
+ "bbox": [
198
+ 176,
199
+ 179,
200
+ 465,
201
+ 195
202
+ ],
203
+ "page_idx": 2
204
+ },
205
+ {
206
+ "type": "text",
207
+ "text": "In this section, we present the Gaussian autoregressive WaveNet as the teacher-net and the Gaussian inverse autoregressive flow as the student-net. Then, we develop our knowledge distillation algorithm. ",
208
+ "bbox": [
209
+ 174,
210
+ 209,
211
+ 825,
212
+ 238
213
+ ],
214
+ "page_idx": 2
215
+ },
216
+ {
217
+ "type": "text",
218
+ "text": "3.1 GAUSSIAN AUTOREGRESSIVE WAVENET ",
219
+ "text_level": 1,
220
+ "bbox": [
221
+ 173,
222
+ 253,
223
+ 495,
224
+ 268
225
+ ],
226
+ "page_idx": 2
227
+ },
228
+ {
229
+ "type": "text",
230
+ "text": "WaveNet models the joint distribution of high dimensional waveform $\\pmb { x } = \\{ x _ { 1 } , \\dots , x _ { T } \\}$ as the product of conditional distributions using the chain rules of probability, ",
231
+ "bbox": [
232
+ 173,
233
+ 280,
234
+ 823,
235
+ 309
236
+ ],
237
+ "page_idx": 2
238
+ },
239
+ {
240
+ "type": "equation",
241
+ "img_path": "images/55c3bd4f36e6647a7ddff6ed005c0dda2e15eac36c4921107e346243fb78f1ea.jpg",
242
+ "text": "$$\np ( \\pmb { x } \\mid \\pmb { c } ; \\pmb { \\theta } ) = \\prod _ { t = 1 } ^ { T } p ( x _ { t } \\mid x _ { < t } , \\pmb { c } ; \\pmb { \\theta } ) ,\n$$",
243
+ "text_format": "latex",
244
+ "bbox": [
245
+ 374,
246
+ 310,
247
+ 622,
248
+ 353
249
+ ],
250
+ "page_idx": 2
251
+ },
252
+ {
253
+ "type": "text",
254
+ "text": "where $x _ { t }$ is the $t$ -th variable of $_ { \\textbf { \\em x } }$ , $x _ { < t }$ represent all variables before $t$ -step, $^ c$ is the conditioner 2 (e.g., mel-spectrogram or hidden states in Section 4), and $\\pmb \\theta$ are parameters of the model. The autoregressive WaveNet takes $x _ { < t }$ as input, and outputs the probability distribution over $x _ { t }$ . ",
255
+ "bbox": [
256
+ 174,
257
+ 356,
258
+ 825,
259
+ 398
260
+ ],
261
+ "page_idx": 2
262
+ },
263
+ {
264
+ "type": "text",
265
+ "text": "Parallel WaveNet (van den Oord et al., 2018) advocates mixture of logistics (MoL) distribution in $\\mathrm { P i x e l C N N + + }$ (Salimans et al., 2017) for autoregressive teacher-net, as it requires much fewer output units compared to categorical distribution (e.g., 65,536 softmax units for 16-bit audios). Actually, the output distribution of student-net is required to be differentiable over samples $_ { \\textbf { \\em x } }$ and allow backpropagation from teacher to student in distillation. As a result, one also needs to choose a continuous distribution for teacher WaveNet. Directly maximizing the log-likelihood of MoL is prone to numerical issues, and one has to employ the quantized surrogate loss introduced in $\\mathrm { P i x e l C N N + + }$ . ",
266
+ "bbox": [
267
+ 173,
268
+ 404,
269
+ 825,
270
+ 502
271
+ ],
272
+ "page_idx": 2
273
+ },
274
+ {
275
+ "type": "text",
276
+ "text": "In this work, we demonstrate that a single Gaussian output distribution for WaveNet suffices to model the raw waveform. It might raise the modeling capacity concern because we use the single Gaussian instead of mixture of Gaussians (Chung et al., 2015). We will demonstrate their comparable performance in experiment. Specifically, the conditional distribution of $x _ { t }$ given previous samples is, ",
277
+ "bbox": [
278
+ 174,
279
+ 508,
280
+ 825,
281
+ 565
282
+ ],
283
+ "page_idx": 2
284
+ },
285
+ {
286
+ "type": "equation",
287
+ "img_path": "images/306600464d69be8caaff099d231171679c544f571e66cd5b27988a8ba671bb37.jpg",
288
+ "text": "$$\np ( \\boldsymbol { x } _ { t } \\mid \\boldsymbol { x } _ { < t } ; \\pmb { \\theta } ) = \\mathcal { N } \\big ( \\mu ( \\boldsymbol { x } _ { < t } ; \\pmb { \\theta } ) , \\sigma ( \\boldsymbol { x } _ { < t } ; \\pmb { \\theta } ) \\big ) ,\n$$",
289
+ "text_format": "latex",
290
+ "bbox": [
291
+ 354,
292
+ 566,
293
+ 640,
294
+ 585
295
+ ],
296
+ "page_idx": 2
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "where $\\mu ( \\boldsymbol { x } _ { < t } ; \\boldsymbol { \\theta } )$ and $\\sigma ( x _ { < t } ; \\theta )$ are mean and standard deviation predicted by the autoregressive WaveNet, respectively. In practice, the network predicts $\\log \\sigma ( x _ { < t } )$ and operates at log-scale for numerical stability. Given observed data, we do maximum likelihood estimation (MLE) for $\\pmb \\theta$ . Note that, the model may give very accurate prediction of 16-bit discrete $x _ { t }$ without real-valued noise (i.e., $\\mu ( x _ { < t } ) \\approx x _ { t } )$ , then the log-likelihood calculation can become numerically unstable when it is free to minimize $\\sigma ( x _ { < t } )$ . As a result, we clip the predicted $\\log \\sigma ( x _ { < t } )$ at $^ { - 9 }$ (natural logarithm) before calculating the log-likelihood at training. 3 We discuss the importance of clipping constant for logscale in Appendix A. We also tried the dequantization trick by adding uniform noise $\\pmb { u } \\in [ 0 , \\frac { 2 } { 6 5 5 3 6 } ]$ to the 16-bits samples similar as in image modeling (e.g., Uria et al., 2013). Indeed, these tricks are equivalent, in the sense that they both upper bound the continuous likelihood for modeling quantized data. We prefer the clipping trick, as it explicitly controls the model behavior and simplifies probability density distillation afterwards. ",
301
+ "bbox": [
302
+ 173,
303
+ 587,
304
+ 825,
305
+ 753
306
+ ],
307
+ "page_idx": 2
308
+ },
309
+ {
310
+ "type": "text",
311
+ "text": "3.2 GAUSSIAN INVERSE AUTOREGRESSIVE FLOW (IAF) ",
312
+ "text_level": 1,
313
+ "bbox": [
314
+ 173,
315
+ 770,
316
+ 576,
317
+ 785
318
+ ],
319
+ "page_idx": 2
320
+ },
321
+ {
322
+ "type": "text",
323
+ "text": "Normalizing flows (Rezende and Mohamed, 2015; Dinh et al., 2017) map a simple initial density $q ( z )$ (e.g., isotropic Gaussian) into a complex one by applying an invertible transformation $\\begin{array} { r } { { \\bf x } = f ( z { \\bf ) } } \\end{array}$ . Given $f$ is a bijection, the distribution of $_ { \\textbf { \\em x } }$ can be obtained through the change of variables formula: ",
324
+ "bbox": [
325
+ 174,
326
+ 795,
327
+ 826,
328
+ 838
329
+ ],
330
+ "page_idx": 2
331
+ },
332
+ {
333
+ "type": "equation",
334
+ "img_path": "images/ad1f2cdadc7277fd9b2a86b2dfb575027537c7ccf8f134834dc7b55cdf8e46ce.jpg",
335
+ "text": "$$\nq ( \\pmb { x } ) = q ( \\pmb { z } ) \\left| \\operatorname* { d e t } \\left( \\frac { \\partial f ( \\pmb { z } ) } { \\partial \\pmb { z } } \\right) \\right| ^ { - 1 } ,\n$$",
336
+ "text_format": "latex",
337
+ "bbox": [
338
+ 388,
339
+ 839,
340
+ 607,
341
+ 877
342
+ ],
343
+ "page_idx": 2
344
+ },
345
+ {
346
+ "type": "text",
347
+ "text": "where de t \u0000 ∂f(z)∂z \u0001 is the determinant of the Jacobian and is computationally expensive to obtain in general. Inverse autoregressive flow (IAF) (Kingma et al., 2016) is a special normalizing flow with a simple Jacobian determinant. In IAF, $_ { z }$ has the same dimension as $_ { \\textbf { \\em x } }$ , and the transformation is based on an autoregressive network taking $_ z$ as the input: $x _ { t } = f ( z _ { \\leq t } ; \\vartheta )$ , where $\\vartheta$ are parameters of the model. Note that the $t$ -th variable $x _ { t }$ only depends on previous and current latent variables $z _ { \\leq t }$ , thus the Jacobian is a triangular matrix and the determinant is the product of the diagonal entries, ",
348
+ "bbox": [
349
+ 173,
350
+ 101,
351
+ 825,
352
+ 188
353
+ ],
354
+ "page_idx": 3
355
+ },
356
+ {
357
+ "type": "equation",
358
+ "img_path": "images/e688fe47e579c595045adc8be921b5323cf526d0f9ec9983edb2e2314c5c124c.jpg",
359
+ "text": "$$\n\\operatorname* { d e t } \\left( \\frac { \\partial f ( \\boldsymbol { z } ) } { \\partial \\boldsymbol { z } } \\right) = \\prod _ { t } \\frac { \\partial f ( \\boldsymbol { z } _ { \\le t } ) } { \\partial \\boldsymbol { z } _ { t } } ,\n$$",
360
+ "text_format": "latex",
361
+ "bbox": [
362
+ 393,
363
+ 194,
364
+ 602,
365
+ 232
366
+ ],
367
+ "page_idx": 3
368
+ },
369
+ {
370
+ "type": "text",
371
+ "text": "which is easy to calculate. Parallel WaveNet (van den Oord et al., 2018) uses a single logistic distribution based IAF to match its mixture of logistics (MoL) teacher. ",
372
+ "bbox": [
373
+ 174,
374
+ 238,
375
+ 823,
376
+ 267
377
+ ],
378
+ "page_idx": 3
379
+ },
380
+ {
381
+ "type": "text",
382
+ "text": "We use the Gaussian IAF (Kingma et al., 2016) and define the transformation $x _ { t } = f ( z _ { \\leq t } ; \\vartheta )$ as: ",
383
+ "bbox": [
384
+ 171,
385
+ 272,
386
+ 805,
387
+ 287
388
+ ],
389
+ "page_idx": 3
390
+ },
391
+ {
392
+ "type": "equation",
393
+ "img_path": "images/2f55d8c01b7e7aebfdf491a920f4566975a0e11b7008914ce067453928f70d81.jpg",
394
+ "text": "$$\nx _ { t } = z _ { t } \\cdot \\sigma ( z _ { < t } ; \\pmb { \\vartheta } ) + \\mu ( z _ { < t } ; \\pmb { \\vartheta } ) ,\n$$",
395
+ "text_format": "latex",
396
+ "bbox": [
397
+ 388,
398
+ 295,
399
+ 607,
400
+ 313
401
+ ],
402
+ "page_idx": 3
403
+ },
404
+ {
405
+ "type": "text",
406
+ "text": "where the shifting function $\\mu ( \\boldsymbol { z } _ { < t } ; \\boldsymbol { \\vartheta } )$ and scaling function $\\sigma ( \\boldsymbol { z } _ { < t } ; \\boldsymbol { \\vartheta } )$ are modeled by an autoregressive WaveNet in Section 3.1. The IAF transformation computes $_ { \\textbf { \\em x } }$ in parallel given $_ z$ , which makes efficient use of resource like GPU. Importantly, if we assume $z _ { t } \\sim \\mathcal { N } ( z _ { t } \\mid \\mu _ { 0 } , \\sigma _ { 0 } )$ , it is easy to observe that $x _ { t }$ also follows a Gaussian distribution, ",
407
+ "bbox": [
408
+ 173,
409
+ 318,
410
+ 825,
411
+ 375
412
+ ],
413
+ "page_idx": 3
414
+ },
415
+ {
416
+ "type": "equation",
417
+ "img_path": "images/cafc234b9117c57dd6f6273ff566ccd087f10261eb598db7fab8085c590f236c.jpg",
418
+ "text": "$$\nq ( x _ { t } \\mid z _ { < t } ; \\pmb { \\vartheta } ) = \\mathcal { N } \\big ( \\mu _ { q } , \\sigma _ { q } \\big ) ,\n$$",
419
+ "text_format": "latex",
420
+ "bbox": [
421
+ 401,
422
+ 380,
423
+ 594,
424
+ 400
425
+ ],
426
+ "page_idx": 3
427
+ },
428
+ {
429
+ "type": "text",
430
+ "text": "where $\\mu _ { q } = \\mu _ { 0 } \\cdot \\sigma ( z _ { < t } ; \\vartheta ) + \\mu ( z _ { < t } ; \\vartheta )$ and $\\sigma _ { q } = \\sigma _ { 0 } \\cdot \\sigma ( z _ { < t } ; \\vartheta )$ . Note that $_ { \\textbf { \\em x } }$ are highly correlated through the marginalization of latents $_ z$ , and the IAF jointly models $_ { \\textbf { \\em x } }$ at all timesteps. ",
431
+ "bbox": [
432
+ 174,
433
+ 406,
434
+ 823,
435
+ 435
436
+ ],
437
+ "page_idx": 3
438
+ },
439
+ {
440
+ "type": "text",
441
+ "text": "To evaluate the likelihood of observed data $_ { \\textbf { \\em x } }$ , we can use the identities Eq. (3) and (4), and plug-in the transformation defined in Eq. (5), which will give us, ",
442
+ "bbox": [
443
+ 173,
444
+ 441,
445
+ 821,
446
+ 470
447
+ ],
448
+ "page_idx": 3
449
+ },
450
+ {
451
+ "type": "equation",
452
+ "img_path": "images/b87e15f8ba74e0653bae21582a675f353d6d69ef4a8b362be6b2d805968fa7dd.jpg",
453
+ "text": "$$\nq ( \\pmb { x } ; \\pmb { \\vartheta } ) = q ( \\pmb { z } ) \\left( \\prod _ { t } \\sigma ( z _ { < t } ; \\pmb { \\vartheta } ) \\right) ^ { - 1 } .\n$$",
454
+ "text_format": "latex",
455
+ "bbox": [
456
+ 375,
457
+ 476,
458
+ 622,
459
+ 522
460
+ ],
461
+ "page_idx": 3
462
+ },
463
+ {
464
+ "type": "text",
465
+ "text": "However, one need the inverse transformationn $f ^ { - 1 }$ of Eq. (5), ",
466
+ "bbox": [
467
+ 173,
468
+ 527,
469
+ 586,
470
+ 544
471
+ ],
472
+ "page_idx": 3
473
+ },
474
+ {
475
+ "type": "equation",
476
+ "img_path": "images/015c084c51333364b7b6c3d095307f60676574536be12f60c010bfae7eaab186.jpg",
477
+ "text": "$$\nz _ { t } = \\frac { x _ { t } - \\mu ( z _ { < t } ; \\vartheta ) } { \\sigma ( z _ { < t } , \\vartheta ) } ,\n$$",
478
+ "text_format": "latex",
479
+ "bbox": [
480
+ 426,
481
+ 549,
482
+ 570,
483
+ 584
484
+ ],
485
+ "page_idx": 3
486
+ },
487
+ {
488
+ "type": "text",
489
+ "text": "to compute the corresponding $_ z$ from the observed $_ { \\textbf { \\em x } }$ , which is autoregressive and slow. As a result, learning an IAF directly through maximum likelihood can be very slow. ",
490
+ "bbox": [
491
+ 171,
492
+ 589,
493
+ 825,
494
+ 618
495
+ ],
496
+ "page_idx": 3
497
+ },
498
+ {
499
+ "type": "text",
500
+ "text": "In general, normalizing flows require a series of transformations until the distribution $q ( { \\pmb x } ; { \\pmb \\vartheta } )$ reaches a desired level of complexity. First, we draw a white noise sample $z ^ { ( 0 ) }$ from the isotropic Gaussian distribution $\\mathcal { N } ( 0 , I )$ . Then, we repeatedly apply the transformation $\\boldsymbol { z } _ { t } ^ { ( i ) } = f ( \\boldsymbol { z } _ { \\le t } ^ { ( i - 1 ) } ; \\bar { \\boldsymbol { \\vartheta } } )$ (z(i−1)≤t ; ϑ) defined in Eq. (5) from $z ^ { ( 0 ) } \\to \\dots z ^ { ( i ) } \\to \\dots z ^ { ( n ) }$ and we let $x = z ^ { ( n ) }$ . We summarize this procedure in Algorithm 1. Note the parameters are not shared across different flows. ",
501
+ "bbox": [
502
+ 173,
503
+ 625,
504
+ 825,
505
+ 704
506
+ ],
507
+ "page_idx": 3
508
+ },
509
+ {
510
+ "type": "text",
511
+ "text": "3.3 KNOWLEDGE DISTILLATION ",
512
+ "text_level": 1,
513
+ "bbox": [
514
+ 176,
515
+ 720,
516
+ 413,
517
+ 734
518
+ ],
519
+ "page_idx": 3
520
+ },
521
+ {
522
+ "type": "text",
523
+ "text": "3.3.1 REGULARIZED KL DIVERGENCE ",
524
+ "text_level": 1,
525
+ "bbox": [
526
+ 176,
527
+ 746,
528
+ 457,
529
+ 761
530
+ ],
531
+ "page_idx": 3
532
+ },
533
+ {
534
+ "type": "text",
535
+ "text": "van den Oord et al. (2018) proposed the probability density distillation method to circumvent the difficulty of maximum likelihood learning for IAF. In distillation, the goal is to minimize the sequence-level reverse KL divergence between the student IAF and pretrained teacher WaveNet. This sequence-level KL divergence can be naively approximated by sampling $_ z$ and $\\scriptstyle { \\boldsymbol { x } } = f ( { \\boldsymbol { z } } )$ from IAF, but it may exhibit high variance. The variance of this estimate can be reduced by marginalizing over the one-step-ahead predictions for each timestep (van den Oord et al., 2018). However, parallel WaveNet has to run a separate Monte Carlo sampling at each timestep, because the per-time-step KL divergence between the logistic and mixture of logistics distribution is still intractable. Indeed, parallel WaveNet first draws a white noise sample $_ { z }$ , then it draws multiple different samples $x _ { t }$ from $\\bar { \\boldsymbol { q } } ( \\boldsymbol { x } _ { t } | \\boldsymbol { z } _ { < t } )$ to estimate the intractable integral. Our method only need to draw one sample $_ { z }$ , then it computes the KL divergence in closed-form thanks to the Gaussian setup. ",
536
+ "bbox": [
537
+ 173,
538
+ 770,
539
+ 826,
540
+ 924
541
+ ],
542
+ "page_idx": 3
543
+ },
544
+ {
545
+ "type": "text",
546
+ "text": "Algorithm 1 Gaussian Inverse Autoregressive Flows as Student Network ",
547
+ "text_level": 1,
548
+ "bbox": [
549
+ 174,
550
+ 103,
551
+ 653,
552
+ 118
553
+ ],
554
+ "page_idx": 4
555
+ },
556
+ {
557
+ "type": "text",
558
+ "text": "Input: ${ z ^ { ( 0 ) } \\sim \\mathcal { N } ( 0 , I ) }$ : white noises; $n$ : number of flows; $\\{ \\pmb { \\vartheta } ^ { ( i ) } \\}$ : parameters of autoregressive WaveNet for the $i$ -th flow; \nOutput: samples $_ { \\textbf { \\em x } }$ ; output distribution $q ( x _ { t } \\mid z _ { < t } )$ with mean $\\mu _ { q } [ t ]$ and standard deviation ${ \\sigma } _ { { q } } [ t ]$ \nInitialize $\\pmb { \\mu } _ { z } = 0 , \\pmb { \\sigma } _ { z } = 1$ \nfor $i$ -th flow in $[ 1 : n ]$ do Run autoregressive WaveNet $\\vartheta ^ { ( i ) }$ by taking $z ^ { ( i - 1 ) }$ as input $\\begin{array} { c } { \\begin{array} { c } { \\mu [ t ] \\subset \\ d \\mu \\big ( z _ { < t } ^ { ( i - 1 ) } ; \\pmb { \\vartheta } ^ { ( i ) } \\big ) } \\\\ { \\pmb { \\sigma } [ t ] \\pmb { \\sigma } \\big ( z _ { < t } ^ { ( i - 1 ) } ; \\pmb { \\vartheta } ^ { ( i ) } \\big ) } \\\\ { z ^ { ( i ) } = z ^ { ( i - 1 ) } \\odot \\pmb { \\sigma } + \\pmb { \\mu } } \\\\ { \\pmb { \\sigma } _ { z } = \\pmb { \\sigma } _ { z } \\odot \\pmb { \\sigma } } \\\\ { \\pmb { \\mu } _ { z } = \\pmb { \\mu } _ { z } \\odot \\pmb { \\sigma } + \\pmb { \\mu } } \\end{array} } \\end{array}$ \nend for \nx = z(n), µq = µz , σq = σz \nRemark: iterating over $\\log \\sigma$ in log-scale improves numerical stability in practice. ",
559
+ "bbox": [
560
+ 184,
561
+ 125,
562
+ 756,
563
+ 383
564
+ ],
565
+ "page_idx": 4
566
+ },
567
+ {
568
+ "type": "image",
569
+ "img_path": "images/b77651c40ba381f1a19b08dc0e7663312b18bab37d16aae5635163c13861a2d5.jpg",
570
+ "image_caption": [
571
+ "Figure 1: The empirical histograms of (a) $\\log \\sigma _ { p }$ in teacher WaveNet and (b) $\\log \\sigma _ { q }$ in student IAF during density distillation using reverse ${ \\mathrm { K L } } ^ { \\mathrm { r e g } }$ divergence. "
572
+ ],
573
+ "image_footnote": [],
574
+ "bbox": [
575
+ 236,
576
+ 398,
577
+ 761,
578
+ 520
579
+ ],
580
+ "page_idx": 4
581
+ },
582
+ {
583
+ "type": "text",
584
+ "text": "Given a white noise sample $_ { z }$ , Algorithm 1 outputs sample $\\begin{array} { r } { \\mathbf { \\boldsymbol { x } } = f ( \\boldsymbol { z } ) } \\end{array}$ , as well as the output Gaussian distribution $q ( x _ { t } \\mid z _ { < t } ; \\vartheta )$ with mean $\\mu _ { q }$ and standard deviation $\\sigma _ { q }$ . We feed the sample $_ { \\textbf { \\em x } }$ into an autoregressive WaveNet, and obtain its output distribution $p ( x _ { t } \\ | \\ x _ { < t } ; \\pmb \\theta )$ with mean $\\mu _ { p }$ and standard deviation $\\sigma _ { p }$ . One can show that the per-time-step KL divergence between student’s output distribution $q ( x _ { t } | \\boldsymbol { z } _ { < t } ; \\vartheta )$ and teacher’s $p ( \\boldsymbol { x } _ { t } | \\boldsymbol { x } _ { < t } ; \\boldsymbol { \\theta } )$ has closed-form expression (see Appendix D), ",
585
+ "bbox": [
586
+ 174,
587
+ 585,
588
+ 825,
589
+ 657
590
+ ],
591
+ "page_idx": 4
592
+ },
593
+ {
594
+ "type": "equation",
595
+ "img_path": "images/464f84d2321a746bc09a13138546aeab9874eb7360322abb887515a72f09efe8.jpg",
596
+ "text": "$$\n\\operatorname { K L } { \\big ( } q \\parallel p { \\big ) } = \\log { \\frac { \\sigma _ { p } } { \\sigma _ { q } } } + { \\frac { \\sigma _ { q } ^ { 2 } - \\sigma _ { p } ^ { 2 } + ( \\mu _ { p } - \\mu _ { q } ) ^ { 2 } } { 2 \\sigma _ { p } ^ { 2 } } } ,\n$$",
597
+ "text_format": "latex",
598
+ "bbox": [
599
+ 339,
600
+ 661,
601
+ 655,
602
+ 699
603
+ ],
604
+ "page_idx": 4
605
+ },
606
+ {
607
+ "type": "text",
608
+ "text": "which also forms an unbiased estimate of the sequence-level KL divergence between student’s distribution $q ( { \\pmb x } )$ and teacher $p ( { \\pmb x } )$ (see Appendix C). ",
609
+ "bbox": [
610
+ 174,
611
+ 703,
612
+ 823,
613
+ 733
614
+ ],
615
+ "page_idx": 4
616
+ },
617
+ {
618
+ "type": "text",
619
+ "text": "In this submission, we lower bound $\\log \\sigma _ { p }$ and $\\log \\sigma _ { q }$ at $^ { - 7 }$ before calculating the KL divergence. 4 However, the division by $\\sigma _ { p } ^ { 2 }$ still raises serious numerical problem, when we directly minimize the average KL divergence over all timesteps. To elaborate this, we monitor the empirical histograms of $\\sigma _ { p }$ from teacher WaveNet during distillation in Figure 1 (a). One can see that it is mostly distributed around $( e ^ { - 9 } , e ^ { - 2 } )$ , which incurs numerical problem if $\\sigma _ { p }$ and $\\sigma _ { q }$ have very different magnitudes at the beginning of training. This is because a well-trained WaveNet usually has highly peaked output distributions. The same observation holds true for other output distributions, including mixture of Gaussians and mixture of logistics. ",
620
+ "bbox": [
621
+ 173,
622
+ 738,
623
+ 826,
624
+ 853
625
+ ],
626
+ "page_idx": 4
627
+ },
628
+ {
629
+ "type": "text",
630
+ "text": "To address this problem, we define the following variant of $\\mathrm { K L }$ divergence: ",
631
+ "bbox": [
632
+ 176,
633
+ 859,
634
+ 665,
635
+ 875
636
+ ],
637
+ "page_idx": 4
638
+ },
639
+ {
640
+ "type": "equation",
641
+ "img_path": "images/18282b3b512fc6d53fd54918dc8149a2c878ce4c645f1ec2125ae2dd70e76d38.jpg",
642
+ "text": "$$\n\\begin{array} { r } { { \\bf K } { \\bf L } ^ { \\mathrm { r e g } } \\left( q \\parallel p \\right) = \\lambda \\big | \\log \\sigma _ { p } - \\log \\sigma _ { q } \\big | ^ { 2 } + { \\bf K } { \\bf L } \\left( q \\parallel p \\right) . } \\end{array}\n$$",
643
+ "text_format": "latex",
644
+ "bbox": [
645
+ 328,
646
+ 880,
647
+ 668,
648
+ 901
649
+ ],
650
+ "page_idx": 4
651
+ },
652
+ {
653
+ "type": "text",
654
+ "text": "4Clipping at $- 6$ also works well and could improve numerical stability. See more discussion in Appendix A. ",
655
+ "bbox": [
656
+ 186,
657
+ 910,
658
+ 820,
659
+ 924
660
+ ],
661
+ "page_idx": 4
662
+ },
663
+ {
664
+ "type": "text",
665
+ "text": "One can interpret the first term as regularization,5 which largely stabilizes the optimization process by quickly matching the $\\sigma$ ’s from student and teacher models, as demonstrated in Figure 1 (a) and (b). In addition, it does not introduce any bias for matching their probability density functions, as we have the following proposition: ",
666
+ "bbox": [
667
+ 174,
668
+ 102,
669
+ 825,
670
+ 160
671
+ ],
672
+ "page_idx": 5
673
+ },
674
+ {
675
+ "type": "text",
676
+ "text": "Proposition 3.1. For probability distributions in the location-scale family (including Gaussian, logistic distribution etc.), the regularized $K L$ divergence in Eq. (10) still satisfies the following properties: (i) $\\mathrm { K L } ^ { r e g } \\left( q \\parallel p \\right) \\geq 0$ , and (ii) $\\mathrm { K L } ^ { r e g } \\left( q \\parallel \\bar { p } \\right) = 0$ if and only if $p = q$ . ",
677
+ "bbox": [
678
+ 173,
679
+ 171,
680
+ 825,
681
+ 215
682
+ ],
683
+ "page_idx": 5
684
+ },
685
+ {
686
+ "type": "text",
687
+ "text": "Given a sample $_ { z }$ and its mapped $_ { \\textbf { \\em x } }$ , we also test the forward $K L$ divergence between the student’s output distribution $q ( x _ { t } | \\boldsymbol { z } _ { < t } ; \\vartheta )$ and teacher’s $p ( \\boldsymbol { x } _ { t } | \\boldsymbol { x } _ { < t } ; \\boldsymbol { \\theta } )$ , ",
688
+ "bbox": [
689
+ 173,
690
+ 227,
691
+ 823,
692
+ 257
693
+ ],
694
+ "page_idx": 5
695
+ },
696
+ {
697
+ "type": "equation",
698
+ "img_path": "images/733f3bf6a367be54f6d4f79a5d06c71dc499f4e19417e36bdf7056363e6f043e.jpg",
699
+ "text": "$$\n\\begin{array} { r } { \\mathrm { K L } \\left( p \\parallel q \\right) = \\mathbb { H } ( p , q ) - \\mathbb { H } ( p ) , } \\end{array}\n$$",
700
+ "text_format": "latex",
701
+ "bbox": [
702
+ 397,
703
+ 263,
704
+ 599,
705
+ 281
706
+ ],
707
+ "page_idx": 5
708
+ },
709
+ {
710
+ "type": "text",
711
+ "text": "where $\\mathbb { H } ( p , q )$ is the cross entropy, and $\\mathbb H ( p )$ is the entropy of teacher model. One can ignore the entropy term $\\mathbb H ( p )$ since we are optimizing student $q$ under a pretrained teacher $p$ . Note that the sample-level forward KLD in Eq. (11) is a biased estimate of sequence-level $\\mathbb { L } \\left( { \\bar { p } } ( { \\pmb x } ) \\parallel q ( { \\pmb x } ) \\right)$ . To make it numerically stable, we apply the same regularization term in Eq. (10) and observe very similar empirical distributions of $\\log { \\sigma }$ in Figure 1. ",
712
+ "bbox": [
713
+ 174,
714
+ 290,
715
+ 825,
716
+ 361
717
+ ],
718
+ "page_idx": 5
719
+ },
720
+ {
721
+ "type": "text",
722
+ "text": "3.3.2 STFT LOSS ",
723
+ "text_level": 1,
724
+ "bbox": [
725
+ 174,
726
+ 376,
727
+ 312,
728
+ 392
729
+ ],
730
+ "page_idx": 5
731
+ },
732
+ {
733
+ "type": "text",
734
+ "text": "In knowledge distillation, it is a common practice to incorporate an additional loss using the groundtruth dataset (e.g., Kim and Rush, 2016). Empirically, we found that training student IAF with KL divergence loss alone will lead to whisper voices. van den Oord et al. (2018) advocates the average power loss to solve this issue, which is actually coupled with the short length of training audio clip (i.e. 0.32s) in their experiments. As the clip length increases, the average power loss will be less effective. Instead, we compute the frame-level loss between the output samples $_ { \\textbf { \\em x } }$ from student IAF and corresponding ground-truth audio ${ \\bf { x } } _ { n }$ : ",
735
+ "bbox": [
736
+ 173,
737
+ 401,
738
+ 825,
739
+ 501
740
+ ],
741
+ "page_idx": 5
742
+ },
743
+ {
744
+ "type": "equation",
745
+ "img_path": "images/7b01351bca1c2db28bffd3a1704b015f3fc1cfe5f3ea82efdc6ade1896b0ab87.jpg",
746
+ "text": "$$\n\\frac { 1 } { B } \\bigg \\| \\big | \\mathrm { S T F T } ( \\pmb { x } ) \\big | - \\big | \\mathrm { S T F T } ( \\pmb { x } _ { n } ) \\big | \\bigg \\| _ { 2 } ^ { 2 } ,\n$$",
747
+ "text_format": "latex",
748
+ "bbox": [
749
+ 387,
750
+ 507,
751
+ 609,
752
+ 546
753
+ ],
754
+ "page_idx": 5
755
+ },
756
+ {
757
+ "type": "text",
758
+ "text": "where $\\left| \\operatorname { S T F T } ( { \\pmb x } ) \\right|$ are the magnitudes of short-term Fourier transform (STFT), and $B = 1 0 2 5$ is the number of frequency bins as we set FFT size to 2048. We use a $1 2 . 5 \\mathrm { m s }$ frame-shift, 50ms window length and Hanning window. Our final loss function is a linear combination of average KL divergence and frame-level loss, and we simply set their coefficients to one in all experiments. ",
759
+ "bbox": [
760
+ 174,
761
+ 554,
762
+ 825,
763
+ 611
764
+ ],
765
+ "page_idx": 5
766
+ },
767
+ {
768
+ "type": "text",
769
+ "text": "4 TEXT-TO-WAVE ARCHITECTURE ",
770
+ "text_level": 1,
771
+ "bbox": [
772
+ 176,
773
+ 632,
774
+ 477,
775
+ 648
776
+ ],
777
+ "page_idx": 5
778
+ },
779
+ {
780
+ "type": "text",
781
+ "text": "In this section, we present our fully convolutional text-to-wave architecture (see Fig. 2 (a)) for endto-end TTS. Our architecture is based on Deep Voice 3 (DV3), a convolutional attention-based TTS system (Ping et al., 2018). DV3 is capable of converting textual features (e.g., characters, phonemes and stresses) into spectral features (e.g., log-mel spectrograms and log-linear spectrograms). These spectral features can be used as inputs for a separately trained waveform synthesis model, such as WaveNet. In contrast, we directly feed the hidden representation learned from the attention mechanism to the WaveNet through some intermediate processing, and train the whole model from scratch in an end-to-end manner. ",
782
+ "bbox": [
783
+ 174,
784
+ 665,
785
+ 825,
786
+ 777
787
+ ],
788
+ "page_idx": 5
789
+ },
790
+ {
791
+ "type": "text",
792
+ "text": "Note that, conditioning the WaveNet on hidden representation is crucial to the success of training from scratch. Indeed, we tried to condition WaveNet on predicted mel-spectrogram from DV3, thus the gradients of WaveNet loss can backpropagate through DV3 to improve the text-to-spectrogram model. When the whole model is trained from scratch, we found it performs slightly worse than the separate training pipeline. The major reason is that the predicted mel-spectrogram from DV3 can be inaccurate at early training, and may spoil the training of WaveNet. In order to get satisfactory results, one need pretrain DV3 and WaveNet, then fine-tune the whole system (e.g., Zhao et al., 2018). ",
793
+ "bbox": [
794
+ 173,
795
+ 782,
796
+ 825,
797
+ 882
798
+ ],
799
+ "page_idx": 5
800
+ },
801
+ {
802
+ "type": "text",
803
+ "text": "The proposed architecture consists of four components: ",
804
+ "bbox": [
805
+ 173,
806
+ 888,
807
+ 537,
808
+ 902
809
+ ],
810
+ "page_idx": 5
811
+ },
812
+ {
813
+ "type": "image",
814
+ "img_path": "images/dde2977d1e73c1531708fa9055c6f7cb71445d25b4c89e76a25b99f4d5d5abc7.jpg",
815
+ "image_caption": [
816
+ "Figure 2: (a) Text-to-wave model converts textual features into waveform. All components feed their hidden representation to others directly. (b) Bridge-net maps frame-level hidden representation to sample-level through several convolution blocks and transposed convolution layers interleaved with softsign non-linearities. (c) Convolution block is based on gated linear unit. "
817
+ ],
818
+ "image_footnote": [],
819
+ "bbox": [
820
+ 192,
821
+ 103,
822
+ 797,
823
+ 306
824
+ ],
825
+ "page_idx": 6
826
+ },
827
+ {
828
+ "type": "text",
829
+ "text": "• Encoder: A convolutional encoder as in DV3, which encodes textual features into an internal hidden representation. Decoder: A causal convolutional decoder as in DV3, which decodes the encoder representation with attention into the log-mel spectrogram in an autoregressive manner. Bridge-net: A convolutional intermediate processing block, which processes the hidden representation from the decoder and predict log-linear spectrogram. Unlike the decoder, it is non-causal and can thus utilize future context information. In addition, it upsamples the hidden representation from frame-level to sample-level. \nVocoder: A Gaussian autoregressive WaveNet to synthesize the waveform, which is conditioned on the upsampled hidden representation from the bridge-net. This component can be replaced by a student IAF distilled from the autoregressive vocoder. ",
830
+ "bbox": [
831
+ 215,
832
+ 400,
833
+ 825,
834
+ 564
835
+ ],
836
+ "page_idx": 6
837
+ },
838
+ {
839
+ "type": "text",
840
+ "text": "The overall objective function is a linear combination of the losses from decoder, bridge-net and vocoder; we simply set all coefficients to one in experiments. We introduce bridge-net to utilize future temporal information as it can apply non-causal convolution. All modules in our architecture are convolutional, which enables fast training 6 and alleviates the common difficulties in RNN-based models (e.g., vanishing and exploding gradient problems (Pascanu et al., 2013)). Throughout the whole model, we use the convolution block from DV3 (see Fig. 2(c)) as the basic building block. It consists of a 1-D convolution with a gated linear unit (GLU) and a residual connection. We set the dropout probability to 0.05 in all experiments. We give further details in the following subsections. ",
841
+ "bbox": [
842
+ 174,
843
+ 573,
844
+ 825,
845
+ 684
846
+ ],
847
+ "page_idx": 6
848
+ },
849
+ {
850
+ "type": "text",
851
+ "text": "4.1 ENCODER-DECODER ",
852
+ "text_level": 1,
853
+ "bbox": [
854
+ 174,
855
+ 699,
856
+ 359,
857
+ 713
858
+ ],
859
+ "page_idx": 6
860
+ },
861
+ {
862
+ "type": "text",
863
+ "text": "We use the same encoder-decoder architecture as DV3 (Ping et al., 2018). The encoder first converts characters or phonemes into trainable embeddings, followed by a series of convolution blocks to extract long-range textual information. The decoder autoregressively predicts the log-mel spectrograms with an L1 loss (teacher-forced at training). It starts with layers of 1x1 convolution to preprocess the input log-mel spectrogram, and then applies a series of causal convolutions and attentions. A multi-hop attention-based alignment is learned between character embeddings and log-mel spectrograms. ",
864
+ "bbox": [
865
+ 174,
866
+ 722,
867
+ 825,
868
+ 820
869
+ ],
870
+ "page_idx": 6
871
+ },
872
+ {
873
+ "type": "text",
874
+ "text": "4.2 BRIDGE-NET ",
875
+ "text_level": 1,
876
+ "bbox": [
877
+ 174,
878
+ 834,
879
+ 303,
880
+ 848
881
+ ],
882
+ "page_idx": 6
883
+ },
884
+ {
885
+ "type": "text",
886
+ "text": "The hidden states of decoder are fed to the bridge-net for temporal processing and upsampling. The output hidden representation is then fed to the vocoder for waveform synthesis. Bridge-net consists of a stack of convolution blocks, and two layers of transposed 2-D convolution interleaved with softsign ",
887
+ "bbox": [
888
+ 176,
889
+ 858,
890
+ 825,
891
+ 900
892
+ ],
893
+ "page_idx": 6
894
+ },
895
+ {
896
+ "type": "table",
897
+ "img_path": "images/67d5d1d1c8c84528865c65cd0f76fd2e91ca1bde321fb7e218c79bd420a28c7d.jpg",
898
+ "table_caption": [
899
+ "Table 1: Mean Opinion Score (MOS) ratings with $9 5 \\%$ confidence intervals using different output distributions for autoregressive WaveNet. We also include the conditional log-likelihoods (CLL) (per dimension) on the same 16 test audios for WaveNet with continuous outputs. "
900
+ ],
901
+ "table_footnote": [],
902
+ "table_body": "<table><tr><td>Output Distribution</td><td>Subjective 5-scale MOS</td><td>Test CLL</td></tr><tr><td>Gaussian</td><td>4.40±0.20</td><td>4.687</td></tr><tr><td>Mixture of Gaussians Mixture of Logistics</td><td>4.38±0.22 4.03 ± 0.27</td><td>4.671 4.590</td></tr><tr><td>Softmax (2048-way)</td><td>4.31 ± 0.23</td><td></td></tr><tr><td>Ground-truth (24 kHz)</td><td>4.54± 0.12</td><td></td></tr></table>",
903
+ "bbox": [
904
+ 274,
905
+ 99,
906
+ 718,
907
+ 188
908
+ ],
909
+ "page_idx": 7
910
+ },
911
+ {
912
+ "type": "table",
913
+ "img_path": "images/b593411543dcadb56f17b48c6b72f3f6ecdb357fb93177352cdc6b360c69298a.jpg",
914
+ "table_caption": [],
915
+ "table_footnote": [],
916
+ "table_body": "<table><tr><td>Distillation method</td><td>Subjective 5-scale MOS</td></tr><tr><td>Student-1 with reverse KLreg Student-1 with forward KLreg Student-2 with reverse KL reg</td><td>4.16± 0.21 4.12 ± 0.20</td></tr></table>",
917
+ "bbox": [
918
+ 300,
919
+ 246,
920
+ 694,
921
+ 306
922
+ ],
923
+ "page_idx": 7
924
+ },
925
+ {
926
+ "type": "text",
927
+ "text": "Table 2: Mean Opinion Score (MOS) ratings with $9 5 \\%$ confidence intervals using different distillation objective functions for student Gaussian IAF. We use the crowdMOS toolkit as in Table 1. ",
928
+ "bbox": [
929
+ 173,
930
+ 314,
931
+ 825,
932
+ 343
933
+ ],
934
+ "page_idx": 7
935
+ },
936
+ {
937
+ "type": "text",
938
+ "text": "to upsample the per-timestep hidden representation from 80 per second to 24,000 per second. The upsampling strides in time are 15 and 20 for the two layers, respectively. Correspondingly, we set the 2-D convolution filter sizes as $( 3 0 , 3 )$ and $( 4 0 , 3 )$ , where the filter sizes (in time) are doubled from strides to avoid the checkerboard artifacts (Odena et al., 2016). ",
939
+ "bbox": [
940
+ 174,
941
+ 359,
942
+ 825,
943
+ 415
944
+ ],
945
+ "page_idx": 7
946
+ },
947
+ {
948
+ "type": "text",
949
+ "text": "5 EXPERIMENT ",
950
+ "text_level": 1,
951
+ "bbox": [
952
+ 176,
953
+ 435,
954
+ 316,
955
+ 452
956
+ ],
957
+ "page_idx": 7
958
+ },
959
+ {
960
+ "type": "text",
961
+ "text": "In this section, we present several experiments to evaluate the proposed parallel wave generation method and text-to-wave architecture. ",
962
+ "bbox": [
963
+ 174,
964
+ 464,
965
+ 823,
966
+ 492
967
+ ],
968
+ "page_idx": 7
969
+ },
970
+ {
971
+ "type": "text",
972
+ "text": "Data: We use an internal English speech dataset containing about 20 hours of audio from a female speaker with a sampling rate of $4 8 \\mathrm { k H z }$ . We downsample the audios to $2 4 \\mathrm { k H z }$ . ",
973
+ "bbox": [
974
+ 174,
975
+ 500,
976
+ 821,
977
+ 527
978
+ ],
979
+ "page_idx": 7
980
+ },
981
+ {
982
+ "type": "text",
983
+ "text": "Autoregressive WaveNet: We first show that a single Gaussian output distribution for autoregressive WaveNet suffices to model the raw waveform. We use the similar WaveNet architecture detailed in Arık et al. (2017a) (see Appendix B). We use 80-band log-mel spectrogram as the conditioner. To upsample the conditioner from frame-level (80 per second) to sample-level (24,000 per second), we apply two layers of transposed 2-D convolution (in time and frequency) interleaved with leaky ReLU $\\mathit { \\Delta } \\alpha = 0 . 4$ ). The upsampling strides in time are 15 and 20 for the two layers, respectively. Correspondingly, we set the 2-D convolution filter sizes as $( 3 0 , 3 )$ and $( 4 0 , 3 )$ . We also find that normalizing log-mel spectrogram to the range of [0, 1] improves the synthesized audio quality (e.g., Yamamoto, 2018). We train 20-layers WaveNets conditioned on ground-truth log-mel spectrogram with various output distributions, including single Gaussian, 10-component mixture of Gaussians (MoG), 10-component mixture of Logistics (MoL), and softmax with 2048 linearly quantized channels. We set both residual channel (dimension of the hidden state of every layer) and skip channel (the dimension to which layer outputs are projected prior to the output layer) to 128. We set the filter size of dilated convolutions to 2 for teacher WaveNet. All models share the same architecture except the output distributions, and they are trained for 1000K steps using the Adam optimizer (Kingma and Ba, 2015) with batch-size 8 and 0.5s audio clips. The learning rate is set to 0.001 in the beginning and annealed by half for every 200K steps. ",
984
+ "bbox": [
985
+ 174,
986
+ 535,
987
+ 825,
988
+ 770
989
+ ],
990
+ "page_idx": 7
991
+ },
992
+ {
993
+ "type": "text",
994
+ "text": "We report the mean opinion score (MOS) for naturalness evaluation in Table 1. We use the crowdMOS toolkit (Ribeiro et al., 2011), where batches of samples from these models were presented to workers on Mechanical Turk. The results indicate that the Gaussian autoregressive WaveNet provides comparable results to MoG and softmax outputs, and outperforms MoL in our experiments. We also include the conditional log-likelihoods (CLL) on test audios (conditioned on mel-spectrograms) for continuous output WaveNets, where the Gaussian, MoG, and MoL are trained with the same clipping constant $- 9$ . See more discussions about clipping constant for log-scale variable in Appendix A. MoL obtains slightly worse CLL, as it does not directly optimize the continuous likelihood. ",
995
+ "bbox": [
996
+ 174,
997
+ 776,
998
+ 825,
999
+ 888
1000
+ ],
1001
+ "page_idx": 7
1002
+ },
1003
+ {
1004
+ "type": "text",
1005
+ "text": "Student Gaussian IAF: We distill two 60-layer parallel student-nets from a pre-trained 20-layer Gaussian autoregressive WaveNet. Our student-1 consists six stacked Gaussian IAF and each flow is parameterized by a 10-layer WaveNet with 64 residual channels, 64 skip channels, and filter size 3 in dilated convolutions. Student-2 consists of four stacked Gaussian IAF blocks, which are parameterized by [10, 10, 10, 30]-layer WaveNets respectively, with the same channels and filter size as studuent-1. For student-2, we also reverse the sequence being generated in time between successive IAF blocks and find it improves the performance. Note that the student models share the same conditioner network (layers of transposed 2-D convolution) with teacher WaveNet during distillation. Training conditioner network of student model from scratch leads to worse result. We test both the forward and reverse KL divergences combined with the STFT-loss, and we simply set their combination coefficients to one in all experiments. The student models are trained for 1000K steps using Adam optimizer. The learning rate is set to 0.001 in the beginning and annealed by half for every 200K steps. Surprisingly, we always find good results after only 50K steps of distillation, which perhaps benefits from the closed-form computation of KL divergence. The models are trained longer for extra improvement. We report the MOS evaluation results in Table 2. Both of these distillation methods work well and obtain comparable results. Student-2 outperforms student-1 by generating “clearner” voices. We expect further improvements by incorporating perceptual and contrastive losses introduced in van den Oord et al. (2018) and we will leave it for future work. At inference, the parallel student-net runs ${ \\sim } 2 0 $ times faster than real time on NVIDIA GeForce GTX 1080 Ti. ",
1006
+ "bbox": [
1007
+ 173,
1008
+ 895,
1009
+ 823,
1010
+ 922
1011
+ ],
1012
+ "page_idx": 7
1013
+ },
1014
+ {
1015
+ "type": "table",
1016
+ "img_path": "images/2c2c2bfdb7c1779d0700233af9ee6ade54a0516fca4a7defa73b12a49a5fe220.jpg",
1017
+ "table_caption": [
1018
+ "Table 3: Mean Opinion Score (MOS) ratings with $9 5 \\%$ confidence intervals for comparing the text-to-wave model and separately trained pipeline. We use the crowdMOS toolkit as in Table 1. "
1019
+ ],
1020
+ "table_footnote": [],
1021
+ "table_body": "<table><tr><td>Method</td><td>Subjective 5-scale MOS</td></tr><tr><td>Text-to-WaveModel</td><td>4.15± 0.25</td></tr><tr><td>Text-to-Wave (distilled vocoder)</td><td>4.11 ± 0.24</td></tr><tr><td>DV3 +WaveNet (predicted Mel)</td><td>3.81 ± 0.26</td></tr><tr><td>DV3+ WaveNet (true Mel)</td><td>3.73 ± 0.24</td></tr></table>",
1022
+ "bbox": [
1023
+ 287,
1024
+ 99,
1025
+ 705,
1026
+ 172
1027
+ ],
1028
+ "page_idx": 8
1029
+ },
1030
+ {
1031
+ "type": "text",
1032
+ "text": "",
1033
+ "bbox": [
1034
+ 174,
1035
+ 233,
1036
+ 825,
1037
+ 469
1038
+ ],
1039
+ "page_idx": 8
1040
+ },
1041
+ {
1042
+ "type": "text",
1043
+ "text": "Text-to-Wave Model: We train the proposed text-to-wave model from scratch and compare it with the separately trained pipeline presented in Deep Voice 3 (DV3) (Ping et al., 2018). We use the same text preprocesssing and joint character-phoneme representation in DV3. The hyper-parameters of encoder and decoder are the same as the single-speaker DV3. The bridge-net has 6 layers of convolution blocks with input/output size of 256. The hyper-parameters of the vocoders are the same as previous subsections. The vocoder part is trained by conditioning on sliced hidden representations corresponding to 0.5s audio clips. Other parts of model are trained on whole-length utterances. The model is trained for $1 . 5 \\mathbf { M }$ steps using Adam optimizer with batch size 16. The learning rate is set to 0.001 in the beginning and annealed by half for every 500K steps. We also distill a Gaussian IAF from the trained autoregressive vocoder within this end-to-end model. Both student IAF and autoregressive vocoder are conditioned on the upsampled hidden representation from the bridge-net. For the separately trained pipeline, we train two Gaussian autoregressive WaveNets conditioned on groundtruth mel-spectrogram and predicted mel-spectrogram from DV3, respectively. We run inference on the same unseen text as DV3 and report the MOS results in Table 3. The results demonstrate that the text-to-wave model significantly outperforms the separately trained pipeline. The text-to-wave model with a distilled parallel vocoder gives slightly worse result to the one with autoregressive vocoder. In the separately trained pipeline, training a WaveNet conditioned on predicted mel-spectrograms eases the training/test mismatch, thus outperforms training with ground-truth. ",
1044
+ "bbox": [
1045
+ 173,
1046
+ 477,
1047
+ 825,
1048
+ 727
1049
+ ],
1050
+ "page_idx": 8
1051
+ },
1052
+ {
1053
+ "type": "text",
1054
+ "text": "6 CONCLUSION ",
1055
+ "text_level": 1,
1056
+ "bbox": [
1057
+ 174,
1058
+ 752,
1059
+ 318,
1060
+ 767
1061
+ ],
1062
+ "page_idx": 8
1063
+ },
1064
+ {
1065
+ "type": "text",
1066
+ "text": "In this work, we first demonstrate that a single Gaussian output distribution is sufficient for modeling the raw waveform in WaveNet without degeneration of audio quality. Then, we propose a parallel wave generation method based on Gaussian inverse autoregressive flow (IAF), in which the IAF is distilled from the autoregressive WaveNet by minimizing a regularized KL divergence for highly peaked distributions. In contrast to parallel WaveNet, our distillation algorithm estimates the KL divergence in closed-form and largely stabilizes the training procedure. Furthermore, we propose the first text-to-wave neural architecture for TTS, which can be trained from scratch in an end-to-end manner. Our text-to-wave architecture outperforms the separately trained pipeline and opens up the research opportunities for fully end-to-end TTS. We also demonstrate appealing results by distilling a parallel neural vocoder conditioned on the hidden representation within the end-to-end model. ",
1067
+ "bbox": [
1068
+ 174,
1069
+ 784,
1070
+ 825,
1071
+ 924
1072
+ ],
1073
+ "page_idx": 8
1074
+ },
1075
+ {
1076
+ "type": "text",
1077
+ "text": "ACKNOWLEDGEMENTS ",
1078
+ "text_level": 1,
1079
+ "bbox": [
1080
+ 176,
1081
+ 104,
1082
+ 334,
1083
+ 117
1084
+ ],
1085
+ "page_idx": 9
1086
+ },
1087
+ {
1088
+ "type": "text",
1089
+ "text": "We thank Yongguo Kang, Yu Gu and Tao Sun from Baidu Speech Department for very helpful discussions. We also thank anonymous reviewers for their valuable feedback and suggestions. ",
1090
+ "bbox": [
1091
+ 174,
1092
+ 130,
1093
+ 823,
1094
+ 159
1095
+ ],
1096
+ "page_idx": 9
1097
+ },
1098
+ {
1099
+ "type": "text",
1100
+ "text": "REFERENCES ",
1101
+ "text_level": 1,
1102
+ "bbox": [
1103
+ 174,
1104
+ 179,
1105
+ 287,
1106
+ 195
1107
+ ],
1108
+ "page_idx": 9
1109
+ },
1110
+ {
1111
+ "type": "text",
1112
+ "text": "S. O. Arık, M. Chrzanowski, A. Coates, G. Diamos, A. Gibiansky, Y. Kang, X. Li, J. Miller, J. Raiman, S. Sengupta, and M. Shoeybi. Deep Voice: Real-time neural text-to-speech. In ICML, 2017a. \nS. O. Arık, G. Diamos, A. Gibiansky, J. Miller, K. Peng, W. Ping, J. Raiman, and Y. Zhou. Deep Voice 2: Multi-speaker neural text-to-speech. In NIPS, 2017b. \nD. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015. \nC. Bucilua, R. Caruana, and A. Niculescu-Mizil. Model compression. In ACM SIGKDD, 2006. \nJ. Chung, K. Kastner, L. Dinh, K. Goel, A. C. Courville, and Y. Bengio. A recurrent latent variable model for sequential data. In NIPS, 2015. \nL. Dinh, D. Krueger, and Y. Bengio. NICE: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014. \nL. Dinh, J. Sohl-Dickstein, and S. Bengio. Density estimation using Real NVP. In ICLR, 2017. \nD. Griffin and J. Lim. Signal estimation from modified short-time Fourier transform. IEEE Transactions on Acoustics, Speech, and Signal Processing, 1984. \nJ. Gu, J. Bradbury, C. Xiong, V. O. Li, and R. Socher. Non-autoregressive neural machine translation. In ICLR, 2018. \nG. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. \nŁ. Kaiser, A. Roy, A. Vaswani, N. Pamar, S. Bengio, J. Uszkoreit, and N. Shazeer. Fast decoding in sequence models using discrete latent variables. arXiv preprint arXiv:1803.03382, 2018. \nY. Kim and A. M. Rush. Sequence-level knowledge distillation. In EMNLP, 2016. \nD. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. \nD. P. Kingma and M. Welling. Auto-encoding variational Bayes. In ICLR, 2014. \nD. P. Kingma, T. Salimans, R. Jozefowicz, X. Chen, I. Sutskever, and M. Welling. Improving variational inference with inverse autoregressive flow. In NIPS, 2016. \nJ. Lee, E. Mansimov, and K. Cho. Deterministic non-autoregressive neural sequence modeling by iterative refinement. arXiv preprint arXiv:1802.06901, 2018. \nS. Mehri, K. Kumar, I. Gulrajani, R. Kumar, S. Jain, J. Sotelo, A. Courville, and Y. Bengio. SampleRNN: An unconditional end-to-end neural audio generation model. In ICLR, 2017. \nM. Morise, F. Yokomori, and K. Ozawa. WORLD: a vocoder-based high-quality speech synthesis system for real-time applications. IEICE Transactions on Information and Systems, 2016. \nK. Murphy. Machine learning, a probabilistic perspective, 2014. \nA. Odena, V. Dumoulin, and C. Olah. Deconvolution and checkerboard artifacts. Distill, 2016. doi: 10.23915/distill.00003. URL http://distill.pub/2016/deconv-checkerboard. \nR. Pascanu, T. Mikolov, and Y. Bengio. On the difficulty of training recurrent neural networks. In ICML, 2013. \nW. Ping, K. Peng, A. Gibiansky, S. O. Arik, A. Kannan, S. Narang, J. Raiman, and J. Miller. Deep Voice 3: Scaling text-to-speech with convolutional sequence learning. In ICLR, 2018. \nD. J. Rezende and S. Mohamed. Variational inference with normalizing flows. In ICML, 2015. \nF. Ribeiro, D. Florêncio, C. Zhang, and M. Seltzer. CrowdMOS: An approach for crowdsourcing mean opinion score studies. In ICASSP, 2011. \nA. Roy, A. Vaswani, A. Neelakantan, and N. Parmar. Theory and experiments on vector quantized autoencoders. arXiv preprint arXiv:1805.11063, 2018. \nT. Salimans, A. Karpathy, X. Chen, and D. P. Kingma. PixelCNN $^ { + + }$ : Improving the PixelCNN with discretized logistic mixture likelihood and other modifications. In ICLR, 2017. \nJ. Shen, R. Pang, R. J. Weiss, M. Schuster, N. Jaitly, Z. Yang, Z. Chen, Y. Zhang, Y. Wang, R. SkerryRyan, et al. Natural TTS synthesis by conditioning WaveNet on mel spectrogram predictions. In ICASSP, 2018. \nJ. Sotelo, S. Mehri, K. Kumar, J. F. Santos, K. Kastner, A. Courville, and Y. Bengio. Char2wav: End-to-end speech synthesis. ICLR workshop, 2017. \nY. Taigman, L. Wolf, A. Polyak, and E. Nachmani. VoiceLoop: Voice fitting and synthesis via a phonological loop. In ICLR, 2018. \nP. Taylor. Text-to-Speech Synthesis. Cambridge University Press, 2009. \nB. Uria, I. Murray, and H. Larochelle. Rnade: The real-valued neural autoregressive density-estimator. In Advances in Neural Information Processing Systems, pages 2175–2183, 2013. \nA. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. WaveNet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016a. \nA. van den Oord, N. Kalchbrenner, L. Espeholt, O. Vinyals, A. Graves, et al. Conditional image generation with PixelCNN decoders. In NIPS, 2016b. \nA. van den Oord, Y. Li, I. Babuschkin, K. Simonyan, O. Vinyals, K. Kavukcuoglu, G. v. d. Driessche, E. Lockhart, L. C. Cobo, F. Stimberg, et al. Parallel WaveNet: Fast high-fidelity speech synthesis. In ICML, 2018. \nY. Wang, R. Skerry-Ryan, D. Stanton, Y. Wu, R. J. Weiss, N. Jaitly, Z. Yang, Y. Xiao, Z. Chen, S. Bengio, Q. Le, Y. Agiomyrgiannakis, R. Clark, and R. A. Saurous. Tacotron: Towards end-to-end speech synthesis. In Interspeech, 2017. \nR. Yamamoto. WaveNet vocoder, 2018. URL https://github.com/r9y9/wavenet_ vocoder. \nY. Zhao, S. Takaki, H.-T. Luong, J. Yamagishi, D. Saito, and N. Minematsu. Wasserstein GAN and waveform loss-based acoustic model training for multi-speaker text-to-speech synthesis systems using a WaveNet vocoder. IEEE Access, 2018. ",
1113
+ "bbox": [
1114
+ 169,
1115
+ 184,
1116
+ 828,
1117
+ 924
1118
+ ],
1119
+ "page_idx": 9
1120
+ },
1121
+ {
1122
+ "type": "text",
1123
+ "text": "",
1124
+ "bbox": [
1125
+ 169,
1126
+ 99,
1127
+ 828,
1128
+ 746
1129
+ ],
1130
+ "page_idx": 10
1131
+ },
1132
+ {
1133
+ "type": "text",
1134
+ "text": "Appendices ",
1135
+ "text_level": 1,
1136
+ "bbox": [
1137
+ 174,
1138
+ 98,
1139
+ 341,
1140
+ 127
1141
+ ],
1142
+ "page_idx": 11
1143
+ },
1144
+ {
1145
+ "type": "text",
1146
+ "text": "A CLIPPING LOG-SCALE AT TRAINING ",
1147
+ "text_level": 1,
1148
+ "bbox": [
1149
+ 176,
1150
+ 148,
1151
+ 511,
1152
+ 166
1153
+ ],
1154
+ "page_idx": 11
1155
+ },
1156
+ {
1157
+ "type": "text",
1158
+ "text": "Clipping for $\\log \\sigma$ plays an important role in training Gaussian WaveNet. Without the clipping trick, the optimization process become numerically unstable. The clipping constant also controls the model capacity and largely impacts on final speech quality. We discuss its impact for both autoregressive WaveNet and student IAF. Note that, the clipping is only applied at training, not at inference. ",
1159
+ "bbox": [
1160
+ 174,
1161
+ 183,
1162
+ 826,
1163
+ 238
1164
+ ],
1165
+ "page_idx": 11
1166
+ },
1167
+ {
1168
+ "type": "image",
1169
+ "img_path": "images/808555fed8c6d9a6e8e3f775f1b1cad1eb5d4c3866f569310b0803a32bc83607.jpg",
1170
+ "image_caption": [
1171
+ "Figure 3: The negative log-likelihoods (per dimension) of Gausssian WaveNet on hold-out audios during training. The learning rates in Adam optimizer are initially set to 0.001 and annealed by half for every 200K steps. "
1172
+ ],
1173
+ "image_footnote": [],
1174
+ "bbox": [
1175
+ 192,
1176
+ 255,
1177
+ 781,
1178
+ 731
1179
+ ],
1180
+ "page_idx": 11
1181
+ },
1182
+ {
1183
+ "type": "text",
1184
+ "text": "A.1 AUTOREGRESSIVE WAVENET ",
1185
+ "text_level": 1,
1186
+ "bbox": [
1187
+ 176,
1188
+ 813,
1189
+ 421,
1190
+ 827
1191
+ ],
1192
+ "page_idx": 11
1193
+ },
1194
+ {
1195
+ "type": "text",
1196
+ "text": "For Gaussian WaveNet alone, smaller clipping constant for $\\log \\sigma ( x _ { < t } )$ at training usually leads to larger likelihood, but it also need more iterations to converge. Figure 3 shows its impact on log-likelihood and convergence behaviour. From Figure 3 (a)-(d), the validation likelihood improves a lot from with clipping constant $- 7$ to $^ { - 9 }$ , but the improvement is negligible from $^ { - 9 }$ to $- 1 0$ . In addition, (e) shows the numerical instability without clipping, and (f) shows the dequantization with uniform noise u ∈ [0, 265536 ] stabilizes optimization and performs very similar as clipping at $- 1 0$ . ",
1197
+ "bbox": [
1198
+ 173,
1199
+ 839,
1200
+ 825,
1201
+ 926
1202
+ ],
1203
+ "page_idx": 11
1204
+ },
1205
+ {
1206
+ "type": "text",
1207
+ "text": "For speech quality, models trained with small clipping constant (e.g., $- 9 )$ tend to have less artifacts at convergence, especially for the silence portion of utterances. However, very small clipping constant in teacher WaveNet may raise difficulty for distillation, because the range of $\\log \\sigma$ will be large (see Figure 4). For different datasets and conditioners, the optimal clipping constant may be different. We suggest $- 9$ as the default for Gaussian teacher, after we tried various datasets (including English, Mandarin) and conditioners (including mel-spectrogram, hidden states, linguistic conditioner). ",
1208
+ "bbox": [
1209
+ 173,
1210
+ 103,
1211
+ 826,
1212
+ 188
1213
+ ],
1214
+ "page_idx": 12
1215
+ },
1216
+ {
1217
+ "type": "image",
1218
+ "img_path": "images/90778094f07481c5fd45ecd3f9621822ff18426e1637dded624a66c77ef74dd7.jpg",
1219
+ "image_caption": [
1220
+ "Figure 4: The empirical histograms of predicted $\\log \\sigma$ (before clipping) in Gaussian WaveNet with different clipping constants during training. "
1221
+ ],
1222
+ "image_footnote": [],
1223
+ "bbox": [
1224
+ 271,
1225
+ 200,
1226
+ 725,
1227
+ 497
1228
+ ],
1229
+ "page_idx": 12
1230
+ },
1231
+ {
1232
+ "type": "text",
1233
+ "text": "A.2 GAUSSIAN IAF ",
1234
+ "text_level": 1,
1235
+ "bbox": [
1236
+ 176,
1237
+ 560,
1238
+ 326,
1239
+ 574
1240
+ ],
1241
+ "page_idx": 12
1242
+ },
1243
+ {
1244
+ "type": "text",
1245
+ "text": "In distillation, we also clip $\\log \\sigma _ { p }$ and $\\log \\sigma _ { q }$ for numerical reason before computing the KL divergence (KLD). Note that, the clipping is not applied for the regularization term. In general, larger clipping constant leads to more stable optimization, but it could make the KLD loss less useful. We suggest $- 6$ as the default setting, after we tried various datasets and conditioners. ",
1246
+ "bbox": [
1247
+ 174,
1248
+ 585,
1249
+ 826,
1250
+ 642
1251
+ ],
1252
+ "page_idx": 12
1253
+ },
1254
+ {
1255
+ "type": "text",
1256
+ "text": "Useful tricks: When we work on student WaveNet with linguistic conditioner on internal Mandarin dataset, we find the following tricks are effective to improve the numerical stability at distillation. ",
1257
+ "bbox": [
1258
+ 174,
1259
+ 648,
1260
+ 825,
1261
+ 678
1262
+ ],
1263
+ "page_idx": 12
1264
+ },
1265
+ {
1266
+ "type": "text",
1267
+ "text": "• After initial training (e.g., 500 iterations), if the KLD loss is larger than a threshold (e.g., 10.0), we simply mask it as zero, and let the regularization term and STFT loss to help it out. • After initial training, if the global norm of gradients is larger than 1000.0, we clip the gradients by small values $[ - 0 . 1 , 0 . 1 ]$ . Otherwise, we clip the values of gradients to $[ - 5 . 0 , 5 . 0 ]$ . • Larger batch size (e.g., 16) and smaller learning rate (e.g., 0.0002) are helpful to stabilize the distillation. ",
1268
+ "bbox": [
1269
+ 209,
1270
+ 683,
1271
+ 826,
1272
+ 767
1273
+ ],
1274
+ "page_idx": 12
1275
+ },
1276
+ {
1277
+ "type": "text",
1278
+ "text": "B DETAILS OF DILATED CONVOLUTION BLOCK ",
1279
+ "text_level": 1,
1280
+ "bbox": [
1281
+ 173,
1282
+ 786,
1283
+ 588,
1284
+ 803
1285
+ ],
1286
+ "page_idx": 12
1287
+ },
1288
+ {
1289
+ "type": "text",
1290
+ "text": "We also employ a stack of dilated convolution blocks, where each block has 10 layers and the dilation is doubled at each layer, i.e., $\\{ 1 , 2 , 4 , . . . , 5 1 2 \\}$ . We add the output hidden states from each layer through residual connection before projecting them to the number of skip channels. ",
1291
+ "bbox": [
1292
+ 174,
1293
+ 816,
1294
+ 825,
1295
+ 859
1296
+ ],
1297
+ "page_idx": 12
1298
+ },
1299
+ {
1300
+ "type": "text",
1301
+ "text": "In dilated convolution block, we compute the $i$ -th hidden layer $\\mathbf { \\delta } _ { h } ( i )$ with dialation $2 ^ { i - 1 }$ by gated convolutions (van den Oord et al., 2016b): ",
1302
+ "bbox": [
1303
+ 174,
1304
+ 867,
1305
+ 825,
1306
+ 897
1307
+ ],
1308
+ "page_idx": 12
1309
+ },
1310
+ {
1311
+ "type": "equation",
1312
+ "img_path": "images/74475400f6602206b1adfa764c416270f2e9c2d2b6a09c358cee4eef38b91298.jpg",
1313
+ "text": "$$\n\\begin{array} { r } { \\pmb { h } ^ { ( i ) } = \\mathrm { s i g m o i d } ( \\pmb { W } _ { g } ^ { ( i ) } \\ast \\pmb { h } ^ { ( i - 1 ) } + \\pmb { A } _ { g } ^ { ( i ) } \\cdot \\pmb { c } + \\pmb { b } _ { g } ^ { ( i ) } ) \\odot \\mathrm { t a n h } ( \\pmb { W } _ { f } ^ { ( i ) } \\ast \\pmb { h } ^ { ( i - 1 ) } + \\pmb { A } _ { f } ^ { ( i ) } \\cdot \\pmb { c } + \\pmb { b } _ { f } ^ { ( i ) } ) , } \\end{array}\n$$",
1314
+ "text_format": "latex",
1315
+ "bbox": [
1316
+ 204,
1317
+ 898,
1318
+ 790,
1319
+ 922
1320
+ ],
1321
+ "page_idx": 12
1322
+ },
1323
+ {
1324
+ "type": "text",
1325
+ "text": "therein $\\boldsymbol { h } ^ { 0 } = \\boldsymbol { x }$ is the input of the block, $^ *$ denotes the causal dilated convolution, $\\cdot$ represents $1 \\times 1$ convolution over the upsampled conditioner $^ c$ , $\\odot$ denotes the element-wise multiplication, $W _ { g } ^ { ( i ) } , A _ { g } ^ { ( i ) } , b _ { g } ^ { ( i ) }$ are convolutions and bias parameters at $i$ -th layer for sigmoid gating function, and $W _ { f } ^ { ( i ) } , A _ { f } ^ { ( i ) } , b _ { f } ^ { ( i ) }$ are analogous parameters for tanh function. ",
1326
+ "bbox": [
1327
+ 173,
1328
+ 102,
1329
+ 826,
1330
+ 169
1331
+ ],
1332
+ "page_idx": 13
1333
+ },
1334
+ {
1335
+ "type": "text",
1336
+ "text": "C ESTIMATE THE SEQUENCE-LEVEL KL DIVERGENCE ",
1337
+ "text_level": 1,
1338
+ "bbox": [
1339
+ 173,
1340
+ 205,
1341
+ 642,
1342
+ 223
1343
+ ],
1344
+ "page_idx": 13
1345
+ },
1346
+ {
1347
+ "type": "text",
1348
+ "text": "The sequence-level KL divergence between student distribution $q ( { \\pmb x } )$ and teacher’s $p ( { \\pmb x } )$ can be written as, ",
1349
+ "bbox": [
1350
+ 173,
1351
+ 247,
1352
+ 826,
1353
+ 279
1354
+ ],
1355
+ "page_idx": 13
1356
+ },
1357
+ {
1358
+ "type": "equation",
1359
+ "img_path": "images/a86f446adb9d6ebf9a07a8e274db07ddc69b0d6e345fb2b8318a496bc4380de0.jpg",
1360
+ "text": "$$\n\\begin{array} { r l } & { = \\mathbb { E } _ { q ( x ) } \\left[ \\displaystyle \\sum _ { \\mathbf { t } = 1 } ^ { T } \\log q ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) - \\log p ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) \\right] } \\\\ & { \\phantom { = \\ } } \\\\ & { = \\displaystyle \\sum _ { \\mathbf { t } = 1 } ^ { T } \\mathbb { E } _ { q ( x _ { t } ) \\leq \\ \\Big [ \\log q ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) - \\log p ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) \\Big ] } } \\\\ & { = \\displaystyle \\sum _ { \\mathbf { t } = 1 } ^ { T } \\mathbb { E } _ { q ( x _ { t } ) \\leq \\ \\log \\Big [ \\log q ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) \\Big [ \\log q ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) - \\log p ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) \\Big ] } } \\\\ & { = \\displaystyle \\sum _ { \\mathbf { t } = 1 } ^ { T } \\mathbb { E } _ { q ( x _ { t } ) \\leq \\ \\log \\Big [ \\mathrm { K L } \\big ( q ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) \\big [ \\log ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) \\big ) \\Big ] } } \\\\ & { = \\displaystyle \\sum _ { \\mathbf { t } = 1 } ^ { T } \\sum _ { \\mathbf { t } = 1 } ^ { T } \\Big [ \\mathrm { K L } \\big ( q ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) \\big \\lVert p ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) \\big \\rVert \\Big ) } \\\\ & { = \\mathbb { E } _ { q ( x ) \\leq \\ \\frac { T } { \\delta } } \\left[ \\mathrm { K L } \\left( q ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) \\big \\lVert p ( x _ { t } | x _ { \\mathbf { c } ( \\cdot ) } ) \\big \\rVert \\right) \\right] } \\end{array}\n$$",
1361
+ "text_format": "latex",
1362
+ "bbox": [
1363
+ 349,
1364
+ 376,
1365
+ 740,
1366
+ 592
1367
+ ],
1368
+ "page_idx": 13
1369
+ },
1370
+ {
1371
+ "type": "text",
1372
+ "text": "Note that, the above equality holds for arbitrary distributions. Since $q ( { \\pmb x } )$ is an IAF, and $_ { \\textbf { \\em x } }$ are sampled through $\\begin{array} { r } { { \\bf x } = f ( z ) } \\end{array}$ and $z \\sim N ( 0 , I )$ , then ",
1373
+ "bbox": [
1374
+ 173,
1375
+ 613,
1376
+ 825,
1377
+ 643
1378
+ ],
1379
+ "page_idx": 13
1380
+ },
1381
+ {
1382
+ "type": "equation",
1383
+ "img_path": "images/5cce93bdced44c952132800d78777e743c02224319864f6cd1b2796bf63d5319.jpg",
1384
+ "text": "$$\n\\mathrm { K L } \\left( q ( \\pmb { x } ) \\parallel p ( \\pmb { x } ) \\right) = \\underset { \\pmb { x } \\sim N ( 0 , I ) } { \\mathbb { E } } \\Big [ \\sum _ { t = 1 } ^ { T } \\mathrm { K L } \\left( q ( x _ { t } | \\mathfrak { z } _ { < t } ) \\parallel p ( x _ { t } | \\mathfrak { x } _ { < t } ) \\right) \\Big ] .\n$$",
1385
+ "text_format": "latex",
1386
+ "bbox": [
1387
+ 279,
1388
+ 666,
1389
+ 717,
1390
+ 715
1391
+ ],
1392
+ "page_idx": 13
1393
+ },
1394
+ {
1395
+ "type": "text",
1396
+ "text": "Thus, the summation of per-time-step KL divergence is an unbiased estimate of the sequence-level KL divergence. ",
1397
+ "bbox": [
1398
+ 173,
1399
+ 738,
1400
+ 825,
1401
+ 767
1402
+ ],
1403
+ "page_idx": 13
1404
+ },
1405
+ {
1406
+ "type": "text",
1407
+ "text": "D KL DIVERGENCE BETWEEN GAUSSIAN DISTRIBUTIONS ",
1408
+ "text_level": 1,
1409
+ "bbox": [
1410
+ 173,
1411
+ 804,
1412
+ 674,
1413
+ 824
1414
+ ],
1415
+ "page_idx": 13
1416
+ },
1417
+ {
1418
+ "type": "text",
1419
+ "text": "Given two Gaussian distributions $p ( x ) = \\mathcal { N } ( \\mu _ { p } , \\sigma _ { p } )$ and $\\boldsymbol { q } ( \\boldsymbol { x } ) = \\mathcal { N } ( \\mu _ { q } , \\sigma _ { q } )$ , their KL divergence is: ",
1420
+ "bbox": [
1421
+ 171,
1422
+ 847,
1423
+ 825,
1424
+ 866
1425
+ ],
1426
+ "page_idx": 13
1427
+ },
1428
+ {
1429
+ "type": "equation",
1430
+ "img_path": "images/2364a7629c8cc7081143fbddffd4d63c419bd802830091d7197fe823f3ea581e.jpg",
1431
+ "text": "$$\n\\mathrm { K L } \\left( q \\parallel p \\right) = \\int q ( x ) \\log \\frac { q ( x ) } { p ( x ) } d x = \\mathbb { H } ( q , p ) - \\mathbb { H } ( q )\n$$",
1432
+ "text_format": "latex",
1433
+ "bbox": [
1434
+ 325,
1435
+ 887,
1436
+ 671,
1437
+ 921
1438
+ ],
1439
+ "page_idx": 13
1440
+ },
1441
+ {
1442
+ "type": "text",
1443
+ "text": "where $\\log \\equiv \\log _ { e }$ , the entropy, ",
1444
+ "bbox": [
1445
+ 173,
1446
+ 103,
1447
+ 377,
1448
+ 119
1449
+ ],
1450
+ "page_idx": 14
1451
+ },
1452
+ {
1453
+ "type": "equation",
1454
+ "img_path": "images/cb4e017767dfde27c982e0e6bc76bb1034adb2447852917777b0dfceb234a28a.jpg",
1455
+ "text": "$$\n\\begin{array} { r l } & { \\mathbb { H } ( q ) = - \\displaystyle \\int q ( x ) \\log q ( x ) d x } \\\\ & { \\quad \\quad = - \\displaystyle \\int q ( x ) \\log \\left[ ( 2 \\pi \\sigma q _ { q } ^ { 2 } ) ^ { - \\frac { 1 } { 2 } } \\exp \\big ( - \\frac { ( x - \\mu _ { q } ) ^ { 2 } } { 2 \\sigma _ { q } ^ { 2 } } \\big ) \\right] d x } \\\\ & { \\quad \\quad = \\displaystyle \\frac { 1 } { 2 } \\log \\big ( 2 \\pi \\sigma q _ { q } ^ { 2 } \\big ) \\int q ( x ) d x + \\frac { 1 } { 2 \\sigma _ { q } ^ { 2 } } \\int q ( x ) ( x - \\mu _ { q } ) ^ { 2 } d x } \\\\ & { \\quad \\quad = \\displaystyle \\frac { 1 } { 2 } \\log \\big ( 2 \\pi \\sigma q _ { q } ^ { 2 } \\big ) \\cdot 1 + \\frac { 1 } { 2 \\sigma _ { q } ^ { 2 } } \\cdot \\sigma _ { q } ^ { 2 } } \\\\ & { \\quad \\quad = \\displaystyle \\frac { 1 } { 2 } \\log \\big ( 2 \\pi \\sigma q _ { q } ^ { 2 } \\big ) + \\frac { 1 } { 2 } } \\end{array}\n$$",
1456
+ "text_format": "latex",
1457
+ "bbox": [
1458
+ 292,
1459
+ 126,
1460
+ 702,
1461
+ 299
1462
+ ],
1463
+ "page_idx": 14
1464
+ },
1465
+ {
1466
+ "type": "text",
1467
+ "text": "and the cross entropy, ",
1468
+ "bbox": [
1469
+ 173,
1470
+ 301,
1471
+ 318,
1472
+ 316
1473
+ ],
1474
+ "page_idx": 14
1475
+ },
1476
+ {
1477
+ "type": "equation",
1478
+ "img_path": "images/4722f9bf4e8c21da4a6057ba2efc0e1c474a6154df51ca9736be31ac0af6c55d.jpg",
1479
+ "text": "$$\n\\begin{array} { r l } { \\mathbb { H } ( q , p ) = - \\int q ( x ) \\log p ( x ) d x } \\\\ { \\ } & { = - \\int q ( x ) \\log \\left[ ( 2 \\pi \\sigma _ { p } ^ { 2 } ) ^ { - \\frac { 1 } { 2 } } \\exp \\big ( - \\frac { ( x - \\mu _ { p } ) ^ { 2 } } { 2 \\sigma _ { p } ^ { 2 } } \\big ) \\right] d x } \\\\ { \\ } & { = \\frac { 1 } { 2 } \\log \\big ( 2 \\pi \\sigma _ { p } ^ { 2 } \\big ) \\int q ( x ) d x + \\frac { 1 } { 2 \\sigma _ { p } ^ { 2 } } \\int q ( x ) ( x - \\mu _ { p } ) ^ { 2 } d x } \\\\ { \\ } & { = \\frac { 1 } { 2 } \\log \\big ( 2 \\pi \\sigma _ { p } ^ { 2 } ) + \\frac { 1 } { 2 \\sigma _ { p } ^ { 2 } } \\int q ( x ) ( x ^ { 2 } - 2 \\mu _ { p } x + \\mu _ { p } ^ { 2 } ) d x } \\\\ { \\ } & { = \\frac { 1 } { 2 } \\log \\big ( 2 \\pi \\sigma _ { p } ^ { 2 } \\big ) + \\frac { \\mu _ { p } ^ { 2 } + \\sigma _ { p } ^ { 2 } - 2 \\mu _ { p } \\mu _ { p } + \\mu _ { p } ^ { 2 } } { 2 \\sigma _ { p } ^ { 2 } } } \\\\ { \\ } & { = \\frac { 1 } { 2 } \\log \\big ( 2 \\pi \\sigma _ { p } ^ { 2 } \\big ) + \\frac { \\sigma _ { q } ^ { 2 } + \\big ( \\mu _ { p } - \\mu _ { q } \\big ) ^ { 2 } } { 2 \\sigma _ { p } ^ { 2 } } . } \\end{array}\n$$",
1480
+ "text_format": "latex",
1481
+ "bbox": [
1482
+ 284,
1483
+ 324,
1484
+ 710,
1485
+ 541
1486
+ ],
1487
+ "page_idx": 14
1488
+ },
1489
+ {
1490
+ "type": "text",
1491
+ "text": "Combining $\\mathbb { H } ( q )$ and $\\mathbb { H } ( q , p )$ together, we obtain ",
1492
+ "bbox": [
1493
+ 171,
1494
+ 546,
1495
+ 498,
1496
+ 563
1497
+ ],
1498
+ "page_idx": 14
1499
+ },
1500
+ {
1501
+ "type": "equation",
1502
+ "img_path": "images/f7853b3af5afeaea82391ff635ced2221915bc616e3ef7456b25cd06fed1e164.jpg",
1503
+ "text": "$$\n\\operatorname { K L } { \\big ( } q \\parallel p { \\big ) } = \\log { \\frac { \\sigma _ { p } } { \\sigma _ { q } } } + { \\frac { \\sigma _ { q } ^ { 2 } - \\sigma _ { p } ^ { 2 } + ( \\mu _ { p } - \\mu _ { q } ) ^ { 2 } } { 2 \\sigma _ { p } ^ { 2 } } } .\n$$",
1504
+ "text_format": "latex",
1505
+ "bbox": [
1506
+ 339,
1507
+ 568,
1508
+ 656,
1509
+ 607
1510
+ ],
1511
+ "page_idx": 14
1512
+ }
1513
+ ]
parse/train/HklY120cYm/HklY120cYm_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/HklY120cYm/HklY120cYm_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/OeWooOxFwDa/OeWooOxFwDa.md ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Do Transformers Really Perform Bad for Graph Representation?
2
+
3
+ Chengxuan $\mathbf { Y i n g ^ { 1 } }$ ∗, Tianle $\mathbf { C a i ^ { 2 } }$ , Shengjie Luo3∗, Shuxin Zheng4†, Guolin ${ \bf K } { \bf e } ^ { 4 }$ , Di $\mathbf { H e ^ { 4 } }$ †, Yanming Shen1, Tie-Yan Liu4 1Dalian University of Technology 2Princeton University 3Peking University 4Microsoft Research Asia yingchengsyuan@gmail.com, tianle.cai@princeton.edu, luosj@stu.pku.edu.cn {shuz†, guoke, dihe†, tyliu}@microsoft.com, shen@dlut.edu.cn
4
+
5
+ # Abstract
6
+
7
+ The Transformer architecture has become a dominant choice in many domains, such as natural language processing and computer vision. Yet, it has not achieved competitive performance on popular leaderboards of graph-level prediction compared to mainstream GNN variants. Therefore, it remains a mystery how Transformers could perform well for graph representation learning. In this paper, we solve this mystery by presenting Graphormer, which is built upon the standard Transformer architecture, and could attain excellent results on a broad range of graph representation learning tasks, especially on the recent OGB Large-Scale Challenge. Our key insight to utilizing Transformer in the graph is the necessity of effectively encoding the structural information of a graph into the model. To this end, we propose several simple yet effective structural encoding methods to help Graphormer better model graph-structured data. Besides, we mathematically characterize the expressive power of Graphormer and exhibit that with our ways of encoding the structural information of graphs, many popular GNN variants could be covered as the special cases of Graphormer. The code and models of Graphormer will be made publicly available at https://github.com/Microsoft/Graphormer.
8
+
9
+ # 1 Introduction
10
+
11
+ The Transformer [46] is well acknowledged as the most powerful neural network in modelling sequential data, such as natural language [11, 35, 6] and speech [17]. Model variants built upon Transformer have also been shown great performance in computer vision [12, 36] and programming language [19, 57, 41]. However, to the best of our knowledge, Transformer has still not been the de-facto standard on public graph representation leaderboards [22, 14, 21]. There are many attempts of leveraging Transformer into the graph domain, but the only effective way is replacing some key modules (e.g., feature aggregation) in classic GNN variants by the softmax attention [47, 7, 23, 48, 56, 43, 13]. Therefore, it is still an open question whether Transformer architecture is suitable to model graphs and how to make it work in graph representation learning.
12
+
13
+ In this paper, we give an affirmative answer by developing Graphormer, which is directly built upon the standard Transformer, and achieves state-of-the-art performance on a wide range of graphlevel prediction tasks, including the very recent Open Graph Benchmark Large-Scale Challenge (OGB-LSC) [21], and several popular leaderboards (e.g., OGB [22], Benchmarking-GNN [14]). The Transformer is originally designed for sequence modeling. To utilize its power in graphs, we believe the key is to properly incorporate structural information of graphs into the model. Note that for each node $i$ , the self-attention only calculates the semantic similarity between $i$ and other nodes, without considering the structural information of a graph reflected on the nodes and the relation between node pairs. Graphormer incorporates several effective structural encoding methods to leverage such information, which are described below.
14
+
15
+ First, we propose a Centrality Encoding in Graphormer to capture the node importance in the graph. In a graph, different nodes may have different importance, e.g., celebrities are considered to be more influential than the majority of web users in a social network. However, such information isn’t reflected in the self-attention module as it calculates the similarities mainly using the node semantic features. To address the problem, we propose to encode the node centrality in Graphormer. In particular, we leverage the degree centrality for the centrality encoding, where a learnable vector is assigned to each node according to its degree and added to the node features in the input layer. Empirical studies show that simple centrality encoding is effective for Transformer in modeling the graph data.
16
+
17
+ Second, we propose a novel Spatial Encoding in Graphormer to capture the structural relation between nodes. One notable geometrical property that distinguishes graph-structured data from other structured data, e.g., language, images, is that there does not exist a canonical grid to embed the graph. In fact, nodes can only lie in a non-Euclidean space and are linked by edges. To model such structural information, for each node pair, we assign a learnable embedding based on their spatial relation. Multiple measurements in the literature could be leveraged for modeling spatial relations. For a general purpose, we use the distance of the shortest path between any two nodes as a demonstration, which will be encoded as a bias term in the softmax attention and help the model accurately capture the spatial dependency in a graph. In addition, sometimes there is additional spatial information contained in edge features, such as the type of bond between two atoms in a molecular graph. We design a new edge encoding method to further take such signal into the Transformer layers. To be concrete, for each node pair, we compute an average of dot-products of the edge features and learnable embeddings along the shortest path, then use it in the attention module. Equipped with these encodings, Graphormer could better model the relationship for node pairs and represent the graph.
18
+
19
+ By using the proposed encodings above, we further mathematically show that Graphormer has strong expressiveness as many popular GNN variants are just its special cases. The great capacity of the model leads to state-of-the-art performance on a wide range of tasks in practice. On the large-scale quantum chemistry regression dataset3 in the very recent Open Graph Benchmark Large-Scale Challenge (OGB-LSC) [21], Graphormer outperforms most mainstream GNN variants by more than $10 \%$ points in terms of the relative error. On other popular leaderboards of graph representation learning (e.g., MolHIV, MolPCBA, ZINC) [22, 14], Graphormer also surpasses the previous best results, demonstrating the potential and adaptability of the Transformer architecture.
20
+
21
+ # 2 Preliminary
22
+
23
+ In this section, we recap the preliminaries in Graph Neural Networks and Transformer.
24
+
25
+ Graph Neural Network (GNN). Let $G = ( V , E )$ denote a graph where $V = \{ v _ { 1 } , v _ { 2 } , \cdots , v _ { n } \}$ $n = | V |$ is the number of nodes. Let the feature vector of node $v _ { i }$ be $x _ { i }$ . GNNs aim to learn representation of nodes and graphs. Typically, modern GNNs follow a learning schema that iteratively updates the representation of a node by aggregating representations of its first or higher-order neighbors. We denote $h _ { i } ^ { ( l ) }$ as the representation of $v _ { i }$ at the $l$ -th layer and define $h _ { i } ^ { ( 0 ) } = x _ { i }$ . The $l$ -th iteration of aggregation could be characterized by AGGREGATE-COMBINE step as
26
+
27
+ $$
28
+ \begin{array} { r } { a _ { i } ^ { ( l ) } = \mathrm { A G G R E G A T E } ^ { ( l ) } \left( \left\{ h _ { j } ^ { ( l - 1 ) } : j \in \mathcal { N } ( v _ { i } ) \right\} \right) , \quad h _ { i } ^ { ( l ) } = \mathrm { C O M B I N E } ^ { ( l ) } \left( h _ { i } ^ { ( l - 1 ) } , a _ { i } ^ { ( l ) } \right) , } \end{array}
29
+ $$
30
+
31
+ where $\mathcal { N } ( v _ { i } )$ is the set of first or higher-order neighbors of $v _ { i }$ . The AGGREGATE function is used to gather the information from neighbors. Common aggregation functions include MEAN, MAX, SUM, which are used in different architectures of GNNs [26, 18, 47, 50]. The goal of COMBINE function is to fuse the information from neighbors into the node representation.
32
+
33
+ ![](images/b1dbe178f7ab6b299fd7d7fd04c91e59c8f4f1133e39ece71c3e6b387ff5b126.jpg)
34
+ Figure 1: An illustration of our proposed centrality encoding, spatial encoding, and edge encoding in Graphormer.
35
+
36
+ In addition, for graph representation tasks, a READOUT function is designed to aggregate node features $h _ { i } ^ { ( L ) }$ of the final iteration into the representation $h _ { G }$ of the entire graph $G$ :
37
+
38
+ $$
39
+ h _ { G } = \mathrm { R E A D O U T } \left( \left\{ h _ { i } ^ { ( L ) } \mid v _ { i } \in G \right\} \right) .
40
+ $$
41
+
42
+ READOUT can be implemented by a simple permutation invariant function such as summation [50] or a more sophisticated graph-level pooling function [1].
43
+
44
+ Transformer. The Transformer architecture consists of a composition of Transformer layers [46]. Each Transformer layer has two parts: a self-attention module and a position-wise feed-forward network (FFN). Let $H = \left[ h _ { 1 } ^ { \top } , \cdots , h _ { n } ^ { \top } \right] ^ { \top } \in \mathbb { R } ^ { n \times d }$ denote the input of self-attention module where $d$ is the hidden dimension and $h _ { i } \in \mathbb { R } ^ { 1 \times d }$ is the hidden representation at position $i$ . The input $H$ is projected by three matrices $W _ { Q } \in \mathbb { R } ^ { d \times d _ { K } } , W _ { K } \in \mathbb { R } ^ { d \times d _ { K } }$ and $W _ { V } \in \mathbb { R } ^ { \dot { d } \times d _ { V } }$ to the corresponding representations $Q , K , V$ . The self-attention is then calculated as:
45
+
46
+ $$
47
+ \begin{array} { r l r } { Q = H W _ { Q } , } & { { } K = H W _ { K } , \quad V = H W _ { V } , } & { } \\ { \displaystyle } & { { } A = \frac { Q K ^ { \top } } { \sqrt { d _ { K } } } , } & { \mathrm { A t t n } \left( H \right) = \mathrm { s o f t m a x } \left( A \right) V , } & { } \end{array}
48
+ $$
49
+
50
+ where $A$ is a matrix capturing the similarity between queries and keys. For simplicity of illustration, we consider the single-head self-attention and assume $d _ { K } = d _ { V } = d$ . The extension to the multi-head attention is standard and straightforward, and we omit bias terms for simplicity.
51
+
52
+ # 3 Graphormer
53
+
54
+ In this section, we present our Graphormer for graph tasks. First, we elaborate on several key designs in the Graphormer, which serve as an inductive bias in the neural network to learn the graph representation. We further provide the detailed implementations of Graphormer. Finally, we show that our proposed Graphormer is more powerful since popular GNN models [26, 50, 18] are its special cases.
55
+
56
+ # 3.1 Structural Encodings in Graphormer
57
+
58
+ As discussed in the introduction, it is important to develop ways to leverage the structural information of graphs into the Transformer model. To this end, we present three simple but effective designs of encoding in Graphormer. See Figure 1 for an illustration.
59
+
60
+ # 3.1.1 Centrality Encoding
61
+
62
+ In Eq.4, the attention distribution is calculated based on the semantic correlation between nodes. However, node centrality, which measures how important a node is in the graph, is usually a strong signal for graph understanding. For example, celebrities who have a huge number of followers are important factors in predicting the trend of a social network [38, 37]. Such information is neglected in the current attention calculation, and we believe it should be a valuable signal for Transformer models.
63
+
64
+ In Graphormer, we use the degree centrality, which is one of the standard centrality measures in literature, as an additional signal to the neural network. To be specific, we develop a Centrality Encoding which assigns each node two real-valued embedding vectors according to its indegree and outdegree. As the centrality encoding is applied to each node, we simply add it to the node features as the input.
65
+
66
+ $$
67
+ h _ { i } ^ { ( 0 ) } = x _ { i } + z _ { \deg ^ { - } ( v _ { i } ) } ^ { - } + z _ { \deg ^ { + } ( v _ { i } ) } ^ { + } ,
68
+ $$
69
+
70
+ where $z ^ { - } , z ^ { + } \in \mathbb { R } ^ { d }$ are learnable embedding vectors specified by the indegree $\deg ^ { - } ( v _ { i } )$ and outdegree $\deg ^ { + } ( v _ { i } )$ respectively. For undirected graphs, $\deg ^ { - } ( v _ { i } )$ and $\deg ^ { + } ( v _ { i } )$ could be unified to $\deg ( v _ { i } )$ . By using the centrality encoding in the input, the softmax attention can catch the node importance signal in the queries and the keys. Therefore the model can capture both the semantic correlation and the node importance in the attention mechanism.
71
+
72
+ # 3.1.2 Spatial Encoding
73
+
74
+ An advantage of Transformer is its global receptive field. In each Transformer layer, each token can attend to the information at any position and then process its representation. But this operation has a byproduct problem that the model has to explicitly specify different positions or encode the positional dependency (such as locality) in the layers. For sequential data, one can either give each position an embedding (i.e., absolute positional encoding [46]) as the input or encode the relative distance of any two positions (i.e., relative positional encoding [42, 44]) in the Transformer layer.
75
+
76
+ However, for graphs, nodes are not arranged as a sequence. They can lie in a multi-dimensional spatial space and are linked by edges. To encode the structural information of a graph in the model, we propose a novel Spatial Encoding. Concretely, for any graph $G$ , we consider a function $\phi \left( v _ { i } , v _ { j } \right) : V \times V \to \mathbb { R }$ which measures the spatial relation between $v _ { i }$ and $v _ { j }$ in graph $G$ . The function $\phi$ can be defined by the connectivity between the nodes in the graph. In this paper, we choose $\phi ( v _ { i } , v _ { j } )$ to be the distance of the shortest path (SPD) between $v _ { i }$ and $v _ { j }$ if the two nodes are connected. If not, we set the output of $\phi$ to be a special value, i.e., -1. We assign each (feasible) output value a learnable scalar which will serve as a bias term in the self-attention module. Denote $A _ { i j }$ as the $( i , j )$ -element of the Query-Key product matrix $A$ , we have:
77
+
78
+ $$
79
+ A _ { i j } = \frac { ( h _ { i } W _ { Q } ) ( h _ { j } W _ { K } ) ^ { T } } { \sqrt { d } } + b _ { \phi ( v _ { i } , v _ { j } ) } ,
80
+ $$
81
+
82
+ where $b _ { \phi ( v _ { i } , v _ { j } ) }$ is a learnable scalar indexed by $\phi ( v _ { i } , v _ { j } )$ , and shared across all layers.
83
+
84
+ Here we discuss several benefits of our proposed method. First, compared to conventional GNNs described in Section 2, where the receptive field is restricted to the neighbors, we can see that in Eq. (6), the Transformer layer provides a global information that each node can attend to all other nodes in the graph. Second, by using $b _ { \phi ( v _ { i } , v _ { j } ) }$ , each node in a single Transformer layer can adaptively attend to all other nodes according to the graph structural information. For example, if $b _ { \phi ( v _ { i } , v _ { j } ) }$ is learned to be a decreasing function with respect to $\phi ( v _ { i } , v _ { j } )$ , for each node, the model will likely pay more attention to the nodes near it and pay less attention to the nodes far away from it.
85
+
86
+ # 3.1.3 Edge Encoding in the Attention
87
+
88
+ In many graph tasks, edges also have structural features, e.g., in a molecular graph, atom pairs may have features describing the type of bond between them. Such features are important to the graph representation, and encoding them together with node features into the network is essential. There are mainly two edge encoding methods used in previous works. In the first method, the edge features are added to the associated nodes’ features [22, 30]. In the second method, for each node, its associated edges’ features will be used together with the node features in the aggregation [15, 50, 26]. However, such ways of using edge feature only propagate the edge information to its associated nodes, which may not be an effective way to leverage edge information in representation of the whole graph.
89
+
90
+ To better encode edge features into attention layers, we propose a new edge encoding method in Graphormer. The attention mechanism needs to estimate correlations for each node pair $( v _ { i } , v _ { j } )$ , and we believe the edges connecting them should be considered in the correlation as in [34, 48]. For each ordered node pair $( v _ { i } , v _ { j } )$ , we find (one of) the shortest path ${ \bf S P } _ { i j } = ( e _ { 1 } , e _ { 2 } , . . . , e _ { N } )$ from $v _ { i }$ to $v _ { j }$ , and compute an average of the dot-products of the edge feature and a learnable embedding along the path. The proposed edge encoding incorporates edge features via a bias term to the attention module. Concretely, we modify the $( i , j )$ -element of $A$ in Eq. (3) further with the edge encoding $c _ { i j }$ as:
91
+
92
+ $$
93
+ A _ { i j } = \frac { ( h _ { i } W _ { Q } ) ( h _ { j } W _ { K } ) ^ { T } } { \sqrt { d } } + b _ { \phi ( v _ { i } , v _ { j } ) } + c _ { i j } , \mathrm { ~ w h e r e ~ } c _ { i j } = \frac { 1 } { N } \sum _ { n = 1 } ^ { N } x _ { e _ { n } } ( w _ { n } ^ { E } ) ^ { T } ,
94
+ $$
95
+
96
+ where $\boldsymbol { x } _ { e _ { n } }$ is the feature of the $n$ -th edge $e _ { n }$ in $\mathrm { S P } _ { i j }$ , $w _ { n } ^ { E } \in \mathbb { R } ^ { d _ { E } }$ is the $n$ -th weight embedding, and $d _ { E }$ is the dimensionality of edge feature.
97
+
98
+ # 3.2 Implementation Details of Graphormer
99
+
100
+ Graphormer Layer. Graphormer is built upon the original implementation of classic Transformer encoder described in [46]. In addition, we apply the layer normalization (LN) before the multi-head self-attention (MHA) and the feed-forward blocks (FFN) instead of after [49]. This modification has been unanimously adopted by all current Transformer implementations because it leads to more effective optimization [40]. Especially, for FFN sub-layer, we set the dimensionality of input, output, and the inner-layer to the same dimension with $d$ . We formally characterize the Graphormer layer as below:
101
+
102
+ $$
103
+ \begin{array} { c } { { \boldsymbol { h } ^ { \prime } ( \boldsymbol { l } ) = \boldsymbol { \mathbf { M H A } } \big ( \boldsymbol { \mathrm { L N } } \big ( \boldsymbol { h } ^ { ( l - 1 ) } \big ) \big ) + \boldsymbol { h } ^ { ( l - 1 ) } } } \\ { { \boldsymbol { h } ^ { ( l ) } = \boldsymbol { \mathrm { F F N } } \big ( \boldsymbol { \mathrm { L N } } \big ( \boldsymbol { h } ^ { \prime } ( \boldsymbol { l } ) \big ) \big ) + \boldsymbol { h } ^ { \prime } ( \boldsymbol { l } ) } } \end{array}
104
+ $$
105
+
106
+ Special Node. As stated in the previous section, various graph pooling functions are proposed to represent the graph embedding. Inspired by [15], in Graphormer, we add a special node called [VNode] to the graph, and make connection between [VNode] and each node individually. In the AGGREGATE-COMBINE step, the representation of [VNode] has been updated as normal nodes in graph, and the representation of the entire graph $h _ { G }$ would be the node feature of [VNode] in the final layer. In the BERT model [11, 35], there is a similar token, i.e., [CLS], which is a special token attached at the beginning of each sequence, to represent the sequence-level feature on downstream tasks. While the [VNode] is connected to all other nodes in graph, which means the distance of the shortest path is 1 for any $\phi ( [ \mathtt { V N o d e } ] , v _ { j } )$ and $\phi ( v _ { i } , [ \mathtt { V N o d e } ] )$ , the connection is not physical. To distinguish the connection of physical and virtual, inspired by [25], we reset all spatial encodings for $b _ { \phi ( [ \tt N N o d e ] , \boldsymbol { v } _ { j } ) }$ and $b _ { \phi ( v _ { i } , [ \mathsf { V N o d e } ] ) }$ to a distinct learnable scalar.
107
+
108
+ # 3.3 How Powerful is Graphormer?
109
+
110
+ In the previous subsections, we introduce three structural encodings and the architecture of Graphormer. Then a natural question is: Do these modifications make Graphormer more powerful than other GNN variants? In this subsection, we first give an affirmative answer by showing that Graphormer can represent the AGGREGATE and COMBINE steps in popular GNN models:
111
+
112
+ Fact 1. By choosing proper weights and distance function $\phi ,$ , the Graphormer layer can represent AGGREGATE and COMBINE steps of popular GNN models such as GIN, GCN, GraphSAGE.
113
+
114
+ The proof sketch to derive this result is: 1) Spatial encoding enables self-attention module to distinguish neighbor set $\mathcal { N } \left( v _ { i } \right)$ of node $v _ { i }$ so that the softmax function can calculate mean statistics over $\bar { \mathcal { N } } \left( v _ { i } \right)$ ; 2) Knowing the degree of a node, mean over neighbors can be translated to sum over neighbors; 3) With multiple heads and FFN, representations of $v _ { i }$ and $\mathcal { N } \left( v _ { i } \right)$ can be processed separately and combined together later. We defer the proof of this fact to Appendix A.
115
+
116
+ Moreover, we show further that by using our spatial encoding, Graphormer can go beyond classic message passing GNNs whose expressive power is no more than the 1-Weisfeiler-Lehman (WL) test. We give a concrete example in Appendix A to show how Graphormer helps distinguish graphs that the 1-WL test fails to.
117
+
118
+ Connection between Self-attention and Virtual Node. Besides the superior expressiveness than popular GNNs, we also find an interesting connection between using self-attention and the virtual node heuristic [15, 31, 24, 22]. As shown in the leaderboard of OGB [22], the virtual node trick, which augments graphs with additional supernodes that are connected to all nodes in the original graphs, can significantly improve the performance of existing GNNs. Conceptually, the benefit of the virtual node is that it can aggregate the information of the whole graph (like the READOUT function) and then propagate it to each node. However, a naive addition of a supernode to a graph can potentially lead to inadvertent over-smoothing of information propagation [24]. We instead find that such a graph-level aggregation and propagation operation can be naturally fulfilled by vanilla self-attention without additional encodings. Concretely, we can prove the following fact:
119
+
120
+ Fact 2. By choosing proper weights, every node representation of the output of a Graphormer layer without additional encodings can represent MEAN READOUT functions.
121
+
122
+ This fact takes the advantage of self-attention that each node can attend to all other nodes. Thus it can simulate graph-level READOUT operation to aggregate information from the whole graph. Besides the theoretical justification, we empirically find that Graphormer does not encounter the problem of over-smoothing, which makes the improvement scalable. The fact also inspires us to introduce a special node for graph readout (see the previous subsection).
123
+
124
+ # 4 Experiments
125
+
126
+ We first conduct experiments on the recent OGB-LSC [21] quantum chemistry regression (i.e., PCQM4M-LSC) challenge, which is currently the biggest graph-level prediction dataset and contains more than $3 . 8 \mathbf { M }$ graphs in total. Then, we report the results on the other three popular tasks: ogbgmolhiv, ogbg-molpcba and ZINC, which come from the OGB [22] and benchmarking-GNN [14] leaderboards. Finally, we ablate the important design elements of Graphormer. A detailed description of datasets and training strategies could be found in Appendix B.
127
+
128
+ # 4.1 OGB Large-Scale Challenge
129
+
130
+ Baselines. We benchmark the proposed Graphormer with GCN [26] and GIN [50], and their variants with virtual node (-VN) [15]. They achieve the state-of-the-art valid and test mean absolute error (MAE) on the official leaderboard4 [21]. In addition, we compare to GIN’s multi-hop variant [5], and 12-layer deep graph network DeeperGCN [30], which also show promising performance on other leaderboards. We further compare our Graphormer with the recent Transformer-based graph model GT [13].
131
+
132
+ Settings. We primarily report results on two model sizes: Graphormer $( L = 1 2 , d = 7 6 8 )$ , and a smaller one GraphormerSMALL $( L = 6 , d = 5 1 2 )$ . Both the number of attention heads in the attention module and the dimensionality of edge features $d _ { E }$ are set to 32. We use AdamW as the optimizer, and set the hyper-parameter $\epsilon$ to 1e-8 and $( \beta 1 , \beta 2 )$ to (0.99,0.999). The peak learning rate is set to 2e-4 (3e-4 for GraphormerSMALL) with a 60k-step warm-up stage followed by a linear decay learning rate scheduler. The total training steps are 1M. The batch size is set to 1024. All models are trained on 8 NVIDIA V100 GPUS for about 2 days.
133
+
134
+ Table 1: Results on PCQM4M-LSC. \* indicates the results are cited from the official leaderboard [21].
135
+
136
+ <table><tr><td>method</td><td>#param.</td><td>train MAE</td><td>validate MAE</td></tr><tr><td>GCN[26]</td><td>2.0M</td><td>0.1318</td><td>0.1691 (0.1684*)</td></tr><tr><td>GIN [50]</td><td>3.8M</td><td>0.1203</td><td>0.1537 (0.1536*)</td></tr><tr><td>GCN-VN [26,15]</td><td>4.9M</td><td>0.1225</td><td>0.1485 (0.1510*)</td></tr><tr><td>GIN-VN [50,15]</td><td>6.7M</td><td>0.1150</td><td>0.1395 (0.1396*)</td></tr><tr><td>GINE-VN [5,15]</td><td>13.2M</td><td>0.1248</td><td>0.1430</td></tr><tr><td>DeeperGCN-VN [30,15]</td><td>25.5M</td><td>0.1059</td><td>0.1398</td></tr><tr><td>GT[13]</td><td>0.6M</td><td>0.0944</td><td>0.1400</td></tr><tr><td>GT-Wide [13]</td><td>83.2M</td><td>0.0955</td><td>0.1408</td></tr><tr><td>GraphormersmALL</td><td>12.5M</td><td>0.0778</td><td>0.1264</td></tr><tr><td>Graphormer</td><td>47.1M</td><td>0.0582</td><td>0.1234</td></tr></table>
137
+
138
+ Results. Table 1 summarizes performance comparisons on PCQM4M-LSC dataset. From the table, GIN-VN achieves the previous state-of-the-art validate MAE of 0.1395. The original implementation of GT [13] employs a hidden dimension of 64 to reduce the total number of parameters. For a fair comparison, we also report the result by enlarging the hidden dimension to 768, denoted by GT-Wide, which leads to a total number of parameters of 83.2M. While, both GT and GT-Wide do not outperform GIN-VN and DeeperGCN-VN. Especially, we do not observe a performance gain along with the growth of parameters of GT.
139
+
140
+ Compared to the previous state-of-the-art GNN architecture, Graphormer noticeably surpasses GINVN by a large margin, e.g., $1 1 . 5 \%$ relative validate MAE decline. By using the ensemble with ExpC [51], we got a $0 . 1 2 0 0 \mathrm { M A E }$ on complete test set and won the first place of the graph-level track in OGB Large-Scale Challenge[21, 53]. As stated in Section 3.3, we further find that the proposed Graphormer does not encounter the problem of over-smoothing, i.e., the train and validate error keep going down along with the growth of depth and width of models.
141
+
142
+ # 4.2 Graph Representation
143
+
144
+ In this section, we further investigate the performance of Graphormer on commonly used graph-level prediction tasks of popular leaderboards, i.e., OGB [22] (OGBG-MolPCBA, OGBG-MolHIV), and benchmarking-GNN [14] (ZINC). Since pre-training is encouraged by OGB, we mainly explore the transferable capability of a Graphormer model pre-trained on OGB-LSC (i.e., PCQM4M-LSC). Please note that the model configurations, hyper-parameters, and the pre-training performance of pre-trained Graphormers used for MolPCBA and MolHIV are different from the models used in the previous subsection. Please refer to Appendix B for detailed descriptions. For benchmarkingGNN, which does not encourage large pre-trained model, we train an additional GraphormerSLIM $( L = 1 2 , d = 8 0$ , total param. $= 4 8 9 K$ ) from scratch on ZINC.
145
+
146
+ Baselines. We report performance of GNNs which achieve top-performance on the official leaderboards5 without additional domain-specific features. Considering that the pre-trained Graphormer leverages external data, for a fair comparison on OGB datasets, we additionally report performance for fine-tuning GIN-VN pre-trained on PCQM4M-LSC dataset, which achieves the previous state-ofthe-art valid and test MAE on that dataset.
147
+
148
+ Settings. We report detailed training strategies in Appendix B. In addition, Graphormer is more easily trapped in the over-fitting problem due to the large size of the model and the small size of the dataset. Therefore, we employ a widely used data augmentation for graph - FLAG [27], to mitigate the over-fitting problem on OGB datasets.
149
+
150
+ Results. Table 2, 3 and 4 summarize performance of Graphormer comparing with other GNNs on MolHIV, MolPCBA and ZINC datasets. Especially, GT [13] and SAN [28] in Table 4 are recently proposed Transformer-based GNN models. Graphormer consistently and significantly outperforms previous state-of-the-art GNNs on all three datasets by a large margin. Specially, except Graphormer, the other pre-trained GNNs do not achieve competitive performance, which is in line with previous literature [20]. In addition, we conduct more comparisons to fine-tuning the pre-trained GNNs, please refer to Appendix C.
151
+
152
+ Table 2: Results on MolPCBA.
153
+
154
+ <table><tr><td>method</td><td>#param.</td><td>AP (%)</td></tr><tr><td>DeeperGCN-VN+FLAG [30] DGN[2]</td><td>5.6M 6.7M</td><td>28.42±0.43 28.85±0.30</td></tr><tr><td>GINE-VN [5]</td><td>6.1M</td><td>29.17±0.15</td></tr><tr><td>PHC-GNN [29]</td><td>1.7M</td><td>29.47±0.26</td></tr><tr><td>GINE-APPNP [5]</td><td>6.1M</td><td>29.79±0.30</td></tr><tr><td>GIN-vN[50] (fine-tune)</td><td>3.4M</td><td>29.02±0.17</td></tr><tr><td>Graphormer-FLAG</td><td>119.5M</td><td>31.39±0.32</td></tr></table>
155
+
156
+ Table 3: Results on MolHIV.
157
+
158
+ <table><tr><td>method</td><td>#param.</td><td>AUC (%)</td></tr><tr><td>GCN-GraphNorm [5,8] PNA [10]</td><td>526K 326K</td><td>78.83±1.00 79.05±1.32</td></tr><tr><td>PHC-GNN [29]</td><td>111K</td><td>79.34±1.16</td></tr><tr><td>DeeperGCN-FLAG [30] DGN[2]</td><td>532K</td><td>79.42±1.20</td></tr><tr><td></td><td>114K</td><td>79.70±0.97</td></tr><tr><td>GIN-vN[50] (fine-tune) Graphormer-FLAG</td><td>3.3M 47.0M</td><td>77.80±1.82 80.51±0.53</td></tr></table>
159
+
160
+ Table 4: Results on ZINC.
161
+
162
+ <table><tr><td>method</td><td>#param.</td><td>test MAE</td></tr><tr><td>GIN[50]</td><td>509,549</td><td>0.526±0.051</td></tr><tr><td>GraphSage [18]</td><td>505,341</td><td>0.398±0.002</td></tr><tr><td>GAT[47]</td><td>531,345</td><td>0.384±0.007</td></tr><tr><td>GCN[26]</td><td>505,079</td><td>0.367±0.011</td></tr><tr><td>GatedGCN-PE [4]</td><td>505,011</td><td>0.214±0.006</td></tr><tr><td>MPNN (sum)[15]</td><td>480,805</td><td>0.145±0.007</td></tr><tr><td>PNA [10]</td><td>387,155</td><td>0.142±0.010</td></tr><tr><td>GT[13]</td><td>588.929</td><td>0.226±0.014</td></tr><tr><td>SAN[28]</td><td>508,577</td><td>0.139±0.006</td></tr><tr><td>GraphormersLIM</td><td>489,321</td><td>0.122±0.006</td></tr></table>
163
+
164
+ # 4.3 Ablation Studies
165
+
166
+ We perform a series of ablation studies on the importance of designs in our proposed Graphormer, on PCQM4M-LSC dataset. The ablation results are included in Table 5. To save the computation resources, the Transformer models in table 5 have 12 layers, and are trained for 100K iterations.
167
+
168
+ Node Relation Encoding. We compare previously used positional encoding (PE) to our proposed spatial encoding, which both aim to encode the information of distinct node relation to Transformers. There are various PEs employed by previous Transformer-based GNNs, e.g., Weisfeiler-LehmanPE (WL-PE) [56] and Laplacian PE [3, 14]. We report the performance for Laplacian PE since it performs well comparing to a series of PEs for Graph Transformer in previous literature [13]. Transformer architecture with the spatial encoding outperforms the counterpart built on the positional encoding, which demonstrates the effectiveness of using spatial encoding to capture the node spatial information.
169
+
170
+ Centrality Encoding. Transformer architecture with degree-based centrality encoding yields a large margin performance boost in comparison to those without centrality information. This indicates that the centrality encoding is indispensable to Transformer architecture for modeling graph data.
171
+
172
+ Edge Encoding. We compare our proposed edge encoding (denoted as via attn bias) to two commonly used edge encodings described in Section 3.1.3 to incorporate edge features into GNN, denoted as via node and via Aggr in Table 5. From the table, the gap of performance is minor between the two conventional methods, but our proposed edge encoding performs significantly better, which indicates that edge encoding as attention bias is more effective for Transformer to capture spatial information on edges.
173
+
174
+ Table 5: Ablation study results on PCQM4M-LSC dataset with different designs.
175
+
176
+ <table><tr><td rowspan="2">Node Relation Encoding LaplacianPE[13]</td><td rowspan="2">Spatial</td><td rowspan="2">Centrality</td><td colspan="3">Edge Encoding</td><td rowspan="2">valid MAE</td></tr><tr><td>via node</td><td>via Aggr</td><td>via attn bias(Eq.7)</td></tr><tr><td>1</td><td>-</td><td>=</td><td>-</td><td>二</td><td>-</td><td>0.2276</td></tr><tr><td>√</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>0.1483</td></tr><tr><td>-</td><td>√</td><td>-</td><td>二</td><td>二</td><td>-</td><td>0.1427</td></tr><tr><td>二</td><td>√</td><td>√</td><td>1</td><td>二</td><td>二</td><td>0.1396</td></tr><tr><td>-</td><td>√</td><td>√</td><td>√</td><td>:</td><td>-</td><td>0.1328</td></tr><tr><td>-</td><td>√</td><td>√</td><td>1</td><td>√</td><td>-</td><td>0.1327</td></tr><tr><td>-</td><td>√</td><td>√</td><td>1</td><td>-</td><td>√</td><td>0.1304</td></tr></table>
177
+
178
+ # 5 Related Work
179
+
180
+ In this section, we highlight the most recent works which attempt to develop standard Transformer architecture-based GNN or graph structural encoding, but spend less effort on elaborating the works by adapting attention mechanism to GNNs [33, 55, 7, 23, 1, 47, 48, 56, 45].
181
+
182
+ # 5.1 Graph Transformer
183
+
184
+ There are several works that study the performance of pure Transformer architectures (stacked by transformer layers) with modifications on graph representation tasks, which are more related to our Graphormer. For example, several parts of the transformer layer are modified in [43], including an additional GNN employed in attention sub-layer to produce vectors of $Q$ , $K$ , and $V$ , long-range residual connection, and two branches of FFN to produce node and edge representations separately. They pre-train their model on 10 million unlabelled molecules and achieve excellent results by fine-tuning on downstream tasks. Attention module is modified to a soft adjacency matrix in [39] by directly adding the adjacency matrix and RDKit6-computed inter-atomic distance matrix to the attention probabilites. Very recently, Dwivedi et al. [13] revisit a series of works for Transformerbased GNNs, and suggest that the attention mechanism in Transformers on graph data should only aggregate the information from neighborhood (i.e., using adjacent matrix as attention mask) to ensure graph sparsity, and propose to use Laplacian eigenvector as positional encoding. Their model GT surpasses baseline GNNs on graph representation task. A concurrent work [28] propose a novel full Laplacian spectrum to learn the position of each node in a graph, and empirically shows better results than GT.
185
+
186
+ # 5.2 Structural Encodings in GNNs
187
+
188
+ Path and Distance in GNNs. Information of path and distance is commonly used in GNNs. For example, an attention-based aggregation is proposed in [9] where the node features, edge features, one-hot feature of the distance and ring flag feature are concatenated to calculate the attention probabilites; similar to [9], path-based attention is leveraged in [52] to model the influence between the center node and its higher-order neighbors; a distance-weighted aggregation scheme on graph is proposed in [54]; it has been proved in [32] that adopting distance encoding (i.e., one-hot feature of the distance as extra node attribute) could lead to a strictly more expressive power than the 1-WL test.
189
+
190
+ Positional Encoding in Transformer on Graph. Several works introduce positional encoding (PE) to Transformer-based GNNs to help the model capture the node position information. For example, Graph-BERT [56] introduces three types of PE to embed the node position information to model, i.e., an absolute WL-PE which represents different nodes labeled by Weisfeiler-Lehman algorithm, an intimacy based PE and a hop based PE which are both variant to the sampled subgraphs. Absolute Laplacian PE is employed in [13] and empircal study shows that its performance surpasses the absolute WL-PE used in [56].
191
+
192
+ Edge Feature. Except the conventionally used methods to encode edge feature, which are described in previous section, there are several attempts that exploit how to better encode edge features: an attention-based GNN layer is developed in [16] to encode edge features, where the edge feature is weighted by the similarity of the features of its two nodes; edge feature has been encoded into the popular GIN [50] in [5]; in [13], the authors propose to project edge features to an embedding vector, then multiply it by attention coefficients, and send the result to an additional FFN sub-layer to produce edge representations;
193
+
194
+ # 6 Conclusion
195
+
196
+ We have explored the direct application of Transformers to graph representation. With three novel graph structural encodings, the proposed Graphormer works surprisingly well on a wide range of popular benchmark datasets. While these initial results are encouraging, many challenges remain. For example, the quadratic complexity of the self-attention module restricts Graphormer’s application on large graphs. Therefore, future development of efficient Graphormer is necessary. Performance improvement could be expected by leveraging domain knowledge-powered encodings on particular graph datasets. Finally, an applicable graph sampling strategy is desired for node representation extraction with Graphormer. We leave them for future works.
197
+
198
+ # References
199
+
200
+ [1] Jinheon Baek, Minki Kang, and Sung Ju Hwang. Accurate learning of graph representations with graph multiset pooling. ICLR, 2021.
201
+ [2] Dominique Beaini, Saro Passaro, Vincent Létourneau, William L Hamilton, Gabriele Corso, and Pietro Liò. Directional graph networks. In International Conference on Machine Learning, 2021.
202
+ [3] Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps for dimensionality reduction and data representation. Neural computation, 15(6):1373–1396, 2003.
203
+ [4] Xavier Bresson and Thomas Laurent. Residual gated graph convnets. arXiv preprint arXiv:1711.07553, 2017.
204
+ [5] Rémy Brossard, Oriel Frigo, and David Dehaene. Graph convolutions that can finally model local structure. arXiv preprint arXiv:2011.15069, 2020.
205
+ [6] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 1877–1901. Curran Associates, Inc., 2020.
206
+ [7] Deng Cai and Wai Lam. Graph transformer for graph-to-sequence learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 7464–7471, 2020.
207
+ [8] Tianle Cai, Shengjie Luo, Keyulu Xu, Di He, Tie-yan Liu, and Liwei Wang. Graphnorm: A principled approach to accelerating graph neural network training. In International Conference on Machine Learning, 2021.
208
+ [9] Benson Chen, Regina Barzilay, and Tommi Jaakkola. Path-augmented graph transformer network. arXiv preprint arXiv:1905.12712, 2019.
209
+ [10] Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò, and Petar Velickovi ˇ c. Principal neighbour-´ hood aggregation for graph nets. Advances in Neural Information Processing Systems, 33, 2020.
210
+ [11] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, 2019.
211
+ [12] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
212
+ [13] Vijay Prakash Dwivedi and Xavier Bresson. A generalization of transformer networks to graphs. AAAI Workshop on Deep Learning on Graphs: Methods and Applications, 2021.
213
+ [14] Vijay Prakash Dwivedi, Chaitanya K Joshi, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. arXiv preprint arXiv:2003.00982, 2020.
214
+ [15] Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pages 1263–1272. PMLR, 2017.
215
+ [16] Liyu Gong and Qiang Cheng. Exploiting edge features for graph neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9211–9219, 2019.
216
+ [17] Anmol Gulati, James Qin, Chung-Cheng Chiu, Niki Parmar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zhengdong Zhang, Yonghui Wu, et al. Conformer: Convolution-augmented transformer for speech recognition. arXiv preprint arXiv:2005.08100, 2020.
217
+ [18] William L Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NIPS, 2017.
218
+ [19] Vincent J Hellendoorn, Charles Sutton, Rishabh Singh, Petros Maniatis, and David Bieber. Global relational models of source code. In International conference on learning representations, 2019.
219
+ [20] W Hu, B Liu, J Gomes, M Zitnik, P Liang, V Pande, and J Leskovec. Strategies for pre-training graph neural networks. In International Conference on Learning Representations (ICLR), 2020.
220
+ [21] Weihua Hu, Matthias Fey, Hongyu Ren, Maho Nakata, Yuxiao Dong, and Jure Leskovec. Ogb-lsc: A large-scale challenge for machine learning on graphs. arXiv preprint arXiv:2103.09430, 2021.
221
+ [22] Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020.
222
+ [23] Ziniu Hu, Yuxiao Dong, Kuansan Wang, and Yizhou Sun. Heterogeneous graph transformer. In Proceedings of The Web Conference 2020, pages 2704–2710, 2020.
223
+ [24] Katsuhiko Ishiguro, Shin-ichi Maeda, and Masanori Koyama. Graph warp module: an auxiliary module for boosting the power of graph neural networks in molecular graph analysis. arXiv preprint arXiv:1902.01020, 2019.
224
+ [25] Guolin Ke, Di He, and Tie-Yan Liu. Rethinking the positional encoding in language pre-training. ICLR, 2020.
225
+ [26] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
226
+ [27] Kezhi Kong, Guohao Li, Mucong Ding, Zuxuan Wu, Chen Zhu, Bernard Ghanem, Gavin Taylor, and Tom Goldstein. Flag: Adversarial data augmentation for graph neural networks. arXiv preprint arXiv:2010.09891, 2020.
227
+ [28] Devin Kreuzer, Dominique Beaini, William Hamilton, Vincent Létourneau, and Prudencio Tossou. Rethinking graph transformers with spectral attention. arXiv preprint arXiv:2106.03893, 2021.
228
+ [29] Tuan Le, Marco Bertolini, Frank Noé, and Djork-Arné Clevert. Parameterized hypercomplex graph neural networks for graph classification. arXiv preprint arXiv:2103.16584, 2021.
229
+ [30] Guohao Li, Chenxin Xiong, Ali Thabet, and Bernard Ghanem. Deepergcn: All you need to train deeper gcns. arXiv preprint arXiv:2006.07739, 2020.
230
+ [31] Junying Li, Deng Cai, and Xiaofei He. Learning graph-level representation for drug discovery. arXiv preprint arXiv:1709.03741, 2017.
231
+ [32] Pan Li, Yanbang Wang, Hongwei Wang, and Jure Leskovec. Distance encoding: Design provably more powerful neural networks for graph representation learning. Advances in Neural Information Processing Systems, 33, 2020.
232
+ [33] Yuan Li, Xiaodan Liang, Zhiting Hu, Yinbo Chen, and Eric P. Xing. Graph transformer, 2019.
233
+ [34] Xi Victoria Lin, Richard Socher, and Caiming Xiong. Multi-hop knowledge graph reasoning with reward shaping. arXiv preprint arXiv:1808.10568, 2018.
234
+ [35] 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, 2019.
235
+ [36] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021.
236
+ [37] P David Marshall. The promotion and presentation of the self: celebrity as marker of presentational media. Celebrity studies, 1(1):35–48, 2010.
237
+ [38] Alice Marwick and Danah Boyd. To see and be seen: Celebrity practice on twitter. Convergence, 17(2):139–158, 2011.
238
+ [39] Łukasz Maziarka, Tomasz Danel, Sławomir Mucha, Krzysztof Rataj, Jacek Tabor, and Stanisław Jastrz˛ebski. Molecule attention transformer. arXiv preprint arXiv:2002.08264, 2020.
239
+ [40] Sharan Narang, Hyung Won Chung, Yi Tay, William Fedus, Thibault Fevry, Michael Matena, Karishma Malkan, Noah Fiedel, Noam Shazeer, Zhenzhong Lan, et al. Do transformer modifications transfer across implementations and applications? arXiv preprint arXiv:2102.11972, 2021.
240
+ [41] Dinglan Peng, Shuxin Zheng, Yatao Li, Guolin Ke, Di He, and Tie-Yan Liu. How could neural networks understand programs? In International Conference on Machine Learning. PMLR, 2021.
241
+ [42] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020.
242
+ [43] Yu Rong, Yatao Bian, Tingyang Xu, Weiyang Xie, Ying Wei, Wenbing Huang, and Junzhou Huang. Selfsupervised graph transformer on large-scale molecular data. Advances in Neural Information Processing Systems, 33, 2020.
243
+ [44] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 464–468, 2018.
244
+ [45] Yunsheng Shi, Zhengjie Huang, Wenjin Wang, Hui Zhong, Shikun Feng, and Yu Sun. Masked label prediction: Unified message passing model for semi-supervised classification. arXiv preprint arXiv:2009.03509, 2020.
245
+ [46] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
246
+ [47] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. ´ Graph attention networks. ICLR, 2018.
247
+ [48] Guangtao Wang, Rex Ying, Jing Huang, and Jure Leskovec. Direct multi-hop attention based graph neural network. arXiv preprint arXiv:2009.14332, 2020.
248
+ [49] Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan, Liwei Wang, and Tieyan Liu. On layer normalization in the transformer architecture. In International Conference on Machine Learning, pages 10524–10533. PMLR, 2020.
249
+ [50] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019.
250
+ [51] Mingqi Yang, Yanming Shen, Heng Qi, and Baocai Yin. Breaking the expressive bottlenecks of graph neural networks. arXiv preprint arXiv:2012.07219, 2020.
251
+ [52] Yiding Yang, Xinchao Wang, Mingli Song, Junsong Yuan, and Dacheng Tao. Spagan: Shortest path graph attention network. Advances in IJCAI, 2019.
252
+ [53] Chengxuan Ying, Mingqi Yang, Shuxin Zheng, Guolin Ke, Shengjie Luo, Tianle Cai, Chenglin Wu, Yuxin Wang, Yanming Shen, and Di He. First place solution of kdd cup 2021 & ogb large-scale challenge graph-level track. arXiv preprint arXiv:2106.08279, 2021.
253
+ [54] Jiaxuan You, Rex Ying, and Jure Leskovec. Position-aware graph neural networks. In International Conference on Machine Learning, pages 7134–7143. PMLR, 2019.
254
+ [55] Seongjun Yun, Minbyul Jeong, Raehyun Kim, Jaewoo Kang, and Hyunwoo J Kim. Graph transformer networks. Advances in Neural Information Processing Systems, 32, 2019.
255
+ [56] Jiawei Zhang, Haopeng Zhang, Congying Xia, and Li Sun. Graph-bert: Only attention is needed for learning graph representations. arXiv preprint arXiv:2001.05140, 2020.
256
+ [57] Daniel Zügner, Tobias Kirschstein, Michele Catasta, Jure Leskovec, and Stephan Günnemann. Languageagnostic representation learning of source code from structure and context. In International Conference on Learning Representations, 2020.
parse/train/OeWooOxFwDa/OeWooOxFwDa_content_list.json ADDED
@@ -0,0 +1,1088 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Do Transformers Really Perform Bad for Graph Representation? ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 269,
8
+ 122,
9
+ 727,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Chengxuan $\\mathbf { Y i n g ^ { 1 } }$ ∗, Tianle $\\mathbf { C a i ^ { 2 } }$ , Shengjie Luo3∗, Shuxin Zheng4†, Guolin ${ \\bf K } { \\bf e } ^ { 4 }$ , Di $\\mathbf { H e ^ { 4 } }$ †, Yanming Shen1, Tie-Yan Liu4 1Dalian University of Technology 2Princeton University 3Peking University 4Microsoft Research Asia yingchengsyuan@gmail.com, tianle.cai@princeton.edu, luosj@stu.pku.edu.cn {shuz†, guoke, dihe†, tyliu}@microsoft.com, shen@dlut.edu.cn ",
17
+ "bbox": [
18
+ 220,
19
+ 224,
20
+ 776,
21
+ 313
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 348,
32
+ 535,
33
+ 364
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "The Transformer architecture has become a dominant choice in many domains, such as natural language processing and computer vision. Yet, it has not achieved competitive performance on popular leaderboards of graph-level prediction compared to mainstream GNN variants. Therefore, it remains a mystery how Transformers could perform well for graph representation learning. In this paper, we solve this mystery by presenting Graphormer, which is built upon the standard Transformer architecture, and could attain excellent results on a broad range of graph representation learning tasks, especially on the recent OGB Large-Scale Challenge. Our key insight to utilizing Transformer in the graph is the necessity of effectively encoding the structural information of a graph into the model. To this end, we propose several simple yet effective structural encoding methods to help Graphormer better model graph-structured data. Besides, we mathematically characterize the expressive power of Graphormer and exhibit that with our ways of encoding the structural information of graphs, many popular GNN variants could be covered as the special cases of Graphormer. The code and models of Graphormer will be made publicly available at https://github.com/Microsoft/Graphormer. ",
40
+ "bbox": [
41
+ 233,
42
+ 381,
43
+ 766,
44
+ 601
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 Introduction ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 174,
54
+ 627,
55
+ 310,
56
+ 645
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "The Transformer [46] is well acknowledged as the most powerful neural network in modelling sequential data, such as natural language [11, 35, 6] and speech [17]. Model variants built upon Transformer have also been shown great performance in computer vision [12, 36] and programming language [19, 57, 41]. However, to the best of our knowledge, Transformer has still not been the de-facto standard on public graph representation leaderboards [22, 14, 21]. There are many attempts of leveraging Transformer into the graph domain, but the only effective way is replacing some key modules (e.g., feature aggregation) in classic GNN variants by the softmax attention [47, 7, 23, 48, 56, 43, 13]. Therefore, it is still an open question whether Transformer architecture is suitable to model graphs and how to make it work in graph representation learning. ",
63
+ "bbox": [
64
+ 174,
65
+ 660,
66
+ 825,
67
+ 785
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "In this paper, we give an affirmative answer by developing Graphormer, which is directly built upon the standard Transformer, and achieves state-of-the-art performance on a wide range of graphlevel prediction tasks, including the very recent Open Graph Benchmark Large-Scale Challenge (OGB-LSC) [21], and several popular leaderboards (e.g., OGB [22], Benchmarking-GNN [14]). The Transformer is originally designed for sequence modeling. To utilize its power in graphs, we believe the key is to properly incorporate structural information of graphs into the model. Note that for each node $i$ , the self-attention only calculates the semantic similarity between $i$ and other nodes, without considering the structural information of a graph reflected on the nodes and the relation between node pairs. Graphormer incorporates several effective structural encoding methods to leverage such information, which are described below. ",
74
+ "bbox": [
75
+ 174,
76
+ 791,
77
+ 825,
78
+ 861
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "",
85
+ "bbox": [
86
+ 174,
87
+ 92,
88
+ 825,
89
+ 160
90
+ ],
91
+ "page_idx": 1
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "First, we propose a Centrality Encoding in Graphormer to capture the node importance in the graph. In a graph, different nodes may have different importance, e.g., celebrities are considered to be more influential than the majority of web users in a social network. However, such information isn’t reflected in the self-attention module as it calculates the similarities mainly using the node semantic features. To address the problem, we propose to encode the node centrality in Graphormer. In particular, we leverage the degree centrality for the centrality encoding, where a learnable vector is assigned to each node according to its degree and added to the node features in the input layer. Empirical studies show that simple centrality encoding is effective for Transformer in modeling the graph data. ",
96
+ "bbox": [
97
+ 173,
98
+ 166,
99
+ 825,
100
+ 291
101
+ ],
102
+ "page_idx": 1
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "Second, we propose a novel Spatial Encoding in Graphormer to capture the structural relation between nodes. One notable geometrical property that distinguishes graph-structured data from other structured data, e.g., language, images, is that there does not exist a canonical grid to embed the graph. In fact, nodes can only lie in a non-Euclidean space and are linked by edges. To model such structural information, for each node pair, we assign a learnable embedding based on their spatial relation. Multiple measurements in the literature could be leveraged for modeling spatial relations. For a general purpose, we use the distance of the shortest path between any two nodes as a demonstration, which will be encoded as a bias term in the softmax attention and help the model accurately capture the spatial dependency in a graph. In addition, sometimes there is additional spatial information contained in edge features, such as the type of bond between two atoms in a molecular graph. We design a new edge encoding method to further take such signal into the Transformer layers. To be concrete, for each node pair, we compute an average of dot-products of the edge features and learnable embeddings along the shortest path, then use it in the attention module. Equipped with these encodings, Graphormer could better model the relationship for node pairs and represent the graph. ",
107
+ "bbox": [
108
+ 174,
109
+ 297,
110
+ 826,
111
+ 506
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "By using the proposed encodings above, we further mathematically show that Graphormer has strong expressiveness as many popular GNN variants are just its special cases. The great capacity of the model leads to state-of-the-art performance on a wide range of tasks in practice. On the large-scale quantum chemistry regression dataset3 in the very recent Open Graph Benchmark Large-Scale Challenge (OGB-LSC) [21], Graphormer outperforms most mainstream GNN variants by more than $10 \\%$ points in terms of the relative error. On other popular leaderboards of graph representation learning (e.g., MolHIV, MolPCBA, ZINC) [22, 14], Graphormer also surpasses the previous best results, demonstrating the potential and adaptability of the Transformer architecture. ",
118
+ "bbox": [
119
+ 174,
120
+ 511,
121
+ 825,
122
+ 622
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "2 Preliminary ",
129
+ "text_level": 1,
130
+ "bbox": [
131
+ 174,
132
+ 642,
133
+ 305,
134
+ 659
135
+ ],
136
+ "page_idx": 1
137
+ },
138
+ {
139
+ "type": "text",
140
+ "text": "In this section, we recap the preliminaries in Graph Neural Networks and Transformer. ",
141
+ "bbox": [
142
+ 174,
143
+ 672,
144
+ 738,
145
+ 689
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "Graph Neural Network (GNN). Let $G = ( V , E )$ denote a graph where $V = \\{ v _ { 1 } , v _ { 2 } , \\cdots , v _ { n } \\}$ $n = | V |$ is the number of nodes. Let the feature vector of node $v _ { i }$ be $x _ { i }$ . GNNs aim to learn representation of nodes and graphs. Typically, modern GNNs follow a learning schema that iteratively updates the representation of a node by aggregating representations of its first or higher-order neighbors. We denote $h _ { i } ^ { ( l ) }$ as the representation of $v _ { i }$ at the $l$ -th layer and define $h _ { i } ^ { ( 0 ) } = x _ { i }$ . The $l$ -th iteration of aggregation could be characterized by AGGREGATE-COMBINE step as ",
152
+ "bbox": [
153
+ 174,
154
+ 702,
155
+ 825,
156
+ 790
157
+ ],
158
+ "page_idx": 1
159
+ },
160
+ {
161
+ "type": "equation",
162
+ "img_path": "images/9d27557a53ef3258bb52558bcc14076b3517b796821803782ddd1c0528c6e983.jpg",
163
+ "text": "$$\n\\begin{array} { r } { a _ { i } ^ { ( l ) } = \\mathrm { A G G R E G A T E } ^ { ( l ) } \\left( \\left\\{ h _ { j } ^ { ( l - 1 ) } : j \\in \\mathcal { N } ( v _ { i } ) \\right\\} \\right) , \\quad h _ { i } ^ { ( l ) } = \\mathrm { C O M B I N E } ^ { ( l ) } \\left( h _ { i } ^ { ( l - 1 ) } , a _ { i } ^ { ( l ) } \\right) , } \\end{array}\n$$",
164
+ "text_format": "latex",
165
+ "bbox": [
166
+ 183,
167
+ 796,
168
+ 794,
169
+ 824
170
+ ],
171
+ "page_idx": 1
172
+ },
173
+ {
174
+ "type": "text",
175
+ "text": "where $\\mathcal { N } ( v _ { i } )$ is the set of first or higher-order neighbors of $v _ { i }$ . The AGGREGATE function is used to gather the information from neighbors. Common aggregation functions include MEAN, MAX, SUM, which are used in different architectures of GNNs [26, 18, 47, 50]. The goal of COMBINE function is to fuse the information from neighbors into the node representation. ",
176
+ "bbox": [
177
+ 174,
178
+ 830,
179
+ 825,
180
+ 887
181
+ ],
182
+ "page_idx": 1
183
+ },
184
+ {
185
+ "type": "image",
186
+ "img_path": "images/b1dbe178f7ab6b299fd7d7fd04c91e59c8f4f1133e39ece71c3e6b387ff5b126.jpg",
187
+ "image_caption": [
188
+ "Figure 1: An illustration of our proposed centrality encoding, spatial encoding, and edge encoding in Graphormer. "
189
+ ],
190
+ "image_footnote": [],
191
+ "bbox": [
192
+ 240,
193
+ 88,
194
+ 751,
195
+ 367
196
+ ],
197
+ "page_idx": 2
198
+ },
199
+ {
200
+ "type": "text",
201
+ "text": "In addition, for graph representation tasks, a READOUT function is designed to aggregate node features $h _ { i } ^ { ( L ) }$ of the final iteration into the representation $h _ { G }$ of the entire graph $G$ : ",
202
+ "bbox": [
203
+ 176,
204
+ 440,
205
+ 823,
206
+ 474
207
+ ],
208
+ "page_idx": 2
209
+ },
210
+ {
211
+ "type": "equation",
212
+ "img_path": "images/40d4018da0927975ac3a5f1c757b2ed28b50996d8fe22d37d1b2d704d3460566.jpg",
213
+ "text": "$$\nh _ { G } = \\mathrm { R E A D O U T } \\left( \\left\\{ h _ { i } ^ { ( L ) } \\mid v _ { i } \\in G \\right\\} \\right) .\n$$",
214
+ "text_format": "latex",
215
+ "bbox": [
216
+ 362,
217
+ 486,
218
+ 635,
219
+ 513
220
+ ],
221
+ "page_idx": 2
222
+ },
223
+ {
224
+ "type": "text",
225
+ "text": "READOUT can be implemented by a simple permutation invariant function such as summation [50] or a more sophisticated graph-level pooling function [1]. ",
226
+ "bbox": [
227
+ 173,
228
+ 523,
229
+ 826,
230
+ 553
231
+ ],
232
+ "page_idx": 2
233
+ },
234
+ {
235
+ "type": "text",
236
+ "text": "Transformer. The Transformer architecture consists of a composition of Transformer layers [46]. Each Transformer layer has two parts: a self-attention module and a position-wise feed-forward network (FFN). Let $H = \\left[ h _ { 1 } ^ { \\top } , \\cdots , h _ { n } ^ { \\top } \\right] ^ { \\top } \\in \\mathbb { R } ^ { n \\times d }$ denote the input of self-attention module where $d$ is the hidden dimension and $h _ { i } \\in \\mathbb { R } ^ { 1 \\times d }$ is the hidden representation at position $i$ . The input $H$ is projected by three matrices $W _ { Q } \\in \\mathbb { R } ^ { d \\times d _ { K } } , W _ { K } \\in \\mathbb { R } ^ { d \\times d _ { K } }$ and $W _ { V } \\in \\mathbb { R } ^ { \\dot { d } \\times d _ { V } }$ to the corresponding representations $Q , K , V$ . The self-attention is then calculated as: ",
237
+ "bbox": [
238
+ 173,
239
+ 571,
240
+ 825,
241
+ 662
242
+ ],
243
+ "page_idx": 2
244
+ },
245
+ {
246
+ "type": "equation",
247
+ "img_path": "images/90d60c4d7f7937031a8d64da7d91ce6286c85c9c07125ff8d333a8865ac9ed05.jpg",
248
+ "text": "$$\n\\begin{array} { r l r } { Q = H W _ { Q } , } & { { } K = H W _ { K } , \\quad V = H W _ { V } , } & { } \\\\ { \\displaystyle } & { { } A = \\frac { Q K ^ { \\top } } { \\sqrt { d _ { K } } } , } & { \\mathrm { A t t n } \\left( H \\right) = \\mathrm { s o f t m a x } \\left( A \\right) V , } & { } \\end{array}\n$$",
249
+ "text_format": "latex",
250
+ "bbox": [
251
+ 352,
252
+ 674,
253
+ 645,
254
+ 731
255
+ ],
256
+ "page_idx": 2
257
+ },
258
+ {
259
+ "type": "text",
260
+ "text": "where $A$ is a matrix capturing the similarity between queries and keys. For simplicity of illustration, we consider the single-head self-attention and assume $d _ { K } = d _ { V } = d$ . The extension to the multi-head attention is standard and straightforward, and we omit bias terms for simplicity. ",
261
+ "bbox": [
262
+ 174,
263
+ 739,
264
+ 825,
265
+ 782
266
+ ],
267
+ "page_idx": 2
268
+ },
269
+ {
270
+ "type": "text",
271
+ "text": "3 Graphormer ",
272
+ "text_level": 1,
273
+ "bbox": [
274
+ 174,
275
+ 806,
276
+ 312,
277
+ 824
278
+ ],
279
+ "page_idx": 2
280
+ },
281
+ {
282
+ "type": "text",
283
+ "text": "In this section, we present our Graphormer for graph tasks. First, we elaborate on several key designs in the Graphormer, which serve as an inductive bias in the neural network to learn the graph representation. We further provide the detailed implementations of Graphormer. Finally, we show that our proposed Graphormer is more powerful since popular GNN models [26, 50, 18] are its special cases. ",
284
+ "bbox": [
285
+ 174,
286
+ 842,
287
+ 825,
288
+ 911
289
+ ],
290
+ "page_idx": 2
291
+ },
292
+ {
293
+ "type": "text",
294
+ "text": "3.1 Structural Encodings in Graphormer ",
295
+ "text_level": 1,
296
+ "bbox": [
297
+ 174,
298
+ 90,
299
+ 472,
300
+ 106
301
+ ],
302
+ "page_idx": 3
303
+ },
304
+ {
305
+ "type": "text",
306
+ "text": "As discussed in the introduction, it is important to develop ways to leverage the structural information of graphs into the Transformer model. To this end, we present three simple but effective designs of encoding in Graphormer. See Figure 1 for an illustration. ",
307
+ "bbox": [
308
+ 174,
309
+ 117,
310
+ 825,
311
+ 160
312
+ ],
313
+ "page_idx": 3
314
+ },
315
+ {
316
+ "type": "text",
317
+ "text": "3.1.1 Centrality Encoding ",
318
+ "text_level": 1,
319
+ "bbox": [
320
+ 174,
321
+ 178,
322
+ 367,
323
+ 193
324
+ ],
325
+ "page_idx": 3
326
+ },
327
+ {
328
+ "type": "text",
329
+ "text": "In Eq.4, the attention distribution is calculated based on the semantic correlation between nodes. However, node centrality, which measures how important a node is in the graph, is usually a strong signal for graph understanding. For example, celebrities who have a huge number of followers are important factors in predicting the trend of a social network [38, 37]. Such information is neglected in the current attention calculation, and we believe it should be a valuable signal for Transformer models. ",
330
+ "bbox": [
331
+ 173,
332
+ 203,
333
+ 825,
334
+ 286
335
+ ],
336
+ "page_idx": 3
337
+ },
338
+ {
339
+ "type": "text",
340
+ "text": "In Graphormer, we use the degree centrality, which is one of the standard centrality measures in literature, as an additional signal to the neural network. To be specific, we develop a Centrality Encoding which assigns each node two real-valued embedding vectors according to its indegree and outdegree. As the centrality encoding is applied to each node, we simply add it to the node features as the input. ",
341
+ "bbox": [
342
+ 173,
343
+ 292,
344
+ 825,
345
+ 362
346
+ ],
347
+ "page_idx": 3
348
+ },
349
+ {
350
+ "type": "equation",
351
+ "img_path": "images/97c0eb4b1a4109a8bdf7798d2ebf3f6b044e62f0040ac943515e5518cc8f5e96.jpg",
352
+ "text": "$$\nh _ { i } ^ { ( 0 ) } = x _ { i } + z _ { \\deg ^ { - } ( v _ { i } ) } ^ { - } + z _ { \\deg ^ { + } ( v _ { i } ) } ^ { + } ,\n$$",
353
+ "text_format": "latex",
354
+ "bbox": [
355
+ 387,
356
+ 371,
357
+ 609,
358
+ 397
359
+ ],
360
+ "page_idx": 3
361
+ },
362
+ {
363
+ "type": "text",
364
+ "text": "where $z ^ { - } , z ^ { + } \\in \\mathbb { R } ^ { d }$ are learnable embedding vectors specified by the indegree $\\deg ^ { - } ( v _ { i } )$ and outdegree $\\deg ^ { + } ( v _ { i } )$ respectively. For undirected graphs, $\\deg ^ { - } ( v _ { i } )$ and $\\deg ^ { + } ( v _ { i } )$ could be unified to $\\deg ( v _ { i } )$ . By using the centrality encoding in the input, the softmax attention can catch the node importance signal in the queries and the keys. Therefore the model can capture both the semantic correlation and the node importance in the attention mechanism. ",
365
+ "bbox": [
366
+ 173,
367
+ 406,
368
+ 825,
369
+ 479
370
+ ],
371
+ "page_idx": 3
372
+ },
373
+ {
374
+ "type": "text",
375
+ "text": "3.1.2 Spatial Encoding ",
376
+ "text_level": 1,
377
+ "bbox": [
378
+ 174,
379
+ 496,
380
+ 344,
381
+ 512
382
+ ],
383
+ "page_idx": 3
384
+ },
385
+ {
386
+ "type": "text",
387
+ "text": "An advantage of Transformer is its global receptive field. In each Transformer layer, each token can attend to the information at any position and then process its representation. But this operation has a byproduct problem that the model has to explicitly specify different positions or encode the positional dependency (such as locality) in the layers. For sequential data, one can either give each position an embedding (i.e., absolute positional encoding [46]) as the input or encode the relative distance of any two positions (i.e., relative positional encoding [42, 44]) in the Transformer layer. ",
388
+ "bbox": [
389
+ 173,
390
+ 521,
391
+ 825,
392
+ 606
393
+ ],
394
+ "page_idx": 3
395
+ },
396
+ {
397
+ "type": "text",
398
+ "text": "However, for graphs, nodes are not arranged as a sequence. They can lie in a multi-dimensional spatial space and are linked by edges. To encode the structural information of a graph in the model, we propose a novel Spatial Encoding. Concretely, for any graph $G$ , we consider a function $\\phi \\left( v _ { i } , v _ { j } \\right) : V \\times V \\to \\mathbb { R }$ which measures the spatial relation between $v _ { i }$ and $v _ { j }$ in graph $G$ . The function $\\phi$ can be defined by the connectivity between the nodes in the graph. In this paper, we choose $\\phi ( v _ { i } , v _ { j } )$ to be the distance of the shortest path (SPD) between $v _ { i }$ and $v _ { j }$ if the two nodes are connected. If not, we set the output of $\\phi$ to be a special value, i.e., -1. We assign each (feasible) output value a learnable scalar which will serve as a bias term in the self-attention module. Denote $A _ { i j }$ as the $( i , j )$ -element of the Query-Key product matrix $A$ , we have: ",
399
+ "bbox": [
400
+ 173,
401
+ 611,
402
+ 825,
403
+ 737
404
+ ],
405
+ "page_idx": 3
406
+ },
407
+ {
408
+ "type": "equation",
409
+ "img_path": "images/01f9948dcf0ff147a103c9a3f1a62a87c62cbab474d5754fa2d7ca58dac40909.jpg",
410
+ "text": "$$\nA _ { i j } = \\frac { ( h _ { i } W _ { Q } ) ( h _ { j } W _ { K } ) ^ { T } } { \\sqrt { d } } + b _ { \\phi ( v _ { i } , v _ { j } ) } ,\n$$",
411
+ "text_format": "latex",
412
+ "bbox": [
413
+ 372,
414
+ 746,
415
+ 624,
416
+ 782
417
+ ],
418
+ "page_idx": 3
419
+ },
420
+ {
421
+ "type": "text",
422
+ "text": "where $b _ { \\phi ( v _ { i } , v _ { j } ) }$ is a learnable scalar indexed by $\\phi ( v _ { i } , v _ { j } )$ , and shared across all layers. ",
423
+ "bbox": [
424
+ 174,
425
+ 791,
426
+ 732,
427
+ 808
428
+ ],
429
+ "page_idx": 3
430
+ },
431
+ {
432
+ "type": "text",
433
+ "text": "Here we discuss several benefits of our proposed method. First, compared to conventional GNNs described in Section 2, where the receptive field is restricted to the neighbors, we can see that in Eq. (6), the Transformer layer provides a global information that each node can attend to all other nodes in the graph. Second, by using $b _ { \\phi ( v _ { i } , v _ { j } ) }$ , each node in a single Transformer layer can adaptively attend to all other nodes according to the graph structural information. For example, if $b _ { \\phi ( v _ { i } , v _ { j } ) }$ is learned to be a decreasing function with respect to $\\phi ( v _ { i } , v _ { j } )$ , for each node, the model will likely pay more attention to the nodes near it and pay less attention to the nodes far away from it. ",
434
+ "bbox": [
435
+ 173,
436
+ 813,
437
+ 825,
438
+ 912
439
+ ],
440
+ "page_idx": 3
441
+ },
442
+ {
443
+ "type": "text",
444
+ "text": "3.1.3 Edge Encoding in the Attention ",
445
+ "text_level": 1,
446
+ "bbox": [
447
+ 176,
448
+ 90,
449
+ 444,
450
+ 106
451
+ ],
452
+ "page_idx": 4
453
+ },
454
+ {
455
+ "type": "text",
456
+ "text": "In many graph tasks, edges also have structural features, e.g., in a molecular graph, atom pairs may have features describing the type of bond between them. Such features are important to the graph representation, and encoding them together with node features into the network is essential. There are mainly two edge encoding methods used in previous works. In the first method, the edge features are added to the associated nodes’ features [22, 30]. In the second method, for each node, its associated edges’ features will be used together with the node features in the aggregation [15, 50, 26]. However, such ways of using edge feature only propagate the edge information to its associated nodes, which may not be an effective way to leverage edge information in representation of the whole graph. ",
457
+ "bbox": [
458
+ 173,
459
+ 114,
460
+ 825,
461
+ 227
462
+ ],
463
+ "page_idx": 4
464
+ },
465
+ {
466
+ "type": "text",
467
+ "text": "To better encode edge features into attention layers, we propose a new edge encoding method in Graphormer. The attention mechanism needs to estimate correlations for each node pair $( v _ { i } , v _ { j } )$ , and we believe the edges connecting them should be considered in the correlation as in [34, 48]. For each ordered node pair $( v _ { i } , v _ { j } )$ , we find (one of) the shortest path ${ \\bf S P } _ { i j } = ( e _ { 1 } , e _ { 2 } , . . . , e _ { N } )$ from $v _ { i }$ to $v _ { j }$ , and compute an average of the dot-products of the edge feature and a learnable embedding along the path. The proposed edge encoding incorporates edge features via a bias term to the attention module. Concretely, we modify the $( i , j )$ -element of $A$ in Eq. (3) further with the edge encoding $c _ { i j }$ as: ",
468
+ "bbox": [
469
+ 173,
470
+ 232,
471
+ 826,
472
+ 330
473
+ ],
474
+ "page_idx": 4
475
+ },
476
+ {
477
+ "type": "equation",
478
+ "img_path": "images/0f24d54f7fb09e1e1fde4217b6d40a66968283b62e511c948fd9099de1e41a5f.jpg",
479
+ "text": "$$\nA _ { i j } = \\frac { ( h _ { i } W _ { Q } ) ( h _ { j } W _ { K } ) ^ { T } } { \\sqrt { d } } + b _ { \\phi ( v _ { i } , v _ { j } ) } + c _ { i j } , \\mathrm { ~ w h e r e ~ } c _ { i j } = \\frac { 1 } { N } \\sum _ { n = 1 } ^ { N } x _ { e _ { n } } ( w _ { n } ^ { E } ) ^ { T } ,\n$$",
480
+ "text_format": "latex",
481
+ "bbox": [
482
+ 245,
483
+ 354,
484
+ 751,
485
+ 397
486
+ ],
487
+ "page_idx": 4
488
+ },
489
+ {
490
+ "type": "text",
491
+ "text": "where $\\boldsymbol { x } _ { e _ { n } }$ is the feature of the $n$ -th edge $e _ { n }$ in $\\mathrm { S P } _ { i j }$ , $w _ { n } ^ { E } \\in \\mathbb { R } ^ { d _ { E } }$ is the $n$ -th weight embedding, and $d _ { E }$ is the dimensionality of edge feature. ",
492
+ "bbox": [
493
+ 174,
494
+ 411,
495
+ 825,
496
+ 441
497
+ ],
498
+ "page_idx": 4
499
+ },
500
+ {
501
+ "type": "text",
502
+ "text": "3.2 Implementation Details of Graphormer ",
503
+ "text_level": 1,
504
+ "bbox": [
505
+ 174,
506
+ 457,
507
+ 488,
508
+ 473
509
+ ],
510
+ "page_idx": 4
511
+ },
512
+ {
513
+ "type": "text",
514
+ "text": "Graphormer Layer. Graphormer is built upon the original implementation of classic Transformer encoder described in [46]. In addition, we apply the layer normalization (LN) before the multi-head self-attention (MHA) and the feed-forward blocks (FFN) instead of after [49]. This modification has been unanimously adopted by all current Transformer implementations because it leads to more effective optimization [40]. Especially, for FFN sub-layer, we set the dimensionality of input, output, and the inner-layer to the same dimension with $d$ . We formally characterize the Graphormer layer as below: ",
515
+ "bbox": [
516
+ 173,
517
+ 483,
518
+ 825,
519
+ 580
520
+ ],
521
+ "page_idx": 4
522
+ },
523
+ {
524
+ "type": "equation",
525
+ "img_path": "images/5760025aa6f65fc8e650b832dfdc4d44a46d5354bf08bfc810aeba390cef835f.jpg",
526
+ "text": "$$\n\\begin{array} { c } { { \\boldsymbol { h } ^ { \\prime } ( \\boldsymbol { l } ) = \\boldsymbol { \\mathbf { M H A } } \\big ( \\boldsymbol { \\mathrm { L N } } \\big ( \\boldsymbol { h } ^ { ( l - 1 ) } \\big ) \\big ) + \\boldsymbol { h } ^ { ( l - 1 ) } } } \\\\ { { \\boldsymbol { h } ^ { ( l ) } = \\boldsymbol { \\mathrm { F F N } } \\big ( \\boldsymbol { \\mathrm { L N } } \\big ( \\boldsymbol { h } ^ { \\prime } ( \\boldsymbol { l } ) \\big ) \\big ) + \\boldsymbol { h } ^ { \\prime } ( \\boldsymbol { l } ) } } \\end{array}\n$$",
527
+ "text_format": "latex",
528
+ "bbox": [
529
+ 377,
530
+ 604,
531
+ 620,
532
+ 650
533
+ ],
534
+ "page_idx": 4
535
+ },
536
+ {
537
+ "type": "text",
538
+ "text": "Special Node. As stated in the previous section, various graph pooling functions are proposed to represent the graph embedding. Inspired by [15], in Graphormer, we add a special node called [VNode] to the graph, and make connection between [VNode] and each node individually. In the AGGREGATE-COMBINE step, the representation of [VNode] has been updated as normal nodes in graph, and the representation of the entire graph $h _ { G }$ would be the node feature of [VNode] in the final layer. In the BERT model [11, 35], there is a similar token, i.e., [CLS], which is a special token attached at the beginning of each sequence, to represent the sequence-level feature on downstream tasks. While the [VNode] is connected to all other nodes in graph, which means the distance of the shortest path is 1 for any $\\phi ( [ \\mathtt { V N o d e } ] , v _ { j } )$ and $\\phi ( v _ { i } , [ \\mathtt { V N o d e } ] )$ , the connection is not physical. To distinguish the connection of physical and virtual, inspired by [25], we reset all spatial encodings for $b _ { \\phi ( [ \\tt N N o d e ] , \\boldsymbol { v } _ { j } ) }$ and $b _ { \\phi ( v _ { i } , [ \\mathsf { V N o d e } ] ) }$ to a distinct learnable scalar. ",
539
+ "bbox": [
540
+ 173,
541
+ 660,
542
+ 825,
543
+ 814
544
+ ],
545
+ "page_idx": 4
546
+ },
547
+ {
548
+ "type": "text",
549
+ "text": "3.3 How Powerful is Graphormer? ",
550
+ "text_level": 1,
551
+ "bbox": [
552
+ 176,
553
+ 829,
554
+ 428,
555
+ 844
556
+ ],
557
+ "page_idx": 4
558
+ },
559
+ {
560
+ "type": "text",
561
+ "text": "In the previous subsections, we introduce three structural encodings and the architecture of Graphormer. Then a natural question is: Do these modifications make Graphormer more powerful than other GNN variants? In this subsection, we first give an affirmative answer by showing that Graphormer can represent the AGGREGATE and COMBINE steps in popular GNN models: ",
562
+ "bbox": [
563
+ 174,
564
+ 856,
565
+ 825,
566
+ 911
567
+ ],
568
+ "page_idx": 4
569
+ },
570
+ {
571
+ "type": "text",
572
+ "text": "Fact 1. By choosing proper weights and distance function $\\phi ,$ , the Graphormer layer can represent AGGREGATE and COMBINE steps of popular GNN models such as GIN, GCN, GraphSAGE. ",
573
+ "bbox": [
574
+ 173,
575
+ 92,
576
+ 823,
577
+ 119
578
+ ],
579
+ "page_idx": 5
580
+ },
581
+ {
582
+ "type": "text",
583
+ "text": "The proof sketch to derive this result is: 1) Spatial encoding enables self-attention module to distinguish neighbor set $\\mathcal { N } \\left( v _ { i } \\right)$ of node $v _ { i }$ so that the softmax function can calculate mean statistics over $\\bar { \\mathcal { N } } \\left( v _ { i } \\right)$ ; 2) Knowing the degree of a node, mean over neighbors can be translated to sum over neighbors; 3) With multiple heads and FFN, representations of $v _ { i }$ and $\\mathcal { N } \\left( v _ { i } \\right)$ can be processed separately and combined together later. We defer the proof of this fact to Appendix A. ",
584
+ "bbox": [
585
+ 174,
586
+ 128,
587
+ 825,
588
+ 198
589
+ ],
590
+ "page_idx": 5
591
+ },
592
+ {
593
+ "type": "text",
594
+ "text": "Moreover, we show further that by using our spatial encoding, Graphormer can go beyond classic message passing GNNs whose expressive power is no more than the 1-Weisfeiler-Lehman (WL) test. We give a concrete example in Appendix A to show how Graphormer helps distinguish graphs that the 1-WL test fails to. ",
595
+ "bbox": [
596
+ 174,
597
+ 204,
598
+ 825,
599
+ 260
600
+ ],
601
+ "page_idx": 5
602
+ },
603
+ {
604
+ "type": "text",
605
+ "text": "Connection between Self-attention and Virtual Node. Besides the superior expressiveness than popular GNNs, we also find an interesting connection between using self-attention and the virtual node heuristic [15, 31, 24, 22]. As shown in the leaderboard of OGB [22], the virtual node trick, which augments graphs with additional supernodes that are connected to all nodes in the original graphs, can significantly improve the performance of existing GNNs. Conceptually, the benefit of the virtual node is that it can aggregate the information of the whole graph (like the READOUT function) and then propagate it to each node. However, a naive addition of a supernode to a graph can potentially lead to inadvertent over-smoothing of information propagation [24]. We instead find that such a graph-level aggregation and propagation operation can be naturally fulfilled by vanilla self-attention without additional encodings. Concretely, we can prove the following fact: ",
606
+ "bbox": [
607
+ 174,
608
+ 273,
609
+ 825,
610
+ 412
611
+ ],
612
+ "page_idx": 5
613
+ },
614
+ {
615
+ "type": "text",
616
+ "text": "Fact 2. By choosing proper weights, every node representation of the output of a Graphormer layer without additional encodings can represent MEAN READOUT functions. ",
617
+ "bbox": [
618
+ 176,
619
+ 415,
620
+ 821,
621
+ 443
622
+ ],
623
+ "page_idx": 5
624
+ },
625
+ {
626
+ "type": "text",
627
+ "text": "This fact takes the advantage of self-attention that each node can attend to all other nodes. Thus it can simulate graph-level READOUT operation to aggregate information from the whole graph. Besides the theoretical justification, we empirically find that Graphormer does not encounter the problem of over-smoothing, which makes the improvement scalable. The fact also inspires us to introduce a special node for graph readout (see the previous subsection). ",
628
+ "bbox": [
629
+ 174,
630
+ 452,
631
+ 825,
632
+ 522
633
+ ],
634
+ "page_idx": 5
635
+ },
636
+ {
637
+ "type": "text",
638
+ "text": "4 Experiments ",
639
+ "text_level": 1,
640
+ "bbox": [
641
+ 174,
642
+ 540,
643
+ 312,
644
+ 558
645
+ ],
646
+ "page_idx": 5
647
+ },
648
+ {
649
+ "type": "text",
650
+ "text": "We first conduct experiments on the recent OGB-LSC [21] quantum chemistry regression (i.e., PCQM4M-LSC) challenge, which is currently the biggest graph-level prediction dataset and contains more than $3 . 8 \\mathbf { M }$ graphs in total. Then, we report the results on the other three popular tasks: ogbgmolhiv, ogbg-molpcba and ZINC, which come from the OGB [22] and benchmarking-GNN [14] leaderboards. Finally, we ablate the important design elements of Graphormer. A detailed description of datasets and training strategies could be found in Appendix B. ",
651
+ "bbox": [
652
+ 174,
653
+ 570,
654
+ 825,
655
+ 654
656
+ ],
657
+ "page_idx": 5
658
+ },
659
+ {
660
+ "type": "text",
661
+ "text": "4.1 OGB Large-Scale Challenge ",
662
+ "text_level": 1,
663
+ "bbox": [
664
+ 176,
665
+ 669,
666
+ 410,
667
+ 684
668
+ ],
669
+ "page_idx": 5
670
+ },
671
+ {
672
+ "type": "text",
673
+ "text": "Baselines. We benchmark the proposed Graphormer with GCN [26] and GIN [50], and their variants with virtual node (-VN) [15]. They achieve the state-of-the-art valid and test mean absolute error (MAE) on the official leaderboard4 [21]. In addition, we compare to GIN’s multi-hop variant [5], and 12-layer deep graph network DeeperGCN [30], which also show promising performance on other leaderboards. We further compare our Graphormer with the recent Transformer-based graph model GT [13]. ",
674
+ "bbox": [
675
+ 173,
676
+ 695,
677
+ 825,
678
+ 779
679
+ ],
680
+ "page_idx": 5
681
+ },
682
+ {
683
+ "type": "text",
684
+ "text": "Settings. We primarily report results on two model sizes: Graphormer $( L = 1 2 , d = 7 6 8 )$ , and a smaller one GraphormerSMALL $( L = 6 , d = 5 1 2 )$ . Both the number of attention heads in the attention module and the dimensionality of edge features $d _ { E }$ are set to 32. We use AdamW as the optimizer, and set the hyper-parameter $\\epsilon$ to 1e-8 and $( \\beta 1 , \\beta 2 )$ to (0.99,0.999). The peak learning rate is set to 2e-4 (3e-4 for GraphormerSMALL) with a 60k-step warm-up stage followed by a linear decay learning rate scheduler. The total training steps are 1M. The batch size is set to 1024. All models are trained on 8 NVIDIA V100 GPUS for about 2 days. ",
685
+ "bbox": [
686
+ 174,
687
+ 791,
688
+ 825,
689
+ 890
690
+ ],
691
+ "page_idx": 5
692
+ },
693
+ {
694
+ "type": "table",
695
+ "img_path": "images/d8de64a963f72230e2bca846d0ee8e18d6fcd41dfb97ee9110deb86fa56b8338.jpg",
696
+ "table_caption": [
697
+ "Table 1: Results on PCQM4M-LSC. \\* indicates the results are cited from the official leaderboard [21]. "
698
+ ],
699
+ "table_footnote": [],
700
+ "table_body": "<table><tr><td>method</td><td>#param.</td><td>train MAE</td><td>validate MAE</td></tr><tr><td>GCN[26]</td><td>2.0M</td><td>0.1318</td><td>0.1691 (0.1684*)</td></tr><tr><td>GIN [50]</td><td>3.8M</td><td>0.1203</td><td>0.1537 (0.1536*)</td></tr><tr><td>GCN-VN [26,15]</td><td>4.9M</td><td>0.1225</td><td>0.1485 (0.1510*)</td></tr><tr><td>GIN-VN [50,15]</td><td>6.7M</td><td>0.1150</td><td>0.1395 (0.1396*)</td></tr><tr><td>GINE-VN [5,15]</td><td>13.2M</td><td>0.1248</td><td>0.1430</td></tr><tr><td>DeeperGCN-VN [30,15]</td><td>25.5M</td><td>0.1059</td><td>0.1398</td></tr><tr><td>GT[13]</td><td>0.6M</td><td>0.0944</td><td>0.1400</td></tr><tr><td>GT-Wide [13]</td><td>83.2M</td><td>0.0955</td><td>0.1408</td></tr><tr><td>GraphormersmALL</td><td>12.5M</td><td>0.0778</td><td>0.1264</td></tr><tr><td>Graphormer</td><td>47.1M</td><td>0.0582</td><td>0.1234</td></tr></table>",
701
+ "bbox": [
702
+ 279,
703
+ 109,
704
+ 720,
705
+ 258
706
+ ],
707
+ "page_idx": 6
708
+ },
709
+ {
710
+ "type": "text",
711
+ "text": "Results. Table 1 summarizes performance comparisons on PCQM4M-LSC dataset. From the table, GIN-VN achieves the previous state-of-the-art validate MAE of 0.1395. The original implementation of GT [13] employs a hidden dimension of 64 to reduce the total number of parameters. For a fair comparison, we also report the result by enlarging the hidden dimension to 768, denoted by GT-Wide, which leads to a total number of parameters of 83.2M. While, both GT and GT-Wide do not outperform GIN-VN and DeeperGCN-VN. Especially, we do not observe a performance gain along with the growth of parameters of GT. ",
712
+ "bbox": [
713
+ 173,
714
+ 284,
715
+ 826,
716
+ 382
717
+ ],
718
+ "page_idx": 6
719
+ },
720
+ {
721
+ "type": "text",
722
+ "text": "Compared to the previous state-of-the-art GNN architecture, Graphormer noticeably surpasses GINVN by a large margin, e.g., $1 1 . 5 \\%$ relative validate MAE decline. By using the ensemble with ExpC [51], we got a $0 . 1 2 0 0 \\mathrm { M A E }$ on complete test set and won the first place of the graph-level track in OGB Large-Scale Challenge[21, 53]. As stated in Section 3.3, we further find that the proposed Graphormer does not encounter the problem of over-smoothing, i.e., the train and validate error keep going down along with the growth of depth and width of models. ",
723
+ "bbox": [
724
+ 173,
725
+ 387,
726
+ 825,
727
+ 472
728
+ ],
729
+ "page_idx": 6
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "4.2 Graph Representation ",
734
+ "text_level": 1,
735
+ "bbox": [
736
+ 176,
737
+ 487,
738
+ 369,
739
+ 502
740
+ ],
741
+ "page_idx": 6
742
+ },
743
+ {
744
+ "type": "text",
745
+ "text": "In this section, we further investigate the performance of Graphormer on commonly used graph-level prediction tasks of popular leaderboards, i.e., OGB [22] (OGBG-MolPCBA, OGBG-MolHIV), and benchmarking-GNN [14] (ZINC). Since pre-training is encouraged by OGB, we mainly explore the transferable capability of a Graphormer model pre-trained on OGB-LSC (i.e., PCQM4M-LSC). Please note that the model configurations, hyper-parameters, and the pre-training performance of pre-trained Graphormers used for MolPCBA and MolHIV are different from the models used in the previous subsection. Please refer to Appendix B for detailed descriptions. For benchmarkingGNN, which does not encourage large pre-trained model, we train an additional GraphormerSLIM $( L = 1 2 , d = 8 0$ , total param. $= 4 8 9 K$ ) from scratch on ZINC. ",
746
+ "bbox": [
747
+ 173,
748
+ 512,
749
+ 826,
750
+ 637
751
+ ],
752
+ "page_idx": 6
753
+ },
754
+ {
755
+ "type": "text",
756
+ "text": "Baselines. We report performance of GNNs which achieve top-performance on the official leaderboards5 without additional domain-specific features. Considering that the pre-trained Graphormer leverages external data, for a fair comparison on OGB datasets, we additionally report performance for fine-tuning GIN-VN pre-trained on PCQM4M-LSC dataset, which achieves the previous state-ofthe-art valid and test MAE on that dataset. ",
757
+ "bbox": [
758
+ 174,
759
+ 651,
760
+ 825,
761
+ 722
762
+ ],
763
+ "page_idx": 6
764
+ },
765
+ {
766
+ "type": "text",
767
+ "text": "Settings. We report detailed training strategies in Appendix B. In addition, Graphormer is more easily trapped in the over-fitting problem due to the large size of the model and the small size of the dataset. Therefore, we employ a widely used data augmentation for graph - FLAG [27], to mitigate the over-fitting problem on OGB datasets. ",
768
+ "bbox": [
769
+ 174,
770
+ 736,
771
+ 825,
772
+ 791
773
+ ],
774
+ "page_idx": 6
775
+ },
776
+ {
777
+ "type": "text",
778
+ "text": "Results. Table 2, 3 and 4 summarize performance of Graphormer comparing with other GNNs on MolHIV, MolPCBA and ZINC datasets. Especially, GT [13] and SAN [28] in Table 4 are recently proposed Transformer-based GNN models. Graphormer consistently and significantly outperforms previous state-of-the-art GNNs on all three datasets by a large margin. Specially, except Graphormer, the other pre-trained GNNs do not achieve competitive performance, which is in line with previous literature [20]. In addition, we conduct more comparisons to fine-tuning the pre-trained GNNs, please refer to Appendix C. ",
779
+ "bbox": [
780
+ 174,
781
+ 806,
782
+ 823,
783
+ 862
784
+ ],
785
+ "page_idx": 6
786
+ },
787
+ {
788
+ "type": "table",
789
+ "img_path": "images/3a511faba09a350bb981b6f9fa84ce21829f7c9cda52bbc7d22c8e2788956d43.jpg",
790
+ "table_caption": [
791
+ "Table 2: Results on MolPCBA. "
792
+ ],
793
+ "table_footnote": [],
794
+ "table_body": "<table><tr><td>method</td><td>#param.</td><td>AP (%)</td></tr><tr><td>DeeperGCN-VN+FLAG [30] DGN[2]</td><td>5.6M 6.7M</td><td>28.42±0.43 28.85±0.30</td></tr><tr><td>GINE-VN [5]</td><td>6.1M</td><td>29.17±0.15</td></tr><tr><td>PHC-GNN [29]</td><td>1.7M</td><td>29.47±0.26</td></tr><tr><td>GINE-APPNP [5]</td><td>6.1M</td><td>29.79±0.30</td></tr><tr><td>GIN-vN[50] (fine-tune)</td><td>3.4M</td><td>29.02±0.17</td></tr><tr><td>Graphormer-FLAG</td><td>119.5M</td><td>31.39±0.32</td></tr></table>",
795
+ "bbox": [
796
+ 173,
797
+ 107,
798
+ 513,
799
+ 219
800
+ ],
801
+ "page_idx": 7
802
+ },
803
+ {
804
+ "type": "table",
805
+ "img_path": "images/7238c8eb2fcfd8d13c708d9f9a85d46e8e5452fef844670a02542345a35bf35f.jpg",
806
+ "table_caption": [
807
+ "Table 3: Results on MolHIV. "
808
+ ],
809
+ "table_footnote": [],
810
+ "table_body": "<table><tr><td>method</td><td>#param.</td><td>AUC (%)</td></tr><tr><td>GCN-GraphNorm [5,8] PNA [10]</td><td>526K 326K</td><td>78.83±1.00 79.05±1.32</td></tr><tr><td>PHC-GNN [29]</td><td>111K</td><td>79.34±1.16</td></tr><tr><td>DeeperGCN-FLAG [30] DGN[2]</td><td>532K</td><td>79.42±1.20</td></tr><tr><td></td><td>114K</td><td>79.70±0.97</td></tr><tr><td>GIN-vN[50] (fine-tune) Graphormer-FLAG</td><td>3.3M 47.0M</td><td>77.80±1.82 80.51±0.53</td></tr></table>",
811
+ "bbox": [
812
+ 532,
813
+ 108,
814
+ 852,
815
+ 219
816
+ ],
817
+ "page_idx": 7
818
+ },
819
+ {
820
+ "type": "table",
821
+ "img_path": "images/48249c38da7c9b73908fb1049afc3bbd7f8c2904d638a6e58bb216ca2a541d88.jpg",
822
+ "table_caption": [
823
+ "Table 4: Results on ZINC. "
824
+ ],
825
+ "table_footnote": [],
826
+ "table_body": "<table><tr><td>method</td><td>#param.</td><td>test MAE</td></tr><tr><td>GIN[50]</td><td>509,549</td><td>0.526±0.051</td></tr><tr><td>GraphSage [18]</td><td>505,341</td><td>0.398±0.002</td></tr><tr><td>GAT[47]</td><td>531,345</td><td>0.384±0.007</td></tr><tr><td>GCN[26]</td><td>505,079</td><td>0.367±0.011</td></tr><tr><td>GatedGCN-PE [4]</td><td>505,011</td><td>0.214±0.006</td></tr><tr><td>MPNN (sum)[15]</td><td>480,805</td><td>0.145±0.007</td></tr><tr><td>PNA [10]</td><td>387,155</td><td>0.142±0.010</td></tr><tr><td>GT[13]</td><td>588.929</td><td>0.226±0.014</td></tr><tr><td>SAN[28]</td><td>508,577</td><td>0.139±0.006</td></tr><tr><td>GraphormersLIM</td><td>489,321</td><td>0.122±0.006</td></tr></table>",
827
+ "bbox": [
828
+ 348,
829
+ 262,
830
+ 648,
831
+ 412
832
+ ],
833
+ "page_idx": 7
834
+ },
835
+ {
836
+ "type": "text",
837
+ "text": "",
838
+ "bbox": [
839
+ 176,
840
+ 449,
841
+ 825,
842
+ 491
843
+ ],
844
+ "page_idx": 7
845
+ },
846
+ {
847
+ "type": "text",
848
+ "text": "4.3 Ablation Studies ",
849
+ "text_level": 1,
850
+ "bbox": [
851
+ 174,
852
+ 520,
853
+ 328,
854
+ 535
855
+ ],
856
+ "page_idx": 7
857
+ },
858
+ {
859
+ "type": "text",
860
+ "text": "We perform a series of ablation studies on the importance of designs in our proposed Graphormer, on PCQM4M-LSC dataset. The ablation results are included in Table 5. To save the computation resources, the Transformer models in table 5 have 12 layers, and are trained for 100K iterations. ",
861
+ "bbox": [
862
+ 174,
863
+ 551,
864
+ 826,
865
+ 592
866
+ ],
867
+ "page_idx": 7
868
+ },
869
+ {
870
+ "type": "text",
871
+ "text": "Node Relation Encoding. We compare previously used positional encoding (PE) to our proposed spatial encoding, which both aim to encode the information of distinct node relation to Transformers. There are various PEs employed by previous Transformer-based GNNs, e.g., Weisfeiler-LehmanPE (WL-PE) [56] and Laplacian PE [3, 14]. We report the performance for Laplacian PE since it performs well comparing to a series of PEs for Graph Transformer in previous literature [13]. Transformer architecture with the spatial encoding outperforms the counterpart built on the positional encoding, which demonstrates the effectiveness of using spatial encoding to capture the node spatial information. ",
872
+ "bbox": [
873
+ 174,
874
+ 619,
875
+ 825,
876
+ 731
877
+ ],
878
+ "page_idx": 7
879
+ },
880
+ {
881
+ "type": "text",
882
+ "text": "Centrality Encoding. Transformer architecture with degree-based centrality encoding yields a large margin performance boost in comparison to those without centrality information. This indicates that the centrality encoding is indispensable to Transformer architecture for modeling graph data. ",
883
+ "bbox": [
884
+ 176,
885
+ 758,
886
+ 825,
887
+ 800
888
+ ],
889
+ "page_idx": 7
890
+ },
891
+ {
892
+ "type": "text",
893
+ "text": "Edge Encoding. We compare our proposed edge encoding (denoted as via attn bias) to two commonly used edge encodings described in Section 3.1.3 to incorporate edge features into GNN, denoted as via node and via Aggr in Table 5. From the table, the gap of performance is minor between the two conventional methods, but our proposed edge encoding performs significantly better, which indicates that edge encoding as attention bias is more effective for Transformer to capture spatial information on edges. ",
894
+ "bbox": [
895
+ 174,
896
+ 827,
897
+ 825,
898
+ 911
899
+ ],
900
+ "page_idx": 7
901
+ },
902
+ {
903
+ "type": "table",
904
+ "img_path": "images/e1ba1100df80b35ead2037c7be51b500eda703c80ecfe0c1afa99e963547ed3c.jpg",
905
+ "table_caption": [
906
+ "Table 5: Ablation study results on PCQM4M-LSC dataset with different designs. "
907
+ ],
908
+ "table_footnote": [],
909
+ "table_body": "<table><tr><td rowspan=\"2\">Node Relation Encoding LaplacianPE[13]</td><td rowspan=\"2\">Spatial</td><td rowspan=\"2\">Centrality</td><td colspan=\"3\">Edge Encoding</td><td rowspan=\"2\">valid MAE</td></tr><tr><td>via node</td><td>via Aggr</td><td>via attn bias(Eq.7)</td></tr><tr><td>1</td><td>-</td><td>=</td><td>-</td><td>二</td><td>-</td><td>0.2276</td></tr><tr><td>√</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>0.1483</td></tr><tr><td>-</td><td>√</td><td>-</td><td>二</td><td>二</td><td>-</td><td>0.1427</td></tr><tr><td>二</td><td>√</td><td>√</td><td>1</td><td>二</td><td>二</td><td>0.1396</td></tr><tr><td>-</td><td>√</td><td>√</td><td>√</td><td>:</td><td>-</td><td>0.1328</td></tr><tr><td>-</td><td>√</td><td>√</td><td>1</td><td>√</td><td>-</td><td>0.1327</td></tr><tr><td>-</td><td>√</td><td>√</td><td>1</td><td>-</td><td>√</td><td>0.1304</td></tr></table>",
910
+ "bbox": [
911
+ 179,
912
+ 109,
913
+ 818,
914
+ 237
915
+ ],
916
+ "page_idx": 8
917
+ },
918
+ {
919
+ "type": "text",
920
+ "text": "5 Related Work ",
921
+ "text_level": 1,
922
+ "bbox": [
923
+ 174,
924
+ 258,
925
+ 321,
926
+ 276
927
+ ],
928
+ "page_idx": 8
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "In this section, we highlight the most recent works which attempt to develop standard Transformer architecture-based GNN or graph structural encoding, but spend less effort on elaborating the works by adapting attention mechanism to GNNs [33, 55, 7, 23, 1, 47, 48, 56, 45]. ",
933
+ "bbox": [
934
+ 174,
935
+ 290,
936
+ 825,
937
+ 332
938
+ ],
939
+ "page_idx": 8
940
+ },
941
+ {
942
+ "type": "text",
943
+ "text": "5.1 Graph Transformer ",
944
+ "text_level": 1,
945
+ "bbox": [
946
+ 174,
947
+ 348,
948
+ 351,
949
+ 363
950
+ ],
951
+ "page_idx": 8
952
+ },
953
+ {
954
+ "type": "text",
955
+ "text": "There are several works that study the performance of pure Transformer architectures (stacked by transformer layers) with modifications on graph representation tasks, which are more related to our Graphormer. For example, several parts of the transformer layer are modified in [43], including an additional GNN employed in attention sub-layer to produce vectors of $Q$ , $K$ , and $V$ , long-range residual connection, and two branches of FFN to produce node and edge representations separately. They pre-train their model on 10 million unlabelled molecules and achieve excellent results by fine-tuning on downstream tasks. Attention module is modified to a soft adjacency matrix in [39] by directly adding the adjacency matrix and RDKit6-computed inter-atomic distance matrix to the attention probabilites. Very recently, Dwivedi et al. [13] revisit a series of works for Transformerbased GNNs, and suggest that the attention mechanism in Transformers on graph data should only aggregate the information from neighborhood (i.e., using adjacent matrix as attention mask) to ensure graph sparsity, and propose to use Laplacian eigenvector as positional encoding. Their model GT surpasses baseline GNNs on graph representation task. A concurrent work [28] propose a novel full Laplacian spectrum to learn the position of each node in a graph, and empirically shows better results than GT. ",
956
+ "bbox": [
957
+ 174,
958
+ 373,
959
+ 825,
960
+ 580
961
+ ],
962
+ "page_idx": 8
963
+ },
964
+ {
965
+ "type": "text",
966
+ "text": "5.2 Structural Encodings in GNNs ",
967
+ "text_level": 1,
968
+ "bbox": [
969
+ 176,
970
+ 597,
971
+ 426,
972
+ 612
973
+ ],
974
+ "page_idx": 8
975
+ },
976
+ {
977
+ "type": "text",
978
+ "text": "Path and Distance in GNNs. Information of path and distance is commonly used in GNNs. For example, an attention-based aggregation is proposed in [9] where the node features, edge features, one-hot feature of the distance and ring flag feature are concatenated to calculate the attention probabilites; similar to [9], path-based attention is leveraged in [52] to model the influence between the center node and its higher-order neighbors; a distance-weighted aggregation scheme on graph is proposed in [54]; it has been proved in [32] that adopting distance encoding (i.e., one-hot feature of the distance as extra node attribute) could lead to a strictly more expressive power than the 1-WL test. ",
979
+ "bbox": [
980
+ 174,
981
+ 622,
982
+ 825,
983
+ 719
984
+ ],
985
+ "page_idx": 8
986
+ },
987
+ {
988
+ "type": "text",
989
+ "text": "Positional Encoding in Transformer on Graph. Several works introduce positional encoding (PE) to Transformer-based GNNs to help the model capture the node position information. For example, Graph-BERT [56] introduces three types of PE to embed the node position information to model, i.e., an absolute WL-PE which represents different nodes labeled by Weisfeiler-Lehman algorithm, an intimacy based PE and a hop based PE which are both variant to the sampled subgraphs. Absolute Laplacian PE is employed in [13] and empircal study shows that its performance surpasses the absolute WL-PE used in [56]. ",
990
+ "bbox": [
991
+ 174,
992
+ 734,
993
+ 825,
994
+ 832
995
+ ],
996
+ "page_idx": 8
997
+ },
998
+ {
999
+ "type": "text",
1000
+ "text": "Edge Feature. Except the conventionally used methods to encode edge feature, which are described in previous section, there are several attempts that exploit how to better encode edge features: an attention-based GNN layer is developed in [16] to encode edge features, where the edge feature is weighted by the similarity of the features of its two nodes; edge feature has been encoded into the popular GIN [50] in [5]; in [13], the authors propose to project edge features to an embedding vector, then multiply it by attention coefficients, and send the result to an additional FFN sub-layer to produce edge representations; ",
1001
+ "bbox": [
1002
+ 176,
1003
+ 847,
1004
+ 825,
1005
+ 887
1006
+ ],
1007
+ "page_idx": 8
1008
+ },
1009
+ {
1010
+ "type": "text",
1011
+ "text": "",
1012
+ "bbox": [
1013
+ 174,
1014
+ 92,
1015
+ 825,
1016
+ 147
1017
+ ],
1018
+ "page_idx": 9
1019
+ },
1020
+ {
1021
+ "type": "text",
1022
+ "text": "6 Conclusion ",
1023
+ "text_level": 1,
1024
+ "bbox": [
1025
+ 174,
1026
+ 167,
1027
+ 299,
1028
+ 184
1029
+ ],
1030
+ "page_idx": 9
1031
+ },
1032
+ {
1033
+ "type": "text",
1034
+ "text": "We have explored the direct application of Transformers to graph representation. With three novel graph structural encodings, the proposed Graphormer works surprisingly well on a wide range of popular benchmark datasets. While these initial results are encouraging, many challenges remain. For example, the quadratic complexity of the self-attention module restricts Graphormer’s application on large graphs. Therefore, future development of efficient Graphormer is necessary. Performance improvement could be expected by leveraging domain knowledge-powered encodings on particular graph datasets. Finally, an applicable graph sampling strategy is desired for node representation extraction with Graphormer. We leave them for future works. ",
1035
+ "bbox": [
1036
+ 173,
1037
+ 199,
1038
+ 825,
1039
+ 310
1040
+ ],
1041
+ "page_idx": 9
1042
+ },
1043
+ {
1044
+ "type": "text",
1045
+ "text": "References ",
1046
+ "text_level": 1,
1047
+ "bbox": [
1048
+ 174,
1049
+ 329,
1050
+ 266,
1051
+ 344
1052
+ ],
1053
+ "page_idx": 9
1054
+ },
1055
+ {
1056
+ "type": "text",
1057
+ "text": "[1] Jinheon Baek, Minki Kang, and Sung Ju Hwang. Accurate learning of graph representations with graph multiset pooling. ICLR, 2021. \n[2] Dominique Beaini, Saro Passaro, Vincent Létourneau, William L Hamilton, Gabriele Corso, and Pietro Liò. Directional graph networks. In International Conference on Machine Learning, 2021. \n[3] Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps for dimensionality reduction and data representation. Neural computation, 15(6):1373–1396, 2003. \n[4] Xavier Bresson and Thomas Laurent. Residual gated graph convnets. arXiv preprint arXiv:1711.07553, 2017. \n[5] Rémy Brossard, Oriel Frigo, and David Dehaene. Graph convolutions that can finally model local structure. arXiv preprint arXiv:2011.15069, 2020. \n[6] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 1877–1901. Curran Associates, Inc., 2020. \n[7] Deng Cai and Wai Lam. Graph transformer for graph-to-sequence learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 7464–7471, 2020. \n[8] Tianle Cai, Shengjie Luo, Keyulu Xu, Di He, Tie-yan Liu, and Liwei Wang. Graphnorm: A principled approach to accelerating graph neural network training. In International Conference on Machine Learning, 2021. \n[9] Benson Chen, Regina Barzilay, and Tommi Jaakkola. Path-augmented graph transformer network. arXiv preprint arXiv:1905.12712, 2019. \n[10] Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò, and Petar Velickovi ˇ c. Principal neighbour-´ hood aggregation for graph nets. Advances in Neural Information Processing Systems, 33, 2020. \n[11] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, 2019. \n[12] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. \n[13] Vijay Prakash Dwivedi and Xavier Bresson. A generalization of transformer networks to graphs. AAAI Workshop on Deep Learning on Graphs: Methods and Applications, 2021. \n[14] Vijay Prakash Dwivedi, Chaitanya K Joshi, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. arXiv preprint arXiv:2003.00982, 2020. \n[15] Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pages 1263–1272. PMLR, 2017. \n[16] Liyu Gong and Qiang Cheng. Exploiting edge features for graph neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9211–9219, 2019. \n[17] Anmol Gulati, James Qin, Chung-Cheng Chiu, Niki Parmar, Yu Zhang, Jiahui Yu, Wei Han, Shibo Wang, Zhengdong Zhang, Yonghui Wu, et al. Conformer: Convolution-augmented transformer for speech recognition. arXiv preprint arXiv:2005.08100, 2020. \n[18] William L Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NIPS, 2017. \n[19] Vincent J Hellendoorn, Charles Sutton, Rishabh Singh, Petros Maniatis, and David Bieber. Global relational models of source code. In International conference on learning representations, 2019. \n[20] W Hu, B Liu, J Gomes, M Zitnik, P Liang, V Pande, and J Leskovec. Strategies for pre-training graph neural networks. In International Conference on Learning Representations (ICLR), 2020. \n[21] Weihua Hu, Matthias Fey, Hongyu Ren, Maho Nakata, Yuxiao Dong, and Jure Leskovec. Ogb-lsc: A large-scale challenge for machine learning on graphs. arXiv preprint arXiv:2103.09430, 2021. \n[22] Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. arXiv preprint arXiv:2005.00687, 2020. \n[23] Ziniu Hu, Yuxiao Dong, Kuansan Wang, and Yizhou Sun. Heterogeneous graph transformer. In Proceedings of The Web Conference 2020, pages 2704–2710, 2020. \n[24] Katsuhiko Ishiguro, Shin-ichi Maeda, and Masanori Koyama. Graph warp module: an auxiliary module for boosting the power of graph neural networks in molecular graph analysis. arXiv preprint arXiv:1902.01020, 2019. \n[25] Guolin Ke, Di He, and Tie-Yan Liu. Rethinking the positional encoding in language pre-training. ICLR, 2020. \n[26] Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016. \n[27] Kezhi Kong, Guohao Li, Mucong Ding, Zuxuan Wu, Chen Zhu, Bernard Ghanem, Gavin Taylor, and Tom Goldstein. Flag: Adversarial data augmentation for graph neural networks. arXiv preprint arXiv:2010.09891, 2020. \n[28] Devin Kreuzer, Dominique Beaini, William Hamilton, Vincent Létourneau, and Prudencio Tossou. Rethinking graph transformers with spectral attention. arXiv preprint arXiv:2106.03893, 2021. \n[29] Tuan Le, Marco Bertolini, Frank Noé, and Djork-Arné Clevert. Parameterized hypercomplex graph neural networks for graph classification. arXiv preprint arXiv:2103.16584, 2021. \n[30] Guohao Li, Chenxin Xiong, Ali Thabet, and Bernard Ghanem. Deepergcn: All you need to train deeper gcns. arXiv preprint arXiv:2006.07739, 2020. \n[31] Junying Li, Deng Cai, and Xiaofei He. Learning graph-level representation for drug discovery. arXiv preprint arXiv:1709.03741, 2017. \n[32] Pan Li, Yanbang Wang, Hongwei Wang, and Jure Leskovec. Distance encoding: Design provably more powerful neural networks for graph representation learning. Advances in Neural Information Processing Systems, 33, 2020. \n[33] Yuan Li, Xiaodan Liang, Zhiting Hu, Yinbo Chen, and Eric P. Xing. Graph transformer, 2019. \n[34] Xi Victoria Lin, Richard Socher, and Caiming Xiong. Multi-hop knowledge graph reasoning with reward shaping. arXiv preprint arXiv:1808.10568, 2018. \n[35] 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, 2019. \n[36] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021. \n[37] P David Marshall. The promotion and presentation of the self: celebrity as marker of presentational media. Celebrity studies, 1(1):35–48, 2010. \n[38] Alice Marwick and Danah Boyd. To see and be seen: Celebrity practice on twitter. Convergence, 17(2):139–158, 2011. \n[39] Łukasz Maziarka, Tomasz Danel, Sławomir Mucha, Krzysztof Rataj, Jacek Tabor, and Stanisław Jastrz˛ebski. Molecule attention transformer. arXiv preprint arXiv:2002.08264, 2020. \n[40] Sharan Narang, Hyung Won Chung, Yi Tay, William Fedus, Thibault Fevry, Michael Matena, Karishma Malkan, Noah Fiedel, Noam Shazeer, Zhenzhong Lan, et al. Do transformer modifications transfer across implementations and applications? arXiv preprint arXiv:2102.11972, 2021. \n[41] Dinglan Peng, Shuxin Zheng, Yatao Li, Guolin Ke, Di He, and Tie-Yan Liu. How could neural networks understand programs? In International Conference on Machine Learning. PMLR, 2021. \n[42] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020. \n[43] Yu Rong, Yatao Bian, Tingyang Xu, Weiyang Xie, Ying Wei, Wenbing Huang, and Junzhou Huang. Selfsupervised graph transformer on large-scale molecular data. Advances in Neural Information Processing Systems, 33, 2020. \n[44] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pages 464–468, 2018. \n[45] Yunsheng Shi, Zhengjie Huang, Wenjin Wang, Hui Zhong, Shikun Feng, and Yu Sun. Masked label prediction: Unified message passing model for semi-supervised classification. arXiv preprint arXiv:2009.03509, 2020. \n[46] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017. \n[47] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua Bengio. ´ Graph attention networks. ICLR, 2018. \n[48] Guangtao Wang, Rex Ying, Jing Huang, and Jure Leskovec. Direct multi-hop attention based graph neural network. arXiv preprint arXiv:2009.14332, 2020. \n[49] Ruibin Xiong, Yunchang Yang, Di He, Kai Zheng, Shuxin Zheng, Chen Xing, Huishuai Zhang, Yanyan Lan, Liwei Wang, and Tieyan Liu. On layer normalization in the transformer architecture. In International Conference on Machine Learning, pages 10524–10533. PMLR, 2020. \n[50] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. \n[51] Mingqi Yang, Yanming Shen, Heng Qi, and Baocai Yin. Breaking the expressive bottlenecks of graph neural networks. arXiv preprint arXiv:2012.07219, 2020. \n[52] Yiding Yang, Xinchao Wang, Mingli Song, Junsong Yuan, and Dacheng Tao. Spagan: Shortest path graph attention network. Advances in IJCAI, 2019. \n[53] Chengxuan Ying, Mingqi Yang, Shuxin Zheng, Guolin Ke, Shengjie Luo, Tianle Cai, Chenglin Wu, Yuxin Wang, Yanming Shen, and Di He. First place solution of kdd cup 2021 & ogb large-scale challenge graph-level track. arXiv preprint arXiv:2106.08279, 2021. \n[54] Jiaxuan You, Rex Ying, and Jure Leskovec. Position-aware graph neural networks. In International Conference on Machine Learning, pages 7134–7143. PMLR, 2019. \n[55] Seongjun Yun, Minbyul Jeong, Raehyun Kim, Jaewoo Kang, and Hyunwoo J Kim. Graph transformer networks. Advances in Neural Information Processing Systems, 32, 2019. \n[56] Jiawei Zhang, Haopeng Zhang, Congying Xia, and Li Sun. Graph-bert: Only attention is needed for learning graph representations. arXiv preprint arXiv:2001.05140, 2020. \n[57] Daniel Zügner, Tobias Kirschstein, Michele Catasta, Jure Leskovec, and Stephan Günnemann. Languageagnostic representation learning of source code from structure and context. In International Conference on Learning Representations, 2020. ",
1058
+ "bbox": [
1059
+ 178,
1060
+ 352,
1061
+ 826,
1062
+ 916
1063
+ ],
1064
+ "page_idx": 9
1065
+ },
1066
+ {
1067
+ "type": "text",
1068
+ "text": "",
1069
+ "bbox": [
1070
+ 171,
1071
+ 80,
1072
+ 828,
1073
+ 917
1074
+ ],
1075
+ "page_idx": 10
1076
+ },
1077
+ {
1078
+ "type": "text",
1079
+ "text": "",
1080
+ "bbox": [
1081
+ 171,
1082
+ 92,
1083
+ 828,
1084
+ 765
1085
+ ],
1086
+ "page_idx": 11
1087
+ }
1088
+ ]
parse/train/OeWooOxFwDa/OeWooOxFwDa_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/OeWooOxFwDa/OeWooOxFwDa_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/S1fUpoR5FQ/S1fUpoR5FQ.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/S1fUpoR5FQ/S1fUpoR5FQ_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/S1fUpoR5FQ/S1fUpoR5FQ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/S1fUpoR5FQ/S1fUpoR5FQ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SkxxtgHKPS/SkxxtgHKPS.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SkxxtgHKPS/SkxxtgHKPS_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SkxxtgHKPS/SkxxtgHKPS_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/SkxxtgHKPS/SkxxtgHKPS_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ZsZM-4iMQkH/ZsZM-4iMQkH.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ZsZM-4iMQkH/ZsZM-4iMQkH_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ZsZM-4iMQkH/ZsZM-4iMQkH_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/ZsZM-4iMQkH/ZsZM-4iMQkH_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/gDcaUj4Myhn/gDcaUj4Myhn.md ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Laplace Redux – Effortless Bayesian Deep Learning
2
+
3
+ # Erik Daxberger⇤,c,m
4
+
5
+ # Agustinus Kristiadi⇤,t Matthias Bauerd
6
+
7
+ # Runa Eschenhagen⇤,t
8
+
9
+ # Alexander Immer⇤,e,p Philipp Hennigt,m
10
+
11
+ c University of Cambridge mMPI for Intelligent Systems, Tübingen t University of Tübingen
12
+ e Department of Computer Science, ETH Zurich
13
+ pMax Planck ETH Center for Learning Systems dDeepMind, London
14
+
15
+ # Abstract
16
+
17
+ Bayesian formulations of deep learning have been shown to have compelling theoretical properties and offer practical functional benefits, such as improved predictive uncertainty quantification and model selection. The Laplace approximation (LA) is a classic, and arguably the simplest family of approximations for the intractable posteriors of deep neural networks. Yet, despite its simplicity, the LA is not as popular as alternatives like variational Bayes or deep ensembles. This may be due to assumptions that the LA is expensive due to the involved Hessian computation, that it is difficult to implement, or that it yields inferior results. In this work we show that these are misconceptions: we (i) review the range of variants of the LA including versions with minimal cost overhead; (ii) introduce laplace, an easy-to-use software library for PyTorch offering user-friendly access to all major flavors of the LA; and (iii) demonstrate through extensive experiments that the LA is competitive with more popular alternatives in terms of performance, while excelling in terms of computational cost. We hope that this work will serve as a catalyst to a wider adoption of the LA in practical deep learning, including in domains where Bayesian approaches are not typically considered at the moment.
18
+
19
+ laplace library: https://github.com/AlexImmer/Laplace Experiments: https://github.com/runame/laplace-redux
20
+
21
+ # 1 Introduction
22
+
23
+ Despite their successes, modern neural networks (NNs) still suffer from several shortcomings that limit their applicability in some settings. These include (i) poor calibration and overconfidence, especially when the data distribution shifts between training and testing [1], (ii) catastrophic forgetting of previously learned tasks when continuously trained on new tasks [2], and (iii) the difficulty of selecting suitable NN architectures and hyperparameters [3]. Bayesian modeling [4, 5] provides a principled and unified approach to tackle these issues by (i) equipping models with robust uncertainty estimates [6], (ii) enabling models to learn continually by capturing past information [7], and (iii) allowing for automated model selection by optimally trading off data fit and model complexity [8].
24
+
25
+ Even though this provides compelling motivation for using Bayesian neural networks (BNNs) [9], they have not gained much traction in practice. Common criticisms include that BNNs are difficult to implement, finicky to tune, expensive to train, and hard to scale to modern models and datasets. For instance, popular variational Bayesian methods [10–12, etc.] require considerable changes to the training procedure and model architecture. Also, their optimization process is slower and typically more unstable unless carefully tuned [13]. Other methods, such as deep ensembles [14], Monte Carlo dropout [6], and SWAG [15] promise to bring uncertainty quantification to standard NNs in simple manners. But these methods either require a significant cost increase compared to a single network, have limited empirical performance, or an unsatisfying Bayesian interpretation.
26
+
27
+ ![](images/2cd8979d494e70cbf9f9fc80b1e30136132d33c723973cb95205c950f704e8c9.jpg)
28
+ Figure 1: Probabilistic predictions with the Laplace approximation in three steps. (a) We find a MAP estimate (yellow star) via standard training (background contours $=$ log-posterior landscape on the two-dimensional PCA subspace of the SGD trajectory [30]). (b) We locally approximate the posterior landscape by fitting a Gaussian centered at the MAP estimate (yellow contours), with covariance matrix equal to the negative inverse Hessian of the loss at the MAP—this is the Laplace approximation (LA). (c) We use the LA to make predictions with predictive uncertainty estimates— here, the black curve is the predictive mean, and the shading covers the $9 5 \%$ confidence interval.
29
+
30
+ In this paper, we argue that the Laplace approximation (LA) is a simple and cost-efficient, yet competitive approximation method for inference in Bayesian deep learning. First proposed in this context by MacKay [16], the LA dates back to the 18th century [17]. It locally approximates the posterior with a Gaussian distribution centered at a local maximum, with covariance matrix corresponding to the local curvature. Two key advantages of the LA are that the local maximum is readily available from standard maximum a posteriori (MAP) training of NNs, and that curvature estimates can be easily and efficiently obtained thanks to recent advances in second-order optimization, both in terms of more efficient approximations to the Hessian [18–20] and easy-to-use software libraries [21]. Together, they make the LA practical and readily applicable to many already-trained NNs—the LA essentially enables practitioners to turn their high-performing point-estimate NNs into BNNs easily and quickly, without loss of predictive performance. Furthermore, the LA to the marginal likelihood may even be used for Bayesian model selection or NN training [8, 22]. Figure 1 provides an intuition of the LA—we first fit a point estimate of the model and then estimate a Gaussian distribution around that.
31
+
32
+ Yet, despite recent progress in scaling and improving the LA for deep learning [23–29], it is far less widespread than other methods. This is likely due to misconceptions, like that the LA is hard to implement due to the Hessian computation, that it must necessarily perform worse than the competitors due to its local nature, or quite simply that it is old and too simple. Here, we show that these are indeed misconceptions. Moreover, we argue that the LA deserves a wider adoption in both practical and research-oriented deep learning. To this end, our work makes the following contributions:
33
+
34
+ 1. We first survey recent advances and present the key components of scalable and practical Laplace approximations in deep learning (Section 2). 2. We then introduce laplace, an easy-to-use PyTorch-based library for “turning a NN into a BNN” via the LA (Section 3). laplace implements a wide range of different LA variants. 3. Lastly, using laplace, we show in an extensive empirical study that the LA is competitive to alternative approaches, especially considering how simple and cheap it is (Section 4).
35
+
36
+ # 2 The Laplace Approximation in Deep Learning
37
+
38
+ The LA can be used in two different ways to benefit deep learning: Firstly, we can use the LA to approximate the model’s posterior distribution (see Eq. (5) below) to enable probabilistic predictions (as also illustrated in Fig. 1). Secondly, we can use the LA to approximate the model evidence (see Eq. (6)) to enable model selection (e.g. hyperparameter tuning).
39
+
40
+ The canonical form of (supervised) deep learning is that of empirical risk minimization. Given, e.g., an i.i.d. classification dataset $\mathcal { D } : = \{ ( x _ { n } \in \mathbb { R } ^ { M } , y _ { n } \in \mathbb { R } ^ { C } ) \} _ { n = 1 } ^ { N }$ , the weights $\boldsymbol { \theta } \in \mathbb { R } ^ { D }$ of an $L$ -layer NN $f _ { \theta } : \mathbb { R } ^ { M } \mathbb { R } ^ { C }$ are trained to minimize the (regularized) empirical risk, which typically decomposes into a sum over empirical loss terms $\ell ( x _ { n } , y _ { n } ; \theta )$ and a regularizer $r ( \theta )$ ,
41
+
42
+ $$
43
+ \begin{array} { r } { \theta _ { \mathrm { M A P } } = \arg \operatorname* { m i n } _ { \theta \in \mathbb { R } ^ { D } } \mathcal { L } ( \mathcal { D } ; \theta ) = \arg \operatorname* { m i n } _ { \theta \in \mathbb { R } ^ { D } } \left( r ( \theta ) + \sum _ { n = 1 } ^ { N } \ell ( x _ { n } , y _ { n } ; \theta ) \right) . } \end{array}
44
+ $$
45
+
46
+ From the Bayesian viewpoint, these terms can be identified with i.i.d. log- likelihoods and a log-prior, respectively and, thus, $\theta _ { \mathrm { M A P } }$ is indeed a maximum a-posteriori (MAP) estimate:
47
+
48
+ $$
49
+ \ell ( x _ { n } , y _ { n } ; \theta ) = - \log p ( y _ { n } | f _ { \theta } ( x _ { n } ) ) \qquad { \mathrm { a n d } } \qquad r ( \theta ) = - \log p ( \theta )
50
+ $$
51
+
52
+ For example, the widely used weight regularizer $\begin{array} { r } { r ( \theta ) = \frac { 1 } { 2 } \gamma ^ { - 2 } \lVert \theta \rVert ^ { 2 } } \end{array}$ (a.k.a. weight decay) corresponds to a centered Gaussian prior $p ( \theta ) = \mathcal { N } ( \theta ; 0 , \gamma ^ { 2 } I )$ , and the cross-entropy loss amounts to a categorical likelihood. Hence, the exponential of the negative training loss $\mathrm { e x p } \big ( { - \infty } ( \mathcal { D } ; \theta ) \big )$ amounts to an unnormalized posterior. By normalizing it, we obtain
53
+
54
+ $$
55
+ \begin{array} { r } { p ( \theta | \mathcal D ) = \frac 1 Z p ( \mathcal D | \theta ) p ( \theta ) = \frac 1 Z \exp ( - \mathcal L ( \mathcal D ; \theta ) ) , \qquad Z : = \int p ( \mathcal D | \theta ) p ( \theta ) d \theta } \end{array}
56
+ $$
57
+
58
+ with an intractable normalizing constant $Z$ . Laplace approximations [17] use a second-order expansion of $\mathcal { L }$ around $\theta _ { \mathrm { M A P } }$ to construct a Gaussian approximation to $p ( \theta \mid \mathcal { D } )$ . I.e. we consider:
59
+
60
+ $$
61
+ \begin{array} { r } { \mathcal { L } ( \mathcal { D } ; \theta ) \approx \mathcal { L } ( \mathcal { D } ; \theta _ { \mathrm { M A P } } ) + \frac { 1 } { 2 } { ( \theta - \theta _ { \mathrm { M A P } } ) ^ { \top } } \left( \nabla _ { \theta } ^ { 2 } \mathcal { L } ( \mathcal { D } ; \theta ) | _ { \theta _ { \mathrm { M A P } } } \right) ( \theta - \theta _ { \mathrm { M A P } } ) , } \end{array}
62
+ $$
63
+
64
+ where the first-order term vanishes at $\theta _ { \mathrm { M A P } }$ . Then we can identify the Laplace approximation as
65
+
66
+ $$
67
+ p ( \theta | \mathcal { D } ) \approx \mathcal { N } ( \theta ; \theta _ { \mathrm { M A P } } , \Sigma ) \qquad \mathrm { w i t h } \qquad \Sigma : = - \left( \nabla _ { \theta } ^ { 2 } \mathcal { L } ( \mathcal { D } ; \theta ) | _ { \theta _ { \mathrm { M a P } } } \right) ^ { - 1 } .
68
+ $$
69
+
70
+ The normalizing constant $Z$ (which is typically referred to as the marginal likelihood or evidence) is useful for model selection and can also be approximated as
71
+
72
+ $$
73
+ Z \approx \exp ( - \mathcal { L } ( \mathcal { D } ; \theta _ { \mathrm { M A P } } ) ) ( 2 \pi ) ^ { \bar { D } / 2 } ( \operatorname* { d e t } { \varSigma } ) ^ { 1 / 2 } .
74
+ $$
75
+
76
+ See Appendix A for more details. Thus, to obtain the approximate posterior, we first need to find the argmax $\theta _ { \mathrm { M A P } }$ of the log-posterior function, i.e. do “standard” deep learning with regularized empirical risk minimization. The only additional step is to compute the inverse of the Hessian matrix at $\theta _ { \mathrm { M A P } }$ (see Figure 1(b)). The LA can therefore be constructed post-hoc to a pre-trained network, even one downloaded off-the-shelf. As we discuss below, the Hessian computation can be offloaded to recently advanced automatic differentiation libraries [21]. LAs are widely used to approximate the posterior distribution in logistic regression [31], Gaussian process classification [32, 33], and also for Bayesian neural networks (BNNs), both shallow [34] and deep [23]. The latter is the focus of this work.
77
+
78
+ Generally, any prior with twice differentiable log-density can be used. Due to the popularity of the weight decay regularizer, we assume that the prior is a zero-mean Gaussian $p ( \theta ) \overset { \cdot } { = } \mathcal { N } ( \theta ; 0 , \gamma ^ { 2 } I )$ unless stated otherwise.2 The Hessian $\nabla _ { \theta } ^ { 2 } \mathcal { L } ( \mathcal { D } ; \theta ) | _ { \theta _ { \mathrm { M A P } } }$ then depends both on the (simple) log-prior $/$ regularizer and the (complicated) log-likelihood / empirical risk:
79
+
80
+ $$
81
+ \begin{array} { r } { \nabla _ { \theta } ^ { 2 } \mathcal { L } ( \mathcal { D } ; \theta ) | _ { \theta _ { \mathrm { M A P } } } = - \gamma ^ { - 2 } I - \sum _ { n = 1 } ^ { N } \nabla _ { \theta } ^ { 2 } \log p ( y _ { n } | f _ { \theta } ( x _ { n } ) ) | _ { \theta _ { \mathrm { M A P } } } . } \end{array}
82
+ $$
83
+
84
+ A naive implementation of the Hessian is infeasible because the second term in Eq. (7) scales quadratically with the number of network parameters, which can be in the millions or even billions [35, 36]. In recent years, several works have addressed scalability, as well as other factors that affect approximation quality and predictive performance of the LA. In the following, we identify, review, and discuss four key components that allow LAs to scale and perform well on modern deep architectures. See Fig. 2 for an overview and Appendix B for a more detailed version of the review and discussion.
85
+
86
+ # Four Components of Scalable Laplace Approximations for Deep Neural Networks
87
+
88
+ # $\textcircled{1}$ Inference over all Weights or Subsets of Weights
89
+
90
+ In most cases, it is possible to treat all weights probabilistically when using appropriate approximations of the Hessian, as we discuss below in $\textcircled{2}$ . Another simple way to scale the LA to large NNs (without Hessian approximations) is the subnetwork $\pmb { L A }$ [27], which only treats a subset of the model parameters probabilistically with the LA and leaves the remaining parameters at their MAP-estimated values. An important special case of this applies the LA to only the last linear layer of an $L$ -layer NN, while fixing the feature extractor defined by the first $L - 1$ layers at its MAP estimate [37, 28]. This last-layer $\pmb { L A }$ is cost-effective yet compelling both theoretically and in practice [28].
91
+
92
+ ![](images/00a601d4d4902eb04ba88847f92e868cc249cf34c759b9bac557dcb04925b14b.jpg)
93
+ Figure 2: Four key components to scale and apply the LA to a neural network $f _ { \theta }$ (with randomlyinitialized or pre-trained weights $\theta$ ), with corresponding laplace code. $\textcircled{1}$ We first choose which part of the model we want to perform inference over with the LA. $\textcircled{2}$ We then select how to to approximate the Hessian. $\textcircled{3}$ We can then perform model selection using the evidence: (a) If we started with an untrained model $f _ { \theta }$ , we can jointly train the model and use the evidence to tune hyperparameters online. (b) If we started with a pre-trained model, we can use the evidence to tune the hyperparameters post-hoc. Here, shades represent the loss landscape, while contours represent LA log-posteriors—faded contours represent intermediate iterates during hyperparameter tuning to obtain the final log-posterior (thick yellow contours). $\textcircled{4}$ Finally, to make predictions for a new input $x _ { * }$ , we have several options for computing/approximating the predictive distribution $p ( \boldsymbol { y } | f _ { \boldsymbol { \theta } } ( x _ { * } ) , \mathcal { D } )$ .
94
+
95
+ # $\textcircled{2}$ Hessian Approximations and Their Factorizations
96
+
97
+ One advance in second-order optimization that the LA can benefit from are positive semi-definite approximations to the (potentially indefinite) Hessian of the log-likelihoods of NNs in the second term of Eq. (7) [38]. The Fisher information matrix [39], abbreviated as the Fisher and defined by
98
+
99
+ $$
100
+ \begin{array} { r } { F : = \sum _ { n = 1 } ^ { N } \mathbb { E } _ { \widehat { \mathcal { I } } \sim p ( y \mid f _ { \theta } ( x _ { n } ) ) } \left[ \left( \nabla _ { \theta } \log p ( \widehat { y } \mid f _ { \theta } ( x _ { n } ) ) | _ { \theta _ { \mathrm { M a p } } } \right) ( \nabla _ { \theta } \log p ( \widehat { y } \mid f _ { \theta } ( x _ { n } ) ) | _ { \theta _ { \mathrm { M a p } } } ) ^ { \top } \right] , } \end{array}
101
+ $$
102
+
103
+ As $F$ and $G$ are still quadratically large, we typically need further factorization assumptions. The most lightweight is a diagonal factorization which ignores off-diagonal elements [42, 43]. More expressive alternatives are block-diagonal factorizations such as Kronecker-factored approximate curvature (KFAC) [18–20], which factorizes each within-layer Fisher4 as a Kronecker product of two smaller matrices. KFAC has been successfully applied to the LA [23, 24] and can be improved by low-rank approximations of the KFAC factors [29] by leveraging their eigendecompositions [44]. Finally, recent work has studied/enabled low-rank approximations of the Hessian/Fisher [45–47].
104
+
105
+ # $\textcircled{3}$ Hyperparameter Tuning
106
+
107
+ As with all approximate inference methods, the performance of the LA depends on the (hyper)parameters of the prior and likelihood. For instance, it is typically beneficial to tune the prior variance $\gamma ^ { 2 }$ used for inference [23, 28, 27, 26, 22]. Commonly, this is done through cross-validation, e.g. by maximizing the validation log-likelihood [23, 48] or, additionally, using out-of-distribution data [28, 49]. When using the LA, however, marginal likelihood maximization (a.k.a. empirical Bayes or the evidence framework [34, 50]) constitutes a more principled alternative to tune these hyperparameters, and requires no validation data. Immer et al. [22] showed that marginal likelihood maximization with LA can work in deep learning and even be performed in an online manner jointly with the MAP estimation. Note that such approach is not necessarily feasible for other approximate inference methods because most do not provide an estimate of the marginal likelihood. Other recent approaches for hyperparameter tuning for the LA include Bayesian optimization [51] or the addition of dedicated, trainable hidden units for the sole purpose of uncertainty tuning [49].
108
+
109
+ # $\textcircled{4}$ Approximate Predictive Distribution
110
+
111
+ To predict using a posterior (approximation) $p ( \theta \mid \mathcal { D } )$ , we need to compute $p ( y \mid f ( x _ { * } ) , \mathcal { D } ) \ =$ $\begin{array} { r } { \int p \dot { ( \boldsymbol { y } \vert } f _ { \boldsymbol { \theta } } ( x _ { * } ) ) \dot { p ( \boldsymbol { \theta } \vert } \dot { \mathcal { D } } ) d \boldsymbol { \theta } } \end{array}$ for any test point $x _ { * } \in \mathbb { R } ^ { n }$ , which is intractable in general. The sim| ⇤ D (✓s)Ss=1 from p(✓ | D): p(y | f (x⇤), D) ⇡ S1 PSs=1 p(y | f✓s (x⇤)). However, for LAs with GGN [26] attribute this to the inconsistency between Hessian approximation and the predictive and suggest to use a linearized predictive instead, which can also be useful for theoretic analyses [28]. For the last-layer LA, the Hessian coincides with the GGN and the linearized predictive is exact.
112
+
113
+ The predictive of a linearized neural network with a LA approximation to the posterior $p ( \boldsymbol { \theta } | \mathcal { D } ) \approx$ $\mathcal { N } ( \theta ; \theta _ { \mathrm { M A P } } , \mathcal { \Sigma } )$ results in a Gaussian distribution on neural network outputs $f _ { * } : = f ( x _ { * } )$ and therefore enables simple approximations or even a closed-form solution. The distribution on the outputs is given by $\bar { p } ( f _ { * } | \bar { x } _ { * } , \mathcal { D } ) \approx \mathcal { N } ( f _ { * } ; f _ { \theta _ { \mathrm { M A P } } } ( x _ { * } ) , J ( x _ { * } ) ^ { \intercal } \varSigma J ( x _ { * } ) )$ and is typically significantly lowerdimensional (number of outputs $C$ instead of parameters $D$ ). It can also be inferred entirely in function space as a Gaussian process [25, 26]. Given the distribution on outputs $f _ { * }$ , the predictive distribution can be obtained by integration against the likelihood: $\begin{array} { r } { p ( y | x _ { * } , \mathcal { D } ) = \int p ( y | \bar { f } _ { * } ) p ( f _ { * } | x _ { * } , \mathcal { D } ) d \theta } \end{array}$ . In the case of regression with a Gaussian likelihood with variance $\sigma ^ { 2 }$ , the solution can even be obtained analytically: $\bar { p } ( y | x _ { * } , \mathcal { D } ) \approx \mathcal { N } ( y ; f _ { \theta _ { \mathrm { M A P } } } ( x _ { * } ) , J ( x _ { * } ) ^ { \intercal } \varSigma J ( x _ { * } ) + \sigma ^ { 2 } I )$ . For non-Gaussian likelihoods, e.g. in classification, a further approximation is needed. Again, the simplest approximation to this is Monte Carlo integration. In the binary case, we can employ the probit approximation [31, 16] which approximates the logistic function with the probit function. In the multi-class case, we can use its generalization, the extended probit approximation [52]. Finally, first proposed for non-BNN applications [53, 54], the Laplace bridge approximates the softmax-Gaussian integral via a Dirichlet distribution [55]. The key advantage is that it yields a distribution of the integral solutions.
114
+
115
+ # 3 laplace: A Toolkit for Deep Laplace Approximations
116
+
117
+ Implementing the LA is non-trivial, as it requires efficient computation and storage of the Hessian. While this is not fundamentally difficult, there exists no complete, easy-to-use, and standardized implementation of various LA flavors—instead, it is common for deep learning researchers to repeatedly re-implement the LA and Hessian computation with varying efficiency [56–58, etc.]. An efficient implementation typically requires hundreds of lines of code, making it hard to quickly prototype
118
+
119
+ Listing 1: Fit diagonal LA over all weights of a pre-trained classification model, do post-hoc tuning of the prior precision hyperparameter using cross-validation, and make a prediction for input $x$ with the probit approximation.
120
+
121
+ with the LA. To address this, we introduce laplace: a simple, easy-to-use, extensible library for scalable LAs of deep NNs in PyTorch [59]. laplace enables all sensible combinations of the four components discussed in Section 2—see Fig. 2 for details. Listings 1 and 2 show code examples.
122
+
123
+ The core of laplace consists of efficient implementations of the LA’s key quantities: (i) posterior (i.e. Hessian computation and storage), (ii) marginal likelihood, and (iii) posterior predictive. For (i), to take advantage of advances in automatic differentiation, we outsource the Hessian computation to state-of-the-art, optimized second-order optimization libraries: BackPACK [21] and ASDL [60]. Moreover, we design laplace in a modular manner that makes it easy to add new backends and approximations in the future. For (ii), we follow Immer et al. [22] in our implementation of the LA’s marginal likelihood—it is thus both efficient and differentiable and allows the user to implement both online and post-hoc marginal likelihood tuning, cf. Listing 2. Note that laplace also supports standard cross-validation for hyperparameter tuning [23, 28], as shown in Listing 1. Finally, for (iii), laplace supports all approximations to the posterior predictive distribution discussed in Section 2—it thus provides the user with flexibility in making predictions, depending on the computational budget.
124
+
125
+ Default behavior To abstract away from a large number of options available (Section 2), we provide the following default choices based on our extensive experiments (Section 4); they should be applicable and perform decently in the majority of use cases: we assume a pre-trained network and treat only the last-layer weights probabilistically (last-layer LA), use the KFAC factorization of the GGN and tune the hyperparameters post-hoc using empirical Bayes. To make predictions, we use the closed-form Gaussian predictive distribution for regression and the (extended) probit approximation for classification. Of course, the user can pick custom choices (Listings 1 and 2).
126
+
127
+ Limitations Because laplace employs external libraries (BackPACK [21] and ASDL [60]) as backends, it inherits the available choices of Hessian factorizations from these libraries. For instance, the LA variant proposed by Lee et al. [29] can currently not be implemented via laplace, because neither backend supports eigenvalue-corrected KFAC [44] (yet).
128
+
129
+ # 4 Experiments
130
+
131
+ We benchmark various LAs implemented via laplace. Section 4.1 addresses the question of “which are the best design choices for the LA”, in light of Figure 2. Section 4.2 shows that the LA is competitive to strong Bayesian baselines in in-distribution, dataset-shift, and out-of-distribution (OOD) settings. We then showcase some applications of the LA in downstream tasks. Section 4.3 demonstrates the applicability of the (last-layer) LA on various data modalities and NN architectures (including transformers [61])—settings where other Bayesian methods are challenging to implement. Section 4.4 shows how the LA can be used as an easy-to-use yet strong baseline in continual learning. In all results, arrows behind metric names denote if lower (#) or higher (") values are better.
132
+
133
+ ![](images/aca1294dce9f89ed6bda1908df9957f01fe321679803ea5b42ba687564ecf9c4.jpg)
134
+ Figure 3: In- vs. out-of-distribution (ID and OOD, resp.) performance on CIFAR-10 of different LA configurations (dots), each being a combination of settings for 1) subset-of-weights, 2) covariance structure, 3) hyperparameter tuning, and 4) predictive approximation (see Appendix C.1 for details). “DA” stands for “data augmentation”. Post-hoc performs better with DA and a strong pre-trained network, while online performs better without DA where optimal hyperparameters are unknown.
135
+
136
+ Table 1: OOD detection performance averaged over all test sets (see Appendix C.2 for details). Confidence is defined as the max. of the predictive probability vector [62] (e.g. Confidence $( [ 0 . 7 , 0 . 2 , 0 . 1 ] ) ~ = ~ 0 . 7 )$ . LA and especially $\mathrm { L A ^ { * } }$ reduce the overconfidence of MAP and achieve better results than the VB, CSGHMC (HMC), and SWAG (SWG) baselines.
137
+
138
+ <table><tr><td></td><td colspan="2">Confidence ↓</td><td colspan="2">AUROC个</td></tr><tr><td>Methods</td><td>MNIST</td><td>CIFAR-10</td><td>MNIST</td><td>CIFAR-10</td></tr><tr><td>MAP</td><td>75.0±0.4</td><td>76.1±1.2</td><td>96.5±0.1</td><td>92.1±0.5</td></tr><tr><td>DE</td><td>65.7±0.3</td><td>65.4±0.4</td><td>97.5±0.0</td><td>94.0±0.1</td></tr><tr><td>VB</td><td>73.2±0.8</td><td>58.8±0.7</td><td>95.8±0.2</td><td>88.7±0.3</td></tr><tr><td>HMC</td><td>69.2±1.7</td><td>69.4±0.6</td><td>96.1±0.2</td><td>90.6±0.2</td></tr><tr><td>SWG</td><td>75.8±0.3</td><td>68.1±2.3</td><td>96.5±0.1</td><td>91.3±0.8</td></tr><tr><td>LA</td><td>67.5±0.4</td><td>69.0±1.3</td><td>96.2±0.2</td><td>92.2±0.5</td></tr><tr><td>LA*</td><td>56.1±0.5</td><td>55.7±1.2</td><td>96.4±0.2</td><td>92.4±0.5</td></tr></table>
139
+
140
+ # 4.1 Choosing the Right Laplace Approximation
141
+
142
+ In Section 2 we presented multiple options for each component of the design space of the LA, resulting in a large number of possible combinations, all of which are supported by laplace. Here, we try to reduce this complexity and make suggestions for sensible default choices that cover common application scenarios. To this end, we performed a comprehensive comparison between most variants; we measured in- and out-of-distribution performance on standard image classification benchmarks (MNIST, FashionMNIST, CIFAR-10) but also considered the computational complexity of each variant. We provide details of the comparison and a list of the considered variants in Appendix C.1 and summarize the main arguments and take-aways in the following.
143
+
144
+ Hyperparameter tuning and parameter inference. We can apply the LA purely post-hoc (only tune hyperparameters of a pre-trained network) or online (tune hyperparameters and train the network jointly, as e.g. suggested by Immer et al. [22]). We find that the online LA only works reliably when it is applied to all weights of the network. In contrast, applying the LA post-hoc only on the last layer instead of all weights typically yields better performance due to less underfitting, and is significantly cheaper. For problems where a pre-trained network or optimal hyperparameters are available, e.g. for well-studied data sets, we, therefore, suggest using the post-hoc variant on the last layer. This LA has the benefit that it has minimal overhead over a standard neural network forward pass (cf. Fig. 5) while performing on par or better than state-of-the-art approaches (cf. Fig. 4). When hyperparameters are unknown or no validation data is available, we suggest training the neural network online by optimizing the marginal likelihood, following Immer et al. [22] (cf Section 4.4). Figure 3 illustrates this on CIFAR-10: for CIFAR-10 with data augmentation, strong pre-trained networks and hyperparameters are available and the post-hoc methods directly profit from that while the online methods merely reach the same performance. On the less studied CIFAR-10 without data augmentation, the online method can improve the performance over the post-hoc methods.
145
+
146
+ Covariance approximation and structure. Generally, we find that a more expressive covariance approximation improves performance, as would be expected. However, a full covariance is in most cases intractable for full networks or networks with large last layers. The KFAC structured covariance provides a good trade-off between expressiveness and speed. Diagonal approximations perform significantly worse than KFAC and are therefore not suggested. Independent of the structure, we find that the empirical Fisher (EF) approximations perform better on out-of-distribution detection tasks while GGN approximations tend to perform better on in-distribution metrics.
147
+
148
+ Predictive distribution. Considering in- and out-of-distribution (OOD) performance as well as cost, the probit provides the best approximation to the predictive for the last-layer LA. MC integration can sometimes be superior for OOD detection but at an increased computational cost. The Laplace bridge has the same cost as the probit approximation but typically provides inferior results in our experiments. When using the LA online to optimize hyperparameters, we find that the resulting MAP predictive provides good performance in-distribution, but a probit or MC predictive improves OOD performance.
149
+
150
+ ![](images/85013079cfb36603abfbc81a41bd09b8e1e0a7f28e6c050a63c2f8fc175e90fb.jpg)
151
+ Figure 4: Assessing model calibration (a) on in-distribution data and $^ { ( \mathbf { b } , \mathbf { c } ) }$ under distribution shift, for the MNIST (top row) and CIFAR-10 (bottom row) datasets. For (b,c), we use the Rotated-MNIST (top) and Corrupted-CIFAR-10 (bottom) benchmarks [63, 64]. In (a), we report accuracy and, to measure calibration, negative log-likelihood (NLL) and expected calibration error (ECE)—all evaluated on the standard test sets. In (b) and (c), we plot shift intensities against NLL and ECE, respectively. For Rotated-MNIST (top), shift intensities denote degrees of rotation of the images, while for CorruptedCIFAR-10 (bottom), they denote the amount of image distortion (see [63, 64] for details). (a) On in-distribution data, LA is the best-calibrated method in terms of ECE, while also retaining the accuracy of MAP (unlike VB and CSGHMC). (b,c) On corrupted data, all Bayesian methods improve upon MAP significantly. Even though post-hoc, all LAs achieve competitive results, even to DE. In particular, $\mathrm { L A ^ { * } }$ achieves the best results, at the expense of slightly worse in-distribution calibration— this trade-off between in- and out-of-distribution performance has been observed previously [65].
152
+
153
+ Overall recommendation. Following the experimental evidence, the default in laplace is a posthoc KFAC last-layer LA with a GGN approximation to the Hessian. This default is applicable to all architectures that have a fully-connected last layer and can be easily applied to pre-trained networks. For problems where trained networks are unavailable or hyperparameters are unknown, the online KFAC LA with a GGN or empirical Fisher provides a good baseline with minimal effort.
154
+
155
+ # 4.2 Predictive Uncertainty Quantification
156
+
157
+ We consider two flavors of LAs: the default flavor of laplace (LA) and the most robust one in terms of distribution shift found in Section 4.1 (LA\*—last-layer, with a full empirical Fisher Hessian approximation, and the probit approximation). We compare them with the MAP network (MAP) and various popular and strong Bayesian baselines: Deep Ensemble [DE, 14], mean-field variational Bayes [VB, 11, 12] with the flipout estimator [66], cyclical stochastic-gradient Hamiltonian Monte Carlo [CSGHMC / HMC, 67], and SWAG [SWG, 15]. For each baseline, we use the hyperparameters recommended in the original paper—see Appendix A for details. First, Fig. 4 shows that LA and $\mathbf { L A ^ { * } }$ are, respectively, competitive with and superior to the baselines in trading-off between in-distribution calibration and dataset-shift robustness. Second, Table 1 shows that LA and $\mathbf { L A ^ { * } }$ achieve better results on out-of-distribution (OOD) detection than even VB, CSGHMC, and SWG.
158
+
159
+ The LA shines even more when we consider its (time and memory) cost relative to the other, more complex baselines. In Fig. 5 we show the wall-clock times of each method relative to MAP’s for training and prediction. As expected, DE, VB, and CSGHMC are slow to train and in making predictions: they are between two to five times more expensive than MAP. Meanwhile, despite being post-hoc, SWG is almost twice as expensive as MAP during training due to the need for sampling and updating its batch normalization statistics. Moreover, with 30 samples, as recommended by its authors [15], it is very expensive at prediction time—more than ten times more expensive than MAP.
160
+
161
+ ![](images/f4d6599ca5f3c916fe5523cc6293eef4620b371c53d955f04cdbb82ef14df752.jpg)
162
+ Figure 6: Assessing real-world distribution shift robustness on five datasets from the WILDS benchmark [68], covering different data modalities, model architectures, and output types. Camelyon17: Tissue slide image tumor classification across hospitals (DenseNet-121 [69]). FMoW: Satellite image land use classification across regions/years (DenseNet-121). CivilCommments: Online comment toxicity classification across demographics (DistilBERT [70]). Amazon: Product review sentiment classification across users (DistilBERT). PovertyMap: Satellite image asset wealth regression across countries (ResNet-18 [35]). We plot means $\pm$ standard errors of the NLL (top) and ECE (for classification) or regression calibration error [71] (bottom). The in-distribution (left panels) and OOD (right panels) dataset splits correspond to different domains (e.g. hospitals for Camelyon17). LA is much better calibrated than MAP, and competitive with temp. scaling and DE, especially on the OOD splits.
163
+
164
+ Meanwhile, LA (and LA\*) is the cheapest of all methods considered: it only incurs a negligible overhead on top of the costs of MAP. This is similar for the memory consumption (see Table 5 in Appendix C.5). This shows that the LA is significantly more memory- and compute-efficient than all the other methods, adding minimal overhead over MAP inference and prediction. This makes the LA particularly attractive for practitioners, especially in low-resource environments. Together with Fig. 4 and Table 1, this justifies our default flavor in laplace, and importantly, shows that Bayesian deep learning does not have to be expensive.
165
+
166
+ ![](images/ba8cedf57e99d7de8fa882b2a640bc5dcdba40ce75bdb6c3b845ee399be0eecf.jpg)
167
+ Figure 5: Wall-clock time costs relative to MAP. LA introduces negligible overhead over MAP, while all other baselines are significantly more expensive.
168
+
169
+ # 4.3 Realistic Distribution Shift
170
+
171
+ So far, our experiments focused on comparably simple benchmarks, allowing us to comprehensively assess different LA variants and compare to more involved Bayesian methods such as VB, MCMC, and SWAG. In more realistic settings, however, where we want to improve the uncertainty of complex and costly-to-train models, such as transformers [61], these methods would likely be difficult to get to work well and expensive to run. However, one might often have access to a pre-trained model, allowing for the cheap use of post-hoc methods such as the LA. To demonstrate this, we show how laplace can improve the distribution shift robustness of complex pre-trained models in large-scale settings. To this end, we use WILDS [68], a recently proposed benchmark of realistic distribution shifts encompassing a variety of real-world datasets across different data modalities and application domains. While the WILDS models employ complex (e.g. convolutional or transformer) architectures as feature extractors, they all feed into a linear output layer, allowing us to conveniently and cheaply apply the last-layer LA. As baselines, we consider: 1) the pre-trained MAP models [68], 2) post-hoc temperature scaling of the MAP models (for classification tasks) [1], and 3) deep ensembles [14].5 More details on the experimental setup are provided in Appendix C.3. Fig. 6 shows the results on five different WILDS datasets (see caption for details). Overall, Laplace is significantly better calibrated than MAP, and competitive with temperature scaling and ensembles, especially on the OOD splits.
172
+
173
+ # 4.4 Further Applications
174
+
175
+ Beyond predictive uncertainty quantification, the LA is useful in wide range of applications such as Bayesian optimization [37], bandits [72], active learning [34, 73], and continual learning [24]. The laplace library conveniently facilitates these applications. As an example, we demonstrate the performance of the LA on the standard continual learning benchmark with the PermutedMNIST dataset, consisting of ten tasks each containing pixel-permuted MNIST images [74]. Figure 7 shows how the all-layer diagonal and Kronecker-factored LAs can overcome catastrophic forgetting. In this experiment, we update the LAs after each task as suggested by Ritter et al. [24] and improve upon their result by tuning the prior precision through marginal likelihood optimization during training, following Immer et al. [22] (details in Appendix C.4). Using this scheme, the performance after 10 tasks is at around $9 6 \%$ accuracy, outperforming other Bayesian approaches for continual learning [7, 75, 76]. Concretely, we show that the KFAC LA, while much simpler when applied via laplace, can achieve better performance to a recent VB baseline [VOGN, 13]. Our library thus provides an easy and quick way of constructing a strong baseline for this application.
176
+
177
+ ![](images/c57807865bc426e868ac3d967fdb140129f548f82f96c23b66f4a6de203120ea.jpg)
178
+ Figure 7: Continual learning results on Permuted-MNIST. MAP fails catastrophically as more tasks are added. The Bayesian approaches substantially outperform MAP, with LA-KFAC performing the best, closely followed by VOGN.
179
+
180
+ # 5 Related Work
181
+
182
+ The LA is fundamentally a local approximation that covers a single mode of the posterior; similarly, other Gaussian approximations such as mean-field variational inference [11–13] or SWAG [15] also only capture local information. SWAG uses the first and second empirical moment of SGD iterates to form a diagonal plus low-rank Gaussian approximation but requires storing many NN copies and applying a (costly) heuristic related to batch normalization at test time. In contrast, the LA directly uses curvature information of the loss around the MAP and can be applied post-hoc to pre-trained NNs.
183
+
184
+ In contrast to local Gaussian approximations, (stochastic-gradient) MCMC methods [77, 78, 67, 79, 80, etc.] and deep ensembles [14] can explore several modes. Nevertheless, prior works—also validated in our experiments in Section 4—indicate that using a single mode might not be as limiting in practice as one might think. Wilson and Izmailov [81] conjecture that this is due to the complex, nonlinear connection between the parameter space and the function (output) space of NNs. Moreover, while unbiased compared to its simpler alternatives, MCMC methods are notoriously expensive in practice and, thus, often require further approximations such as distillation [82, 83]. Finally, note that both the LA as well as SWAG can be extended to ensembles of modes in a post-hoc manner [84, 81].
185
+
186
+ # 6 Conclusion
187
+
188
+ In this paper, we argued that the Laplace approximation is a simple yet competitive and versatile method for Bayesian deep learning that deserves wider adoption. To this end, we reviewed many recent advances to and variants of the Laplace approximation, including versions with minimal cost overhead that can be applied post-hoc to pre-trained off-the-shelf models. In a comprehensive evaluation we demonstrated that the Laplace approximation is on par with other approaches that approximate the intractable network posterior, but at typically much lower computational cost. A particularly simple variant that only treats some weights probabilistically can even be used in the context of pre-trained transformer models to improve predictive uncertainty. As an efficient implementation is not straightforward, we introduced laplace, a modular and extensible software library for PyTorch offering user-friendly access to all major flavors of the Laplace approximation. In this way, Laplace approximations provide drop-in Bayesian functionality for most types of deep neural networks.
189
+
190
+ # Acknowledgments and Disclosure of Funding
191
+
192
+ We thank Kazuki Osawa for providing early access to his automatic second-order differentiation (ASDL) library for PyTorch and Alex Botev for feedback on the manuscript. We also thank the anonymous reviewers for their helpful suggestions for our paper.
193
+
194
+ E.D. acknowledges funding from the EPSRC and Qualcomm. A.I. gratefully acknowledges funding by the Max Planck ETH Center for Learning Systems (CLS). R.E., A.K. and P.H. gratefully acknowledge financial support by the European Research Council through ERC StG Action 757275 / PANAMA; the DFG Cluster of Excellence “Machine Learning - New Perspectives for Science”, EXC 2064/1, project number 390727645; the German Federal Ministry of Education and Research (BMBF) through the Tübingen AI Center (FKZ: 01IS18039A); and funds from the Ministry of Science, Research and Arts of the State of Baden-Württemberg. A.K. is grateful to the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for support.
195
+
196
+ # References
197
+
198
+ [1] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q. Weinberger. On Calibration of Modern Neural Networks. In ICML, 2017.
199
+ [2] James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming Catastrophic Forgetting in Neural Networks. Proceedings of the National Academy of Sciences, 114(13), 2017.
200
+ [3] Frank Hutter, Lars Kotthoff, and Joaquin Vanschoren. Automated Cachine Learning: Methods, Systems, Challenges. Springer Nature, 2019.
201
+ [4] David Barber. Bayesian Reasoning and Machine Learning. Cambridge University Press, 2012.
202
+ [5] Zoubin Ghahramani. Probabilistic Machine Learning and Artificial Intelligence. Nature, 521(7553), 2015.
203
+ [6] Yarin Gal and Zoubin Ghahramani. Dropout as a Bayesian Approximation: Representing Model Uncertainty in Deep Learning. In ICML, 2016.
204
+ [7] Cuong V Nguyen, Yingzhen Li, Thang D Bui, and Richard E Turner. Variational Continual Learning. In ICLR, 2018.
205
+ [8] David JC MacKay. Probable Networks and Plausible Predictions—a Review of Practical Bayesian Methods for Supervised Neural Networks. Network: Computation in Neural Systems, 1995.
206
+ [9] Yarin Gal. Uncertainty in deep learning. University of Cambridge, 2016.
207
+ [10] Geoffrey E Hinton and Drew Van Camp. Keeping the Neural Networks Simple by Minimizing the Description Length of the Weights. In COLT, 1993.
208
+ [11] Alex Graves. Practical Variational Inference for Neural Networks. In NIPS, 2011.
209
+ [12] Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight Uncertainty in Neural Networks. In ICML, 2015.
210
+ [13] Kazuki Osawa, Siddharth Swaroop, Mohammad Emtiyaz E Khan, Anirudh Jain, Runa Eschenhagen, Richard E Turner, and Rio Yokota. Practical Deep Learning with Bayesian Principles. In NeurIPS, 2019.
211
+ [14] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles. In NIPS, 2017.
212
+ [15] Wesley J Maddox, Pavel Izmailov, Timur Garipov, Dmitry P Vetrov, and Andrew Gordon Wilson. A Simple Baseline for Bayesian Uncertainty in Deep Learning. In NeurIPS, 2019.
213
+ [16] David JC MacKay. Bayesian Interpolation. Neural computation, 4(3), 1992.
214
+ [17] Pierre-Simon Laplace. Mémoires de Mathématique et de Physique, Tome Sixieme. 1774.
215
+ [18] Tom Heskes. On “Natural” Learning and Pruning in Multilayered Perceptrons. Neural Computation, 12 (4), 2000.
216
+ [19] James Martens and Roger Grosse. Optimizing Neural Networks with Kronecker-Factored Approximate Curvature. In ICML, 2015.
217
+ [20] Aleksandar Botev, Hippolyt Ritter, and David Barber. Practical Gauss-Newton Optimisation for Deep Learning. In ICML, 2017.
218
+ [21] Felix Dangel, Frederik Kunstner, and Philipp Hennig. Backpack: Packing More into Backprop. In ICLR, 2020.
219
+ [22] Alexander Immer, Matthias Bauer, Vincent Fortuin, Gunnar Rätsch, and Mohammad Emtiyaz Khan. Scalable Marginal Likelihood Estimation for Model Selection in Deep Learning. In ICML, 2021.
220
+ [23] Hippolyt Ritter, Aleksandar Botev, and David Barber. A Scalable Laplace Approximation for Neural Networks. In ICLR, 2018.
221
+ [24] Hippolyt Ritter, Aleksandar Botev, and David Barber. Online Structured Laplace Approximations for Overcoming Catastrophic Forgetting. In NIPS, 2018.
222
+ [25] Mohammad Emtiyaz E Khan, Alexander Immer, Ehsan Abedi, and Maciej Korzepa. Approximate Inference Turns Deep Networks Into Gaussian Processes. In NeurIPS, 2019.
223
+ [26] Alexander Immer, Maciej Korzepa, and Matthias Bauer. Improving Predictions of Bayesian Neural Networks via Local Linearization. In AISTATS, 2021.
224
+ [27] Erik Daxberger, Eric Nalisnick, James Urquhart Allingham, Javier Antorán, and José Miguel HernándezLobato. Bayesian Deep Learning via Subnetwork Inference. In ICML, 2021.
225
+ [28] Agustinus Kristiadi, Matthias Hein, and Philipp Hennig. Being Bayesian, Even Just a Bit, Fixes Overconfidence in ReLU Networks. In ICML, 2020.
226
+ [29] Jongseok Lee, Matthias Humt, Jianxiang Feng, and Rudolph Triebel. Estimating Model Uncertainty of Neural Networks in Sparse Information Form. In ICML, 2020.
227
+ [30] Pavel Izmailov, Wesley J Maddox, Polina Kirichenko, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Subspace Inference for Bayesian Deep Learning. In UAI, 2019.
228
+ [31] David J Spiegelhalter and Steffen L Lauritzen. Sequential Updating of Conditional Probabilities on Directed Graphical Structures. Networks, 1990.
229
+ [32] Christopher KI Williams and David Barber. Bayesian Classification with Gaussian processes. IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(12), 1998.
230
+ [33] Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian Processes in Machine Learning. The MIT Press, 2005.
231
+ [34] David JC MacKay. The Evidence Framework Applied to Classification Networks. Neural computation, 1992.
232
+ [35] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In CVPR, 2016.
233
+ [36] Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism. arXiv preprint arXiv:1909.08053, 2019.
234
+ [37] Jasper Snoek, Oren Rippel, Kevin Swersky, Ryan Kiros, Nadathur Satish, Narayanan Sundaram, Mostofa Patwary, Mr Prabhat, and Ryan Adams. Scalable bayesian optimization using deep neural networks. In ICML, 2015.
235
+ [38] James Martens. New insights and perspectives on the natural gradient method. Journal of Machine Learning Research, 21(146):1–76, 2020.
236
+ [39] Shun-Ichi Amari. Natural Gradient Works Efficiently in Learning. Neural computation, 10(2), 1998.
237
+ [40] Frederik Kunstner, Lukas Balles, and Philipp Hennig. Limitations of the Empirical Fisher Approximation for Natural Gradient Descent. In NeurIPS, 2019.
238
+ [41] Nicol N Schraudolph. Fast Curvature Matrix-Vector Products for Second-Order Gradient Descent. Neural computation, 14(7), 2002.
239
+ [42] Yann LeCun, John S Denker, and Sara A Solla. Optimal Brain Damage. In NIPS, 1990.
240
+ [43] John S Denker and Yann LeCun. Transforming Neural-Net Output Levels to Probability Distributions. In NIPS, 1990.
241
+ [44] Thomas George, César Laurent, Xavier Bouthillier, Nicolas Ballas, and Pascal Vincent. Fast Approximate Natural Gradient Descent in a Kronecker Factored Eigenbasis. In NIPS, 2018.
242
+ [45] David Madras, James Atwood, and Alex D’Amour. Detecting extrapolation with local ensembles. In ICLR, 2020.
243
+ [46] Wesley J Maddox, Gregory Benton, and Andrew Gordon Wilson. Rethinking parameter counting in deep models: Effective dimensionality revisited. arXiv preprint arXiv:2003.02139, 2020.
244
+ [47] Apoorva Sharma, Navid Azizan, and Marco Pavone. Sketching curvature for efficient out-of-distribution detection for deep neural networks. arXiv preprint arXiv:2102.12567, 2021.
245
+ [48] Andrew YK Foong, Yingzhen Li, José Miguel Hernández-Lobato, and Richard E Turner. ’In-Between’ Uncertainty in Bayesian Neural Networks. arXiv preprint arXiv:1906.11537, 2019.
246
+ [49] Agustinus Kristiadi, Matthias Hein, and Philipp Hennig. Learnable Uncertainty under Laplace Approximations. In UAI, 2021.
247
+ [50] José M Bernardo and Adrian FM Smith. Bayesian Theory. John Wiley & Sons, 2009.
248
+ [51] Matthias Humt, Jongseok Lee, and Rudolph Triebel. Bayesian Optimization Meets Laplace Approximation for Robotic Introspection. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS) Long-Term Autonomy Workshop, 2020.
249
+ [52] Mark N Gibbs. Bayesian Gaussian Processes for Regression and Classification. Ph. D. Thesis, Department of Physics, University of Cambridge, 1997.
250
+ [53] David JC MacKay. Choice of Basis for Laplace Approximation. Machine learning, 33(1), 1998.
251
+ [54] Philipp Hennig, David Stern, Ralf Herbrich, and Thore Graepel. Kernel Topic Models. In AISTATS, 2012.
252
+ [55] Marius Hobbhahn, Agustinus Kristiadi, and Philipp Hennig. Fast Predictive Uncertainty for Classification with Bayesian Deep Networks. arXiv preprint arXiv:2003.01227, 2020.
253
+ [56] Wesley J Maddox, Pavel Izmailov, Timur Garipov, Dmitry P Vetrov, and Andrew Gordon Wilson. Code repo for "A Simple Baseline for Bayesian Deep Learning". https://github.com/wjmaddox/swa_ gaussian, 2019.
254
+ [57] Agustinus Kristiadi. Last-layer Laplace approximation code examples. https://github.com/wiseodd/ last_layer_laplace, 2020.
255
+ [58] Jongseok Lee and Matthias Humt. Official Code: Estimating Model Uncertainty of Neural Networks in Sparse Information Form, ICML2020. https://github.com/DLR-RM/curvature, 2020.
256
+ [59] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In NeurIPS, 2019.
257
+ [60] Kazuki Osawa. ASDL: Automatic second-order differentiation (for fisher, gradient covariance, hessian, jacobian, and kernel) library. https://github.com/kazukiosawa/asdfghjkl, 2021.
258
+ [61] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is All You Need. In NIPS, 2017.
259
+ [62] Dan Hendrycks and Kevin Gimpel. A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networks. In ICLR, 2017.
260
+ [63] Dan Hendrycks and Thomas Dietterich. Benchmarking Neural Network Robustness to Common Corruptions and Perturbations. In ICLR, 2019.
261
+ [64] Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, David Sculley, Sebastian Nowozin, Joshua Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can You Trust Your Model’s Uncertainty? Evaluating Predictive Uncertainty under Dataset Shift. In NeurIPS, 2019.
262
+ [65] Zhiyun Lu, Eugene Ie, and Fei Sha. Uncertainty Estimation with Infinitesimal Jackknife, Its Distribution and Mean-Field Approximation. arXiv preprint arXiv:2006.07584, 2020.
263
+ [66] Yeming Wen, Paul Vicol, Jimmy Ba, Dustin Tran, and Roger Grosse. Flipout: Efficient Pseudo-Independent Weight Perturbations on Mini-Batches. In ICLR, 2018.
264
+ [67] Ruqi Zhang, Chunyuan Li, Jianyi Zhang, Changyou Chen, and Andrew Gordon Wilson. Cyclical Stochastic Gradient MCMC for Bayesian Deep Learning. In ICLR, 2020.
265
+ [68] Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, et al. WILDS: A Benchmark of In-The-Wild Distribution Shifts. In arXiv preprint arXiv:2012.07421, 2020.
266
+ [69] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely Connected Convolutional Networks. In CVPR, 2017.
267
+ [70] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. DistilBERT, a Distilled Version of Bert: Smaller, Faster, Cheaper and Lighter. In 5th Workshop on Energy Efficient Machine Learning and Cognitive Computing - NeurIPS, 2019.
268
+ [71] Volodymyr Kuleshov, Nathan Fenner, and Stefano Ermon. Accurate Uncertainties for Deep Learning Using Calibrated Regression. In ICML, 2018.
269
+ [72] Olivier Chapelle and Lihong Li. An Empirical Evaluation of Thompson Sampling. In NIPS, 2011.
270
+ [73] Mijung Park, Greg Horwitz, and Jonathan W Pillow. Active Learning of Neural Response Functions with Gaussian Processes. In NIPS, 2011.
271
+ [74] Ian J Goodfellow, Mehdi Mirza, Da Xiao, Aaron Courville, and Yoshua Bengio. An Empirical Investigation of Catastrophic Forgetting in Gradient-Based Neural Networks. arXiv preprint arXiv:1312.6211, 2013.
272
+ [75] Michalis K Titsias, Jonathan Schwarz, Alexander G de G Matthews, Razvan Pascanu, and Yee Whye Teh. Functional Regularisation for Continual Learning with Gaussian Processes. In ICLR, 2020.
273
+ [76] Pingbo Pan, Siddharth Swaroop, Alexander Immer, Runa Eschenhagen, Richard E Turner, and Mohammad Emtiyaz Khan. Continual Deep Learning by Functional Regularisation of Memorable Past. In NeurIPS, 2020.
274
+ [77] Max Welling and Yee W Teh. Bayesian Learning via Stochastic Gradient Langevin Dynamics. In ICML, 2011.
275
+ [78] Florian Wenzel, Kevin Roth, Bastiaan S Veeling, Jakub Swi ˛atkowski, Linh Tran, Stephan Mandt, Jasper ´ Snoek, Tim Salimans, Rodolphe Jenatton, and Sebastian Nowozin. How Good is the Bayes Posterior in Deep Neural Networks Really? ICML, 2020.
276
+ [79] Pavel Izmailov, Sharad Vikram, Matthew D Hoffman, and Andrew Gordon Wilson. What Are Bayesian Neural Network Posteriors Really Like? In ICML, 2021.
277
+ [80] Adrià Garriga-Alonso and Vincent Fortuin. Exact langevin dynamics with stochastic gradients. arXiv preprint arXiv:2102.01691, 2021.
278
+ [81] Andrew G Wilson and Pavel Izmailov. Bayesian Deep Learning and a Probabilistic Perspective of Generalization. In NeurIPS, 2020.
279
+ [82] Anoop Korattikara, Vivek Rathod, Kevin Murphy, and Max Welling. Bayesian Dark Knowledge. In NIPS, 2015.
280
+ [83] Kuan-Chieh Wang, Paul Vicol, James Lucas, Li Gu, Roger Grosse, and Richard Zemel. Adversarial Distillation of Bayesian Neural Network Posteriors. In ICML, 2018.
281
+ [84] Runa Eschenhagen, Erik Daxberger, Philipp Hennig, and Agustinus Kristiadi. Mixtures of Laplace Approximations for Improved Post-Hoc Uncertainty in Deep Learning. NeurIPS Workshop on Bayesian Deep Learning, 2021.
282
+ [85] Jonathan Frankle and Michael Carbin. The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks. In ICLR, 2019.
283
+ [86] David JC MacKay. A Practical Bayesian Framework For Backpropagation Networks. Neural computation, 1992.
284
+ [87] Sebastian Farquhar, Lewis Smith, and Yarin Gal. Liberty or Depth: Deep Bayesian Neural Nets Do Not Need Complex Weight Posterior Approximations. In NeurIPS, 2020.
285
+ [88] Arjun K Gupta and Daya K Nagar. Matrix Variate Distributions. Chapman and Hall, 1999.
286
+ [89] Carl Eckart and Gale Young. The approximation of one matrix by another of lower rank. Psychometrika, 1 (3):211–218, 1936.
287
+ [90] Christopher M. Bishop. Pattern Recognition and Machine Learning. Springer, 2006.
288
+ [91] Anqi Wu, Sebastian Nowozin, Edward Meeds, Richard E. Turner, Jose Miguel Hernandez-Lobato, and Alexander L. Gaunt. Deterministic Variational Inference for Robust Bayesian Neural Networks. In ICLR, 2019.
289
+ [92] Amr Ahmed and Eric P Xing. Seeking The Truly Correlated Topic Posterior—On Tight Approximate Inference of Logistic-Normal Admixture Model. In AISTATS, 2007.
290
+ [93] Michael Braun and Jon McAuliffe. Variational Inference for Large-Scale Models of Discrete Choice. Journal of the American Statistical Association, 105(489), 2010.
291
+ [94] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
292
+ [95] Sergey Zagoruyko and Nikos Komodakis. Wide Residual Networks. In BMVC, 2016.
293
+ [96] Ilya Loshchilov and Frank Hutter. SGDR: Stochastic Gradient Descent with Warm Restarts. In ICLR, 2017.
294
+ [97] Ranganath Krishnan and Piero Esposito. Bayesian-Torch: Bayesian Neural Network Layers for Uncertainty Estimation. https://github.com/IntelLabs/bayesian-torch, 2020.
295
+ [98] Florian Wenzel, Jasper Snoek, Dustin Tran, and Rodolphe Jenatton. Hyperparameter Ensembles for Robustness and Uncertainty Quantification. In NeurIPS, 2020.
296
+ [99] Ferenc Huszár. Note on the quadratic penalties in elastic weight consolidation. Proceedings of the National Academy of Sciences, page 201717042, 2018.
parse/train/gDcaUj4Myhn/gDcaUj4Myhn_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/o81ZyBCojoA/o81ZyBCojoA.md ADDED
@@ -0,0 +1,380 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ON FAST ADVERSARIAL ROBUSTNESS ADAPTATION IN MODEL-AGNOSTIC META-LEARNING
2
+
3
+ Ren Wang1,4 $^ *$ Kaidi $\mathbf { X } \mathbf { u } ^ { 2 }$ Sijia $\mathbf { L i u ^ { 3 , 5 } }$ † Pin-Yu Chen3 Tsui-Wei Weng3 Chuang Gan3
4
+ Meng Wang1
5
+ 1Rensselaer Polytechnic Institute, USA
6
+ 2Northeastern University, USA
7
+ 3MIT-IBM Watson AI Lab, IBM Research, USA
8
+ 4University of Michigan, USA
9
+ 5Michigan State University, USA
10
+
11
+ # ABSTRACT
12
+
13
+ Model-agnostic meta-learning (MAML) has emerged as one of the most successful meta-learning techniques in few-shot learning. It enables us to learn a meta-initialization of model parameters (that we call meta-model) to rapidly adapt to new tasks using a small amount of labeled training data. Despite the generalization power of the meta-model, it remains elusive that how adversarial robustness can be maintained by MAML in few-shot learning. In addition to generalization, robustness is also desired for a meta-model to defend adversarial examples (attacks). Toward promoting adversarial robustness in MAML, we first study when a robustness-promoting regularization should be incorporated, given the fact that MAML adopts a bi-level (fine-tuning vs. meta-update) learning procedure. We show that robustifying the meta-update stage is sufficient to make robustness adapted to the task-specific fine-tuning stage even if the latter uses a standard training protocol. We also make additional justification on the acquired robustness adaptation by peering into the interpretability of neurons’ activation maps. Furthermore, we investigate how robust regularization can efficiently be designed in MAML. We propose a general but easily-optimized robustness-regularized meta-learning framework, which allows the use of unlabeled data augmentation, fast adversarial attack generation, and computationally-light fine-tuning. In particular, we for the first time show that the auxiliary contrastive learning task can enhance the adversarial robustness of MAML. Finally, extensive experiments are conducted to demonstrate the effectiveness of our proposed methods in robust few-shot learning. Codes are available at https://github.com/wangren09/MetaAdv.
14
+
15
+ # 1 INTRODUCTION
16
+
17
+ Meta-learning, which can offer fast generalization adaptation to unseen tasks (Thrun & Pratt, 2012; Novak & Gowin, 1984), has widely been studied from model- and metric-based methods (Santoro et al., 2016; Munkhdalai & Yu, 2017; Koch et al., 2015; Snell et al., 2017) to optimizationbased methods (Ravi & Larochelle, 2016; Finn et al., 2017; Nichol et al., 2018). In particular, model-agnostic meta-learning (MAML) (Finn et al., 2017) is one of the most intriguing bi-level optimization-based meta-learning methods designed for fast-adapted few-shot learning. That is, the learnt meta-model can rapidly be generalized to unforeseen tasks with only a small amount of data. It has successfully been applied to use cases such as object detection (Wang et al., 2020), medical image analysis (Maicas et al., 2018), and language modeling (Huang et al., 2018).
18
+
19
+ In addition to generalization-ability, recent works (Yin et al., 2018; Goldblum et al., 2019; Xu et al., 2020) investigated MAML from another fundamental perspective, adversarial robustness, given by the capabilities of a model defending against adversarially perturbed inputs (known as adversarial examples/attacks) (Goodfellow et al., 2014; Xu et al., 2019b). The challenge of lacking robustness of deep learning (DL) models has gained increasing interest and attention. And there exists a proactive arm race between adversarial attack and defense; see overview in (Carlini et al., 2019; Hao-Chen et al., 2020).
20
+
21
+ There have existed many defensive methods in the context of standard model training, e.g., (Madry et al., 2017; Zhang et al., 2019b; Wong et al., 2020; Carmon et al., 2019; Stanforth et al., 2019; Xu et al., 2019a), however, few work studied robust MAML except (Yin et al., 2018; Goldblum et al., 2019) to the best of our knowledge. And tackling such a problem is more challenging than robustifying the standard model training, since MAML contains a bi-leveled learning procedure in which the meta-update step (outer loop) optimizes a task-agnostic initialization of model parameters while the fine-tuning step (inner loop) learns a task-specific model instantization updated from the common initialization. Thus, it remains elusive when (namely, at which learning stage) and how robust regularization should be promoted to strike a graceful balance between generalization/robustness and computation efficiency. Note that neither the standard MAML (Finn et al., 2017) nor the standard robust training (Madry et al., 2017; Zhang et al., 2019b) is as easy as normal training. Besides the algorithmic design in robust MAML, it is also important to draw in-depth explanation and analysis on why adversarial robustness can efficiently be gained in MAML. In this work, we aim to re-visit the problem of adversarial robustness in MAML (Yin et al., 2018; Goldblum et al., 2019) and make affirmative answers to the above questions on when, how and why.
22
+
23
+ Contributions Compared to the existing works (Yin et al., 2018; Goldblum et al., 2019), we make the following contributions:
24
+
25
+ • Given the fact that MAML is formed as a bi-level learning procedure, we show and explain why regularizing adversarial robustness at the meta-update level is sufficient to offer fast and effective robustness adaptation on few-shot test tasks.
26
+
27
+ • Given the fact that either MAML or robust training alone is computationally intensive, we propose a general but efficient robustness-regularized meta-learning framework, which allows the use of unlabeled data augmentation, fast (one-step) adversarial example generation during meta-updating, and partial model training during fine-tuning (only fine-tuning the classifier’s head).
28
+
29
+ • We for the first time show that the use of unlabeled data augmentation, particularly introducing an auxiliary contrastive learning task, can provide additional benefits on adversarial robustness of MAML in the low data regime, $2 \%$ robust accuracy improvement and $9 \%$ clean accuracy improvement over the state-of-the-art robust MAML method (named as adversarial querying) in (Goldblum et al., 2019).
30
+
31
+ Related work To train a standard model (instead of a meta-model), the most effective robust training methods include adversarial training (Madry et al., 2017), TRADES that places a theoreticallygrounded trade-off between accuracy and robustness (Zhang et al., 2019b), and their many variants such as fast adversarial training methods (Shafahi et al., 2019; Zhang et al., 2019a; Wong et al., 2020; Andriushchenko & Flammarion, 2020), semi-supervised robust training (Carmon et al., 2019; Stanforth et al., 2019), adversarial transfer learning and certifiably robust training (Wong & Kolter, 2017; Dvijotham et al., 2018). Moreover, recent works (Hendrycks et al., 2019; Chen et al., 2020a; Shafahi et al., 2020; Chan et al., 2020; Utrera et al., 2020; Salman et al., 2020) studied the transferability of robustness in in the context of transfer learning and representation learning. However, the aforementioned standard robust training methods are not directly applicable to MAML in few-shot learning considering MAML’s bi-leveled optimization nature.
32
+
33
+ A few recent works studied the problem of adversarial training in the context of MAML (Goldblum et al., 2019; Yin et al., 2018). Yin et al. (2018) considered the robust training in both fine-tuning and meta-update steps, which is unavoidably computationally expensive and difficult in optimization. The most relevant work to ours is (Goldblum et al., 2019), which proposed adversarial querying (AQ) by integrating adversarial training with MAML. Similar to ours, AQ attempted to robustify meta-update only to gain sufficient robustness. However, it lacks explanation for the rationale behind that. We will show that AQ can also be regarded as a special case of our proposed robustnesspromoting MAML framework. Most important, we make a more in-depth study with novelties summarized in Contributions.
34
+
35
+ Another line of research relevant to ours is efficient MAML, e.g., (Raghu et al., 2019; Song et al., 2019; Su et al., 2019), where the goal is to improve the computation efficiency and/or the generalization of MAML. In (Song et al., 2019), gradient-free optimization was leveraged to alleviate the need of second-order derivative information during meta-update. In (Raghu et al., 2019), MAML was simplified by removing the fine-tuning step over the representation block of a meta-model. It was shown that such a simplification is surprisingly effective without losing generalization-ability. In (Su et al., 2019), a self-supervised representation learning task was augmented to the meta-updating objective and resulted in a meta-model with improved generalization. Although useful insights were gained from MAML in the aforementioned works, none of them took adversarial robustness into account.
36
+
37
+ # 2 PRELIMINARIES AND PROBLEM STATEMENT
38
+
39
+ In this section, we first review model-agnostic meta learning (MAML) (Finn et al., 2017) and adversarial training (Madry et al., 2017), respectively. We then motivate the setup of robustness-promoting MAML and demonstrate its challenges in design when integrating MAML with robust regularization.
40
+
41
+ MAML MAML attempts to learn an initialization of model parameters (namely, a meta-model) so that a new few-shot task can quickly and easily be tackled by fine-tuning this meta-model over a small amount of labeled data. The characteristic signature of MAML is its $b i$ -level learning procedure, where the fine-tuning stage forms a task-specific inner loop while the meta-model is updated at the outer loop by minimizing the validation error of fine-tuned models over cumulative tasks. Formally, consider $N$ few-shot learning tasks $\{ \mathcal { T } _ { i } \} _ { i = 1 } ^ { N }$ , each of which has a fine-tuning data set $\mathcal { D } _ { i }$ and a validation set $\mathcal { D } _ { i } ^ { \prime }$ , where $\mathcal { D } _ { i }$ is used in the fine-tuning stage and $\mathcal { D } _ { i } ^ { \prime }$ is used in the meta-update stage. Here the superscript $( \prime )$ is preserved to indicate operations/parameters at the meta-upate stage. MAML is then formulated as the following bi-level optimization problem (Finn et al., 2017):
42
+
43
+ $$
44
+ \begin{array} { r l } & { \underset { \mathbf { w } } { \mathrm { m i n i m i z e } } \quad \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \ell _ { i } ^ { \prime } ( \mathbf { w } _ { i } ^ { \prime } ; \mathcal { D } _ { i } ^ { \prime } ) } \\ & { \mathrm { s u b j e c t ~ t o } \quad \mathbf { w } _ { i } ^ { \prime } = \arg \operatorname* { m i n } _ { \mathbf { w } _ { i } } \ell _ { i } ( \mathbf { w } _ { i } ; \mathcal { D } _ { i } , \mathbf { w } ) , \ \forall i \in [ N ] } \end{array}
45
+ $$
46
+
47
+ where w denotes the meta-model to be designed, $\mathbf { w } _ { i } ^ { \prime }$ is the $\mathcal { T } _ { i }$ -specific fine-tuned model, $\ell _ { i } ^ { \prime } ( \mathbf { w } _ { i } ^ { \prime } ; \mathcal { D } _ { i } ^ { \prime } )$ represents the validation error using the fine-tuned model, $\ell _ { i } ( \mathbf { w } _ { i } ; { \mathcal { D } } _ { i } , \mathbf { w } )$ denotes the training error when fine-tuning the task-specific model parameters $\mathbf { w } _ { i }$ using the task-agnostic initialization $\mathbf { w }$ , and for ease of notation, $[ K ]$ represents the integer set $\{ 1 , 2 , \ldots , K \}$ . In (1), the objective function and the constraint correspond to the meta-update stage and fine-tuning stage, respectively. The bilevel optimization problem is challenging because each constraint calls an inner optimization oracle, which is typically instantiated into a $K$ -step gradient descent (GD) based solver:
48
+
49
+ $$
50
+ \begin{array} { r } { \mathbf { w } _ { i } ^ { ( k ) } = \mathbf { w } _ { i } ^ { ( k - 1 ) } - \alpha \nabla _ { \mathbf { w } _ { i } } \ell _ { i } ( \mathbf { w } _ { i } ^ { ( k - 1 ) } ; \mathcal { D } _ { i } , \mathbf { w } ) , \ k \in [ K ] , \ \mathrm { w i t h } \ \mathbf { w } _ { i } ^ { ( 0 ) } = \mathbf { w } . } \end{array}
51
+ $$
52
+
53
+ We note that even with the above simplified fine-tuning step, updating the meta-model w still requires the second-order derivatives of the objective function of (1) with respect to (w.r.t.) w.
54
+
55
+ Adversarial training The min-max optimization based adversarial training (AT) is known as one of the most powerful defense methods to obtain a robust model against adversarial attacks (Madry et al., 2017). We summarize AT and its variants through the following robustness-regularized optimization problem:
56
+
57
+ $$
58
+ \operatorname* { m i n i m i z e } _ { \mathbf { w } } \quad \lambda \mathbb { E } _ { ( \mathbf { x } , y ) \in \mathcal { D } } \left[ \ell ( \mathbf { w } ; \mathbf { x } , y ) \right] + \underbrace { \mathbb { E } _ { ( \mathbf { x } , y ) \in \mathcal { D } } [ \underset { \| \delta \| _ { \infty } \leq \epsilon } { \mathrm { m a x i m i z e } } g ( \mathbf { w } ; \mathbf { x } + \delta , y ) ] } _ { \mathcal { R } ( \mathbf { w } ; \mathcal { D } ) } ,
59
+ $$
60
+
61
+ where $\ell ( \mathbf { w } ; \mathbf { x } , y )$ denotes the prediction loss evaluated at the point $\mathbf { x }$ with label $y$ , $\lambda \geq 0$ is a regularization parameter, $\delta$ denotes the input perturbation variable within the $\ell _ { \infty }$ -norm ball of radius , $g$ represents the robust loss evaluated at the model w at the perturbed example $\mathbf { x } + \delta$ given the true label $y$ , and for ease of notation, let $\mathcal { R } ( \mathbf { w } ; \mathcal { D } )$ denote the robust regularization function for model w under the data set $\mathcal { D }$ . In the rest of the paper, we consider two specifications of $\mathcal { R }$ : (a) $A T$ regularization (Madry et al., 2017), where we set $g = \ell$ and $\lambda = 0$ ; (b) TRADES regularization (Zhang et al., 2019b), where we define $g$ as the cross-entropy between the distribution of prediction probabilities at the perturbed example $( { \bf x } + \delta )$ and that at the original sample $\mathbf { x }$ .
62
+
63
+ Robustness-promoting MAML Integrating MAML with AT is a natural solution to enhance adversarial robustness of a meta-model in few-shot learning. However, this seemingly simple scheme is in fact far from trivial, and there exist three critical roadblocks as elaborated below.
64
+
65
+ First, it remains elusive at which stage (fine-tuning or meta-update) robustness can most effectively be gained for MAML. Based on (1) and (2), we can cast this problem as a unified optimization problem that augments the MAML loss with the robust regularization under two degrees of freedom characterized by two hyper-parameters $\gamma _ { \mathrm { o u t } } \geq 0$ and $\gamma _ { \mathrm { i n } } \geq 0$ :
66
+
67
+ $$
68
+ \begin{array} { r l } { \underset { \mathbf { w } } { \mathrm { m i n i m i z e } } } & { \frac { 1 } { N } \sum _ { i = 1 } ^ { N } [ \ell _ { i } ^ { \prime } ( \mathbf { w } _ { i } ^ { \prime } ; \mathcal { D } _ { i } ^ { \prime } ) + \gamma _ { \mathrm { o u t } } \mathcal { R } _ { i } ( \mathbf { w } _ { i } ^ { \prime } ; \mathcal { D } _ { i } ^ { \prime } ) ] } \\ { \mathrm { s u b j e c t ~ t o } } & { \mathbf { w } _ { i } ^ { \prime } = \arg \operatorname* { m i n } _ { \mathbf { w } _ { i } } [ \ell _ { i } ( \mathbf { w } _ { i } ; \mathcal { D } _ { i } , \mathbf { w } ) + \gamma _ { \mathrm { i n } } \mathcal { R } _ { i } ( \mathbf { w } _ { i } ; \mathcal { D } _ { i } ) ] , \forall i \in [ N ] . } \end{array}
69
+ $$
70
+
71
+ Here $\mathcal { R } _ { i }$ denotes the task-specific robustness regularizer, and the choice of $( \gamma _ { \mathrm { i n } } , \gamma _ { \mathrm { o u t } } )$ determines the specific scenario of robustness-promoting MAML. Clearly, the direct application is to set $\gamma _ { \mathrm { i n } } > 0$ and $\gamma _ { \mathrm { o u t } } ~ > ~ 0$ , that is, both fine-tuning and meta-update steps would be carried out using robust training, which calls additional loops to generate adversarial examples. Thus, this would make computation most intensive. Spurred by that, we ask: Is it possible to achieve a robust meta-model by incorporating robust regularization into only either meta-update or fine-tuning step (corresponding to $\gamma _ { \mathrm { i n } } = 0$ or $\gamma _ { \mathrm { o u t } } = 0 .$ )?
72
+
73
+ Second, both MAML in (1) and AT in (2) are challenging bi-level optimization problems which need to call inner optimization routines for fine-tuning and attack generation, respectively. Thus, we ask whether or not the computationally-light alternatives of inner solvers, e.g., partial fine-tuning (Raghu et al., 2019) and fast attack generation (Wong et al., 2020), can promise adversarial robustness in few-shot learning.
74
+
75
+ Third, it has been shown that adversarial robustness can benefit from semi-supervised learning by leveraging (unlabeled) data augmentation (Carmon et al., 2019; Stanforth et al., 2019). Spurred by that, we further ask: Is it possible to generalize robustness-promoting MAML to the setup of semi-supervised learning for improved accuracy-robustness tradeoff?
76
+
77
+ # 3 WHEN TO INCORPORATE ROBUST REGULARIZATION IN MAML?
78
+
79
+ In this section, we evaluate at which stage adversarial robustness can be gained during meta-training. We will provide insights and step-by-step investigations to show when to incorporate robust training in MAML and why it works. Based on (3), we focus on two robustness-promoting meta-training protocols. (a) $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { b o t h } }$ , where robustness regularization applied to both fine-tuning and meta-update steps with $\gamma _ { \mathrm { i n } } , \gamma _ { \mathrm { o u t } } > 0$ ; (b) $\mathrm { R - M A M L _ { o u t } }$ , where robust regularization applied to meta-update only, i.e., $\gamma _ { \mathrm { i n } } = 0$ and $\gamma _ { \mathrm { o u t } } > 0$ . Compared to $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { b o t h } }$ , $\mathrm { R - M A M L _ { o u t } }$ is more user-friendly since it allows the use of standard fine-tuning over the learnt robust meta-model when tackling unseen few-shot test tasks (known as meta-testing). In what follows, we will show that even if $\mathrm { R - M A M L _ { o u t } }$ does not use robust regularization in fine-tuning, it is sufficient to warrant the transferability of meta-model’s robustness to downstream fine-tuning tasks.
80
+
81
+ ![](images/5ad7d4cebdc07c0c34f554e4009dc1019326c4bce8f3aaab5a5243d77c8abfcd.jpg)
82
+ Figure 1: RA of meta-models trained by standard MAML, $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { b o t h } }$ and $\mathrm { R - M A M L _ { o u t } }$ versus PGD attacks of different perturbation sizes during meta-testing. Results show that robustness regularized meta-update with standard fine-tuning (namely, $\mathrm { R - M A M L _ { o u t } }$ ) has already been effective in promotion of robustness.
83
+
84
+ # All you need is robust meta-update during meta
85
+
86
+ training To study this claim, we solve problem (3) using $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { b o t h } }$ and $\mathrm { R - M A M L _ { o u t } }$ respectively in the 5-way 1-shot learning setup, where 1 data sample at each of 5 randomly selected MiniImagenet classes (Ravi $\&$ Larochelle, 2016) constructs a learning task. Throughout this section, we specify $\mathcal { R } _ { i }$ in (3) as the AT regularization, which calls a 10-step projected gradient descent (PGD) attack generation method with $\epsilon = 2 / 2 5 5$ in its inner maximization subroutine given by (2). We refer readers to Section 6 for more implementation details.
87
+
88
+ We find that the meta-model acquired by $\mathrm { R - M A M L _ { o u t } }$ yields nearly the same robust accuracy (RA) as $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { b o t h } }$ against various PGD attacks generated at the testing phase using different perturbation sizes $\epsilon = \{ 0 , 2 , \ldots , 1 0 \} / 2 5 5$ as shown in Figure 1. Unless specified otherwise, we evaluate the performance of the meta-learning schemes over 2400 random unseen 5-way 1-shot test tasks. We also note that RA under $\epsilon = 0$ becomes the standard accuracy (SA) evaluated using benign (unperturbed) test examples. It is clear from Figure 1 that both $\mathrm { R - M A M L _ { o u t } }$ and $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { b o t h } }$ can yield significantly better RA than MAML with slightly worse SA. It is also expected that RA decreases as the attack power $\epsilon$ increases.
89
+
90
+ Spurred by experiment results in Figure 1, we hypothesize that the promotion of robustness in meta-update alone (i.e. $\mathrm { R - M A M L _ { o u t } }$ ) is already sufficient to offer robust representation, over which fine-tuned models can preserve robustness to downstream tasks. In what follows, we justify the above hypothesis from two perspectives: (i) explanation of learned neuron’s representation and (ii) resilience of learnt robust meta-model to different fine-tuning schemes at the metatesting phase.
91
+
92
+ (i) Learned signature of neuron’s representation It is recently shown in (Engstrom et al., 2019) that a robust model exhibits perceptually-aligned neuron activation maps, which are not present if the model lacks adversarial robustness. To uncover such a signature of robustness, a feature inversion technique (Engstrom et al., 2019) is applied to finding an inverted input attribution map (IAM) that maximizes neuron’s activation. Based on that, we examine if $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { b o t h } }$ and $\mathrm { R - M A M L _ { o u t } }$ can similarly generate explainable inverted images from the learned neuron’s representation. We refer readers to Appendix 2 for more details on feature inversion from neuron’s activation.
93
+
94
+ ![](images/9af13fb40c06fc6734f9e69b111566c1056f136766d7cc407cd8bcf16baa5eb1.jpg)
95
+ Figure 2: Visualization of a randomly selected neuron’s inverted input attribution maps (IAMs) under different meta-models. The first row shows the seed images. The second-fourth rows show IAMs corresponding to models trained by MAML, $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { b o t h } }$ and $\mathrm { R - M A M L _ { o u t } }$ , respectively. Except MAML, R-MAMLboth and $\mathbf { R } { \cdot } \mathbf { M A M L _ { o u t } }$ all catch high-level features from the data.
96
+
97
+ In our experiment, we indeed find that both $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { b o t h } }$ and $\mathrm { R - M A M L _ { o u t } }$ yield similar IAMs inverted from neuron’s activation at different input examples, as plotted in Figure 2. More intriguingly, the learnt IAMs characterize the contour of objects existed in input images, and accompanied by the learnt high-level features, e.g., colors. In contrast, the IAMs of MAML lack such an interpretability The observations from the interpretability of neurons’ representation justify why R-MAML $\mathrm { \bf { o u t } }$ is a effective as $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { b o t h } }$ and why MAML does not preserve robustness.
98
+
99
+ (ii) Robust meta-update provides robustness adaptation without additional adversarial fine-tuning at meta-testing Meta-testing includes only the fine-tuning stage. Therefore, we need to explore if standard finetuning is enough to maintain the robustness. Suppose that $\mathrm { R - M A M L _ { o u t } }$ is adopted as the meta-training method to solve problem (3), we then ask if robustness-regularized meta-testing strategy can improve the robustness of finetuned model at downstream tasks. Surprisingly, we find that making an additional effort to adversarially fine-tune the meta-model (trained by $\mathrm { R - M A M L _ { o u t } }$ ) during testing does not provide an obvious robustness improvement over the standard fine-tuning scheme during testing (Table 1). This consistently implies that robust meta-update $\mathrm { ( R - M A M L _ { o u t } ) }$ ) is sufficient to render intrinsic robustness in its learnt meta-model regardless of fine-tuning strategies used at meta-testing. Figure S1 in Appendix 3 provides evidence that the visualization difference is small between before standard fine-tuning and after standard fine-tuning.
100
+
101
+ Table 1: Comparison of different strategies in meta-testing on $\mathbf { R } { \cdot } \mathbf { M A M L _ { o u t } }$ : (a) standard fine-tuning (S-FT), (b) adversarial fine-tuning (A-FT).
102
+
103
+ <table><tr><td></td><td>S-FT</td><td>A-FT</td></tr><tr><td>SA</td><td>40.9%</td><td>39.6%</td></tr><tr><td>RA</td><td>22.9%</td><td>23.5%</td></tr></table>
104
+
105
+ Adversarial querying (AQ) (Goldblum et al., 2019): A special case of $\mathbf { R } { \cdot } \mathbf { M A M L } _ { \mathrm { o u t } }$ The recent work (Goldblum et al., 2019) developed AQ to improve adversarial robustness in few-shot learning.
106
+
107
+ AQ can be regarded as a special case of $\mathrm { R - M A M L _ { o u t } }$ with $\gamma _ { \mathrm { i n } } = 0$ but setting $\gamma _ { \mathrm { o u t } } = \infty$ in (3). That is, the meta-update is overridden by the AT regularization. We find that AQ yields about $2 \%$ RA improvement over $\mathrm { R - M A M L _ { o u t } }$ , which uses $\gamma _ { \mathrm { o u t } } = 0 . 2$ in (3). However, AQ leads to $1 1 \%$ degradation in SA, and thus makes a much poorer robustness-accuracy tradeoff than our proposed $\mathrm { R - M A M L _ { o u t } }$ . We refer readers to Table 2 for comparison of the proposed $\mathrm { R - M A M L _ { o u t } }$ with other training baselines. Most importantly, different from (Goldblum et al., 2019), we provide insights on why $\mathrm { R - M A M L _ { o u t } }$ is effective in promoting adversarial robustness from meta-update to fine-tuning.
108
+
109
+ # 4 COMPUTATIONALLY-EFFICIENT ROBUSTNESS-REGULARIZED MAML
110
+
111
+ In this section, we study if the proposed $\mathrm { R - M A M L _ { o u t } }$ can further be improved to ease of optimization given the two computation difficulties in (3): (a) bi-leveled meta-learning, and (b) the need of inner maximization to find the worst-case robust regularization. To tackle either problem alone, there have been efficient solution methods proposed recently. In (Raghu et al., 2019), an almostno-inner-loop (ANIL) fine-tuning strategy was proposed, where fine-tuning is only applied to the task-specific classification head following a frozen representation network inherited from the metamodel. Moreover, in (Wong et al., 2020), a fast gradient sign method (FGSM) based attack generator was leveraged to improve the efficiency of AT without losing its adversarial robustness. Motivated by (Raghu et al., 2019; Wong et al., 2020), we ask if integrating $\mathrm { R - M A M L _ { o u t } }$ with ANIL and/or FGSM can improve the training efficiency but preserves the robustness and generalization-ability of a meta-model learnt from $\mathrm { R - M A M L _ { o u t } }$ .
112
+
113
+ $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { o u t } }$ meets ANIL and FGSM We decompose the meta-model $\mathbf { w } = [ \mathbf { w } _ { \mathrm { r } } , \mathbf { w } _ { \mathrm { c } } ]$ into two parts: representation encoding network $\mathbf { w } _ { \mathrm { r } }$ and classification head ${ \bf w } _ { \mathrm { c } }$ . In $\mathrm { R - M A M L _ { o u t } }$ , namely, (3) with $\gamma _ { \mathrm { i n } } = 0$ , ANIL suggests to only fine-tune ${ \bf w } _ { \mathrm { c } }$ over a specific task $\mathcal { T } _ { i }$ . This leads to
114
+
115
+ $$
116
+ \begin{array} { r } { \mathbf { w } _ { \mathrm { c } , i } ^ { \prime } = \underset { \mathbf { w } _ { \mathrm { c } , i } } { \arg \operatorname* { m i n } } \ell _ { i } ( \mathbf { w } _ { \mathrm { c } , i } , \mathbf { w } _ { \mathrm { r } } ; \mathcal { D } _ { i } , \mathbf { w } ) , \mathrm { ~ w i t h ~ } \mathbf { w } _ { \mathrm { r } , i } ^ { \prime } = \mathbf { w } _ { \mathrm { r } } . } \end{array}
117
+ $$
118
+
119
+ In ANIL, the initialized representation network $\mathbf { w } _ { \mathrm { r } }$ keeps intact during task-specific fine-tuning, which thus saves the computation cost. Furthermore, if FGSM is used in $\mathrm { R - M A M L _ { o u t } }$ , then the robustness regularizer $\mathcal { R }$ defined in (2) reduces to
120
+
121
+ $$
122
+ \mathcal { R } ( \mathbf { w } ; \mathcal { D } ) = \mathbb { E } _ { ( \mathbf { x } , y ) \in \mathcal { D } } [ g ( \mathbf { w } ; \mathbf { x } + \delta ^ { * } ( \mathbf { x } ) , y ) ] , \quad \delta ^ { * } ( \mathbf { x } ) = \delta _ { 0 } + \epsilon \nabla _ { \mathbf { x } } g ( \mathbf { w } ; \mathbf { x } , y ) ,
123
+ $$
124
+
125
+ where $\delta _ { 0 }$ is an initial point randomly drawn from a uniform distribution over the interval $[ - \epsilon , \epsilon ]$ . Note that in the original implementation of robust regularization $\mathcal { R }$ , a multi-step projected gradient ascent (PGA) is typically used to optimize the sample-wise adversarial perturbation ${ \pmb \delta } ( { \bf w } )$ . By contrast, FGSM only uses one-step PGA in attack generation and thus improves the computation efficiency.
126
+
127
+ In Table 2, we study two computationally-light alternatives of $\mathrm { R - M A M L _ { o u t } }$ , $\mathrm { R - M A M L _ { o u t } }$ with ANIL $( \mathbf { R - M A M L _ { o u t } }$ -ANIL) and $\mathrm { R - M A M L _ { o u t } }$ with FGSM $\mathrm { ( R - M A M L _ { o u t } ) }$ -FGSM). Compared to $\mathrm { R - M A M L _ { o u t } }$ , we find that although $\mathrm { R - M A M L _ { o u t } }$ -FGSM takes less computation time, it yields even better RA with slightly worse SA. By contrast, $\mathbf { R } { \cdot } \mathbf { M A M L } _ { \mathrm { o u t } }$ -ANIL yields the least computation cost but the worst SA
128
+
129
+ Table 2: Performance of computation-efficient alternatives of $\mathbf { R } { \cdot } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } }$ in SA, RA and computation time per epoch (in minutes).
130
+
131
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SA</td><td rowspan=1 colspan=1>RA</td><td rowspan=1 colspan=1>Time</td></tr><tr><td rowspan=1 colspan=1>MAML</td><td rowspan=1 colspan=1>43.6%</td><td rowspan=1 colspan=1>3.17%</td><td rowspan=1 colspan=1>42min</td></tr><tr><td rowspan=1 colspan=1>AQ (Goldblum et al., 2019)</td><td rowspan=1 colspan=1>29.6%</td><td rowspan=1 colspan=1>24.9%</td><td rowspan=1 colspan=1>52min</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout</td><td rowspan=1 colspan=1>40.9%</td><td rowspan=1 colspan=1>22.9%</td><td rowspan=1 colspan=1>54min</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-ANIL</td><td rowspan=1 colspan=1>37.46%</td><td rowspan=1 colspan=1>22.7%</td><td rowspan=1 colspan=1>36min</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-FGSM</td><td rowspan=1 colspan=1>40.82%</td><td rowspan=1 colspan=1>23.04%</td><td rowspan=1 colspan=1>44min</td></tr></table>
132
+
133
+ and RA. For comparison, we also present the performance of the adversarial meta-learning baseline AQ (Goldblum et al., 2019). As we can see, AQ promotes the adversarial robustness at the cost of a significant SA drop, e.g., $7 . 5 6 \%$ worse than $\mathrm { R - M A M L _ { o u t } }$ -ANIL. Overall, the application of FGSM to $\mathrm { R - M A M L _ { o u t } }$ provides the most graceful tradeoff between the computation cost and the standard and robust accuracies. In the rest of the paper, unless specified otherwise we will use FGSM in $\mathrm { R - M A M L _ { o u t } }$ .
134
+
135
+ # 5 SEMI-SUPERVISED ROBUSTNESS-PROMOTING MAML
136
+
137
+ Given our previous solutions to when (Sec. 3) and how (Sec. 4) a robust regularization could effectively be promoted in few-shot learning, we next ask: Is it possible to further improve our proposal $\mathrm { R - M A M L _ { o u t } }$ by leveraging unlabeled data? Such a question is motivated from two aspects. First, the use of unlabeled data augmentation could be a key momentum to improve the robustnessaccuracy tradeoff (Carmon et al., 2019; Stanforth et al., 2019). Second, the recent success in selfsupervised contrastive representation learning (Chen et al., 2020b; He et al., 2020) demonstrates the power of multi-view (unlabeled) data augmentation to acquire discriminative and generalizable visual representations, which can guide down-stream supervised learning. In what follows, we propose an extension of $\mathrm { R - M A M L _ { o u t } }$ applicable to semi-supervised learning with unlabeled data augmentation.
138
+
139
+ $\mathbf { R } { \cdot } \mathbf { M A M L } _ { \mathrm { o u t } }$ with TRADES regularization. We recall from (2) that the robust regularization $\mathcal { R }$ can also be specified by TRADES (Zhang et al., 2019b), which relies only on the prediction logits of benign and adversarial examples (rather than the training label), and thus lends itself to the application of unlabeled data. Spurred by that, we propose $\mathrm { R - M A M L _ { o u t } }$ -TRADES, which is a variant of $\mathrm { R - M A M L _ { o u t } }$ using the unlabeled data augmented TRADES regularization. To perform data augmentation in experiments, we follow (Carmon et al., 2019) to mine additional (unlabeled) data with the same amount of MiniImagenet data from the original ImageNet data set. For clarity, we call $\mathrm { R - M A M L _ { o u t } }$ using TRADES or AT regularization (but without unlabeled data augmentation) $\mathrm { R - M A M L _ { o u t } }$ (TRADES) or $\mathbf { R } { \mathbf { - } } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } } ( \mathbf { A } \mathbf { T } )$ .
140
+
141
+ We find that with the help of unlabeled data, $\mathrm { R - M A M L _ { o u t } }$ -TRADES improves the accuracyrobustness tradeoff over its supervised counterpart $\mathrm { R - M A M L _ { o u t } }$ using either AT or TRADES regularization (Figure 3). Compared to $\mathrm { R - M A M L _ { o u t } }$ , $\mathrm { R - M A M L _ { o u t } }$ -TRADES yields consistently better RA against different attack strength $\epsilon \in \{ 2 , . . . , 1 0 \} / 2 5 5$ during testing. Interestingly, the improvement becomes more significant as $\epsilon$ increases. As $\epsilon \ = \ 0$ , RA is equivalent to SA, and we observe that the superior performance of $\mathrm { R - M A M L _ { o u t } }$ -TRADES in RA bears a slight degradation in SA compared to $\mathrm { R - M A M L _ { o u t } }$ (TRADES) and $\mathbf { R } { \mathbf { - } } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } } ( \mathbf { A } \mathbf { T } )$ , which indicates the robustness-accuracy tradeoff. Figure S2 in Appendix 5 provides an additional evidence that $\mathrm { R - M A M L _ { o u t } }$ -TRADES has the ability to defend stronger attacks than $\mathbf { R } { \cdot } \mathbf { M A M L } _ { \mathrm { o u t } }$ , and proper unlabeled data augmentation can further improve the accuracy-robustness tradeoff in MAML.
142
+
143
+ ![](images/6b409ce15e4726cb3caef2aaebfc918af41a62c697bef133cb511b990b61d3eb.jpg)
144
+ Figure 3: RA versus (testing-phase) PGD attacks at different values of perturbation strength $\epsilon$ . Here the robust models are trained by different variants of $\mathrm { R - M A M L _ { o u t } }$ , including $\mathrm { R - M A M L _ { o u t } }$ -TRADES (with unlabeled data augmentation), $\mathbf { R } { - } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } }$ using AT regularization but no data augmentation $\mathrm { ( R \mathrm { - } M A M L _ { o u t } ( A T ) ) }$ ), and $\mathbf { R } { - } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } }$ using TRADES regularization but no data augmentation (R-MAML $\scriptstyle \mathtt { o u t }$ (TRADES)).
145
+
146
+ $\mathbf { R } { \mathbf { - M A M L } } _ { \mathrm { o u t } }$ with contrastive learning (CL). To improve adversarial robustness, many works, e.g., (Pang et al., 2019; Sankaranarayanan et al., 2017), also suggest that it is important to encourage robust semantic features that locally cluster according to class, namely, ensuring that features of samples in the same class will lie close to each other and away from those of different classes. The above suggestion aligns with the goals of contrastive learning (CL) (Chen et al., 2020b; Wang & Isola, 2020), which promotes (a) alignment (closeness) of features from positive data pairs, and (b) uniformity of feature distribution. Thus, we develop $\mathrm { R - M A M L _ { o u t } { - } C I }$ L by integrating $\mathrm { R - M A M L _ { o u t } }$ with CL.
147
+
148
+ Prior to defining $\mathbf { R } \mathbf { - } \mathbf { M A M L } _ { \mathrm { o u t } } .$ CL, we first introduce CL and refer readers to (Chen et al., 2020b) for details. Given a data sample $\mathbf { x }$ , CL utilizes its positive counterpart $\mathbf { x } ^ { + }$ given by a certain data transformation $t$ , e.g., cropping and resizing, cut-out, and rotation, $\mathbf { x } ^ { + } ~ = ~ t ( \mathbf { x } )$ . The data pair $( { \bf x } , t ( { \bf x } ^ { \prime } ) )$ is then positive if $\mathbf { x } = \mathbf { x } ^ { \prime }$ , and negative otherwise. The contrastive loss is defined by
149
+
150
+ $$
151
+ \ell _ { \mathrm { C L } } ( \mathbf { w } _ { \mathrm { c } } ; p ^ { + } ) = \mathbb { E } _ { ( \mathbf { x } , \mathbf { x } ^ { + } ) \sim p ^ { + } } \left[ - \log \frac { e ^ { \mathbf { r } ( \mathbf { x } ; \mathbf { w } _ { \mathrm { c } } ) ^ { T } \mathbf { r } ( \mathbf { x } ^ { + } ; \mathbf { w } _ { \mathrm { c } } ) / \tau } } { e ^ { \mathbf { r } ( \mathbf { x } ; \mathbf { w } _ { \mathrm { c } } ) ^ { T } \mathbf { r } ( \mathbf { x } ^ { + } ; \mathbf { w } _ { \mathrm { c } } ) / \tau } + \sum _ { \mathbf { x } ^ { - } \sim p , ( \mathbf { x } , \mathbf { x } ^ { - } ) \not \in p ^ { + } } \left[ e ^ { \mathbf { r } ( \mathbf { x } ; \mathbf { w } _ { \mathrm { c } } ) ^ { T } \mathbf { r } ( \mathbf { x } ^ { - } ; \mathbf { w } _ { \mathrm { c } } ) / \tau } \right] } \right] ,
152
+ $$
153
+
154
+ where $\mathbf { x } ~ \sim ~ p$ denotes the data distribution, $p ^ { + } ( \cdot , \cdot )$ is the distribution of positive pairs, $\mathbf { r } ( \mathbf { x } ; \mathbf { w } _ { \mathrm { c } } )$ is the encoded representation of $\mathbf { x }$ extracted from the representation network ${ \bf w } _ { \mathrm { c } }$ , and $\tau > 0$ is a temperature parameter. The contrastive loss minimizes the distance of a positive pair among many negative pairs, namely, learns network representation with instance-wise discriminative power.
155
+
156
+ According to CL, we then augment the data used to train $\mathbf { R } { - } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } }$ with their transformed counterparts. In addition, the adversarial examples generated during robust regularization can also be used as additional views of the original data, which in turn advance CL. Formally, we modify $\mathrm { R - M A M L _ { o u t } }$ , given by (3) with $\gamma _ { \mathrm { i n } } = 0$ , as
157
+
158
+ $$
159
+ \begin{array} { r l } { { \sf z e } } & { \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left[ \ell _ { i } ^ { \prime } ( { \bf w } _ { i } ^ { \prime } ; \mathcal { D } _ { i } ^ { \prime } ) + \gamma _ { \mathrm { o u t } } \mathcal { R } _ { i } ( { \bf w } _ { i } ^ { \prime } ; \mathcal { D } _ { i } ^ { \prime } ) + \gamma _ { \mathrm { C L } } \ell _ { \mathrm { C L } } ( { \bf w } _ { \mathrm { c } , i } ^ { \prime } ; p _ { i } ^ { + } \cup p _ { i } ^ { \mathrm { a d v } } ) \right] } \\ { { \sf t o } } & { { \bf w } _ { i } ^ { \prime } = \arg \operatorname* { m i n } _ { { \bf w } _ { i } } \ell _ { i } ( { \bf w } _ { i } ; \mathcal { D } _ { i } , { \bf w } ) , \forall i \in [ N ] , } \end{array}
160
+ $$
161
+
162
+ where $\gamma _ { \mathrm { C L } } > 0$ is a regularization parameter associated with the contrastive loss, $p _ { i } ^ { + } \cup p _ { i } ^ { \mathrm { a d v } }$ represents the distribution of positive data pairs constructed by the standard and adversarial views of $\mathcal { D } ^ { \prime }$ , and $\mathbf { w } _ { \mathrm { c } , i } ^ { \prime }$ denotes the representation block of the model $\mathbf { w } _ { i } ^ { \prime }$ .
163
+
164
+ In Table 3, we compare the SA/RA performance of $\mathrm { R - M A M L _ { o u t } { - C l } }$ L with that of previously-suggested 3 variants of R-MAMLout including the versions $\mathbf { R } { \mathbf { - } } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } } ( \mathbf { A } \mathbf { T } )$ and R-MAML $\scriptstyle \mathrm { \mathtt { o u t } }$ (TRADES) without using unlabeled data, and the version with unlabeled data $\mathrm { R - M A M L _ { o u t } }$ -TRADES, as well as 2 baseline methods including standard MAML and adversarial querying (AQ) in few-shot learning (Goldblum et al., 2019). Note that we specify $\mathcal { R } _ { i }$ in
165
+
166
+ Table 3: SA/RA performance of $\mathbf { R } { - } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } }$ -CL versus other variants of proposed $\mathbf { R } { \cdot } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } }$ and baselines.
167
+
168
+ <table><tr><td rowspan=1 colspan=1>SA</td><td rowspan=1 colspan=1>RA</td></tr><tr><td rowspan=1 colspan=1>MAML</td><td rowspan=1 colspan=1>43.6%</td><td rowspan=1 colspan=1>3.17%</td></tr><tr><td rowspan=1 colspan=1>AQ(Goldblum et al.,2019)</td><td rowspan=1 colspan=1>29.6%</td><td rowspan=1 colspan=1>24.9%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout(AT) (ours)</td><td rowspan=1 colspan=1>40.82%</td><td rowspan=1 colspan=1>23.04%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout(TRADES) (ours)</td><td rowspan=1 colspan=1>39.06%</td><td rowspan=1 colspan=1>23.56%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-TRADES (ours)</td><td rowspan=1 colspan=1>37.1%</td><td rowspan=1 colspan=1>25.51%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-CL (ours)</td><td rowspan=1 colspan=1>38.60%</td><td rowspan=1 colspan=1>26.81%</td></tr></table>
169
+
170
+ (4) as TRADES regularization for $\mathrm { R } { - } \mathrm { M A M L } _ { \mathrm { o u t } } { - }$ CL. We find that $\mathrm { R - M A M L _ { o u t } }$ -CL yields the best RA among all meta-learning methods, and improves SA over $\mathrm { R - M A M L _ { o u t } }$ -TRADES. In particular, the comparison with AQ shows that $\mathrm { R - M A M L _ { o u t } }$ -CL leads to $9 \%$ improvement in SA and $1 . 9 \%$ improvement in RA.
171
+
172
+ # 6 ADDITIONAL EXPERIMENTS
173
+
174
+ # Key facts of our implementation.
175
+
176
+ In the previous analysis, we consider 1-shot 5-way image classification tasks over MiniImageNet (Vinyals et al., 2016). And we use a four-layer convolutional neural network for few-shot learning (FSL). By default, we set the training attack strength $\epsilon = 2$ , $\gamma _ { \mathrm { C L } } = 0 . 1$ , and set
177
+
178
+ Table 4: Summary of baseline performance in SA and TA.
179
+
180
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SA</td><td rowspan=1 colspan=1>RA</td></tr><tr><td rowspan=1 colspan=1>MAML (FSL)</td><td rowspan=1 colspan=1>43.6%</td><td rowspan=1 colspan=1>3.17%</td></tr><tr><td rowspan=1 colspan=1>AQ (FSL) (Goldblum et al., 2019)</td><td rowspan=1 colspan=1>29.6%</td><td rowspan=1 colspan=1>24.9%</td></tr><tr><td rowspan=1 colspan=1>Supervised standard training (non-FSL)</td><td rowspan=1 colspan=1>29.74%</td><td rowspan=1 colspan=1>3.51%</td></tr><tr><td rowspan=1 colspan=1>Supervised AT (non-FSL)</td><td rowspan=1 colspan=1>28.22%</td><td rowspan=1 colspan=1>19.02%</td></tr></table>
181
+
182
+ $\gamma _ { \mathrm { o u t } } = 5$ (TRADES), $\gamma _ { \mathrm { o u t } } = 0 . 2$ (AT) via a grid search. During meta-testing, a 10-step PGD attack with attack strength $\epsilon = 2$ is used to evaluate RA of the learnt meta-model over 2400 few-shot test tasks. We provide experiment details in Appendix 4.
183
+
184
+ Summary of baselines. We remark that in addition to MAML and AQ baselines, we also consider the other two baseline methods, supervised standard training over the entire dataset (non-FSL setting), and supervised AT over the entire dataset (non-FSL setting); see a summary in Table 4. The additional baselines demonstrate that robust adaptation in FSL is non-trivial as neither the supervised full AT or the full standard training can achieve satisfactory SA and RA.
185
+
186
+ Experiments on Additional model architecture, datasets and FSL setups. In Table S1 of Appendix 5, we provide additional experiments using ResNet18. In particular, $\mathrm { R - M A M L _ { o u t } }$ -CL leads to $1 3 . 9 4 \%$ SA improvement and $1 . 4 2 \%$ RA improvement over AQ. We also test our methods on CIFAR-FS (Bertinetto et al., 2018) and Omniglot (Lake et al., 2015), and provide the results in Table 5 and Figure S3, respectively (more details can be viewed in Appendix 6 and Appendix 7). The results show that our methods perform well on various datasets and outperform the baseline methods. On CIFAR-FS, we study 1-Shot 5-Way and 5-Shot 5-Way settings. As shown in Table 5, the use of unlabeled data augmentation $( \mathbf { R } { - } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } } { - } \mathbf { C } \mathbf { L }$ ) on CIFAR-FS can provide $1 0 \%$ (or $5 . 6 \%$ ) SA improvement and $3 \%$ (or $1 . 3 \%$ ) RA improvement over AQ under the 1-Shot 5-Way (or 5-Shot 5- Way) setting. Furthermore, we conduct experiments in other FSL setups. On Omniglot, we compare R-MAML $\scriptstyle \prime _ { \mathrm { o u t } }$ (TRADES) to AQ (Goldblum et al., 2019) in the 1-shot (5, 10, 15, 20)-Way settings. Figure S3 shows that R-MAML $\mathrm { \bf { o u t } }$ (TRADES) can always obtain better performance than AQ when the number of classes in each task varies.
187
+
188
+ Table 5: SA/RA performance of our proposed methods on CIFAR-FS (Bertinetto et al., 2018).
189
+
190
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=2>1-Shot 5-Way</td><td rowspan=1 colspan=2>5-Shot 5-Way</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SA</td><td rowspan=1 colspan=1>RA</td><td rowspan=1 colspan=1>SA</td><td rowspan=1 colspan=1>RA</td></tr><tr><td rowspan=1 colspan=1>MAML</td><td rowspan=1 colspan=1>51.07%</td><td rowspan=1 colspan=1>0.235%</td><td rowspan=1 colspan=1>67.2%</td><td rowspan=1 colspan=1>0.225%</td></tr><tr><td rowspan=1 colspan=1>AQ(Goldblum et al.,2019)</td><td rowspan=1 colspan=1>31.25%</td><td rowspan=1 colspan=1>26.34%</td><td rowspan=1 colspan=1>52.32%</td><td rowspan=1 colspan=1>33.96%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout(AT) (ours)</td><td rowspan=1 colspan=1>39.76%</td><td rowspan=1 colspan=1>26.15%</td><td rowspan=1 colspan=1>57.18%</td><td rowspan=1 colspan=1>32.62%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout(TRADES) (ours)</td><td rowspan=1 colspan=1>40.23%</td><td rowspan=1 colspan=1>27.45%</td><td rowspan=1 colspan=1>57.46%</td><td rowspan=1 colspan=1>34.72%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-TRADES (ours)</td><td rowspan=1 colspan=1>40.59%</td><td rowspan=1 colspan=1>28.06%</td><td rowspan=1 colspan=1>57.62%</td><td rowspan=1 colspan=1>34.76%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-CL (ours)</td><td rowspan=1 colspan=1>41.25%</td><td rowspan=1 colspan=1>29.33%</td><td rowspan=1 colspan=1>57.95%</td><td rowspan=1 colspan=1>35.30%</td></tr></table>
191
+
192
+ # 7 CONCLUSION
193
+
194
+ In this paper, we study the problem of adversarial robustness in MAML. Beyond directly integrating MAML with robust training, we show and explain when a robust regularization should be promoted in MAML. We find that robustifying the meta-update stage via fast attack generation method is sufficient to achieve fast robustness adaptation without losing generalization and computation efficiency in general. To further improve our proposal, we for the first time study how unlabeled data help robust MAML. In particular, we propose using contrastive representation learning to acquire improved generalization and robustness simultaneously. Extensive experiments are provided to demonstrate the effectiveness of our approach and justify our insights on the adversarial robustness of MAML. In the future, we plan to establish the convergence rate analysis of robustness-aware MAML by leveraging bi-level and min-max optimization theories.
195
+
196
+ # ACKNOWLEDGEMENT
197
+
198
+ This work was supported by the Rensselaer-IBM AI Research Collaboration (http://airc.
199
+ rpi.edu), part of the IBM AI Horizons Network (http://ibm.biz/AIHorizons).
200
+
201
+ # REFERENCES
202
+
203
+ Maksym Andriushchenko and Nicolas Flammarion. Understanding and improving fast adversarial training. arXiv preprint arXiv:2007.02617, 2020.
204
+
205
+ Luca Bertinetto, Joao F Henriques, Philip Torr, and Andrea Vedaldi. Meta-learning with differentiable closed-form solvers. In International Conference on Learning Representations, 2018.
206
+
207
+ Nicholas Carlini, Anish Athalye, Nicolas Papernot, Wieland Brendel, Jonas Rauber, Dimitris Tsipras, Ian Goodfellow, Aleksander Madry, and Alexey Kurakin. On evaluating adversarial robustness. arXiv preprint arXiv:1902.06705, 2019.
208
+
209
+ Yair Carmon, Aditi Raghunathan, Ludwig Schmidt, John C Duchi, and Percy S Liang. Unlabeled data improves adversarial robustness. In Advances in Neural Information Processing Systems, pp. 11190–11201, 2019.
210
+
211
+ Alvin Chan, Yi Tay, and Yew-Soon Ong. What it thinks is important is important: Robustness transfers through input gradients. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 332–341, 2020.
212
+
213
+ Tianlong Chen, Sijia Liu, Shiyu Chang, Yu Cheng, Lisa Amini, and Zhangyang Wang. Adversarial robustness: From self-supervised pre-training to fine-tuning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 699–708, 2020a.
214
+
215
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020b.
216
+
217
+ Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 215–223, 2011.
218
+
219
+ Krishnamurthy Dvijotham, Sven Gowal, Robert Stanforth, Relja Arandjelovic, Brendan O’Donoghue, Jonathan Uesato, and Pushmeet Kohli. Training verified learners with learned verifiers. arXiv preprint arXiv:1805.10265, 2018.
220
+
221
+ Logan Engstrom, Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Brandon Tran, and Aleksander Madry. Adversarial robustness as a prior for learned representations. arXiv preprint arXiv:1906.00945, 2019.
222
+
223
+ Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017.
224
+
225
+ Micah Goldblum, Liam Fowl, and Tom Goldstein. Adversarially robust few-shot learning: A metalearning approach. arXiv, pp. arXiv–1910, 2019.
226
+
227
+ Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
228
+
229
+ Han Xu Yao Ma Hao-Chen, Liu Debayan Deb, Hui Liu Ji-Liang Tang Anil, and K Jain. Adversarial attacks and defenses in images, graphs and text: A review. International Journal of Automation and Computing, 17(2):151–178, 2020.
230
+
231
+ Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 9729–9738, 2020.
232
+
233
+ Dan Hendrycks, Kimin Lee, and Mantas Mazeika. Using pre-training can improve model robustness and uncertainty. In International Conference on Machine Learning, pp. 2712–2721, 2019.
234
+
235
+ Po-Sen Huang, Chenglong Wang, Rishabh Singh, Wen-tau Yih, and Xiaodong He. Natural language to structured query generation via meta-learning. arXiv preprint arXiv:1803.02400, 2018.
236
+
237
+ Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML deep learning workshop, volume 2. Lille, 2015.
238
+
239
+ Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015.
240
+
241
+ Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
242
+
243
+ Gabriel Maicas, Andrew P Bradley, Jacinto C Nascimento, Ian Reid, and Gustavo Carneiro. Training medical image analysis systems like radiologists. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 546–554. Springer, 2018.
244
+
245
+ Tsendsuren Munkhdalai and Hong Yu. Meta networks. Proceedings of machine learning research, 70:2554, 2017.
246
+
247
+ Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018.
248
+
249
+ Joseph D Novak and D Bob Gowin. Learning how to learn. cambridge University press, 1984.
250
+
251
+ Tianyu Pang, Kun Xu, Chao Du, Ning Chen, and Jun Zhu. Improving adversarial robustness via promoting ensemble diversity. arXiv preprint arXiv:1901.08846, 2019.
252
+
253
+ Aniruddh Raghu, Maithra Raghu, Samy Bengio, and Oriol Vinyals. Rapid learning or feature reuse? towards understanding the effectiveness of maml. arXiv preprint arXiv:1909.09157, 2019.
254
+
255
+ Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. 2016.
256
+
257
+ Hadi Salman, Andrew Ilyas, Logan Engstrom, Ashish Kapoor, and Aleksander Madry. Do adversarially robust imagenet models transfer better? arXiv preprint arXiv:2007.08489, 2020.
258
+
259
+ Swami Sankaranarayanan, Arpit Jain, Rama Chellappa, and Ser Nam Lim. Regularizing deep networks using efficient layerwise adversarial training. arXiv preprint arXiv:1705.07819, 2017.
260
+
261
+ Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In International conference on machine learning, pp. 1842–1850, 2016.
262
+
263
+ Ali Shafahi, Mahyar Najibi, Mohammad Amin Ghiasi, Zheng Xu, John Dickerson, Christoph Studer, Larry S Davis, Gavin Taylor, and Tom Goldstein. Adversarial training for free! In Advances in Neural Information Processing Systems, pp. 3353–3364, 2019.
264
+
265
+ Ali Shafahi, Parsa Saadatpanah, Chen Zhu, Amin Ghiasi, Christoph Studer, David Jacobs, and Tom Goldstein. Adversarially robust transfer learning. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ ryebG04YvB.
266
+
267
+ Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Advances in neural information processing systems, pp. 4077–4087, 2017.
268
+
269
+ Xingyou Song, Wenbo Gao, Yuxiang Yang, Krzysztof Choromanski, Aldo Pacchiano, and Yunhao Tang. Es-maml: Simple hessian-free meta learning. arXiv preprint arXiv:1910.01215, 2019.
270
+
271
+ Robert Stanforth, Alhussein Fawzi, Pushmeet Kohli, et al. Are labels required for improving adversarial robustness? arXiv preprint arXiv:1905.13725, 2019.
272
+
273
+ Jong-Chyi Su, Subhransu Maji, and Bharath Hariharan. When does self-supervision improve fewshot learning? arXiv preprint arXiv:1910.03560, 2019.
274
+
275
+ Sebastian Thrun and Lorien Pratt. Learning to learn. Springer Science & Business Media, 2012.
276
+
277
+ Francisco Utrera, Evan Kravitz, N Benjamin Erichson, Rajiv Khanna, and Michael W Mahoney. Adversarially-trained deep nets transfer better. arXiv preprint arXiv:2007.05869, 2020.
278
+
279
+ Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in neural information processing systems, pp. 3630–3638, 2016.
280
+
281
+ Guangting Wang, Chong Luo, Xiaoyan Sun, Zhiwei Xiong, and Wenjun Zeng. Tracking by instance detection: A meta-learning approach. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6288–6297, 2020.
282
+
283
+ Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. arXiv preprint arXiv:2005.10242, 2020.
284
+
285
+ Eric Wong and J Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. arXiv preprint arXiv:1711.00851, 2017.
286
+
287
+ Eric Wong, Leslie Rice, and J. Zico Kolter. Fast is better than free: Revisiting adversarial training. In International Conference on Learning Representations, 2020. URL https://openreview. net/forum?id $=$ BJx040EFvH.
288
+
289
+ Han Xu, Yaxin Li, Xiaorui Liu, Hui Liu, and Jiliang Tang. Yet meta learning can adapt fast, it can also break easily. arXiv preprint arXiv:2009.01672, 2020.
290
+
291
+ Kaidi Xu, Hongge Chen, Sijia Liu, Pin-Yu Chen, Tsui-Wei Weng, Mingyi Hong, and Xue Lin. Topology attack and defense for graph neural networks: An optimization perspective. In International Joint Conference on Artificial Intelligence (IJCAI), 2019a.
292
+
293
+ Kaidi Xu, Sijia Liu, Pu Zhao, Pin-Yu Chen, Huan Zhang, Quanfu Fan, Deniz Erdogmus, Yanzhi Wang, and Xue Lin. Structured adversarial attack: Towards general implementation and better interpretability. In International Conference on Learning Representations, 2019b.
294
+
295
+ Chengxiang Yin, Jian Tang, Zhiyuan Xu, and Yanzhi Wang. Adversarial meta-learning, 2018.
296
+
297
+ Dinghuai Zhang, Tianyuan Zhang, Yiping Lu, Zhanxing Zhu, and Bin Dong. You only propagate once: Accelerating adversarial training via maximal principle. arXiv preprint arXiv:1905.00877, 2019a.
298
+
299
+ Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P Xing, Laurent El Ghaoui, and Michael I Jordan. Theoretically principled trade-off between robustness and accuracy. International Conference on Machine Learning, 2019b.
300
+
301
+ SUPPLEMENTARY MATERIAL
302
+
303
+ # 1 FRAMEWORK OF R-MAMLout
304
+
305
+ Algorithm S1 shows the framework of $\mathrm { R - M A M L _ { o u t } }$ . The initial inputs include model weights $\mathbf { w }$ , distribution of the training tasks $p ( \mathcal { T } )$ , and the step sizes $\alpha , \beta _ { 1 } , \beta _ { 2 }$ , which correspond to fine-tuning, clean meta-update, adversarial meta-update. Each batch contains multiple tasks that are sampled from the $p ( \mathcal T )$ . $K$ is the number of gradient updates in fine-tuning. The adapted parameter ${ \bf { \bar { w } } } _ { i } ^ { ( K ) }$ is used to generate adversarial validation data $\hat { \mathcal { D } } _ { i } ^ { \prime }$ from the clean validation data $\mathcal { D } _ { i } ^ { \prime }$ and to compute the loss value $\mathcal { R } _ { i } ( \mathbf { w } _ { i } ^ { ( K ) } ; \hat { \mathcal { D } } _ { i } ^ { \prime } )$ . The attack generator can be selected from Projected Gradient Descent (Madry et al., 2017), Fast Gradient Sign Method (Goodfellow et al., 2014), etc. Here $\epsilon$ is used to control the attack strength in the training.
306
+
307
+ # Algorithm S1 R-MAMLout
308
+
309
+ Input: The initialization weights w; Distribution over tasks $p ( \mathcal T )$ ; Step size parameters $\alpha , \beta _ { 1 } , \beta _ { 2 }$ .
310
+ 1 while not done do
311
+ 2 Sample batch of tasks $\mathcal { T } _ { i } \sim p ( \mathcal { T } )$ and separate data in $\mathcal { T } _ { i }$ into $( \mathcal { D } _ { i } , \mathcal { D } _ { i } ^ { \prime } )$
312
+ 3 for each $\mathcal { T } _ { i }$ do
313
+ 4 $\mathbf { w } _ { i } ^ { ( 0 ) } : = \mathbf { w }$
314
+ 5 for $k = 1 , 2 , \cdots , K$ do
315
+ 6 $\mathbf { w } _ { i } ^ { ( k ) } = \mathbf { w } _ { i } ^ { ( k - 1 ) } - \alpha \nabla _ { \mathbf { w } _ { i } } \ell _ { i } ( \mathbf { w } _ { i } ^ { ( k - 1 ) } ; \mathcal { D } _ { i } , \mathbf { w } )$
316
+ 7 end for
317
+ 8 Using attack generator to generate adversarial validation data $\hat { \mathcal { D } } _ { i } ^ { \prime }$ by maximizing adversar
318
+ ial loss Ri(w(K)i ; Dˆ0i) with the constraint kDˆ0i − D0ik∞ ≤ 
319
+ 9 end for
320
+ 10 $\begin{array} { r l } & { \mathbf { \Lambda } _ { \mathbf { w } : = \mathbf { w } } ^ { \mathrm { c u t a ~ r o n } } } \\ & { \mathbf { w } : = \mathbf { w } \sim \beta _ { 1 } \nabla _ { \mathbf { w } } \sum _ { \mathcal { T } _ { i } \sim p ( \mathcal { T } ) } \ell _ { i } ( \mathbf { w } _ { i } ^ { ( K ) } ; \mathcal { D } _ { i } ^ { \prime } , \mathbf { w } ) - \beta _ { 2 } \gamma _ { \mathrm { o u t } } \nabla _ { \mathbf { w } } \sum _ { \mathcal { T } _ { i } \sim p ( \mathcal { T } ) } \mathcal { R } _ { i } ( \mathbf { w } _ { i } ^ { ( K ) } ; \hat { \mathcal { D } } _ { i } ^ { \prime } ) } \\ & { \quad \times \quad \dots } \end{array}$
321
+ 11 end while
322
+ 12 Return: w
323
+
324
+ # 2 DETAILS OF LEARNED SIGNATURE OF NEURON’S ACTIVATION
325
+
326
+ By maximizing a single coordinate of the neuron activation vector r (the output before the fullyconnected layer) with a perturbation in the input, the perturbation will show different behaviors between a robust model and a standard model (Engstrom et al., 2019). To be more specific, the feature pattern is revealed in the input under a robust model, while a standard model does not have such behavior. The optimization problem can be mathematically written in the following form
327
+
328
+ $$
329
+ \begin{array} { r l } { \underset { \delta } { \operatorname* { m a x i m i z e } } } & { { } r _ { i } ( \mathbf { x } + \delta ) } \\ { \mathrm { s u b j e c t \ t o } } & { { } - \mathbf { x } _ { j } \leq \delta _ { j } \leq 2 5 5 - \mathbf { x } _ { j } , } \end{array}
330
+ $$
331
+
332
+ where $r _ { i }$ denotes the $i$ -th coordinate of neuron activation vector. $\delta$ is the perturbation in the input.
333
+ $\mathbf { x } _ { j }$ is the $j$ -th pixel of the image vector $\mathbf { x }$ .
334
+
335
+ # 3 VISUALIZATION OF IAMS BEFORE AND AFTER FINE-TUNING IN META-TESTING
336
+
337
+ Once obtain a model using $\mathrm { R - M A M L _ { o u t } }$ , we can test the impact of the standard fine-tuning on its robustness. Figure S1 shows a randomly selected neuron’s inverted input attribution maps (IAMs) before standard fine-tuning and after standard fine-tuning in the meta-testing phase. The second row shows IAMs of the model before fine-tuning. The third row shows IAMs of the model after fine-tuning. One can find that the difference is small between the IAMs before fine-tuning and after fine-tuning, suggests that robust meta-update itself can provide the robustness adaptation without additional adversarial training.
338
+
339
+ ![](images/98d2862f1a5f7d50de9b9ccc8e5fc460afe70ca5448ce4bb5186b7c890b00a6d.jpg)
340
+ Figure S1: Visualization of a randomly selected neuron’s inverted input attribution maps (IAMs) before finetuning and after fine-tuning in meta-testing. The model is obtained by $\mathrm { R - M A M L _ { o u t } }$ . The second row shows IAMs of the model before fine-tuning. The third row shows IAMs of the model after fine-tuning. One can find that the difference between the IAMs before fine-tuning and after fine-tuning is small, suggests that robust meta-update itself can provide the robustness adaptation without additional adversarial training.
341
+
342
+ # 4 DETAILS OF EXPERIMENTS
343
+
344
+ To test the effectiveness of our methods, we employ the MiniImageNet dataset Vinyals et al. (2016), which is the benchmark for few-shot learning. MiniImageNet contains 100 classes with 600 samples in each class. We use the training set with 64 classes and test set with 20 classes. In our experiments, we downsize each image to $8 4 \times 8 4 \times 3$ .
345
+
346
+ we consider the 1-shot 5-way image classification task, i.e., the inner-gradient update (fine-tuning) is implemented using five classes and one fine-tuning image for each class in one single task. In meta-training, Each batch contains four tasks. We set the number of gradient update steps $K = 5$ in meta-training. For the meta-update, we use 15 validation images for each class. We set the gradient step size in the fine-tuning as $\alpha = 0 . 0 1$ , and the gradient step sizes in the meta-update as $\bar { \beta } _ { 1 } = 0 . 0 0 1 \bar { , } \beta _ { 2 } = 0 . 0 0 1$ for clean validation data and adversarial validation data, respectively.
347
+
348
+ ![](images/ac6e58c34aabfb9077a5c37f264925a672e63e4e49cb8253935f61c11f32fe6f.jpg)
349
+ Figure S2: RA versus (testing-phase) PGD attacks at different values of perturbation strength $\epsilon$ . Here the robust models are trained by $\mathbf { R } { - } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } }$ -TRADES and R-MAML $\scriptstyle { \mathtt { o u t } }$ . Each method trains two models under the training attack strength of $\epsilon = 2 , 4$ , respectively. Results show that $\mathbf { R } { \cdot } \mathbf { M A M L _ { o u t } }$ -TRADES has the ability to defend stronger attacks than $\mathrm { R - M A M L _ { o u t } }$ .
350
+
351
+ # 5 ADDITIONAL COMPARISONS ON MINIIMAGENET
352
+
353
+ Figure S2 shows robust accuracy (RA) performance of models trained using our methods. One can see that $\mathrm { R - M A M L _ { o u t } }$ -TRADES has the ability to defend stronger attacks than $\mathbf { R } { \cdot } \mathbf { M A M L } _ { \mathrm { o u t } }$ .
354
+
355
+ In Table S1, we compare the SA/RA performance of variants of $\mathrm { R - M A M L _ { o u t } }$ including $\mathrm { R - M A M L _ { o u t } ( A T }$ ), the TRADES regularization with unlabeled data $\mathrm { R - M A M L _ { o u t } }$ -TRADES, the version with contrastive learning $\mathrm { R } { - } \mathrm { M A M L } _ { \mathrm { o u t } } { - } \mathrm { C }$ L. One can see that $\mathrm { R - M A M L _ { o u t } }$ -CL yields the best SA and RA among all meta-learning methods.
356
+
357
+ Table S1: SA/RA performance of different variants of proposed $\mathrm { R - M A M L _ { o u t } }$ under the 1-shot 5-way scenario on ResNet18.
358
+
359
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SA</td><td rowspan=1 colspan=1>RA</td></tr><tr><td rowspan=1 colspan=1>MAML</td><td rowspan=1 colspan=1>43.1%</td><td rowspan=1 colspan=1>5.347%</td></tr><tr><td rowspan=1 colspan=1>AQ (Goldblum et al., 2019)</td><td rowspan=1 colspan=1>30.04%</td><td rowspan=1 colspan=1>20.05%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout (AT) (ours)</td><td rowspan=1 colspan=1>38.94%</td><td rowspan=1 colspan=1>19.94%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-TRADES (ours)</td><td rowspan=1 colspan=1>41.94%</td><td rowspan=1 colspan=1>20.19%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-CL (ours)</td><td rowspan=1 colspan=1>43.98%</td><td rowspan=1 colspan=1>21.47%</td></tr></table>
360
+
361
+ # 6 EXPERIMENTS ON CIFAR-FS
362
+
363
+ We also test our proposed methods on CIFAR-FS (Bertinetto et al., 2018), which is an image classification dataset containing 64 classes of training data and 20 classes of evaluation data. The compared methods are the same as in Table 3. We keep the settings to be the same as in the test on MiniImagenet except we set $\epsilon = 8$ . To perform data augmentation in experiments, we mine 500 additional unlabeled data for each training class from the STL-10 dataset (Coates et al., 2011).
364
+
365
+ Table S2 and Table S3 show the comparisons in 1-Shot 5-Way and 5-Shot 5-Way learning scenarios, respectively. One can see that our methods outperform the baseline methods MAML and AQ (Goldblum et al., 2019). The results also indicate that semi-supervised learning (in terms of TRADES and contrastive learning) can further boost the performance. In particular, as shown by Table S2 and Table S3, $\mathrm { R } { - } \mathrm { M A M L } _ { \mathrm { o u t } } { - } ($ CL leads to $1 0 \%$ SA improvement and $3 \%$ RA improvement compared to AQ under the MAML 1-Shot 5-Way setting, and $5 . 6 \%$ SA improvement and $1 . 3 \%$ RA improvement under the 5-Shot 5-Way setting.
366
+
367
+ Table S2: SA/RA performance of our proposed methods on CIFAR-FS (Bertinetto et al., 2018) (1-Shot 5-Way).
368
+
369
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SA</td><td rowspan=1 colspan=1>RA</td></tr><tr><td rowspan=1 colspan=1>MAML</td><td rowspan=1 colspan=1>51.07%</td><td rowspan=1 colspan=1>0.235%</td></tr><tr><td rowspan=1 colspan=1>AQ (Goldblum et al., 2019)</td><td rowspan=1 colspan=1>31.25%</td><td rowspan=1 colspan=1>26.34%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout(AT) (ours)</td><td rowspan=1 colspan=1>39.76%</td><td rowspan=1 colspan=1>26.15%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout(TRADES) (ours)</td><td rowspan=1 colspan=1>40.23%</td><td rowspan=1 colspan=1>27.45%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-TRADES (ours)</td><td rowspan=1 colspan=1>40.59%</td><td rowspan=1 colspan=1>28.06%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-t-CL (ours)</td><td rowspan=1 colspan=1>41.25%</td><td rowspan=1 colspan=1>29.33%</td></tr></table>
370
+
371
+ # 7 EXPERIMENTS ON OMNIGLOT
372
+
373
+ We then conduct experiments on Omniglot (Lake et al., 2015), which includes handwritten characters from 50 different alphabets. There are 1028 classes of training data and 423 classes of evaluation data. Due to the hardness of finding the unlabeled data with similar patterns, we only test our supervised learning methods on Omniglot. We compare R-MAML $\mathrm { \bf { o u t } }$ (TRADES) to AQ (Goldblum et al., 2019) in the 1-shot (5, 10, 15, 20)-Way settings. Figure. S3 shows the results of RA/SA under $\epsilon = 1 0$ . The results show that R-MAMLout(TRADES) can obtain better performance than AQ.
374
+
375
+ Table S3: SA/RA performance of our proposed methods on CIFAR-FS (Bertinetto et al., 2018) (5-Shot 5-Way).
376
+
377
+ <table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>SA</td><td rowspan=1 colspan=1>RA</td></tr><tr><td rowspan=1 colspan=1>MAML</td><td rowspan=1 colspan=1>67.2%</td><td rowspan=1 colspan=1>0.225%</td></tr><tr><td rowspan=1 colspan=1>AQ (Goldblum et al., 2019)</td><td rowspan=1 colspan=1>52.32%</td><td rowspan=1 colspan=1>33.96%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout(AT) (ours)</td><td rowspan=1 colspan=1>57.18%</td><td rowspan=1 colspan=1>32.62%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout(TRADES) (ours)</td><td rowspan=1 colspan=1>57.46%</td><td rowspan=1 colspan=1>34.72%</td></tr><tr><td rowspan=1 colspan=1>R-MAMLout-TRADES (ours)</td><td rowspan=1 colspan=1>57.62%</td><td rowspan=1 colspan=1>34.76%</td></tr><tr><td rowspan=1 colspan=2>R-MAMLout-CL (ours) 57.95%</td><td rowspan=1 colspan=1>57.95%</td></tr></table>
378
+
379
+ ![](images/a489f9ef65804501a1813ee24119d3dccdf9a3e601870770fc1399e60a9f0735.jpg)
380
+ Figure S3: Performance of $\mathbf { R } { - } \mathbf { M } \mathbf { A } \mathbf { M } \mathbf { L } _ { \mathrm { o u t } }$ (TRADES) and AQ (Goldblum et al., 2019) on Omniglot versus number of classes in each task (from 5 to 20 ways): (a) RA. (b) SA.
parse/train/o81ZyBCojoA/o81ZyBCojoA_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/o81ZyBCojoA/o81ZyBCojoA_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/o81ZyBCojoA/o81ZyBCojoA_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/train/r1xQNlBYPS/r1xQNlBYPS.md ADDED
@@ -0,0 +1,250 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MULTICHANNEL GENERATIVE LANGUAGE MODELS
2
+
3
+ Anonymous authors Paper under double-blind review
4
+
5
+ # ABSTRACT
6
+
7
+ A channel corresponds to a viewpoint or transformation of an underlying meaning. A pair of parallel sentences in English and French express the same underlying meaning but through two separate channels corresponding to their languages. In this work, we present Multichannel Generative Language Models (MGLM), which models the joint distribution over multiple channels, and all its decompositions using a single neural network. MGLM can be trained by feeding it $k$ way parallel-data, bilingual data, or monolingual data across pre-determined channels. MGLM is capable of both conditional generation and unconditional sampling. For conditional generation, the model is given a fully observed channel, and generates the $k - 1$ channels in parallel. In the case of machine translation, this is akin to giving it one source, and the model generates $k - 1$ targets. MGLM can also do partial conditional sampling, where the channels are seeded with prespecified words, and the model is asked to infill the rest. Finally, we can sample from MGLM unconditionally over all $k$ channels. Our experiments on the Multi30K dataset containing English, French, Czech, and German languages suggest that the multitask training with the joint objective leads to improvements in bilingual translations. We provide a quantitative analysis of the quality-diversity trade-offs for different variants of the multichannel model for conditional generation, and a measurement of self-consistency during unconditional generation. We provide qualitative examples for parallel greedy decoding across languages and sampling from the joint distribution of the 4 languages.
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ A natural way to consider two parallel sentences in different languages is that each language is expressing the same underlying meaning under a different viewpoint. Each language can be thought of as a transformation that maps an underlying concept into a view that we collectively agree is determined as ‘English’ or ‘French’. Similarly, an image of a cat and the word ‘cat’ are expressing two views of the same underlying concept. In this case, the image corresponds to a high bandwidth channel and the word ‘cat’ to a low bandwidth channel. This way of conceptualizing parallel viewpoints naturally leads to the formulation of a fully generative model over each instance, where the transformation corresponds to a particular generation of the underlying view. We define each of these views as a channel. As a concrete example, given a parallel corpus of English and French sentences, English and French become two channels and the corresponding generative model becomes $p$ (English, French). One key advantage to this formulation is that single model can be trained that can capture the full expressivity of the underlying concept, allowing us to compute conditionals and marginals along with the joint. In the case of parallel sentences, the conditionals correspond to translations from one channel to another while the marginals correspond to standard monolingual language models.
12
+
13
+ In this work, we present a general framework for modeling the joint distribution $p ( \mathbf { x } _ { 1 } , . . . , \mathbf { x } _ { k } )$ over $k$ channels. Our framework marginalizes over all possible factorizations of the joint distribution. Subsequently, this allows our framework to perform, 1) unconditional generation and 2) conditional generation. We harness existing recent work on insertion-based methods that utilize semi-autoregressive models that are permutation-invariant to the joint factorization.
14
+
15
+ Specifically, we show a proof-of-concept multichannel modeling by extending KERMIT (Chan et al., 2019) to model the joint distribution over multiple sequence channels. Specifically, we train KERMIT on the Multi30K (Elliott et al., 2016) machine translation task, consisting of four languages: English (EN), French (FR), Czech (CS), and German (DE). One advantage of multilingual KERMIT is during inference, we can generate translation for a single target language, or generate translations for $k - 1$ languages in parallel in logarithmic time in the token length per language. We illustrate qualitative examples for parallel greedy decoding across languages and sampling from the joint distribution of the 4 languages.
16
+
17
+ The key contributions in this work are:
18
+
19
+ 1. We present MGLM, a multichannel generative modeling framework. MGLM models the joint distribution $p ( \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { k } )$ over $k$ channels.
20
+ 2. We demonstrate both conditional generation (i.e., machine translation) and unconditional sampling from MGLM.
21
+ 3. In the case of conditional generation over multiple languages, we show that not only we are competitive in BLEU, but also with significant advantages in inference time and model memory savings.
22
+ 4. We analyze the Quality-Diversity tradeoff from sampling MGLM and prior work.
23
+
24
+ We highlight that while we focus on languages as a specific instantiation of a channel, our framework can generalize to any arbitrary specification, such as other types of languages or other modalities.
25
+
26
+ # 2 BACKGROUND
27
+
28
+ Traditional autoregressive sequence frameworks (Sutskever et al., 2014; Cho et al., 2014) model the conditional probability $p ( \mathbf { y } \mid \mathbf { x } )$ of an output sequence $y$ conditioned on the input sequence $x$ with a left-to-right factorization. The model decomposes $p ( y \mid x )$ as predicting one output token at time, conditioning on the previously generated output tokens $\mathbf { y } _ { < t }$ and the input sequence $\mathbf { x }$ :
29
+
30
+ $$
31
+ p ( \mathbf { y } \mid \mathbf { x } ) = \prod _ { t } p ( \mathbf { y } _ { t } \mid , \mathbf { y } _ { < t } )
32
+ $$
33
+
34
+ Recent encoder-decoder models with attention such as Transformer (Vaswani et al., 2017) have been successfully applied to various domains, including machine translation. If we were to apply this left-to-right autoregressive approach towards multichannel modeling, we would require to choose a particular factorization order, such as $\begin{array} { r } { p ( \mathbf { w } , \mathbf { x } , \mathbf { y } ) = p ( \mathbf { w } ) p ( \mathbf { x } | \mathbf { w } ) p ( \bar { \mathbf { y } } | \mathbf { x } , \mathbf { w } ) } \end{array}$ .
35
+
36
+ Instead of assuming a fixed left-to-right decomposition, recent autoregressive insertion-based conditional modeling frameworks (Stern et al., 2019; Welleck et al., 2019; Gu et al., 2019) consider arbitrary factorization of the output sequence by using insertion operation, which predicts both (1) content token $c \in { \mathcal { C } }$ from the vocabulary, and (2) location $l$ insert, relative to the current partial output $\hat { \mathbf { y } } _ { t }$ :
37
+
38
+ $$
39
+ p ( c , l | \mathbf { x } , \hat { \mathbf { y } } _ { t } ) = \mathrm { I n s e r t i o n T r a n s f o r m e r } ( \mathbf { x } , \hat { \mathbf { y } } _ { t } )
40
+ $$
41
+
42
+ Subsequent work, KERMIT (Chan et al., 2019), simplified the Insertion Transformer model by removing the encoder and only having a decoder, and the trick is to concatenate the original input and output sequence as one single sequence and optimize over all possible factorizations. Consequently, KERMIT is able to model the joint $p ( \mathbf { x } , \mathbf { y } )$ , conditionals $p ( \mathbf { x } \mid \mathbf { y } ) , p ( \mathbf { y } \mid \mathbf { x } )$ , as well as the marginals $p ( \mathbf { x } ) , p ( \mathbf { y } )$ .
43
+
44
+ Unlike with the left-to-right autoregressive approach, the exact computation of the log-likelihood equation 3 is not possible due to the intractable marginalization over the generation order $z$ , where $S _ { n }$ denotes the set of all possible permutations on $n$ elements. However, we can lower bound the log-likelihood using Jensen’s inequality:
45
+
46
+ $$
47
+ \begin{array} { r l } { \log p ( x ) = \log \displaystyle \sum _ { z \in S _ { n } } p ( z ) p ( \mathbf { x } \mid z ) \ ~ } & { } \\ { \geq \displaystyle \sum _ { z \in S _ { n } } p ( z ) \log p ( \mathbf { x } \mid z ) } & { ~ = : \mathcal { L } ( \mathbf { x } ) } \end{array}
48
+ $$
49
+
50
+ The loss term can be simplified by changing the summation and careful decomposition of the permutation, leading to:
51
+
52
+ $$
53
+ \begin{array} { l } { { \displaystyle { \mathcal { L } } ( x ) = \sum _ { z \in S _ { n } } p ( z ) \log \prod _ { i = 1 } ^ { n } p ( ( c _ { i } ^ { z } , l _ { i } ^ { z } ) \mid \mathbf { x } _ { 1 : i - 1 } ^ { z , i - 1 } ) } \ ~ } \\ { { \displaystyle ~ = \sum _ { i = 1 } ^ { n } \sum _ { z _ { 1 : i - 1 } } p ( z _ { 1 : i - 1 } ) \sum _ { z _ { i } } p ( z _ { i } \mid z _ { 1 : i - 1 } ) \log p ( ( c _ { i } ^ { z } , l _ { i } ^ { z } ) \mid \mathbf { x } _ { 1 : i - 1 } ^ { z , i - 1 } ) } \ ~ } \end{array}
54
+ $$
55
+
56
+ Inference can be autoregressive via greedy decoding:
57
+
58
+ $$
59
+ ( \hat { c } , \hat { l } ) = \mathop { \mathrm { a r g m a x } } _ { c , l } p ( c , l | \hat { \mathbf { x } } _ { t } ) ,
60
+ $$
61
+
62
+ or partially autoregressive via parallel decoding:
63
+
64
+ $$
65
+ \hat { c } _ { l } = \underset { c } { \operatorname { a r g m a x } } p ( c \mid l , \hat { \mathbf { x } } _ { t } ) ,
66
+ $$
67
+
68
+ which is achieved by inserting at all non-finished slots. Stern et al. (2019) has shown that using a binary tree prior for $p ( z )$ led to $\approx \log _ { 2 } n$ iterations for $n$ token generation.
69
+
70
+ # 3 MULTICHANNEL GENERATIVE LANGUAGE MODELS
71
+
72
+ In multichannel generative language mdataset consisting of a set of sequences $\{ \mathbf { x } _ { 1 } ^ { ( i ) } , \bar { \mathbf { \Phi } } , \mathbf { \Phi } \cdot \cdot , \mathbf { x } _ { k } ^ { ( i ) } \} _ { i = 1 } ^ { M }$ s to learn a from up to $k$ enerative model channels, where $\mathbf { \bar { x } } _ { k } ^ { ( i ) } =$ $[ \boldsymbol { x } _ { j , 1 } ^ { ( i ) } , \ldots , \boldsymbol { x } _ { j , n } ^ { ( i ) } ]$ represents a sequence of tokens from the $j$ -th channel for the $i$ -th example. The resulting MGLM models a joint generative distribution over multiple channels. While there are many possible implementation of Multichannel Generative Language Models, we chose to extended the work of Chan et al. (2019) to investigate applying the KERMIT objective on tasks with more than 2 sequences, in order to learn the joint distribution $p ( \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { k } )$ over $k$ channel sequences. For example, these channel sequences can denote different languages, such as learning $p ( E N , F R , C S , D E )$ .
73
+
74
+ ![](images/9c0fb840dac965ef01f65609359de12ca9dd429ed247e3661c94442750e142ed.jpg)
75
+ Figure 1: (Left) An example multichannel modeling over 3 languages (English, French, Czech), Training Sets Inference where the model predicts the missing tokens at each location across multiple channels. (Right) Bilingual EN [SEP] FR [SEP] EN [SEP] During inference, MGLM can generate output sequence for a single target language channel (top), (Uni-direction) EN [SEP] or for multiple language channels in parallel (bottom), conditioning on source channel sentence and EN [SEP] FR [SEP] CS [SEP] partial translations of multiple language channels.
76
+
77
+ (Any to Rest) EN [SEP] FR [SEP] CS [SEP] DE [SEP] We illustrate an example data input consisting of 3 channels in Figure 1 (left). We concatenate the EN [SEP] [SEP] sequences together from all channels for each example, separate by a SEP token. Even with shared Joint EN [SEP] FR [SEP] CS [SEP] DE [SEP] EN [SEP] [SEP] vocabulary, each channel results in a different token embedding, via an addition of a channel-specific Data for Model EN [SEP] [SEP] (learnable) embedding, or simply having a separately learned token embedding per channel. After Source Target Legend FR EN [SEP] [SEP] DE passing through the dense self-attention layers as in per Transformer architecture, the contextualized representation at each output time step predicts the possible tokens to be inserted to the left of the current input token.
78
+
79
+ At inference (generation) time, we can generate unconditionally by seeding the canvas with the [SEP] token and predicting the first actual token, or provide as much, or as little, partial/complete sequence in each channel. Figure 1 (right) shows two possible decoding inference modes: a single target language channel (top), or multiple target language channels in parallel (bottom).
80
+
81
+ # 4 EXPERIMENTS
82
+
83
+ We experiment on a multilingual dataset to demonstrate that we can learn MGLM. We perform both qualitative and quantitative experiments. We highlight the model’s capabilities ranging from conditional generation (i.e., machine translation) to unconditional sampling the joint distribution over multiple languages.
84
+
85
+ We experiment on the Multi30k (Elliott et al., 2016; 2017; Barrault et al., 2018), a multilingual dataset which consists of 29000 parallel training sentences in English (EN), French (FR), Czech (CS), and German (DE) sentences. We use Multi30k because multiple high quality channels (multilingual translations in this case) is readily available to highlight our framework. We implement MGLM as a base Transformer decoder, without any causal masking, with 6 hidden layers and 1024 dimensional hidden representation. We concatenate all 4 language raw text training examples and use SentencePiece (Kudo & Richardson, 2018) to learn an universal subword unigram (Kudo, 2018) tokenizer with a shared 32K vocabulary size. We follow a similar training set up to BERT (Devlin et al., 2019), using Adam (Kingma & Ba, 2015) optimizer with learning rate of 1e-4, warmup over the first $10 \%$ of the total training iterations varying between 10k to 50k iterations. We can train 3 different variants of MGLM by altering the sampling ratio of training data seen by the model:
86
+
87
+ 1. Bilingual (e.g., $\mathrm { E N } \mathrm { F R }$ ). We give the model a fully observed source (e.g., $E N )$ , and ask the model to infill the target (e.g., $F R$ ).
88
+ 2. Multi-target (e.g., any $1 \mathrm { R e s t }$ ). We give the model a fully observed source (e.g., $E N$ ), and ask the model to infill the rest of the targets (e.g., DE, F R, CS).
89
+ 3. Joint. We ask the model to infill all the targets, consequently we learn a joint distribution over all the languages $p ( \mathrm { e n } , \mathrm { f r } , \mathrm { d e } , \mathrm { c s } )$ .
90
+
91
+ # 4.1 TRANSLATION PERFORMANCE
92
+
93
+ The goal of MGLM is not conditional generation (i.e., machine translation), but nevertheless, we demonstrate its ability to do conditional generation in this section. We report the BLEU scores on the three test sets: test 2016 Flickr, test 2017 Flickr, test 2017 MSCOCO, for different English $ \{ \begin{array} { r l } \end{array} $ {German, French, Czech} translations. We use parallel greedy decoding (Stern et al., 2019; Chan et al., 2019), i.e. inserting to all incomplete slots. Table 1 summarizes the results for English to German and vice versa, respectively. Additional results for English to French, English to Czech, and German to English are shown in Appendix A.2. We observe that the Multitarget models performed similar to slightly better than the bilingual models trained only on a single language pair. This is particularly useful when multiple machine translation targets are desired. We now only need one MGLM model which is competitive to the bidirectional expert models. This implies we only need 1 model for inference over multiple languages, as opposed to $N$ models (i.e., saving substantial memory).
94
+
95
+ We also observe the full generative joint model has a BLEU gap compared to the bilingual baseline, which is consistent with the findings in Chan et al. (2019). We hypothesize this is due to the joint distribution being a more challenging task. We further hypothesize that in particular, during training the Joint model needs to fantasize additional details when conditioning on partial sequence in each of the channels. This results in fantasizing additional details not present in the original source sentence during translation tasks.
96
+
97
+ 4.2 PARALLEL GREEDY DECODING: PARALLEL IN TARGET LANGUAGES
98
+
99
+ As alluded conceptually in Figure 1 and in the previous section, our KERMIT-based MGLM is also able to perform parallel greedy decoding that is also parallel in number of target languages. We illustrate this process in Figure 2. By starting with $K$ initial [SEP] tokens for $K$ target output languages, MGLM can decode $K$ target languages that has at most $n$ output tokens per language in ${ \mathcal { O } } ( \log n )$ , i.e. constant in number of target languages.
100
+
101
+ We investigate the relative speed up in generating multiple target language outputs in parallel versus generating the targets in series, in terms of wall-clock time and number of decoding iterations. In Figure 3a, we plot the number of decoding iterations taken versus the total output length $N$ for each
102
+
103
+ Table 1: Multi30k English German test BLEU.
104
+ Input: A man sits on a bench holding his dog and looking at the water. Parallel Decode:
105
+
106
+ <table><tr><td>Model</td><td>Inference</td><td>Test2016</td><td>Test2017</td><td>MSCOCO</td></tr><tr><td>Bilingual (EN→DE)</td><td>EN→DE</td><td>36.14</td><td>28.32</td><td>24.15</td></tr><tr><td>Bilingual (EN ←DE)</td><td>EN →DE</td><td>37.08</td><td>28.69</td><td>26.11</td></tr><tr><td>Multi-target (EN → Rest)</td><td>EN→DE EN →FR,CS,DE</td><td>36.83 35.41</td><td>28.35 29.69</td><td>25.14 25.64</td></tr><tr><td>Multi-target (Any → Rest)</td><td>EN →DE EN →FR,CS,DE</td><td>36.63 36.51</td><td>28.37 28.53</td><td>26.98 25.84</td></tr><tr><td>Joint (p(EN,FR,CS,DE))</td><td>EN →DE EN →FR,CS,DE</td><td>33.06 32.53</td><td>23.42 23.78</td><td>21.39 20.97</td></tr></table>
107
+
108
+ FR: Un homme est assis sur un banc , ten ant son chien et regardant l ’ eau . [SEP] CS: Muzˇ sed´ı na lavicceˇ a drzˇ´ı sve´ ho psa a d´ıva´ se na vodu . [SEP] DE: Ein Mann sitzt auf einer Bank und halt ¨ seine n Hund und schaut auf das Wasser . [SEP] FR: Un homme est assis sur un banc , ten ant son chien et regardant l ’ eau . [SEP] CS: Muzˇ sed´ı na lavicce ˇ a drzˇ´ı sve´ ho psa a d´ıva´ se na vodu . [SEP] DE: Ein Mann sitzt auf einer Bank und halt ¨ seine n Hund und schaut auf das Wasser . [SEP] FR: Un homme est assis sur un banc , ten ant son chien et regardant l ’ eau . [SEP] CS: Muzˇ sed´ı na lavicceˇ a drzˇ´ı sve´ ho psa a d´ıva´ se na vodu . [SEP] DE: Ein Mann sitzt auf einer Bank und halt ¨ seine n Hund und schaut auf das Wasser . [SEP] FR: Un homme est assis sur un banc , ten ant son chien et regardant l ’ eau . [SEP] CS: Muzˇ sed´ı na lavicce ˇ a drzˇ´ı sve´ ho psa a d´ıva´ se na vodu . [SEP] DE: Ein Mann sitzt auf einer Bank und halt ¨ seine n Hund und schaut auf das Wasser . [SEP] FR: Un homme est assis sur un banc , ten ant son chien et regardant l ’ eau . [SEP] CS: Muzˇ sed´ı na lavicceˇ a drzˇ´ı sve´ ho psa a d´ıva´ se na vodu . [SEP] DE: Ein Mann sitzt auf einer Bank und halt ¨ seine n Hund und schaut auf das Wasser . [SEP] sentence in the test 2016 Flickr test set, using the Joint KERMIT model when decoding from a single source language to 3 target languages: English {French, German, Czech}. When performing serial target decoding, we only output the target conditioned on English, i.e. English French, English German, English $ \mathrm { C z e c h }$ . We also plot several theoretical bounds: (1) upper bound $( N )$ when decoding entirely serially, (2) lower bound $3 ( \lfloor \log _ { 2 } ( N / 3 ) \rfloor + 2 )$ when decoding 3 languages serially but parallel within each language, (3) lower bound $\lfloor \bar { \log _ { 2 } ( N / 3 ) } \rfloor + 2$ , when decoding the 3 target languages in parallel and parallel within each language, and (4) $\lfloor \log _ { 2 } ( N ) \rfloor + 2$ , if we decode the entire output in parallel as a single sequence. We observe that our model is able to meet the lower bound several times and in many cases decode below the fourth $\lfloor \log _ { 2 } ( N ) \rfloor + 2$ bound. Figure 3b compares the wall-clock speed up when decoding targets in parallel vs. in series, with a linear regression line plotted. Our model achieving almost 3 times speed up in wall-clock speed. The parallel targets decoding is bottlenecked by the target language with the longest output sequence. Figure 3c compares the total output length when decoding the targets in series versus in parallel. We observe that there is a linear relationship between the output lengths using the two modes.
109
+
110
+ # 4.3 CONDITIONAL BILINGUAL GENERATION: QUALITY-DIVERSITY TRADE-OFF
111
+
112
+ We first evaluated the models on conditional generation task by sampling bilingual translations (1 source, 1 target language) for each of the 12 language pair directions. We sample the token and location $( c , l ) \sim p \bar { ( } c , l \bar { | } x , \hat { y } )$ from the partial canvas at each iteration, generating 100 hypothesis translations per source sentence, at softmax temperature $\tau = 0 . 1 , 0 . 5 , 1 . 0$ . At each temperature and model, we computed the quality of the generated samples by computing the BLEU Papineni et al. (2002) score between the reference translation and the samples, and the diversity by computing the pairwise BLEU between the 100 samples per source, also known as Self-BLEU Zhu et al. (2018). Lower Self-BLEU indicates the higher the diversity as there is less overlap between the samples.
113
+
114
+ ![](images/7c704ca18da7d43725ecb9a85b59f68eff1e4dcbf5f2143abb117692517c360b.jpg)
115
+ Figure 3: (Left) Number of decoding iterations vs. the output length when decoding each target language serially vs. in parallel, compared to various logarithmic bounds. We have shown that the model is able to achieve close to the theoretical lower bound $\lfloor \log _ { 2 } ( N / k ) \rfloor + 2$ where number of target languages $k = 3$ . (Middle) Relative wall-clock speed up when using the parallel target languages decoding vs. serial, achieving slightly under 3 times the performance. (Right) Total output length for the 3 target languages when using serial vs parallel target language generation. While not identical, we observe a linear relationship between the output length using the two different modes
116
+
117
+ ![](images/fef91c59aaf657958fea15e87a64c47704d4bf6d9852fc5faada4b7486f05779.jpg)
118
+ Figure 4: Quality-Diversity BLEU curve for several KERMIT models (bilingual, multitarget, joint) on the Multi30k text 2016 Flickr test set. Dotted diagonal line signifies BLEU equals SelfBLEU. Points indicate different temperatures, from 0.1 (low diversity, left in graph) to 1.0 (high diversity, right in graph)
119
+
120
+ Figure 4 illustrates the Quality-Diversity trade-off for the three models for different translation pairs involving English as one of the language. The top right portion of the graph is the ideal area. We observed that the Multitarget model outperformed the Bilingual model at lower temperature (both higher quality and diversity), and at higher temperature slightly above or below in quality but still higher diversity. Note that only one single Multitarget model was used for all language pair at inference time, while each bilingual model was different for each language pair curve. Therefore, a single Multitarget KERMIT model could outperform specialized bilingual KERMIT models.
121
+
122
+ # 4.4 PARTIAL CONDITIONING MULTILINGUAL GENERATION
123
+
124
+ We demonstrate our model’s ability to generate infilling for partial conditioning over the multiple channels. To be explicit, we seed each channel with a few (different) words, and sample from the model. We ask the model what text completions would best fit under the model’s posterior. Figure 5 highlights several examples for (English, French, German) sentence completion. We took an example from the test 2016 Flickr test set and split it into 3 chunks–beginning in English, middle in French, and ending in German–and sample completion. The model is able to generate a set of diverse, coherent examples.
125
+
126
+ English Groundtruth: A young boy, wearing a chef’s hat and apron, is cutting sausages in a kitchen.
127
+
128
+ French Groundtruth: Un jeune garc¸on, portant une toque et un tablier, coupe des saucisses dans une cuisine. German Groundtruth: Ein kleiner Junge mit Kochmutze und Sch ¨ urze schneidet in einer K ¨ uche W ¨ urstchen. ¨
129
+
130
+ English Seed: A young boy, French Seed: portant une toque et un tablier, German Seed: chneidet in einer Kuche W ¨ urstchen. ¨
131
+
132
+ English: A young boy , wearing a hat , and an apron grilling hotdogs in the kitchen.
133
+
134
+ French: Un jeune garc¸on portant une toque et un tablier, faisant cuire du citron et des hotdogs dans la cuisine. German: Ein junger Mann tragt eine M ¨ utze und ¨ schneidet in einer Kuche W ¨ urstchen. ¨
135
+
136
+ English: A young boy , wearing a hat and a apron, is in a kitchen , cutting with various foods on it.
137
+
138
+ French: Un jeune garc¸on, portant une toque et un tablier, est dans une cuisine en projetant des poeles de la ˆ nourriture.
139
+
140
+ German: Ein kleiner Junge mit Hut und Schurze ¨ schneidet in einer Kuche W ¨ urstchen. ¨
141
+
142
+ English: A young boy, wearing an orange hat and apron, puts barbecue chicken in a kitchen. French: Un jeune garc¸on, portant une toque et un tablier, coupant du poulet dans une cuisine. German: Ein kleiner Junge in einer weißen Mutze und mit Sch ¨ urze ¨ schneidet in einer Kuche W ¨ urstchen ¨ glas
143
+
144
+ English: A young boy, wearing a blue hat and apron, is cooking meat in a kitchen. French: Un petit garc¸on, portant une toque et un tablier, fait la cuisine dans une cuisine. German: Ein kleiner Junge mit blauer Mutze und ¨ schneidet in einer Kuche W ¨ urstchen. ¨
145
+
146
+ Figure 5: Partially conditional generation samples drawn from our model. The seed text is shown in gray, with several different in-filling samples from the model in black. The samples show reasonable consistency and diversity across samples.
147
+
148
+ # 4.5 UNCONDITIONAL MULTILINGUAL GENERATION
149
+
150
+ We then evaluated the models on unconditional multilingual generation task, to generate a sentence each in all 4 languages such that they correspond to each other. For the Joint model, we perform 3 types of sampling: (1) unrestricted, (2) chain, and (3) common cause. For unrestricted, we sampled one (token, location) at each iteration starting from an empty canvas, allowing the model to insert a token in any language, until all slots were marked as completed. In the chain generation, we first restrict to generating English sentence one token at a time, then sampled French, German, and Czech in order, conditioned on the last sentence in the previous language. For common cause, we reuse the same English and French sampled sentences, and generate the German and Czech conditioned on the English sentence (i.e. 3 languages are all conditioned on English).
151
+
152
+ Given these sets of sentences in 4 languages, for each pair of language direction, we computed a pseudo target by using a separately trained (on Multi30k) vanilla Transformer (Vaswani et al., 2017) and performed beam search (size 5) to translate the chosen source language sample. Figure 6 visualizes the pseudo target BLEU score for different source-target language pairs when comparing the Joint model under different types of sampling. The shaded colour represents the difference between the current sampling scheme versus the unrestricted reference. We observe that letting the model sample in unrestricted order was better than either the chain or the common cause sampling.
153
+
154
+ # 5 RELATED WORK
155
+
156
+ While we have demonstrated a KERMIT implementation of a MGLM, many other variants of Transformer models contain similar properties. Xia et al. (2019) and He et al. (2018) both consider shared encoder/decoders while KERMIT removes altogether the distinction between the encoder and decoder. XLNet (Yang et al., 2019) also learns over all permutation of the factorization order, in addition to architectural modification for two-stream attention parameterization to resolve ambiguity in the targets. The idea of concatenating pairs of source and target sequences from different language channels have been explored by Lample & Conneau (2019). However, unlike the insertion objective, their model is trained through Masked Language Modeling as in BERT (Devlin et al., 2019), and therefore was not readily able to be used for generation.
157
+
158
+ ![](images/256add9e3845f9454ab0417731952c48f0807d2b4707c39868f7c06bfbca91ab.jpg)
159
+ Figure 6: Unconditional multilingual generation Pseudo-Target BLEU for self-consistency when generating sentences in multiple languages. Colour shading indicates the difference compared to the Joint model (unrestricted) generation.
160
+ Figure 7: Example unconditional text generation samples from the Joint (top) and chain of Bilingual model (bottom). Note that the Joint model generates one long sequence and we split them into the resulting four sentences in each language here, while Bilingual generate a complete sentence in each language conditioned on previous sentence.
161
+
162
+ <table><tr><td rowspan=1 colspan=2>Model Language</td><td rowspan=1 colspan=1>Generated Sentences</td></tr><tr><td rowspan=1 colspan=1>Joint</td><td rowspan=1 colspan=1>EnglishFrenchGermanCzech</td><td rowspan=1 colspan=1>A young man in a blue jacket walking up a mountain.Un jeune homme en veste bleue descendant une paroi rocheuse en horu.Ein junger Mann in einer blauen Jacke klettert eine Felswand hoch.Mlady muz v modré bunde stoupä po horach.~&quot;Young men in blue jackets ascend and climb mountains.&quot;</td></tr><tr><td rowspan=1 colspan=1>Biling.</td><td rowspan=1 colspan=1>EnglishFrenchGermanCzech</td><td rowspan=1 colspan=1>Two small white dogs are holding the duck in a fenced yard.Deux petits chiens blancs tenant un canard dans une cour cloturée.Zwei kleine weiBe Hunde halten eine gelbe Ente in einem eingezäunten Hof.Dva mali chlapci drzi zlutou panou venku u zlutého oploceném nädvori.~&quot;Two little boys holding a yellow gentleman outside by a yellow fenced courtyard.&quot; X</td></tr></table>
163
+
164
+ Evaluation of text generative models remain a challenge (Liu et al., 2016; Novikova et al., 2017). Quality versus diversity plots have been used to compare the trade-off at different output softmax temperatures, as such in Stochastic Beam Search (Kool et al., 2019) which used a simpler $n$ -gram diversity instead of Self-BLEU (Zhu et al., 2018). However, we are the first to characterize the Q-D behaviour of insertion based models, versus existing left-to-right language models. Other metrics summarize the quality and diversity trade-off as a single number, such as Frechet BERT Distance (Montahaei et al., 2019) inspired by the FID score (Heusel et al., 2017) used in computer vision, or take into account human evaluation (Hashimoto et al., 2019).
165
+
166
+ # 6 CONCLUSION
167
+
168
+ We have demonstrated that a multichannel model implemented with KERMIT can learn a joint distribution over more than two sequences. Furthermore, our multichannel KERMIT model allows for efficient inference of multiple target languages in parallel using a single model. Our work focused on a specific instantiation of channels in the case of languages. However, there are no model limitations that inhibit further generalization to other notion of channels. In future work we aim to consider the addition of multimodal channels, such as images as well as other textual channels, such as paraphrases, premises and hypotheses, as well as questions and answers. Fully generative models still often lag behind purely discriminitive counterparts in terms of performance, but we believe it is crucial to make steps towards other model formulations that have high potential. We also intend to explore the limits on the number of channels that can be considered, such as building generative models over dozens or even hundereds of languages. We hope this initial line of work motivates future research on building generative models of the world.
169
+
170
+ # REFERENCES
171
+
172
+ Lo¨ıc Barrault, Fethi Bougares, Lucia Specia, Chiraag Lala, Desmond Elliott, and Stella Frank. Findings of the third shared task on multimodal machine translation. In Proceedings of the Third Conference on Machine Translation: Shared Task Papers, pp. 304–323, 2018.
173
+
174
+ William Chan, Nikita Kitaev, Kelvin Guu, Mitchell Stern, and Jakob Uszkoreit. KERMIT: Generative Insertion-Based Modeling for Sequences, 2019.
175
+
176
+ Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. In EMNLP, 2014.
177
+
178
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In NAACL, 2019.
179
+
180
+ Desmond Elliott, Stella Frank, Khalil Sima’an, and Lucia Specia. Multi30k: Multilingual englishgerman image descriptions. arXiv preprint arXiv:1605.00459, 2016.
181
+
182
+ Desmond Elliott, Stella Frank, Lo¨ıc Barrault, Fethi Bougares, and Lucia Specia. Findings of the second shared task on multimodal machine translation and multilingual image description. In Proceedings of the Second Conference on Machine Translation, Volume 2: Shared Task Papers, pp. 215–233, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/W17-4718.
183
+
184
+ Jiatao Gu, Qi Liu, and Kyunghyun Cho. Insertion-based Decoding with Automatically Inferred Generation Order. In arXiv, 2019.
185
+
186
+ Tatsunori B Hashimoto, Hugh Zhang, and Percy Liang. Unifying human and statistical evaluation for natural language generation. arXiv preprint arXiv:1904.02792, 2019.
187
+
188
+ Tianyu He, Xu Tan, Yingce Xia, Di He, Tao Qin, Zhibo Chen, and Tie-Yan Liu. Layer-wise coordination between encoder and decoder for neural machine translation. In Advances in Neural Information Processing Systems, pp. 7944–7954, 2018.
189
+
190
+ Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017.
191
+
192
+ Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In ICLR, 2015.
193
+
194
+ Wouter Kool, Herke Van Hoof, and Max Welling. Stochastic beams and where to find them: The Gumbel-top-k trick for sampling sequences without replacement. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 3499–3508, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/ v97/kool19a.html.
195
+
196
+ Taku Kudo. Subword regularization: Improving neural network translation models with multiple subword candidates. arXiv preprint arXiv:1804.10959, 2018.
197
+
198
+ Taku Kudo and John Richardson. Sentencepiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. arXiv preprint arXiv:1808.06226, 2018.
199
+
200
+ Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. arXiv preprint arXiv:1901.07291, 2019.
201
+
202
+ Chia-Wei Liu, Ryan Lowe, Iulian V Serban, Michael Noseworthy, Laurent Charlin, and Joelle Pineau. How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. arXiv preprint arXiv:1603.08023, 2016.
203
+
204
+ Ehsan Montahaei, Danial Alihosseini, and Mahdieh Soleymani Baghshah. Jointly measuring diversity and quality in text generation models. arXiv preprint arXiv:1904.03971, 2019.
205
+
206
+ Jekaterina Novikova, Ondˇrej Dusek, Amanda Cercas Curry, and Verena Rieser. Why we need new ˇ evaluation metrics for nlg. arXiv preprint arXiv:1707.06875, 2017.
207
+
208
+ Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pp. 311–318. Association for Computational Linguistics, 2002.
209
+
210
+ Mitchell Stern, William Chan, Jamie Kiros, and Jakob Uszkoreit. Insertion Transformer: Flexible Sequence Generation via Insertion Operations. In ICML, 2019.
211
+
212
+ Ilya Sutskever, Oriol Vinyals, and Quoc Le. Sequence to Sequence Learning with Neural Networks. In NIPS, 2014.
213
+
214
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention Is All You Need. In NIPS, 2017.
215
+
216
+ Sean Welleck, Kiante Brantley, Hal Daume, and Kyunghyun Cho. Non-Monotonic Sequential Text Generation. In ICML, 2019.
217
+
218
+ Yingce Xia, Tianyu He, Xu Tan, Fei Tian, Di He, and Tao Qin. Tied transformers: Neural machine translation with shared encoder and decoder. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 5466–5473, 2019.
219
+
220
+ Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. arXiv preprint arXiv:1906.08237, 2019.
221
+
222
+ Yaoming Zhu, Sidi Lu, Lei Zheng, Jiaxian Guo, Weinan Zhang, Jun Wang, and Yong Yu. Texygen: A benchmarking platform for text generation models. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pp. 1097–1100. ACM, 2018.
223
+
224
+ A APPENDICES
225
+
226
+ ![](images/15b78b80f5895858c478310c5d25f863b4f802958adcae2286ecc0eb11b850e3.jpg)
227
+ Figure 8: Quality-Diversity BLEU curve for several KERMIT models (bilingual, multitarget, joint) on the Multi30k text 2017 Flickr test set. Dotted diagonal line signifies BLEU equals SelfBLEU. Points indicate different temperatures, from 0.1 (low diversity, left in graph) to 1.0 (high diversity, right in graph)
228
+
229
+ ![](images/ae04656e17711e77b623eecf622768b4eda5e4a23ebcba92aae60419ae8fb851.jpg)
230
+ Figure 9: Quality-Diversity BLEU curve for several KERMIT models (bilingual, multitarget, joint) on the Multi30k text 2017 MSCOCO test set. Dotted diagonal line signifies BLEU equals SelfBLEU. Points indicate different temperatures, from 0.1 (low diversity, left in graph) to 1.0 (high diversity, right in graph)
231
+
232
+ A.2 ADDITIONAL MULTI30K TRANSLATION RESULTS
233
+ Table 2: Multi30k English French test BLEU.
234
+
235
+ <table><tr><td>Model</td><td>Inference</td><td>Test2016</td><td>Test2017</td><td>MSCOCO</td></tr><tr><td>Bilingual (EN → FR)</td><td>EN→FR</td><td>58.80</td><td>50.35</td><td>42.82</td></tr><tr><td>Bilingual (EN ←→FR) Multi-target (EN → Rest)</td><td>EN→FR EN →FR</td><td>59.29 58.08</td><td>52.13 50.39</td><td>42.17 42.19</td></tr><tr><td></td><td>EN →FR,CS,DE</td><td>58.52</td><td>50.49</td><td>41.53</td></tr><tr><td>Multi-target (Any → Rest)</td><td>EN→FR EN →FR,CS,DE</td><td>57.64 57.35</td><td>50.01 48.13</td><td>40.18 39.98</td></tr><tr><td>Joint (p(EN,FR,CS,DE))</td><td>EN→FR EN →FR,CS,DE</td><td>50.87 48.85</td><td>40.69 39.92</td><td>33.93 33.45</td></tr></table>
236
+
237
+ Table 3: Multi30k English Czech test BLEU.
238
+
239
+ <table><tr><td>Model</td><td>Inference</td><td>Test2016</td></tr><tr><td>Bilingual (EN → CS)</td><td>EN →CS</td><td>28.58</td></tr><tr><td>Bilingual (EN ← CS)</td><td>EN →CS</td><td>29.03</td></tr><tr><td rowspan="2">Multi-target (EN → Rest)</td><td>EN→CS</td><td>30.48</td></tr><tr><td>EN →FR,CS,DE</td><td>30.15</td></tr><tr><td rowspan="2">Multi-target (Any → Rest)</td><td>EN→CS</td><td>30.11</td></tr><tr><td>EN →FR,CS,DE</td><td>30.11</td></tr><tr><td rowspan="2">Joint (p(EN,FR,CS,DE))</td><td>EN →CS</td><td>26.45</td></tr><tr><td>EN →FR,CS,DE</td><td>26.35</td></tr></table>
240
+
241
+ <table><tr><td>Model</td><td>Inference</td><td>Test2016</td><td>Test2017</td><td>MSCOCO</td></tr><tr><td>Bilingual (DE →EN)</td><td>DE→EN</td><td>39.40</td><td>34.90</td><td>27.75</td></tr><tr><td>Bilingual (EN ←→DE)</td><td>DE→EN</td><td>40.52</td><td>35.66</td><td>28.61</td></tr><tr><td rowspan="2">Multi-target (DE → Rest)</td><td>DE→EN</td><td>40.75</td><td>36.38</td><td>28.91</td></tr><tr><td>DE →EN,FR,CS</td><td>39.72</td><td>35.95</td><td>28.20</td></tr><tr><td rowspan="2">Multi-target (Any → Rest)</td><td>DE→EN</td><td>40.69</td><td>36.02</td><td>28.89</td></tr><tr><td>DE →EN,FR,CS</td><td>39.97</td><td>37.07</td><td>28.62</td></tr><tr><td rowspan="2">Joint (p(EN,FR,CS,DE))</td><td>DE→EN</td><td>38.44</td><td>30.82</td><td>25.46</td></tr><tr><td>DE →EN,FR,CS</td><td>36.30</td><td>29.68</td><td>24.87</td></tr></table>
242
+
243
+ Table 4: Multi30k German English test BLEU.
244
+
245
+ # A.3 UNCONDITIONAL SAMPLING GENERATION
246
+
247
+ Figure 10 illustrates the serial sampling (one token at a time) from the joint model, every 20 timesteps
248
+ Figure 10: Example of serial sampling unconditional text generation from the joint $p ( { \bar { E } } N , F R , C S , D E )$ model, over 96 insertion time steps. Note that the model generates one long sequence and we split them into the resulting four sentences in each language here.
249
+
250
+ <table><tr><td rowspan=1 colspan=3>Iterations Language Generated Sentence from Joint Model</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>Mlady</td></tr><tr><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>descendantMlady muz v modré bundé stoupá poMann klettert.</td></tr><tr><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>blue jacket walking up a mountain.veste descendant paroi rocheuse enMlady muz v modré bunde stoupa po horach.Mann klettert.</td></tr><tr><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>A man blue jacket walking up a mountain.veste bleue descendant une paroi rocheuse en horu.Mlady muz v modré bunde stoupä po horach.Mann einer blauen klettert eine hoch.</td></tr><tr><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>A young man in blue jacket walking up a mountain.veste bleue descendant une paroi rocheuse en horu.Mlady muz v modré bunde stoupa po horach.Ein junger Mann in einer blauen Jacke klettert eine Felswand hoch.</td></tr><tr><td rowspan=1 colspan=1>96</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>A young man in a blue jacket walking up a mountain.Un jeune homme en veste bleue descendant une paroi rocheuse en horu.Mlady muz v modré bunde stoupa po horach.Ein junger Mann in einer blauen Jacke klettert eine Felswand hoch.</td></tr></table>
parse/train/r1xQNlBYPS/r1xQNlBYPS_content_list.json ADDED
@@ -0,0 +1,1316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "MULTICHANNEL GENERATIVE LANGUAGE MODELS ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 174,
8
+ 98,
9
+ 795,
10
+ 121
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous authors Paper under double-blind review ",
17
+ "bbox": [
18
+ 183,
19
+ 145,
20
+ 398,
21
+ 172
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "ABSTRACT ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 454,
31
+ 210,
32
+ 544,
33
+ 226
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "A channel corresponds to a viewpoint or transformation of an underlying meaning. A pair of parallel sentences in English and French express the same underlying meaning but through two separate channels corresponding to their languages. In this work, we present Multichannel Generative Language Models (MGLM), which models the joint distribution over multiple channels, and all its decompositions using a single neural network. MGLM can be trained by feeding it $k$ way parallel-data, bilingual data, or monolingual data across pre-determined channels. MGLM is capable of both conditional generation and unconditional sampling. For conditional generation, the model is given a fully observed channel, and generates the $k - 1$ channels in parallel. In the case of machine translation, this is akin to giving it one source, and the model generates $k - 1$ targets. MGLM can also do partial conditional sampling, where the channels are seeded with prespecified words, and the model is asked to infill the rest. Finally, we can sample from MGLM unconditionally over all $k$ channels. Our experiments on the Multi30K dataset containing English, French, Czech, and German languages suggest that the multitask training with the joint objective leads to improvements in bilingual translations. We provide a quantitative analysis of the quality-diversity trade-offs for different variants of the multichannel model for conditional generation, and a measurement of self-consistency during unconditional generation. We provide qualitative examples for parallel greedy decoding across languages and sampling from the joint distribution of the 4 languages. ",
40
+ "bbox": [
41
+ 233,
42
+ 241,
43
+ 764,
44
+ 532
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 INTRODUCTION ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 176,
54
+ 559,
55
+ 336,
56
+ 574
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "A natural way to consider two parallel sentences in different languages is that each language is expressing the same underlying meaning under a different viewpoint. Each language can be thought of as a transformation that maps an underlying concept into a view that we collectively agree is determined as ‘English’ or ‘French’. Similarly, an image of a cat and the word ‘cat’ are expressing two views of the same underlying concept. In this case, the image corresponds to a high bandwidth channel and the word ‘cat’ to a low bandwidth channel. This way of conceptualizing parallel viewpoints naturally leads to the formulation of a fully generative model over each instance, where the transformation corresponds to a particular generation of the underlying view. We define each of these views as a channel. As a concrete example, given a parallel corpus of English and French sentences, English and French become two channels and the corresponding generative model becomes $p$ (English, French). One key advantage to this formulation is that single model can be trained that can capture the full expressivity of the underlying concept, allowing us to compute conditionals and marginals along with the joint. In the case of parallel sentences, the conditionals correspond to translations from one channel to another while the marginals correspond to standard monolingual language models. ",
63
+ "bbox": [
64
+ 174,
65
+ 589,
66
+ 825,
67
+ 797
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "In this work, we present a general framework for modeling the joint distribution $p ( \\mathbf { x } _ { 1 } , . . . , \\mathbf { x } _ { k } )$ over $k$ channels. Our framework marginalizes over all possible factorizations of the joint distribution. Subsequently, this allows our framework to perform, 1) unconditional generation and 2) conditional generation. We harness existing recent work on insertion-based methods that utilize semi-autoregressive models that are permutation-invariant to the joint factorization. ",
74
+ "bbox": [
75
+ 174,
76
+ 805,
77
+ 823,
78
+ 875
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Specifically, we show a proof-of-concept multichannel modeling by extending KERMIT (Chan et al., 2019) to model the joint distribution over multiple sequence channels. Specifically, we train KERMIT on the Multi30K (Elliott et al., 2016) machine translation task, consisting of four languages: English (EN), French (FR), Czech (CS), and German (DE). One advantage of multilingual KERMIT is during inference, we can generate translation for a single target language, or generate translations for $k - 1$ languages in parallel in logarithmic time in the token length per language. We illustrate qualitative examples for parallel greedy decoding across languages and sampling from the joint distribution of the 4 languages. ",
85
+ "bbox": [
86
+ 176,
87
+ 882,
88
+ 823,
89
+ 922
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "",
96
+ "bbox": [
97
+ 174,
98
+ 103,
99
+ 825,
100
+ 174
101
+ ],
102
+ "page_idx": 1
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "The key contributions in this work are: ",
107
+ "bbox": [
108
+ 176,
109
+ 180,
110
+ 428,
111
+ 195
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "1. We present MGLM, a multichannel generative modeling framework. MGLM models the joint distribution $p ( \\mathbf { x } _ { 1 } , \\ldots , \\mathbf { x } _ { k } )$ over $k$ channels. \n2. We demonstrate both conditional generation (i.e., machine translation) and unconditional sampling from MGLM. \n3. In the case of conditional generation over multiple languages, we show that not only we are competitive in BLEU, but also with significant advantages in inference time and model memory savings. \n4. We analyze the Quality-Diversity tradeoff from sampling MGLM and prior work. ",
118
+ "bbox": [
119
+ 210,
120
+ 207,
121
+ 825,
122
+ 339
123
+ ],
124
+ "page_idx": 1
125
+ },
126
+ {
127
+ "type": "text",
128
+ "text": "We highlight that while we focus on languages as a specific instantiation of a channel, our framework can generalize to any arbitrary specification, such as other types of languages or other modalities. ",
129
+ "bbox": [
130
+ 174,
131
+ 349,
132
+ 825,
133
+ 378
134
+ ],
135
+ "page_idx": 1
136
+ },
137
+ {
138
+ "type": "text",
139
+ "text": "2 BACKGROUND ",
140
+ "text_level": 1,
141
+ "bbox": [
142
+ 174,
143
+ 400,
144
+ 326,
145
+ 416
146
+ ],
147
+ "page_idx": 1
148
+ },
149
+ {
150
+ "type": "text",
151
+ "text": "Traditional autoregressive sequence frameworks (Sutskever et al., 2014; Cho et al., 2014) model the conditional probability $p ( \\mathbf { y } \\mid \\mathbf { x } )$ of an output sequence $y$ conditioned on the input sequence $x$ with a left-to-right factorization. The model decomposes $p ( y \\mid x )$ as predicting one output token at time, conditioning on the previously generated output tokens $\\mathbf { y } _ { < t }$ and the input sequence $\\mathbf { x }$ : ",
152
+ "bbox": [
153
+ 174,
154
+ 433,
155
+ 825,
156
+ 489
157
+ ],
158
+ "page_idx": 1
159
+ },
160
+ {
161
+ "type": "equation",
162
+ "img_path": "images/97e67e617dae54f81a42bee280c7660a21a8a7c543293caa69c39c16fc820d4a.jpg",
163
+ "text": "$$\np ( \\mathbf { y } \\mid \\mathbf { x } ) = \\prod _ { t } p ( \\mathbf { y } _ { t } \\mid , \\mathbf { y } _ { < t } )\n$$",
164
+ "text_format": "latex",
165
+ "bbox": [
166
+ 406,
167
+ 496,
168
+ 591,
169
+ 530
170
+ ],
171
+ "page_idx": 1
172
+ },
173
+ {
174
+ "type": "text",
175
+ "text": "Recent encoder-decoder models with attention such as Transformer (Vaswani et al., 2017) have been successfully applied to various domains, including machine translation. If we were to apply this left-to-right autoregressive approach towards multichannel modeling, we would require to choose a particular factorization order, such as $\\begin{array} { r } { p ( \\mathbf { w } , \\mathbf { x } , \\mathbf { y } ) = p ( \\mathbf { w } ) p ( \\mathbf { x } | \\mathbf { w } ) p ( \\bar { \\mathbf { y } } | \\mathbf { x } , \\mathbf { w } ) } \\end{array}$ . ",
176
+ "bbox": [
177
+ 174,
178
+ 536,
179
+ 825,
180
+ 594
181
+ ],
182
+ "page_idx": 1
183
+ },
184
+ {
185
+ "type": "text",
186
+ "text": "Instead of assuming a fixed left-to-right decomposition, recent autoregressive insertion-based conditional modeling frameworks (Stern et al., 2019; Welleck et al., 2019; Gu et al., 2019) consider arbitrary factorization of the output sequence by using insertion operation, which predicts both (1) content token $c \\in { \\mathcal { C } }$ from the vocabulary, and (2) location $l$ insert, relative to the current partial output $\\hat { \\mathbf { y } } _ { t }$ : ",
187
+ "bbox": [
188
+ 173,
189
+ 599,
190
+ 825,
191
+ 670
192
+ ],
193
+ "page_idx": 1
194
+ },
195
+ {
196
+ "type": "equation",
197
+ "img_path": "images/977d22c53517ad82a52bd0425e29ab42f19efc8bf3433ee08df16248a3cc40ea.jpg",
198
+ "text": "$$\np ( c , l | \\mathbf { x } , \\hat { \\mathbf { y } } _ { t } ) = \\mathrm { I n s e r t i o n T r a n s f o r m e r } ( \\mathbf { x } , \\hat { \\mathbf { y } } _ { t } )\n$$",
199
+ "text_format": "latex",
200
+ "bbox": [
201
+ 354,
202
+ 678,
203
+ 643,
204
+ 695
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "Subsequent work, KERMIT (Chan et al., 2019), simplified the Insertion Transformer model by removing the encoder and only having a decoder, and the trick is to concatenate the original input and output sequence as one single sequence and optimize over all possible factorizations. Consequently, KERMIT is able to model the joint $p ( \\mathbf { x } , \\mathbf { y } )$ , conditionals $p ( \\mathbf { x } \\mid \\mathbf { y } ) , p ( \\mathbf { y } \\mid \\mathbf { x } )$ , as well as the marginals $p ( \\mathbf { x } ) , p ( \\mathbf { y } )$ . ",
211
+ "bbox": [
212
+ 173,
213
+ 709,
214
+ 825,
215
+ 781
216
+ ],
217
+ "page_idx": 1
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "Unlike with the left-to-right autoregressive approach, the exact computation of the log-likelihood equation 3 is not possible due to the intractable marginalization over the generation order $z$ , where $S _ { n }$ denotes the set of all possible permutations on $n$ elements. However, we can lower bound the log-likelihood using Jensen’s inequality: ",
222
+ "bbox": [
223
+ 174,
224
+ 786,
225
+ 823,
226
+ 843
227
+ ],
228
+ "page_idx": 1
229
+ },
230
+ {
231
+ "type": "equation",
232
+ "img_path": "images/100487bf0e0c7e4b278899b2870c5f26eed2a2ef4db1fc03a6cdf7cc8258a6a7.jpg",
233
+ "text": "$$\n\\begin{array} { r l } { \\log p ( x ) = \\log \\displaystyle \\sum _ { z \\in S _ { n } } p ( z ) p ( \\mathbf { x } \\mid z ) \\ ~ } & { } \\\\ { \\geq \\displaystyle \\sum _ { z \\in S _ { n } } p ( z ) \\log p ( \\mathbf { x } \\mid z ) } & { ~ = : \\mathcal { L } ( \\mathbf { x } ) } \\end{array}\n$$",
234
+ "text_format": "latex",
235
+ "bbox": [
236
+ 348,
237
+ 851,
238
+ 648,
239
+ 922
240
+ ],
241
+ "page_idx": 1
242
+ },
243
+ {
244
+ "type": "text",
245
+ "text": "The loss term can be simplified by changing the summation and careful decomposition of the permutation, leading to: ",
246
+ "bbox": [
247
+ 169,
248
+ 103,
249
+ 825,
250
+ 133
251
+ ],
252
+ "page_idx": 2
253
+ },
254
+ {
255
+ "type": "equation",
256
+ "img_path": "images/a7ff2cb8818c00c04865dc2b912cee50fb8e6a9f0aa09ba48f848996a805d94c.jpg",
257
+ "text": "$$\n\\begin{array} { l } { { \\displaystyle { \\mathcal { L } } ( x ) = \\sum _ { z \\in S _ { n } } p ( z ) \\log \\prod _ { i = 1 } ^ { n } p ( ( c _ { i } ^ { z } , l _ { i } ^ { z } ) \\mid \\mathbf { x } _ { 1 : i - 1 } ^ { z , i - 1 } ) } \\ ~ } \\\\ { { \\displaystyle ~ = \\sum _ { i = 1 } ^ { n } \\sum _ { z _ { 1 : i - 1 } } p ( z _ { 1 : i - 1 } ) \\sum _ { z _ { i } } p ( z _ { i } \\mid z _ { 1 : i - 1 } ) \\log p ( ( c _ { i } ^ { z } , l _ { i } ^ { z } ) \\mid \\mathbf { x } _ { 1 : i - 1 } ^ { z , i - 1 } ) } \\ ~ } \\end{array}\n$$",
258
+ "text_format": "latex",
259
+ "bbox": [
260
+ 272,
261
+ 137,
262
+ 725,
263
+ 224
264
+ ],
265
+ "page_idx": 2
266
+ },
267
+ {
268
+ "type": "text",
269
+ "text": "Inference can be autoregressive via greedy decoding: ",
270
+ "bbox": [
271
+ 176,
272
+ 228,
273
+ 519,
274
+ 243
275
+ ],
276
+ "page_idx": 2
277
+ },
278
+ {
279
+ "type": "equation",
280
+ "img_path": "images/0d1f9cc5b6e17c1de3e9ecaf3334f34b3b8d779b4d0d15a6de3531c03fc4ea3b.jpg",
281
+ "text": "$$\n( \\hat { c } , \\hat { l } ) = \\mathop { \\mathrm { a r g m a x } } _ { c , l } p ( c , l | \\hat { \\mathbf { x } } _ { t } ) ,\n$$",
282
+ "text_format": "latex",
283
+ "bbox": [
284
+ 408,
285
+ 248,
286
+ 588,
287
+ 277
288
+ ],
289
+ "page_idx": 2
290
+ },
291
+ {
292
+ "type": "text",
293
+ "text": "or partially autoregressive via parallel decoding: ",
294
+ "bbox": [
295
+ 173,
296
+ 282,
297
+ 491,
298
+ 297
299
+ ],
300
+ "page_idx": 2
301
+ },
302
+ {
303
+ "type": "equation",
304
+ "img_path": "images/089acb3843620311971f130a7bf1c5a24b86b2f7951087190990870182f42a5e.jpg",
305
+ "text": "$$\n\\hat { c } _ { l } = \\underset { c } { \\operatorname { a r g m a x } } p ( c \\mid l , \\hat { \\mathbf { x } } _ { t } ) ,\n$$",
306
+ "text_format": "latex",
307
+ "bbox": [
308
+ 415,
309
+ 303,
310
+ 581,
311
+ 327
312
+ ],
313
+ "page_idx": 2
314
+ },
315
+ {
316
+ "type": "text",
317
+ "text": "which is achieved by inserting at all non-finished slots. Stern et al. (2019) has shown that using a binary tree prior for $p ( z )$ led to $\\approx \\log _ { 2 } n$ iterations for $n$ token generation. ",
318
+ "bbox": [
319
+ 173,
320
+ 332,
321
+ 825,
322
+ 361
323
+ ],
324
+ "page_idx": 2
325
+ },
326
+ {
327
+ "type": "text",
328
+ "text": "3 MULTICHANNEL GENERATIVE LANGUAGE MODELS ",
329
+ "text_level": 1,
330
+ "bbox": [
331
+ 176,
332
+ 380,
333
+ 638,
334
+ 397
335
+ ],
336
+ "page_idx": 2
337
+ },
338
+ {
339
+ "type": "text",
340
+ "text": "In multichannel generative language mdataset consisting of a set of sequences $\\{ \\mathbf { x } _ { 1 } ^ { ( i ) } , \\bar { \\mathbf { \\Phi } } , \\mathbf { \\Phi } \\cdot \\cdot , \\mathbf { x } _ { k } ^ { ( i ) } \\} _ { i = 1 } ^ { M }$ s to learn a from up to $k$ enerative model channels, where $\\mathbf { \\bar { x } } _ { k } ^ { ( i ) } =$ $[ \\boldsymbol { x } _ { j , 1 } ^ { ( i ) } , \\ldots , \\boldsymbol { x } _ { j , n } ^ { ( i ) } ]$ represents a sequence of tokens from the $j$ -th channel for the $i$ -th example. The resulting MGLM models a joint generative distribution over multiple channels. While there are many possible implementation of Multichannel Generative Language Models, we chose to extended the work of Chan et al. (2019) to investigate applying the KERMIT objective on tasks with more than 2 sequences, in order to learn the joint distribution $p ( \\mathbf { x } _ { 1 } , \\ldots , \\mathbf { x } _ { k } )$ over $k$ channel sequences. For example, these channel sequences can denote different languages, such as learning $p ( E N , F R , C S , D E )$ . ",
341
+ "bbox": [
342
+ 173,
343
+ 411,
344
+ 825,
345
+ 532
346
+ ],
347
+ "page_idx": 2
348
+ },
349
+ {
350
+ "type": "image",
351
+ "img_path": "images/9c0fb840dac965ef01f65609359de12ca9dd429ed247e3661c94442750e142ed.jpg",
352
+ "image_caption": [
353
+ "Figure 1: (Left) An example multichannel modeling over 3 languages (English, French, Czech), Training Sets Inference where the model predicts the missing tokens at each location across multiple channels. (Right) Bilingual EN [SEP] FR [SEP] EN [SEP] During inference, MGLM can generate output sequence for a single target language channel (top), (Uni-direction) EN [SEP] or for multiple language channels in parallel (bottom), conditioning on source channel sentence and EN [SEP] FR [SEP] CS [SEP] partial translations of multiple language channels. "
354
+ ],
355
+ "image_footnote": [],
356
+ "bbox": [
357
+ 183,
358
+ 545,
359
+ 818,
360
+ 666
361
+ ],
362
+ "page_idx": 2
363
+ },
364
+ {
365
+ "type": "text",
366
+ "text": "(Any to Rest) EN [SEP] FR [SEP] CS [SEP] DE [SEP] We illustrate an example data input consisting of 3 channels in Figure 1 (left). We concatenate the EN [SEP] [SEP] sequences together from all channels for each example, separate by a SEP token. Even with shared Joint EN [SEP] FR [SEP] CS [SEP] DE [SEP] EN [SEP] [SEP] vocabulary, each channel results in a different token embedding, via an addition of a channel-specific Data for Model EN [SEP] [SEP] (learnable) embedding, or simply having a separately learned token embedding per channel. After Source Target Legend FR EN [SEP] [SEP] DE passing through the dense self-attention layers as in per Transformer architecture, the contextualized representation at each output time step predicts the possible tokens to be inserted to the left of the current input token. ",
367
+ "bbox": [
368
+ 174,
369
+ 762,
370
+ 825,
371
+ 861
372
+ ],
373
+ "page_idx": 2
374
+ },
375
+ {
376
+ "type": "text",
377
+ "text": "At inference (generation) time, we can generate unconditionally by seeding the canvas with the [SEP] token and predicting the first actual token, or provide as much, or as little, partial/complete sequence in each channel. Figure 1 (right) shows two possible decoding inference modes: a single target language channel (top), or multiple target language channels in parallel (bottom). ",
378
+ "bbox": [
379
+ 174,
380
+ 867,
381
+ 825,
382
+ 924
383
+ ],
384
+ "page_idx": 2
385
+ },
386
+ {
387
+ "type": "text",
388
+ "text": "4 EXPERIMENTS ",
389
+ "text_level": 1,
390
+ "bbox": [
391
+ 174,
392
+ 102,
393
+ 326,
394
+ 117
395
+ ],
396
+ "page_idx": 3
397
+ },
398
+ {
399
+ "type": "text",
400
+ "text": "We experiment on a multilingual dataset to demonstrate that we can learn MGLM. We perform both qualitative and quantitative experiments. We highlight the model’s capabilities ranging from conditional generation (i.e., machine translation) to unconditional sampling the joint distribution over multiple languages. ",
401
+ "bbox": [
402
+ 174,
403
+ 133,
404
+ 823,
405
+ 190
406
+ ],
407
+ "page_idx": 3
408
+ },
409
+ {
410
+ "type": "text",
411
+ "text": "We experiment on the Multi30k (Elliott et al., 2016; 2017; Barrault et al., 2018), a multilingual dataset which consists of 29000 parallel training sentences in English (EN), French (FR), Czech (CS), and German (DE) sentences. We use Multi30k because multiple high quality channels (multilingual translations in this case) is readily available to highlight our framework. We implement MGLM as a base Transformer decoder, without any causal masking, with 6 hidden layers and 1024 dimensional hidden representation. We concatenate all 4 language raw text training examples and use SentencePiece (Kudo & Richardson, 2018) to learn an universal subword unigram (Kudo, 2018) tokenizer with a shared 32K vocabulary size. We follow a similar training set up to BERT (Devlin et al., 2019), using Adam (Kingma & Ba, 2015) optimizer with learning rate of 1e-4, warmup over the first $10 \\%$ of the total training iterations varying between 10k to 50k iterations. We can train 3 different variants of MGLM by altering the sampling ratio of training data seen by the model: ",
412
+ "bbox": [
413
+ 174,
414
+ 196,
415
+ 825,
416
+ 349
417
+ ],
418
+ "page_idx": 3
419
+ },
420
+ {
421
+ "type": "text",
422
+ "text": "1. Bilingual (e.g., $\\mathrm { E N } \\mathrm { F R }$ ). We give the model a fully observed source (e.g., $E N )$ , and ask the model to infill the target (e.g., $F R$ ). \n2. Multi-target (e.g., any $1 \\mathrm { R e s t }$ ). We give the model a fully observed source (e.g., $E N$ ), and ask the model to infill the rest of the targets (e.g., DE, F R, CS). \n3. Joint. We ask the model to infill all the targets, consequently we learn a joint distribution over all the languages $p ( \\mathrm { e n } , \\mathrm { f r } , \\mathrm { d e } , \\mathrm { c s } )$ . ",
423
+ "bbox": [
424
+ 210,
425
+ 362,
426
+ 825,
427
+ 458
428
+ ],
429
+ "page_idx": 3
430
+ },
431
+ {
432
+ "type": "text",
433
+ "text": "4.1 TRANSLATION PERFORMANCE ",
434
+ "text_level": 1,
435
+ "bbox": [
436
+ 176,
437
+ 477,
438
+ 426,
439
+ 491
440
+ ],
441
+ "page_idx": 3
442
+ },
443
+ {
444
+ "type": "text",
445
+ "text": "The goal of MGLM is not conditional generation (i.e., machine translation), but nevertheless, we demonstrate its ability to do conditional generation in this section. We report the BLEU scores on the three test sets: test 2016 Flickr, test 2017 Flickr, test 2017 MSCOCO, for different English $ \\{ \\begin{array} { r l } \\end{array} $ {German, French, Czech} translations. We use parallel greedy decoding (Stern et al., 2019; Chan et al., 2019), i.e. inserting to all incomplete slots. Table 1 summarizes the results for English to German and vice versa, respectively. Additional results for English to French, English to Czech, and German to English are shown in Appendix A.2. We observe that the Multitarget models performed similar to slightly better than the bilingual models trained only on a single language pair. This is particularly useful when multiple machine translation targets are desired. We now only need one MGLM model which is competitive to the bidirectional expert models. This implies we only need 1 model for inference over multiple languages, as opposed to $N$ models (i.e., saving substantial memory). ",
446
+ "bbox": [
447
+ 173,
448
+ 502,
449
+ 825,
450
+ 669
451
+ ],
452
+ "page_idx": 3
453
+ },
454
+ {
455
+ "type": "text",
456
+ "text": "We also observe the full generative joint model has a BLEU gap compared to the bilingual baseline, which is consistent with the findings in Chan et al. (2019). We hypothesize this is due to the joint distribution being a more challenging task. We further hypothesize that in particular, during training the Joint model needs to fantasize additional details when conditioning on partial sequence in each of the channels. This results in fantasizing additional details not present in the original source sentence during translation tasks. ",
457
+ "bbox": [
458
+ 174,
459
+ 676,
460
+ 825,
461
+ 760
462
+ ],
463
+ "page_idx": 3
464
+ },
465
+ {
466
+ "type": "text",
467
+ "text": "4.2 PARALLEL GREEDY DECODING: PARALLEL IN TARGET LANGUAGES ",
468
+ "bbox": [
469
+ 174,
470
+ 779,
471
+ 687,
472
+ 792
473
+ ],
474
+ "page_idx": 3
475
+ },
476
+ {
477
+ "type": "text",
478
+ "text": "As alluded conceptually in Figure 1 and in the previous section, our KERMIT-based MGLM is also able to perform parallel greedy decoding that is also parallel in number of target languages. We illustrate this process in Figure 2. By starting with $K$ initial [SEP] tokens for $K$ target output languages, MGLM can decode $K$ target languages that has at most $n$ output tokens per language in ${ \\mathcal { O } } ( \\log n )$ , i.e. constant in number of target languages. ",
479
+ "bbox": [
480
+ 174,
481
+ 804,
482
+ 825,
483
+ 875
484
+ ],
485
+ "page_idx": 3
486
+ },
487
+ {
488
+ "type": "text",
489
+ "text": "We investigate the relative speed up in generating multiple target language outputs in parallel versus generating the targets in series, in terms of wall-clock time and number of decoding iterations. In Figure 3a, we plot the number of decoding iterations taken versus the total output length $N$ for each ",
490
+ "bbox": [
491
+ 176,
492
+ 882,
493
+ 823,
494
+ 924
495
+ ],
496
+ "page_idx": 3
497
+ },
498
+ {
499
+ "type": "table",
500
+ "img_path": "images/f6d0b27b175b4e24654e0c911de8193a8c2b9b0d1acb4b818d6b727ac007ddd4.jpg",
501
+ "table_caption": [
502
+ "Table 1: Multi30k English German test BLEU. ",
503
+ "Input: A man sits on a bench holding his dog and looking at the water. Parallel Decode: "
504
+ ],
505
+ "table_footnote": [],
506
+ "table_body": "<table><tr><td>Model</td><td>Inference</td><td>Test2016</td><td>Test2017</td><td>MSCOCO</td></tr><tr><td>Bilingual (EN→DE)</td><td>EN→DE</td><td>36.14</td><td>28.32</td><td>24.15</td></tr><tr><td>Bilingual (EN ←DE)</td><td>EN →DE</td><td>37.08</td><td>28.69</td><td>26.11</td></tr><tr><td>Multi-target (EN → Rest)</td><td>EN→DE EN →FR,CS,DE</td><td>36.83 35.41</td><td>28.35 29.69</td><td>25.14 25.64</td></tr><tr><td>Multi-target (Any → Rest)</td><td>EN →DE EN →FR,CS,DE</td><td>36.63 36.51</td><td>28.37 28.53</td><td>26.98 25.84</td></tr><tr><td>Joint (p(EN,FR,CS,DE))</td><td>EN →DE EN →FR,CS,DE</td><td>33.06 32.53</td><td>23.42 23.78</td><td>21.39 20.97</td></tr></table>",
507
+ "bbox": [
508
+ 223,
509
+ 99,
510
+ 774,
511
+ 250
512
+ ],
513
+ "page_idx": 4
514
+ },
515
+ {
516
+ "type": "text",
517
+ "text": "FR: Un homme est assis sur un banc , ten ant son chien et regardant l ’ eau . [SEP] CS: Muzˇ sed´ı na lavicceˇ a drzˇ´ı sve´ ho psa a d´ıva´ se na vodu . [SEP] DE: Ein Mann sitzt auf einer Bank und halt ¨ seine n Hund und schaut auf das Wasser . [SEP] FR: Un homme est assis sur un banc , ten ant son chien et regardant l ’ eau . [SEP] CS: Muzˇ sed´ı na lavicce ˇ a drzˇ´ı sve´ ho psa a d´ıva´ se na vodu . [SEP] DE: Ein Mann sitzt auf einer Bank und halt ¨ seine n Hund und schaut auf das Wasser . [SEP] FR: Un homme est assis sur un banc , ten ant son chien et regardant l ’ eau . [SEP] CS: Muzˇ sed´ı na lavicceˇ a drzˇ´ı sve´ ho psa a d´ıva´ se na vodu . [SEP] DE: Ein Mann sitzt auf einer Bank und halt ¨ seine n Hund und schaut auf das Wasser . [SEP] FR: Un homme est assis sur un banc , ten ant son chien et regardant l ’ eau . [SEP] CS: Muzˇ sed´ı na lavicce ˇ a drzˇ´ı sve´ ho psa a d´ıva´ se na vodu . [SEP] DE: Ein Mann sitzt auf einer Bank und halt ¨ seine n Hund und schaut auf das Wasser . [SEP] FR: Un homme est assis sur un banc , ten ant son chien et regardant l ’ eau . [SEP] CS: Muzˇ sed´ı na lavicceˇ a drzˇ´ı sve´ ho psa a d´ıva´ se na vodu . [SEP] DE: Ein Mann sitzt auf einer Bank und halt ¨ seine n Hund und schaut auf das Wasser . [SEP] sentence in the test 2016 Flickr test set, using the Joint KERMIT model when decoding from a single source language to 3 target languages: English {French, German, Czech}. When performing serial target decoding, we only output the target conditioned on English, i.e. English French, English German, English $ \\mathrm { C z e c h }$ . We also plot several theoretical bounds: (1) upper bound $( N )$ when decoding entirely serially, (2) lower bound $3 ( \\lfloor \\log _ { 2 } ( N / 3 ) \\rfloor + 2 )$ when decoding 3 languages serially but parallel within each language, (3) lower bound $\\lfloor \\bar { \\log _ { 2 } ( N / 3 ) } \\rfloor + 2$ , when decoding the 3 target languages in parallel and parallel within each language, and (4) $\\lfloor \\log _ { 2 } ( N ) \\rfloor + 2$ , if we decode the entire output in parallel as a single sequence. We observe that our model is able to meet the lower bound several times and in many cases decode below the fourth $\\lfloor \\log _ { 2 } ( N ) \\rfloor + 2$ bound. Figure 3b compares the wall-clock speed up when decoding targets in parallel vs. in series, with a linear regression line plotted. Our model achieving almost 3 times speed up in wall-clock speed. The parallel targets decoding is bottlenecked by the target language with the longest output sequence. Figure 3c compares the total output length when decoding the targets in series versus in parallel. We observe that there is a linear relationship between the output lengths using the two modes. ",
518
+ "bbox": [
519
+ 183,
520
+ 315,
521
+ 834,
522
+ 526
523
+ ],
524
+ "page_idx": 4
525
+ },
526
+ {
527
+ "type": "text",
528
+ "text": "",
529
+ "bbox": [
530
+ 174,
531
+ 626,
532
+ 825,
533
+ 833
534
+ ],
535
+ "page_idx": 4
536
+ },
537
+ {
538
+ "type": "text",
539
+ "text": "4.3 CONDITIONAL BILINGUAL GENERATION: QUALITY-DIVERSITY TRADE-OFF ",
540
+ "text_level": 1,
541
+ "bbox": [
542
+ 176,
543
+ 853,
544
+ 740,
545
+ 868
546
+ ],
547
+ "page_idx": 4
548
+ },
549
+ {
550
+ "type": "text",
551
+ "text": "We first evaluated the models on conditional generation task by sampling bilingual translations (1 source, 1 target language) for each of the 12 language pair directions. We sample the token and location $( c , l ) \\sim p \\bar { ( } c , l \\bar { | } x , \\hat { y } )$ from the partial canvas at each iteration, generating 100 hypothesis translations per source sentence, at softmax temperature $\\tau = 0 . 1 , 0 . 5 , 1 . 0$ . At each temperature and model, we computed the quality of the generated samples by computing the BLEU Papineni et al. (2002) score between the reference translation and the samples, and the diversity by computing the pairwise BLEU between the 100 samples per source, also known as Self-BLEU Zhu et al. (2018). Lower Self-BLEU indicates the higher the diversity as there is less overlap between the samples. ",
552
+ "bbox": [
553
+ 176,
554
+ 882,
555
+ 823,
556
+ 924
557
+ ],
558
+ "page_idx": 4
559
+ },
560
+ {
561
+ "type": "image",
562
+ "img_path": "images/7c704ca18da7d43725ecb9a85b59f68eff1e4dcbf5f2143abb117692517c360b.jpg",
563
+ "image_caption": [
564
+ "Figure 3: (Left) Number of decoding iterations vs. the output length when decoding each target language serially vs. in parallel, compared to various logarithmic bounds. We have shown that the model is able to achieve close to the theoretical lower bound $\\lfloor \\log _ { 2 } ( N / k ) \\rfloor + 2$ where number of target languages $k = 3$ . (Middle) Relative wall-clock speed up when using the parallel target languages decoding vs. serial, achieving slightly under 3 times the performance. (Right) Total output length for the 3 target languages when using serial vs parallel target language generation. While not identical, we observe a linear relationship between the output length using the two different modes "
565
+ ],
566
+ "image_footnote": [],
567
+ "bbox": [
568
+ 186,
569
+ 109,
570
+ 797,
571
+ 248
572
+ ],
573
+ "page_idx": 5
574
+ },
575
+ {
576
+ "type": "text",
577
+ "text": "",
578
+ "bbox": [
579
+ 173,
580
+ 383,
581
+ 825,
582
+ 454
583
+ ],
584
+ "page_idx": 5
585
+ },
586
+ {
587
+ "type": "image",
588
+ "img_path": "images/fef91c59aaf657958fea15e87a64c47704d4bf6d9852fc5faada4b7486f05779.jpg",
589
+ "image_caption": [
590
+ "Figure 4: Quality-Diversity BLEU curve for several KERMIT models (bilingual, multitarget, joint) on the Multi30k text 2016 Flickr test set. Dotted diagonal line signifies BLEU equals SelfBLEU. Points indicate different temperatures, from 0.1 (low diversity, left in graph) to 1.0 (high diversity, right in graph) "
591
+ ],
592
+ "image_footnote": [],
593
+ "bbox": [
594
+ 176,
595
+ 468,
596
+ 821,
597
+ 630
598
+ ],
599
+ "page_idx": 5
600
+ },
601
+ {
602
+ "type": "text",
603
+ "text": "Figure 4 illustrates the Quality-Diversity trade-off for the three models for different translation pairs involving English as one of the language. The top right portion of the graph is the ideal area. We observed that the Multitarget model outperformed the Bilingual model at lower temperature (both higher quality and diversity), and at higher temperature slightly above or below in quality but still higher diversity. Note that only one single Multitarget model was used for all language pair at inference time, while each bilingual model was different for each language pair curve. Therefore, a single Multitarget KERMIT model could outperform specialized bilingual KERMIT models. ",
604
+ "bbox": [
605
+ 173,
606
+ 713,
607
+ 825,
608
+ 811
609
+ ],
610
+ "page_idx": 5
611
+ },
612
+ {
613
+ "type": "text",
614
+ "text": "4.4 PARTIAL CONDITIONING MULTILINGUAL GENERATION ",
615
+ "text_level": 1,
616
+ "bbox": [
617
+ 173,
618
+ 828,
619
+ 598,
620
+ 843
621
+ ],
622
+ "page_idx": 5
623
+ },
624
+ {
625
+ "type": "text",
626
+ "text": "We demonstrate our model’s ability to generate infilling for partial conditioning over the multiple channels. To be explicit, we seed each channel with a few (different) words, and sample from the model. We ask the model what text completions would best fit under the model’s posterior. Figure 5 highlights several examples for (English, French, German) sentence completion. We took an example from the test 2016 Flickr test set and split it into 3 chunks–beginning in English, middle in French, and ending in German–and sample completion. The model is able to generate a set of diverse, coherent examples. ",
627
+ "bbox": [
628
+ 174,
629
+ 853,
630
+ 823,
631
+ 924
632
+ ],
633
+ "page_idx": 5
634
+ },
635
+ {
636
+ "type": "text",
637
+ "text": "",
638
+ "bbox": [
639
+ 171,
640
+ 103,
641
+ 823,
642
+ 132
643
+ ],
644
+ "page_idx": 6
645
+ },
646
+ {
647
+ "type": "text",
648
+ "text": "English Groundtruth: A young boy, wearing a chef’s hat and apron, is cutting sausages in a kitchen. ",
649
+ "bbox": [
650
+ 174,
651
+ 152,
652
+ 781,
653
+ 165
654
+ ],
655
+ "page_idx": 6
656
+ },
657
+ {
658
+ "type": "text",
659
+ "text": "French Groundtruth: Un jeune garc¸on, portant une toque et un tablier, coupe des saucisses dans une cuisine. German Groundtruth: Ein kleiner Junge mit Kochmutze und Sch ¨ urze schneidet in einer K ¨ uche W ¨ urstchen. ¨ ",
660
+ "bbox": [
661
+ 173,
662
+ 166,
663
+ 818,
664
+ 190
665
+ ],
666
+ "page_idx": 6
667
+ },
668
+ {
669
+ "type": "text",
670
+ "text": "English Seed: A young boy, French Seed: portant une toque et un tablier, German Seed: chneidet in einer Kuche W ¨ urstchen. ¨ ",
671
+ "bbox": [
672
+ 174,
673
+ 203,
674
+ 482,
675
+ 241
676
+ ],
677
+ "page_idx": 6
678
+ },
679
+ {
680
+ "type": "text",
681
+ "text": "English: A young boy , wearing a hat , and an apron grilling hotdogs in the kitchen. ",
682
+ "bbox": [
683
+ 178,
684
+ 253,
685
+ 676,
686
+ 266
687
+ ],
688
+ "page_idx": 6
689
+ },
690
+ {
691
+ "type": "text",
692
+ "text": "French: Un jeune garc¸on portant une toque et un tablier, faisant cuire du citron et des hotdogs dans la cuisine. German: Ein junger Mann tragt eine M ¨ utze und ¨ schneidet in einer Kuche W ¨ urstchen. ¨ ",
693
+ "bbox": [
694
+ 173,
695
+ 267,
696
+ 820,
697
+ 291
698
+ ],
699
+ "page_idx": 6
700
+ },
701
+ {
702
+ "type": "text",
703
+ "text": "English: A young boy , wearing a hat and a apron, is in a kitchen , cutting with various foods on it. ",
704
+ "bbox": [
705
+ 178,
706
+ 296,
707
+ 781,
708
+ 309
709
+ ],
710
+ "page_idx": 6
711
+ },
712
+ {
713
+ "type": "text",
714
+ "text": "French: Un jeune garc¸on, portant une toque et un tablier, est dans une cuisine en projetant des poeles de la ˆ nourriture. ",
715
+ "bbox": [
716
+ 171,
717
+ 310,
718
+ 805,
719
+ 333
720
+ ],
721
+ "page_idx": 6
722
+ },
723
+ {
724
+ "type": "text",
725
+ "text": "German: Ein kleiner Junge mit Hut und Schurze ¨ schneidet in einer Kuche W ¨ urstchen. ¨ ",
726
+ "bbox": [
727
+ 176,
728
+ 335,
729
+ 686,
730
+ 347
731
+ ],
732
+ "page_idx": 6
733
+ },
734
+ {
735
+ "type": "text",
736
+ "text": "English: A young boy, wearing an orange hat and apron, puts barbecue chicken in a kitchen. French: Un jeune garc¸on, portant une toque et un tablier, coupant du poulet dans une cuisine. German: Ein kleiner Junge in einer weißen Mutze und mit Sch ¨ urze ¨ schneidet in einer Kuche W ¨ urstchen ¨ glas ",
737
+ "bbox": [
738
+ 169,
739
+ 352,
740
+ 820,
741
+ 390
742
+ ],
743
+ "page_idx": 6
744
+ },
745
+ {
746
+ "type": "text",
747
+ "text": "English: A young boy, wearing a blue hat and apron, is cooking meat in a kitchen. French: Un petit garc¸on, portant une toque et un tablier, fait la cuisine dans une cuisine. German: Ein kleiner Junge mit blauer Mutze und ¨ schneidet in einer Kuche W ¨ urstchen. ¨ ",
748
+ "bbox": [
749
+ 176,
750
+ 396,
751
+ 700,
752
+ 434
753
+ ],
754
+ "page_idx": 6
755
+ },
756
+ {
757
+ "type": "text",
758
+ "text": "Figure 5: Partially conditional generation samples drawn from our model. The seed text is shown in gray, with several different in-filling samples from the model in black. The samples show reasonable consistency and diversity across samples. ",
759
+ "bbox": [
760
+ 173,
761
+ 450,
762
+ 821,
763
+ 491
764
+ ],
765
+ "page_idx": 6
766
+ },
767
+ {
768
+ "type": "text",
769
+ "text": "4.5 UNCONDITIONAL MULTILINGUAL GENERATION ",
770
+ "text_level": 1,
771
+ "bbox": [
772
+ 174,
773
+ 518,
774
+ 547,
775
+ 532
776
+ ],
777
+ "page_idx": 6
778
+ },
779
+ {
780
+ "type": "text",
781
+ "text": "We then evaluated the models on unconditional multilingual generation task, to generate a sentence each in all 4 languages such that they correspond to each other. For the Joint model, we perform 3 types of sampling: (1) unrestricted, (2) chain, and (3) common cause. For unrestricted, we sampled one (token, location) at each iteration starting from an empty canvas, allowing the model to insert a token in any language, until all slots were marked as completed. In the chain generation, we first restrict to generating English sentence one token at a time, then sampled French, German, and Czech in order, conditioned on the last sentence in the previous language. For common cause, we reuse the same English and French sampled sentences, and generate the German and Czech conditioned on the English sentence (i.e. 3 languages are all conditioned on English). ",
782
+ "bbox": [
783
+ 174,
784
+ 544,
785
+ 825,
786
+ 670
787
+ ],
788
+ "page_idx": 6
789
+ },
790
+ {
791
+ "type": "text",
792
+ "text": "Given these sets of sentences in 4 languages, for each pair of language direction, we computed a pseudo target by using a separately trained (on Multi30k) vanilla Transformer (Vaswani et al., 2017) and performed beam search (size 5) to translate the chosen source language sample. Figure 6 visualizes the pseudo target BLEU score for different source-target language pairs when comparing the Joint model under different types of sampling. The shaded colour represents the difference between the current sampling scheme versus the unrestricted reference. We observe that letting the model sample in unrestricted order was better than either the chain or the common cause sampling. ",
793
+ "bbox": [
794
+ 174,
795
+ 676,
796
+ 825,
797
+ 773
798
+ ],
799
+ "page_idx": 6
800
+ },
801
+ {
802
+ "type": "text",
803
+ "text": "5 RELATED WORK ",
804
+ "text_level": 1,
805
+ "bbox": [
806
+ 176,
807
+ 794,
808
+ 344,
809
+ 810
810
+ ],
811
+ "page_idx": 6
812
+ },
813
+ {
814
+ "type": "text",
815
+ "text": "While we have demonstrated a KERMIT implementation of a MGLM, many other variants of Transformer models contain similar properties. Xia et al. (2019) and He et al. (2018) both consider shared encoder/decoders while KERMIT removes altogether the distinction between the encoder and decoder. XLNet (Yang et al., 2019) also learns over all permutation of the factorization order, in addition to architectural modification for two-stream attention parameterization to resolve ambiguity in the targets. The idea of concatenating pairs of source and target sequences from different language channels have been explored by Lample & Conneau (2019). However, unlike the insertion objective, their model is trained through Masked Language Modeling as in BERT (Devlin et al., 2019), and therefore was not readily able to be used for generation. ",
816
+ "bbox": [
817
+ 174,
818
+ 825,
819
+ 823,
820
+ 924
821
+ ],
822
+ "page_idx": 6
823
+ },
824
+ {
825
+ "type": "image",
826
+ "img_path": "images/256add9e3845f9454ab0417731952c48f0807d2b4707c39868f7c06bfbca91ab.jpg",
827
+ "image_caption": [
828
+ "Figure 6: Unconditional multilingual generation Pseudo-Target BLEU for self-consistency when generating sentences in multiple languages. Colour shading indicates the difference compared to the Joint model (unrestricted) generation. ",
829
+ "Figure 7: Example unconditional text generation samples from the Joint (top) and chain of Bilingual model (bottom). Note that the Joint model generates one long sequence and we split them into the resulting four sentences in each language here, while Bilingual generate a complete sentence in each language conditioned on previous sentence. "
830
+ ],
831
+ "image_footnote": [],
832
+ "bbox": [
833
+ 225,
834
+ 99,
835
+ 774,
836
+ 233
837
+ ],
838
+ "page_idx": 7
839
+ },
840
+ {
841
+ "type": "table",
842
+ "img_path": "images/7685687d723a6f92e8cb5f0e1e0729fcb08e5cec34ac4f28759d152bacca09fc.jpg",
843
+ "table_caption": [],
844
+ "table_footnote": [],
845
+ "table_body": "<table><tr><td rowspan=1 colspan=2>Model Language</td><td rowspan=1 colspan=1>Generated Sentences</td></tr><tr><td rowspan=1 colspan=1>Joint</td><td rowspan=1 colspan=1>EnglishFrenchGermanCzech</td><td rowspan=1 colspan=1>A young man in a blue jacket walking up a mountain.Un jeune homme en veste bleue descendant une paroi rocheuse en horu.Ein junger Mann in einer blauen Jacke klettert eine Felswand hoch.Mlady muz v modré bunde stoupä po horach.~&quot;Young men in blue jackets ascend and climb mountains.&quot;</td></tr><tr><td rowspan=1 colspan=1>Biling.</td><td rowspan=1 colspan=1>EnglishFrenchGermanCzech</td><td rowspan=1 colspan=1>Two small white dogs are holding the duck in a fenced yard.Deux petits chiens blancs tenant un canard dans une cour cloturée.Zwei kleine weiBe Hunde halten eine gelbe Ente in einem eingezäunten Hof.Dva mali chlapci drzi zlutou panou venku u zlutého oploceném nädvori.~&quot;Two little boys holding a yellow gentleman outside by a yellow fenced courtyard.&quot; X</td></tr></table>",
846
+ "bbox": [
847
+ 173,
848
+ 304,
849
+ 846,
850
+ 464
851
+ ],
852
+ "page_idx": 7
853
+ },
854
+ {
855
+ "type": "text",
856
+ "text": "",
857
+ "bbox": [
858
+ 174,
859
+ 559,
860
+ 820,
861
+ 587
862
+ ],
863
+ "page_idx": 7
864
+ },
865
+ {
866
+ "type": "text",
867
+ "text": "Evaluation of text generative models remain a challenge (Liu et al., 2016; Novikova et al., 2017). Quality versus diversity plots have been used to compare the trade-off at different output softmax temperatures, as such in Stochastic Beam Search (Kool et al., 2019) which used a simpler $n$ -gram diversity instead of Self-BLEU (Zhu et al., 2018). However, we are the first to characterize the Q-D behaviour of insertion based models, versus existing left-to-right language models. Other metrics summarize the quality and diversity trade-off as a single number, such as Frechet BERT Distance (Montahaei et al., 2019) inspired by the FID score (Heusel et al., 2017) used in computer vision, or take into account human evaluation (Hashimoto et al., 2019). ",
868
+ "bbox": [
869
+ 174,
870
+ 593,
871
+ 825,
872
+ 705
873
+ ],
874
+ "page_idx": 7
875
+ },
876
+ {
877
+ "type": "text",
878
+ "text": "6 CONCLUSION ",
879
+ "text_level": 1,
880
+ "bbox": [
881
+ 176,
882
+ 726,
883
+ 318,
884
+ 741
885
+ ],
886
+ "page_idx": 7
887
+ },
888
+ {
889
+ "type": "text",
890
+ "text": "We have demonstrated that a multichannel model implemented with KERMIT can learn a joint distribution over more than two sequences. Furthermore, our multichannel KERMIT model allows for efficient inference of multiple target languages in parallel using a single model. Our work focused on a specific instantiation of channels in the case of languages. However, there are no model limitations that inhibit further generalization to other notion of channels. In future work we aim to consider the addition of multimodal channels, such as images as well as other textual channels, such as paraphrases, premises and hypotheses, as well as questions and answers. Fully generative models still often lag behind purely discriminitive counterparts in terms of performance, but we believe it is crucial to make steps towards other model formulations that have high potential. We also intend to explore the limits on the number of channels that can be considered, such as building generative models over dozens or even hundereds of languages. We hope this initial line of work motivates future research on building generative models of the world. ",
891
+ "bbox": [
892
+ 174,
893
+ 757,
894
+ 825,
895
+ 924
896
+ ],
897
+ "page_idx": 7
898
+ },
899
+ {
900
+ "type": "text",
901
+ "text": "REFERENCES ",
902
+ "text_level": 1,
903
+ "bbox": [
904
+ 174,
905
+ 102,
906
+ 287,
907
+ 117
908
+ ],
909
+ "page_idx": 8
910
+ },
911
+ {
912
+ "type": "text",
913
+ "text": "Lo¨ıc Barrault, Fethi Bougares, Lucia Specia, Chiraag Lala, Desmond Elliott, and Stella Frank. Findings of the third shared task on multimodal machine translation. In Proceedings of the Third Conference on Machine Translation: Shared Task Papers, pp. 304–323, 2018. ",
914
+ "bbox": [
915
+ 176,
916
+ 126,
917
+ 821,
918
+ 169
919
+ ],
920
+ "page_idx": 8
921
+ },
922
+ {
923
+ "type": "text",
924
+ "text": "William Chan, Nikita Kitaev, Kelvin Guu, Mitchell Stern, and Jakob Uszkoreit. KERMIT: Generative Insertion-Based Modeling for Sequences, 2019. ",
925
+ "bbox": [
926
+ 171,
927
+ 178,
928
+ 823,
929
+ 208
930
+ ],
931
+ "page_idx": 8
932
+ },
933
+ {
934
+ "type": "text",
935
+ "text": "Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation. In EMNLP, 2014. ",
936
+ "bbox": [
937
+ 174,
938
+ 217,
939
+ 823,
940
+ 260
941
+ ],
942
+ "page_idx": 8
943
+ },
944
+ {
945
+ "type": "text",
946
+ "text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In NAACL, 2019. ",
947
+ "bbox": [
948
+ 173,
949
+ 268,
950
+ 821,
951
+ 299
952
+ ],
953
+ "page_idx": 8
954
+ },
955
+ {
956
+ "type": "text",
957
+ "text": "Desmond Elliott, Stella Frank, Khalil Sima’an, and Lucia Specia. Multi30k: Multilingual englishgerman image descriptions. arXiv preprint arXiv:1605.00459, 2016. ",
958
+ "bbox": [
959
+ 174,
960
+ 308,
961
+ 820,
962
+ 337
963
+ ],
964
+ "page_idx": 8
965
+ },
966
+ {
967
+ "type": "text",
968
+ "text": "Desmond Elliott, Stella Frank, Lo¨ıc Barrault, Fethi Bougares, and Lucia Specia. Findings of the second shared task on multimodal machine translation and multilingual image description. In Proceedings of the Second Conference on Machine Translation, Volume 2: Shared Task Papers, pp. 215–233, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/W17-4718. ",
969
+ "bbox": [
970
+ 173,
971
+ 347,
972
+ 825,
973
+ 417
974
+ ],
975
+ "page_idx": 8
976
+ },
977
+ {
978
+ "type": "text",
979
+ "text": "Jiatao Gu, Qi Liu, and Kyunghyun Cho. Insertion-based Decoding with Automatically Inferred Generation Order. In arXiv, 2019. ",
980
+ "bbox": [
981
+ 171,
982
+ 426,
983
+ 823,
984
+ 455
985
+ ],
986
+ "page_idx": 8
987
+ },
988
+ {
989
+ "type": "text",
990
+ "text": "Tatsunori B Hashimoto, Hugh Zhang, and Percy Liang. Unifying human and statistical evaluation for natural language generation. arXiv preprint arXiv:1904.02792, 2019. ",
991
+ "bbox": [
992
+ 171,
993
+ 464,
994
+ 823,
995
+ 494
996
+ ],
997
+ "page_idx": 8
998
+ },
999
+ {
1000
+ "type": "text",
1001
+ "text": "Tianyu He, Xu Tan, Yingce Xia, Di He, Tao Qin, Zhibo Chen, and Tie-Yan Liu. Layer-wise coordination between encoder and decoder for neural machine translation. In Advances in Neural Information Processing Systems, pp. 7944–7954, 2018. ",
1002
+ "bbox": [
1003
+ 176,
1004
+ 503,
1005
+ 823,
1006
+ 546
1007
+ ],
1008
+ "page_idx": 8
1009
+ },
1010
+ {
1011
+ "type": "text",
1012
+ "text": "Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, pp. 6626–6637, 2017. ",
1013
+ "bbox": [
1014
+ 174,
1015
+ 556,
1016
+ 823,
1017
+ 599
1018
+ ],
1019
+ "page_idx": 8
1020
+ },
1021
+ {
1022
+ "type": "text",
1023
+ "text": "Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In ICLR, 2015. ",
1024
+ "bbox": [
1025
+ 171,
1026
+ 608,
1027
+ 805,
1028
+ 623
1029
+ ],
1030
+ "page_idx": 8
1031
+ },
1032
+ {
1033
+ "type": "text",
1034
+ "text": "Wouter Kool, Herke Van Hoof, and Max Welling. Stochastic beams and where to find them: The Gumbel-top-k trick for sampling sequences without replacement. In Kamalika Chaudhuri and Ruslan Salakhutdinov (eds.), Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pp. 3499–3508, Long Beach, California, USA, 09–15 Jun 2019. PMLR. URL http://proceedings.mlr.press/ v97/kool19a.html. ",
1035
+ "bbox": [
1036
+ 174,
1037
+ 633,
1038
+ 825,
1039
+ 717
1040
+ ],
1041
+ "page_idx": 8
1042
+ },
1043
+ {
1044
+ "type": "text",
1045
+ "text": "Taku Kudo. Subword regularization: Improving neural network translation models with multiple subword candidates. arXiv preprint arXiv:1804.10959, 2018. ",
1046
+ "bbox": [
1047
+ 171,
1048
+ 727,
1049
+ 823,
1050
+ 756
1051
+ ],
1052
+ "page_idx": 8
1053
+ },
1054
+ {
1055
+ "type": "text",
1056
+ "text": "Taku Kudo and John Richardson. Sentencepiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. arXiv preprint arXiv:1808.06226, 2018. ",
1057
+ "bbox": [
1058
+ 171,
1059
+ 765,
1060
+ 823,
1061
+ 795
1062
+ ],
1063
+ "page_idx": 8
1064
+ },
1065
+ {
1066
+ "type": "text",
1067
+ "text": "Guillaume Lample and Alexis Conneau. Cross-lingual language model pretraining. arXiv preprint arXiv:1901.07291, 2019. ",
1068
+ "bbox": [
1069
+ 173,
1070
+ 804,
1071
+ 823,
1072
+ 833
1073
+ ],
1074
+ "page_idx": 8
1075
+ },
1076
+ {
1077
+ "type": "text",
1078
+ "text": "Chia-Wei Liu, Ryan Lowe, Iulian V Serban, Michael Noseworthy, Laurent Charlin, and Joelle Pineau. How not to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. arXiv preprint arXiv:1603.08023, 2016. ",
1079
+ "bbox": [
1080
+ 174,
1081
+ 843,
1082
+ 823,
1083
+ 886
1084
+ ],
1085
+ "page_idx": 8
1086
+ },
1087
+ {
1088
+ "type": "text",
1089
+ "text": "Ehsan Montahaei, Danial Alihosseini, and Mahdieh Soleymani Baghshah. Jointly measuring diversity and quality in text generation models. arXiv preprint arXiv:1904.03971, 2019. ",
1090
+ "bbox": [
1091
+ 176,
1092
+ 895,
1093
+ 820,
1094
+ 924
1095
+ ],
1096
+ "page_idx": 8
1097
+ },
1098
+ {
1099
+ "type": "text",
1100
+ "text": "Jekaterina Novikova, Ondˇrej Dusek, Amanda Cercas Curry, and Verena Rieser. Why we need new ˇ evaluation metrics for nlg. arXiv preprint arXiv:1707.06875, 2017. ",
1101
+ "bbox": [
1102
+ 171,
1103
+ 103,
1104
+ 823,
1105
+ 132
1106
+ ],
1107
+ "page_idx": 9
1108
+ },
1109
+ {
1110
+ "type": "text",
1111
+ "text": "Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pp. 311–318. Association for Computational Linguistics, 2002. ",
1112
+ "bbox": [
1113
+ 176,
1114
+ 140,
1115
+ 821,
1116
+ 184
1117
+ ],
1118
+ "page_idx": 9
1119
+ },
1120
+ {
1121
+ "type": "text",
1122
+ "text": "Mitchell Stern, William Chan, Jamie Kiros, and Jakob Uszkoreit. Insertion Transformer: Flexible Sequence Generation via Insertion Operations. In ICML, 2019. ",
1123
+ "bbox": [
1124
+ 171,
1125
+ 193,
1126
+ 823,
1127
+ 222
1128
+ ],
1129
+ "page_idx": 9
1130
+ },
1131
+ {
1132
+ "type": "text",
1133
+ "text": "Ilya Sutskever, Oriol Vinyals, and Quoc Le. Sequence to Sequence Learning with Neural Networks. In NIPS, 2014. ",
1134
+ "bbox": [
1135
+ 174,
1136
+ 229,
1137
+ 823,
1138
+ 258
1139
+ ],
1140
+ "page_idx": 9
1141
+ },
1142
+ {
1143
+ "type": "text",
1144
+ "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention Is All You Need. In NIPS, 2017. ",
1145
+ "bbox": [
1146
+ 171,
1147
+ 267,
1148
+ 823,
1149
+ 296
1150
+ ],
1151
+ "page_idx": 9
1152
+ },
1153
+ {
1154
+ "type": "text",
1155
+ "text": "Sean Welleck, Kiante Brantley, Hal Daume, and Kyunghyun Cho. Non-Monotonic Sequential Text Generation. In ICML, 2019. ",
1156
+ "bbox": [
1157
+ 171,
1158
+ 305,
1159
+ 823,
1160
+ 334
1161
+ ],
1162
+ "page_idx": 9
1163
+ },
1164
+ {
1165
+ "type": "text",
1166
+ "text": "Yingce Xia, Tianyu He, Xu Tan, Fei Tian, Di He, and Tao Qin. Tied transformers: Neural machine translation with shared encoder and decoder. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 5466–5473, 2019. ",
1167
+ "bbox": [
1168
+ 174,
1169
+ 343,
1170
+ 823,
1171
+ 387
1172
+ ],
1173
+ "page_idx": 9
1174
+ },
1175
+ {
1176
+ "type": "text",
1177
+ "text": "Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. arXiv preprint arXiv:1906.08237, 2019. ",
1178
+ "bbox": [
1179
+ 173,
1180
+ 395,
1181
+ 823,
1182
+ 438
1183
+ ],
1184
+ "page_idx": 9
1185
+ },
1186
+ {
1187
+ "type": "text",
1188
+ "text": "Yaoming Zhu, Sidi Lu, Lei Zheng, Jiaxian Guo, Weinan Zhang, Jun Wang, and Yong Yu. Texygen: A benchmarking platform for text generation models. In The 41st International ACM SIGIR Conference on Research & Development in Information Retrieval, pp. 1097–1100. ACM, 2018. ",
1189
+ "bbox": [
1190
+ 174,
1191
+ 446,
1192
+ 826,
1193
+ 489
1194
+ ],
1195
+ "page_idx": 9
1196
+ },
1197
+ {
1198
+ "type": "text",
1199
+ "text": "A APPENDICES ",
1200
+ "bbox": [
1201
+ 176,
1202
+ 102,
1203
+ 318,
1204
+ 117
1205
+ ],
1206
+ "page_idx": 10
1207
+ },
1208
+ {
1209
+ "type": "image",
1210
+ "img_path": "images/15b78b80f5895858c478310c5d25f863b4f802958adcae2286ecc0eb11b850e3.jpg",
1211
+ "image_caption": [
1212
+ "Figure 8: Quality-Diversity BLEU curve for several KERMIT models (bilingual, multitarget, joint) on the Multi30k text 2017 Flickr test set. Dotted diagonal line signifies BLEU equals SelfBLEU. Points indicate different temperatures, from 0.1 (low diversity, left in graph) to 1.0 (high diversity, right in graph) "
1213
+ ],
1214
+ "image_footnote": [],
1215
+ "bbox": [
1216
+ 176,
1217
+ 165,
1218
+ 818,
1219
+ 410
1220
+ ],
1221
+ "page_idx": 10
1222
+ },
1223
+ {
1224
+ "type": "image",
1225
+ "img_path": "images/ae04656e17711e77b623eecf622768b4eda5e4a23ebcba92aae60419ae8fb851.jpg",
1226
+ "image_caption": [
1227
+ "Figure 9: Quality-Diversity BLEU curve for several KERMIT models (bilingual, multitarget, joint) on the Multi30k text 2017 MSCOCO test set. Dotted diagonal line signifies BLEU equals SelfBLEU. Points indicate different temperatures, from 0.1 (low diversity, left in graph) to 1.0 (high diversity, right in graph) "
1228
+ ],
1229
+ "image_footnote": [],
1230
+ "bbox": [
1231
+ 174,
1232
+ 505,
1233
+ 820,
1234
+ 747
1235
+ ],
1236
+ "page_idx": 10
1237
+ },
1238
+ {
1239
+ "type": "table",
1240
+ "img_path": "images/3e614c4f978096425b72c1fd436800677794369c4129a494af32256056b49356.jpg",
1241
+ "table_caption": [
1242
+ "A.2 ADDITIONAL MULTI30K TRANSLATION RESULTS ",
1243
+ "Table 2: Multi30k English French test BLEU. "
1244
+ ],
1245
+ "table_footnote": [],
1246
+ "table_body": "<table><tr><td>Model</td><td>Inference</td><td>Test2016</td><td>Test2017</td><td>MSCOCO</td></tr><tr><td>Bilingual (EN → FR)</td><td>EN→FR</td><td>58.80</td><td>50.35</td><td>42.82</td></tr><tr><td>Bilingual (EN ←→FR) Multi-target (EN → Rest)</td><td>EN→FR EN →FR</td><td>59.29 58.08</td><td>52.13 50.39</td><td>42.17 42.19</td></tr><tr><td></td><td>EN →FR,CS,DE</td><td>58.52</td><td>50.49</td><td>41.53</td></tr><tr><td>Multi-target (Any → Rest)</td><td>EN→FR EN →FR,CS,DE</td><td>57.64 57.35</td><td>50.01 48.13</td><td>40.18 39.98</td></tr><tr><td>Joint (p(EN,FR,CS,DE))</td><td>EN→FR EN →FR,CS,DE</td><td>50.87 48.85</td><td>40.69 39.92</td><td>33.93 33.45</td></tr></table>",
1247
+ "bbox": [
1248
+ 223,
1249
+ 132,
1250
+ 774,
1251
+ 281
1252
+ ],
1253
+ "page_idx": 11
1254
+ },
1255
+ {
1256
+ "type": "table",
1257
+ "img_path": "images/119783e1309b8d817ea99f6ff7750e67f1024fafa65c8e3a16360f878ed529be.jpg",
1258
+ "table_caption": [
1259
+ "Table 3: Multi30k English Czech test BLEU. "
1260
+ ],
1261
+ "table_footnote": [],
1262
+ "table_body": "<table><tr><td>Model</td><td>Inference</td><td>Test2016</td></tr><tr><td>Bilingual (EN → CS)</td><td>EN →CS</td><td>28.58</td></tr><tr><td>Bilingual (EN ← CS)</td><td>EN →CS</td><td>29.03</td></tr><tr><td rowspan=\"2\">Multi-target (EN → Rest)</td><td>EN→CS</td><td>30.48</td></tr><tr><td>EN →FR,CS,DE</td><td>30.15</td></tr><tr><td rowspan=\"2\">Multi-target (Any → Rest)</td><td>EN→CS</td><td>30.11</td></tr><tr><td>EN →FR,CS,DE</td><td>30.11</td></tr><tr><td rowspan=\"2\">Joint (p(EN,FR,CS,DE))</td><td>EN →CS</td><td>26.45</td></tr><tr><td>EN →FR,CS,DE</td><td>26.35</td></tr></table>",
1263
+ "bbox": [
1264
+ 300,
1265
+ 329,
1266
+ 696,
1267
+ 477
1268
+ ],
1269
+ "page_idx": 11
1270
+ },
1271
+ {
1272
+ "type": "table",
1273
+ "img_path": "images/a347f1944a5d8aeb25689fc46a55af377fadba4cdcb84314ff70851ca2f31d3f.jpg",
1274
+ "table_caption": [],
1275
+ "table_footnote": [
1276
+ "Table 4: Multi30k German English test BLEU. "
1277
+ ],
1278
+ "table_body": "<table><tr><td>Model</td><td>Inference</td><td>Test2016</td><td>Test2017</td><td>MSCOCO</td></tr><tr><td>Bilingual (DE →EN)</td><td>DE→EN</td><td>39.40</td><td>34.90</td><td>27.75</td></tr><tr><td>Bilingual (EN ←→DE)</td><td>DE→EN</td><td>40.52</td><td>35.66</td><td>28.61</td></tr><tr><td rowspan=\"2\">Multi-target (DE → Rest)</td><td>DE→EN</td><td>40.75</td><td>36.38</td><td>28.91</td></tr><tr><td>DE →EN,FR,CS</td><td>39.72</td><td>35.95</td><td>28.20</td></tr><tr><td rowspan=\"2\">Multi-target (Any → Rest)</td><td>DE→EN</td><td>40.69</td><td>36.02</td><td>28.89</td></tr><tr><td>DE →EN,FR,CS</td><td>39.97</td><td>37.07</td><td>28.62</td></tr><tr><td rowspan=\"2\">Joint (p(EN,FR,CS,DE))</td><td>DE→EN</td><td>38.44</td><td>30.82</td><td>25.46</td></tr><tr><td>DE →EN,FR,CS</td><td>36.30</td><td>29.68</td><td>24.87</td></tr></table>",
1279
+ "bbox": [
1280
+ 222,
1281
+ 523,
1282
+ 776,
1283
+ 672
1284
+ ],
1285
+ "page_idx": 11
1286
+ },
1287
+ {
1288
+ "type": "text",
1289
+ "text": "A.3 UNCONDITIONAL SAMPLING GENERATION ",
1290
+ "text_level": 1,
1291
+ "bbox": [
1292
+ 176,
1293
+ 104,
1294
+ 514,
1295
+ 117
1296
+ ],
1297
+ "page_idx": 12
1298
+ },
1299
+ {
1300
+ "type": "table",
1301
+ "img_path": "images/74ef63cc01486517ed8ad7867b044f4e3aa76ff9ee0d28383b6a4d22bac2907d.jpg",
1302
+ "table_caption": [
1303
+ "Figure 10 illustrates the serial sampling (one token at a time) from the joint model, every 20 timesteps ",
1304
+ "Figure 10: Example of serial sampling unconditional text generation from the joint $p ( { \\bar { E } } N , F R , C S , D E )$ model, over 96 insertion time steps. Note that the model generates one long sequence and we split them into the resulting four sentences in each language here. "
1305
+ ],
1306
+ "table_footnote": [],
1307
+ "table_body": "<table><tr><td rowspan=1 colspan=3>Iterations Language Generated Sentence from Joint Model</td></tr><tr><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>Mlady</td></tr><tr><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>descendantMlady muz v modré bundé stoupá poMann klettert.</td></tr><tr><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>blue jacket walking up a mountain.veste descendant paroi rocheuse enMlady muz v modré bunde stoupa po horach.Mann klettert.</td></tr><tr><td rowspan=1 colspan=1>60</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>A man blue jacket walking up a mountain.veste bleue descendant une paroi rocheuse en horu.Mlady muz v modré bunde stoupä po horach.Mann einer blauen klettert eine hoch.</td></tr><tr><td rowspan=1 colspan=1>80</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>A young man in blue jacket walking up a mountain.veste bleue descendant une paroi rocheuse en horu.Mlady muz v modré bunde stoupa po horach.Ein junger Mann in einer blauen Jacke klettert eine Felswand hoch.</td></tr><tr><td rowspan=1 colspan=1>96</td><td rowspan=1 colspan=1>EnglishFrenchCzechGerman</td><td rowspan=1 colspan=1>A young man in a blue jacket walking up a mountain.Un jeune homme en veste bleue descendant une paroi rocheuse en horu.Mlady muz v modré bunde stoupa po horach.Ein junger Mann in einer blauen Jacke klettert eine Felswand hoch.</td></tr></table>",
1308
+ "bbox": [
1309
+ 173,
1310
+ 171,
1311
+ 825,
1312
+ 534
1313
+ ],
1314
+ "page_idx": 12
1315
+ }
1316
+ ]